diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index b9563ec1..00000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -public - diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0e055065..00000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "hexo" -} diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 18a6fd41..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017-2018 nuls.io - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index 89b8a347..a85e543d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ + # NULS Official Developer Website The website for NULS Developer. You can see the generated files at [nuls-io/nuls-io.github.io](https://github.com/nuls-io/nuls-io.github.io) repository. @@ -28,11 +29,3 @@ $ yarn run build Waiting for you -## License - -Source released under the [MIT license](https://opensource.org/licenses/MIT) - -Power by [HEXO](https://hexo.io) - -Documentation released under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) - diff --git a/_config.yml b/_config.yml deleted file mode 100644 index e73f5821..00000000 --- a/_config.yml +++ /dev/null @@ -1,46 +0,0 @@ -title: NULS -subtitle: "NULS is a global blockchain open-source project which is a highly customizable modular blockchain infrastructure." -description: "NULS developer site. Power by HEXO." -author: NULS -language: en -timezone: UTC - -url: https://nuls-io.github.io -root: / -permalink: news/:year/:month/:day/:title/ -archive_dir: news -code_dir: downloads/code -new_post_name: :year-:month-:day-:title.md # File name of new posts -post_asset_folder: true -per_page: 0 -skip_render: README.md - -theme: nuls -deploy: - type: git - repo: git@github.com:nuls-io/nuls-io.github.io.git - branch: master - -highlight: - enable: true - line_number: false - -marked: - gfm: true - pedantic: false - sanitize: false - tables: true - breaks: true - smartLists: true - smartypants: true - modifyAnchors: '' - autolink: true - -twitter: nulsservice -reddit: r/nulsservice/ -telegram: Nulsio -steemit: nuls -github: nuls-io/nuls -facebook: nulscommunity/ -slack: t/nuls/shared_invite/enQtMjQ4MTM4ODAyNTI4LWJjNGMwYTE0YjRlYmFlZGUwM2JhOGE4MDIwZmE4MzA2MDg1YzUyMmVkN2RhZjkyNWMzZjY5ZDU5ZmViMjZjNGQ -gitter: nuls_io diff --git a/docs/.vuepress/components/NavBar.vue b/docs/.vuepress/components/NavBar.vue new file mode 100644 index 00000000..8a042ebb --- /dev/null +++ b/docs/.vuepress/components/NavBar.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/docs/.vuepress/components/NavBars.vue b/docs/.vuepress/components/NavBars.vue new file mode 100644 index 00000000..5d418656 --- /dev/null +++ b/docs/.vuepress/components/NavBars.vue @@ -0,0 +1,107 @@ + + + + + \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js new file mode 100644 index 00000000..411f615b --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,272 @@ +module.exports = { + base : '/', + markdown: { + lineNumbers: false // 代码块显示行号 + }, + locales: { + // 键名是该语言所属的子路径 + // 作为特例,默认语言可以使用 '/' 作为其路径。 + '/': { + title:"NULS", + lang: 'en-US', + description: 'NULS' + }, + '/zh/': { + title:"NULS", + lang: 'zh-CN', + description: 'NULS' + } + }, + head:[ + ['link', { rel: 'icon', href: "/icon.png" }] + ], + themeConfig : { + repo: 'nuls-io/devsite/tree/dev', + editLinks: true, + docsDir: 'docs', + docsBranch: 'dev', + sidebarDepth: 2, + lastUpdated: 'Last Updated', + nav:[ + {text:"Guide",link:"/learn/"}, + {text:"NULS1.0",link:"/NULS1.0/"}, + {text:"NULS2.0",link:"/NULS2.0/"} + ], + locales: { + '/': { + selectText: 'Languages', + label: 'English', + editLinkText: 'Edit this page on GitHub', + sidebar: { + '/learn/': [ + { + title: 'Overview', + children: [ + 'introduction', + 'howToContribute', + ] + }, + { + title: 'Users Guide', + children: [ + 'NULSTransaction', + 'toolsGuide' + ] + }, + { + title: 'NIPs', + children: [ + 'NIPIntroduction', + 'NIP-1', + 'NIP-2', + 'NIP-3', + 'NIP-4', + ] + }, + { + title: 'NULS Portal', + children: [ + 'NULSNav' + ] + }, + ], + '/NULS1.0/':[ + { + title: 'Launch NULS', + children: [ + 'sourceCodeStartNULS', + 'connectMainnet' + ] + }, + { + title: 'Underlying', + children: [ + 'buildPrivateChain', + ] + }, + { + title: 'Smart Contracts', + children: [ + 'startSmartContract', + 'developerManual', + 'GUIForSmartContract', + 'ideaPlugin', + 'NRC-20TokenStandard', + 'smartContractFee', + 'randomImplementations', + 'randomRPC' + ] + }, + { + title: 'Developer Tools', + children: [ + 'sdk', + 'clientCLI' + ] + }, + ], + '/NULS2.0/': [ + { + title: 'Introduction', + collapsable:false, + children: [ + 'NULS2.0Introduction' + ] + }, + { + title: 'Tutorial', + collapsable:false, + children: [ + 'quickStart', + 'developeModule', + 'encryptedMessageDesign', + 'chainBoxGuide', + 'linuxTutorial', + 'nodeGuide' + ] + }, + { + title: 'Smart Contract', + collapsable:false, + children: [ + 'smartContractManual', + 'mavenPackage', + 'NRC-20TokenStandard', + 'NRC-721', + 'smartContractFee', + ] + }, + ] + }, + }, + '/zh/': { + selectText: '选择语言', + // 该语言在下拉菜单中的标签 + label: '简体中文', + // 编辑链接文字 + editLinkText: '在 GitHub 上编辑此页', + // Service Worker 的配置 + nav:[ + {text:"了解NULS",link:"/zh/learn/"}, + {text:"NULS1.0",link:"/zh/NULS1.0/"}, + {text:"NULS2.0",link:"/zh/NULS2.0/"} + ], + sidebar: { + '/zh/learn/': [ + { + title: '总览', + children: [ + 'introduction', + 'howToContribute', + ] + }, + { + title: '用户操作指南', + children: [ + 'clientWalletGuide', + 'lightWalletGuide', + 'NULSTransaction', + 'NULSExplorerGuide', + ] + }, + { + title: 'NIPs', + children: [ + 'NIPIntroduction', + 'NIP-1', + 'NIP-2', + 'NIP-3', + 'NIP-4', + ] + }, + { + title: 'NULS 导航', + children: [ + 'NULSNav', + ] + }, + ], + '/zh/NULS1.0/':[ + { + title: '启动NULS', + children: [ + 'sourceCodeStartNULS', + 'connectMainnet' + ] + }, + { + title: '底层', + children: [ + 'buildPrivateChain' + ] + }, + { + title: '智能合约', + children: [ + 'startSmartContract', + 'developerManual', + 'GUIForSmartContract', + 'ideaPlugin', + 'NRC-20TokenStandard', + 'smartContractFee', + 'randomImplementations', + 'randomRPC', + 'guessTheSize', + + ] + }, + { + title: '开发者工具', + children: [ + 'sdk', + 'clientCLI' + ] + }, + ], + '/zh/NULS2.0/': [ + { + title: '介绍', + collapsable:false, + children: [ + 'NULS2.0Introduction' + ] + }, + { + title: '教程', + collapsable:false, + children: [ + 'quickStart', + 'developeModule', + 'encryptedMessageDesign', + 'chainBoxGuide', + 'linuxTutorial', + 'nodeGuide', + 'multiSignAccount' + ] + }, + { + title: '智能合约', + collapsable:false, + children: [ + 'smartContractManual', + 'mavenPackage', + 'NRC-20TokenStandard', + 'NRC-721', + 'offlineAssembly', + 'assetsOff', + 'vm-sdk', + 'consensusTransaction', + 'excuteResult', + 'triggerPayable', + 'smartContractFee', + ] + }, + ] + }, + } + }, + } +} + + + diff --git a/docs/.vuepress/dist/404.html b/docs/.vuepress/dist/404.html new file mode 100644 index 00000000..f3869297 --- /dev/null +++ b/docs/.vuepress/dist/404.html @@ -0,0 +1,17 @@ + + + + + + NULS + + + + + + + +

404

That's a Four-Oh-Four.
Take me home.
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/APIManual.html b/docs/.vuepress/dist/NULS1.0/APIManual.html new file mode 100644 index 00000000..b9e36e90 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/APIManual.html @@ -0,0 +1,21 @@ + + + + + + API手册 | NULS + + + + + + + +

API手册

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/GUIForSmartContract.html b/docs/.vuepress/dist/NULS1.0/GUIForSmartContract.html new file mode 100644 index 00000000..44e289ed --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/GUIForSmartContract.html @@ -0,0 +1,32 @@ + + + + + + User Document of Wallet Smart Contract | NULS + + + + + + + +

User Document of Wallet Smart Contract

Deploy contract

1 Start wallet, click [contract] and then click [deploy contract] tab page

deploy

2 Insert Hex code of contract in textbox

3 Insert contract construction function parameter, and note the required item and value type. If not, it will fail the table verification.

deploy

4 Click [advanced option] to alter default value of GasLimit and GasPrice. Other additional information can be inserted too. Such filed must be required. (Optional step)

deploy

5 After filling out, click [test contract]. Wallet will conduct a trial deployment for this contract to verify contract legality.

deploy

6 After passing this test, click [deploy contract]. In case of password, insert password, and then click [confirm]. If no password, click [confirm]. Then, the system will go to [my contracts] page on which the confirmation progress of deployed contract can be reviewed.

Review the confirmation progress of deployed contract.

deploy

7 After confirmation completion

  • Click [to call] on the right of table to go to [call contract] page

  • Click contract address to access to contract overview page

Review contract

1 Start wallet, click [contract] and click [review contract] tab page

access

2 Insert legal contract address in box, and click [access], showing a panel below it

  • Click [pull-down list] in the panel to select the contract method to call
  • Click star mark beside the contract address to collect this contract to the list of my contracts

access

3 Have two cases after selecting a method

  • If read-only method, click [call], get the deployment results after network requests met

    access

  • If readable method (to be linked), click advanced option to alter default value of GasLimit and GasPrice. After clicking [call], generate a transaction, which will consume nuls. Therefore, in case of account password, insert your password. After transaction confirmation, feedback the results.

    View smart contract fee details

    Transaction on calling contract under confirmation

    access

    Transaction on calling contract confirmed

    access

4 If calling linking method, click TxID in panel, to review the details of this transaction to call contract

access

Details of this transaction to call contract

access

My contracts

1 List of my contracts displays the created and collected contracts

access

  • Click contract address to access to contract overview page

    access

  • Click [to call] to access to the [call contract] page

    access

  • Click [cancel collection] to remove this contract from the list of [my contracts]

3 [Transaction records] display the transactions in this contract. Click TxID to review the details about this transaction.

access

4 [Contract details] display all methods of this contract, corresponding parameters and returned value type.

access

5 If the contract is created by current account, click [delete] on the top right of contract overview to delete this contract. After that, contract details are also available, but the method of contract cannot be called.

access

Account multiple assets

After releasing Token via smart contract or transferring in different kinds of Token from other accounts, the account have multiple assets.

1 Access to wallet, to review all kinds of assets under this account address.

access

2 Click [transfer] to access to transfer interface of this kind of asset, insert payee address and transfer amount, to finish transfer of such asset.

access

3 Click [transaction records] to access to transaction records page of this kind of asset

access

4 Click [pull-down list] on [transaction records] page to switch among transaction records of different kinds of assets.

access

5 Click TxID to review the details of this transaction.


Hex coding of NRC-20 Token

504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000
+
+
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/NRC-20TokenStandard.html b/docs/.vuepress/dist/NULS1.0/NRC-20TokenStandard.html new file mode 100644 index 00000000..23d3c0bb --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/NRC-20TokenStandard.html @@ -0,0 +1,50 @@ + + + + + + NRC-20 Token Standard | NULS + + + + + + + +

NRC-20 Token Standard

Simple Summary

A standard interface for tokens.

Abstract

The following standard allows for the implementation of a standard API for tokens within smart contracts. +This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.

Motivation

A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.

Specification

Token

Methods

NOTE: Callers MUST handle false from return boolean. Callers MUST NOT assume that false is never returned!

name

Returns the name of the token - e.g. "MyToken".

@View
+public String name();
+

symbol

Returns the symbol of the token. E.g. "MT".

@View
+public String symbol();
+

decimals

Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

@View
+public int decimals();
+

totalSupply

Returns the total token supply.

@View
+public BigInteger totalSupply();
+

balanceOf

Returns the account balance of another account with address owner.

@View
+public BigInteger balanceOf(@Required Address owner);
+

transfer

Transfers value amount of tokens to address to, and MUST fire the TransferEvent event. +The function SHOULD revert if the from account balance does not have enough tokens to spend.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transfer(@Required Address to, @Required BigInteger value);
+

transferFrom

Transfers value amount of tokens from address from to address to, and MUST fire the TransferEvent event.

The transferFrom method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. +This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. +The function SHOULD revert unless the from account has deliberately authorized the sender of the message via some mechanism, such as calling approve(@Required Address spender, @Required BigInteger value).

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value);
+

approve

Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called again it overwrites the current allowance with value.

public boolean approve(@Required Address spender, @Required BigInteger value);
+

allowance

Returns the amount which spender is still allowed to withdraw from owner.

@View
+public BigInteger allowance(@Required Address owner, @Required Address spender);
+

Events

TransferEvent

MUST trigger when tokens are transferred, including zero value transfers.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

public TransferEvent(Address from, @Required Address to, @Required BigInteger value)
+

ApprovalEvent

MUST trigger on any successful call to approve(@Required Address spender, @Required BigInteger value).

public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value)
+

Implementation

Example implementations are available at

  • https://github.com/nuls-io/nuls-nrc20
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/buildPrivateChain.html b/docs/.vuepress/dist/NULS1.0/buildPrivateChain.html new file mode 100644 index 00000000..f05b92dd --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/buildPrivateChain.html @@ -0,0 +1,45 @@ + + + + + + Build Chain | NULS + + + + + + + +

Build Chain

Introduction

This tutorial guides you to build a private chain based on NULS source code, to make is easier for users to learn about the operation, development or experiment of the NULS Blockchain. By building a chain to fully understand the operation of each node and data interaction, we can better grasp the overall operating mechanism of the NULS Blockchain, which is conducive to further research. We assume that readers have the skills to set up and debug a Java development environment.

Setting up environment

  • Operating systems: macOS, Windows
  • Build Tools: Maven
  • Development Tools: IntelliJ IDEA
  • NULS source code on github: https://github.com/nuls-io/nuls

Beginning

Since blockchain is a decentralized network composed of multiple nodes, we will take a private chain with three nodes as an example. Although we recommend using a Linux server to run the NULS main-net consensus node, in this tutorial, we choose macOS system that can set up a Java development environment to run and debug nodes.

Development environment

First, clone the NULS source code using IntelliJ IDEA and open the project. Make sure JDK is the jdk1.8 version and Maven is configured correctly.

Steps to build

  1. Open the module.ini file, which is the configuration file for joining or building the network. In this tutorial, it is the configuration information of the NULS test-net.

image-20190103193901967

  1. We will use three nodes to build a private chain. First we need to prepare devices (virtual machine works) for three nodes to run.
  • Node A: 192.168.1.1
  • Node B: 192.168.1.2
  • Node C: 192.168.1.3

We also need to set up a seed node to maintain the operation of the blockchain, i.e., to package and forge blocks. In addition, we need to prepare a block-forging address (including private key, to import into the seed node), which can be prepared in advance.

In this tutorial, the initial block-forging address we prepare is: +Nse4zpZHsUuU7h5ymv28pcGbwHju3joV

PS: You may find that the first few letters of the address we prepare differs from those of the test-net address in the figure, which is for the sake of distinguishing the test-net address from the main-net address, so as to avoid confusion that may result in adverse consequences. Specifically, we set the test-net address to start with "TT" and the main-net address to start with "Ns". This tutorial uses the NULS main-branch code, so the address starts with "Ns". If you prefer to custom the starting letters of the private-chain account address, you can try to modify the chain.id parameter in the nuls.ini file. The parameters of the same chain must be in consistence.

  1. Assuming node A is the seed node, then modify the network and consensus sections of the module.ini configuration file of three nodes A, B and C according to the following configuration:
[network]
+Bootstrap=io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap
+Network.server.port=8003
+Network.magic=20190101
+Network.max.in=100
+Network.max.out=10
+Network.seed.ip=192.168.1.1:8003
+
+[consensus]
+Bootstrap=io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap
+Partake.packing=true
+Min.upgrade.delay=1000
+Seed.nodes=Nse4zpZHsUuU7h5ymv28pcGbwHju3joV
+
  • Modify work.seed.ip to the ip and port of the seed node.
  • Modify seed.nodes to the block-forging address.
  • The consistency of the magic parameters network.magic of all nodes in the private chain is a must.
  1. Run the three nodes separately through IntelliJ IDEA. If you only need to debug one node, the other two nodes can be packaged with maven and sent to a Linux server to run. Remarkably, a jre must be placed in the NULS root directory to run properly.
  2. After launching the three nodes, once the IntelliJ IDEA console has the following log output, it means that the three nodes have successfully formed a private chain network, but it still cannot produce new blocks and the block height is 0. If there is no log output, you need to uncomment the <appender-ref ref="STDOUT"/> in logback.xml.
io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash :xxxxxxx,192.168.1.2:8003,192.168.1.2:8003
+
+
  1. Then import the prepared block-forging account Nse4zpZHsUuU7h5ymv28pcGbwHju3joV via wallet interface of the seed node A. After a while, you can see the latest height displayed in the console increasing, which indicates that the network is producing new blocks. At the same time, the height of the node B, C will also increase and the height of the three nodes will remain the same. At this point, the setup of the private chain network is completed.

Conclusion

This tutorial mainly introduces the easiest way to build a private chain for the development and debugging of NULS, without modification on the source code of NULS. If you want to dig deeper into NULS, you can refer to the relevant documentation of NULS to modify and debug the source code. Maybe you will find more secrets!

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/clientCLI.html b/docs/.vuepress/dist/NULS1.0/clientCLI.html new file mode 100644 index 00000000..7ac2d41b --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/clientCLI.html @@ -0,0 +1,710 @@ + + + + + + Linux CLI Manual | NULS + + + + + + + +

Linux CLI Manual

Introduction

​ The User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server.

Version Update Records

Version Date updated Contents
V1.0.0 2018-07-12 All functions of official version

Preparation

Server hardware

Server for creating NULS nodes shall be with configurations not lower than the following

CPU Memory Hard Disk Broadband
Quad-core 3.0GHz 16G 128G Hard Disk 20M Uplink

Recommendation

CPU Memory Hard Disk Broadband
8-core 3.0GHz 32G 256G Hard Disk 100M Uplink

Version of system and core

Linux system

  • CentOS (recommended)

It is recommended to use core of version 2.6.32 or higher.

Start

Download

  • NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet

  • GitHub:https://github.com/nuls-io/nuls-wallet-release

  • Enter wallet download on NULS website,and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users.

    The following is for downloading wallet (v1.0.0) in Linux system:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    Note: the downloading link for the subsequent versions is subject to change.

Install

  • Extract downloaded files in Linux system

    $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz
    +

Operate

  • Enter bin catalogue and run startup script to start full-node wallet

    $ cd bin
    +$ ./start.sh
    +

Use wallet

Quick-start

  • Upon confirming the wallet is started, start the command line of wallet to run it.

    Enter bin catalogue to execute the following commands:

    $ ./cmd.sh
    +

    Display NULS naming prompt nuls>>>, and then directly input NULS wallet operation command to run it.

    The following gives an example of account creating:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    Command create is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully.

Conventions

  • For password: it must be 8 to 20 digits, including letters and figures.
  • Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required.

Wallet command

Help command

All commands for output and printing

  • **Command: help [-a] **
Parameter Description
-a Formatting printing command, optional

Return message help

getaccount <address> --get account information
+

Return message help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

Example

nuls>>> help
+nuls>>> help -a
+

Create account

Create account and return to account addresses collection

  • **Command: create [number] **
Parameter Description
[number] Quantity of accounts created, optional

Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter;

Return accounts collection

[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

Example, to create 2 accounts without password

nuls>>> create 2
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:
+[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

Backup account

For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account

  • Command: backup <address> [path]
Parameter Description
<address> Account address, required
[path] The target folder of backup files, defaults to be the current folder, optional

Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe.

Return message

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Example: backup of an account with password

nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Remove account

Remove local account according to account address; if the account is encrypted, insert password.

  • **Command: remove <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+Success
+

Set account password

Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts.

  • **Command: setpwd <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

Change account password

Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one.

  • **Command: resetpwd <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Enter your old password:**********
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

Set nickname

Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source.

  • Command:setalias <address> <alias>
Parameter Description
<address> Account address, required
<alias> Nickname, required

Return message, transaction hash

"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Example

nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias
+"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Imported account keystore

Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account.

  • **Command: import keystore <path> **
Parameter Description
<path> Address of keystore files to be imported, required

Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required.

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Imported account’s private key

Import account’s private key and create a local account. Receive failure to import if there is an existing local account.

  • **Command:import <privatekey> **
Parameter Description
<privatekey> Account’s private key, required

注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Imported account’s private key (overwritten)

Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account.

  • **Command:import <privatekey> **
Parameter Description
<privatekey> Account’s private key, required

Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.

Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import).

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Inquire account information

Inquire account information based on account address

  • Command:getaccount <address>
Parameter Description
<address> Account address, required

Return message

{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address
+  "alias" : null,//Nickname
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//Public key
+  "priKey" : "",//Private key (unavailable if the account is encrypted)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//Private key after encryption (unavailable if the account is encrypted)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//Creation time
+  "encrypted" : true//Encrypted or not (set password or not)
+}
+

Example

nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}
+

Inquire list of accounts

Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time

  • Command:getaccounts <pageNumber> <pageSize>
Parameter Description
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message, output accounts collection

[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address
+  "alias" : null,//Nickname
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",// Public key
+  "priKey" : "",//Private key (unavailable if the account is encrypted)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",// Private key after encryption (unavailable if the account is encrypted)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//Creation time
+  "encrypted" : true//Encrypted or not (set password or not)
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

Example: to get list of accounts, showing page 1, 2 items per page

nuls>>> getaccounts 1 2
+[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

Inquire account’s private key

Inquire account’s private key based on account address; if the account is encrypted, insert password.

  • **Command:getprikey <address> **
Parameter Description
<address> Account address, required

Return message, imported account address

"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

Example

nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

Inquire account balance

Inquire account balance based on account address

  • **Command:getbalance <address> **
Parameter Description
<address> Account address, required

Return message, imported account address

{
+  "balance" : "9999998.99",//Balance
+  "locked" : "0",//Locked balance
+  "usable" : "9999998.99"//Available balance
+}
+

Example

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "balance" : "9999998.99",
+  "locked" : "0",
+  "usable" : "9999998.99"
+}
+

Transfer

Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly.

  • **Command: transfer <address> <toAddress> <amount> [remark] **
Parameter Description
<address> transferring address, required
<toAddress> receiving address, required
<amount> transferred amount, round to 8 decimals in total (in NULS), required
[remark] Remarks, required

Return message, transfer transaction hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Example

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Inquire transaction details

Inquire transaction details as per transaction hash

  • Command:gettx <hash>
Parameter Description
<hash> Transaction hash, required

Return message, transaction details

{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash
+  "type" : "transfer",//Transaction type (transfer transaction as an example)
+  "time" : "2018-07-16 11:21:46",//Transaction time
+  "blockHeight" : 26269,//Block height of package transaction
+  "fee" : "0.001",//Transaction service charge
+  "value" : "100",//(Transfer) transaction amount
+  "remark" : "Transfer",//remarks
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//Signature
+  "status" : "confirm",//Status of transaction confirmation (confirmed or unconfirmed)
+  "confirmCount" : 46,//Times of confirmation
+  "size" : 254,//Size of transaction
+  "inputs" : [ {//Input of transaction
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {//Output of transaction
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"// Target address of transaction output (means to transfer 100 to the target address)
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//Target address of transaction output (means to give users changes)
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

Example, to inquire transfer transaction

nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596
+{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "type" : "transfer",
+  "time" : "2018-07-16 11:21:46",
+  "blockHeight" : 26269,
+  "fee" : "0.001",
+  "value" : "100",
+  "remark" : "Transfer",
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",
+  "status" : "confirm",
+  "confirmCount" : 46,
+  "size" : 254,
+  "inputs" : [ {
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

Inquire list of transactions

Inquire list of transactions in this account based on account address

  • Command:gettxlist <address> <pageNumber> <pageSize>
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message, transaction details

[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//Transaction hash
+  "blockHeight" : 26473,//Block height of transaction
+  "time" : "2018-07-16 11:55:43",//Transaction time
+  "txType" : "transfer",//Transaction type
+  "status" : 1,//Status of confirmation
+  "info" : "+100"//Message
+},{
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

Example

nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10
+[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",
+  "blockHeight" : 26473,
+  "time" : "2018-07-16 11:55:43",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+}, {
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

Create node

Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least.

  • **Command:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> **
Parameter Description
<agentAddress> Account address of nodes created, required
<packingAddress> Node account package address, required (note: the account shall have no password, otherwise the node cannot package)
<commissionRate> Agent commission proportion, with a range of 10~100, required
<deposit> Node creating deposit of 2 at least, required

Return message, agent hash of return node

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Include consensus (agency node)

Include consensus of 2000NULS at least based on account address and node agent hash

  • **Command:deposit <address> <agentHash> <deposit> **
Parameter Description
<address> Account address, required
<agentHash> Node agent hash, required
<deposit> Include consensus deposit, not less than 2000NULS, required

Return message, transaction hash for including consensus; to exit the consensus, require such hash.

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Example

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Exit the consensus (agency)

Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent.

  • **Command: withdraw <address> <txHash> **
Parameter Description
<address> Account address, required
<txHash> Transaction hash upon agency, required

Return message, transaction hash upon exiting the consensus

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Example

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Stop node

Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours.

  • **Command:stopagent <address> **
Parameter Description
<address> Account address, required

Return message, transaction hash of stop node

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Example

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Get node details

Get node details as per agent hash of node

  • **Command: getagent <agentHash> **
Parameter Description
<agentHash> Node agent hash, required

Return message

{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 60.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "35024DE6",//Node ID
+  "time" : "2018-07-16 16:33:38",//Time for creating node
+  "blockHeight" : 28141,// Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",// Status
+  "creditVal" : 0.05,//Credit value
+  "totalDeposit" : "208000",//Current total agency amount of node
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//Quantity of participants
+}
+

Example

nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6
+{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.05,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}
+

Get list of nodes

As per list of consensus nodes

  • **Command:getagents <pageNumber> <pageSize> **
Parameter Description
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message

[{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 60.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "35024DE6",//Node ID
+  "time" : "2018-07-16 16:33:38",//Time for creating node
+  "blockHeight" : 28141,//Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Status
+  "creditVal" : 0.05,//Credit value
+  "totalDeposit" : "208000",//Current total agent amount of node
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//Quantity of participants
+}]
+

Example

nuls>>> getagents 1 2
+[ {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.18,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}, {
+  "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",
+  "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "deposit" : "20000",
+  "commissionRate" : 10.0,
+  "agentName" : null,
+  "agentId" : "5CE291D8",
+  "time" : "2018-07-16 16:31:12",
+  "blockHeight" : 28126,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.16,
+  "totalDeposit" : "208000",
+  "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "memberCount" : 5
+} ]
+

Get total information of network consensuses

Inquire total information of network consensuses

  • **Command:getconsensus **

Return message

{
+  "agentCount" : 6,//Quantity of nodes
+  "totalDeposit" : "1758000",//Total quantity of agents
+  "rewardOfDay" : "0",//Bonus
+  "consensusAccountNumber" : 6,//Quantity of consensus accounts
+  "packingAgentCount" : 6//Quantity of package addresses
+}
+

Example

nuls>>> getconsensus
+{
+  "agentCount" : 6,
+  "totalDeposit" : "1758000",
+  "rewardOfDay" : "0",
+  "consensusAccountNumber" : 6,
+  "packingAgentCount" : 6
+}
+

Get general of agents in single account

Get the general of all agents (consensuses) information of the account based on account address

  • **Command:getdepositedinfo <address> **
Parameter Description
<address> Account address, required

Return message

{
+  "agentCount" : 1,//Quantity of nodes created
+  "totalDeposit" : "1600000",// Quantity of total agents
+  "joinAgentCount" : 6,//Quantity of nodes in agency
+  "usableBalance" : "8048998.869",//Available balance
+  "reward" : "219.65910271",//Total bonuses gained
+  "rewardOfDay" : "219.65910271",//Bonuses gained a day
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//Node hash
+}
+

Example

nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "agentCount" : 1,
+  "totalDeposit" : "1600000",
+  "joinAgentCount" : 6,
+  "usableBalance" : "8048998.869",
+  "reward" : "219.65910271",
+  "rewardOfDay" : "219.65910271",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"
+}
+

Get list of agent information of single account

Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash.

  • **Command:getdepositeds <address> <pageNumber> <pageSize> [agentHash] **
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required
[agentHash] Node hash, optional

Return message

[{
+  "deposit" : "2000",//Agency amount
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Address of agent
+  "time" : "2018-07-16 16:38:25",//Time
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//Agency transaction hash
+  "blockHeight" : 28148,//Block height of transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Node status
+  "agentName" : "35024DE6",//Node name
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//Node address
+}]
+

Example

nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "deposit" : "2000",
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:25",
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",
+  "blockHeight" : 28148,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "35024DE6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"
+}, {
+  "deposit" : "2000",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:43",
+  "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",
+  "blockHeight" : 28149,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "E09EB7FD",
+  "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"
+} ]
+

Get list of agency nodes of single account

Inquire list of agency nodes asper address (return list of node information)

  • **Command:getdepositedagents <address> <pageNumber> <pageSize> **
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message

[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//Node hash
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Account address for creating node
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//Node package (block) address
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 40.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "0198ACAF",// Node ID
+  "time" : "2018-07-16 16:32:52",//Time for creating node
+  "blockHeight" : 28136,//Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Status
+  "creditVal" : -0.91,//Credit value
+  "totalDeposit" : "204000",//Current total agent amount of node
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3// Quantity of participants
+}]
+

Example, to get page 1, display 2 items per page

nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "deposit" : "20000",
+  "commissionRate" : 40.0,
+  "agentName" : null,
+  "agentId" : "0198ACAF",
+  "time" : "2018-07-16 16:32:52",
+  "blockHeight" : 28136,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.91,
+  "totalDeposit" : "204000",
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3
+}, {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.91,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+} ]
+

Get the latest block head information

Get the latest block head information

  • Command:getbestblockheader

Return message

{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//Block hash
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//Former block hash
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//Merkle hash
+  "time" : "2018-07-17 10:25:40",//Block generation time
+  "height" : 33950,//Block height
+  "txCount" : 1,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 668413,//Rounds of consensuses 
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-17 10:25:30",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0",//Consensus bonus 
+  "fee" : "0",//Package service charge of block
+  "confirmCount" : 0,//Times of confirmation
+  "size" : 204,//Size of block
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"// Signature
+}
+

Example

nuls>>> getbestblockheader
+{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",
+  "time" : "2018-07-17 10:25:40",
+  "height" : 33950,
+  "txCount" : 1,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 668413,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-17 10:25:30",
+  "packingIndexOfRound" : 1,
+  "reward" : "0",
+  "fee" : "0",
+  "confirmCount" : 0,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"
+}
+

Inquire block information

Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.

  • **Command:getblock <hash> | <height> **
Parameter Description
<hash> Block hash
<height> Height of block

Return message

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash
+  "time" : "2018-07-16 16:29:30",//Block generation time
+  "height" : 28115,//Block height
+  "txCount" : 2,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 662578,//Rounds of consensuses 
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0.001",//Consensus bonus 
+  "fee" : "0.001",//Package service charge of block
+  "confirmCount" : 6174,//Times of confirmation
+  "size" : 507,//Size of block
+  "txList" : [ {//Transaction collection
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//Transaction hash
+    "type" : "coinbase",//Transaction type
+    "time" : "2018-07-16 16:29:30",//Transaction time
+    "blockHeight" : 28115,//Block height of transaction
+    "fee" : "0",//Transaction service charge
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],//Transaction input
+    "outputs" : [ //Transaction output
+        {
+          "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+          "value" : 100000,
+          "lockTime" : 29115
+        }
+    ]
+  }],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature
+}
+

Example: to get block as per height

nuls>>> getblock 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6174,
+  "size" : 507,
+  "txList" : [ {
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",
+    "type" : "coinbase",
+    "time" : "2018-07-16 16:29:30",
+    "blockHeight" : 28115,
+    "fee" : "0",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],
+    "outputs" : [ {
+      "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+      "value" : 100000,
+      "lockTime" : 29115
+    } ]
+  }, {
+    "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",
+    "type" : "transfer",
+    "time" : "2018-07-16 16:29:27",
+    "blockHeight" : 28115,
+    "fee" : "0.001",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 249,
+    "inputs" : [ {
+      "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",
+      "fromIndex" : 1,
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 972899896100000
+    } ],
+    "outputs" : [ {
+      "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",
+      "value" : 3000000000000,
+      "lockTime" : 0
+    }, {
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 969899896000000,
+      "lockTime" : 0
+    } ]
+  } ],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

Inquire block head information

Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.

  • **Command:getblockheader <hash> | <height> **
Parameter Description
<hash> Block hash
<height> Block height

Return message

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash
+  "time" : "2018-07-16 16:29:30",//Block generation time
+  "height" : 28115,//Block height
+  "txCount" : 2,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 662578,//Rounds of consensuses
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0.001",//Consensus bonus 
+  "fee" : "0.001",//Package service charge of block
+  "confirmCount" : 6174,//Times of confirmation
+  "size" : 507,//Size of block
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature
+}
+

Example: to get block as per height

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

Inquire network information

Inquire network basic information

  • **Command:getnetinfo **

Return message

{
+  "localBestHeight" : 35317,//Height of local latest block
+  "netBestHeight" : 35317,//Height of latest block online
+  "timeOffset" : "0ms",//Offset of network time
+  "inCount" : 0,//Quantity of passive connecting nodes
+  "outCount" : 1//Quantity of active connecting nodes
+}
+

Example

nuls>>> getnetinfo
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

Inquire network node IP

Inquire network node IP

  • **Command: getnetnodes **

Return message

[ "192.168.1.223" ]
+

Example: get block as per height

nuls>>> getnetnodes
+[ "192.168.1.223" ]
+

Inquire current version information

Inquire current version number

  • **Command:version **

Return message

[ "192.168.1.223" ]
+

Example

nuls>>> version
+{
+  "myVersion" : "1.0.0",
+  "newestVersion" : "0.9.11",
+  "upgradable" : false,
+  "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing"
+}
+

Version update

Inquire current version number

  • **Command:upgrade <version> **

Example

nuls>>> version 1.0.0
+

Exit wallet command program

Exiting from wallet command line program does not mean exiting from wallet node started.

  • Command:exit

Example

nuls>>> exit
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/connectMainnet.html b/docs/.vuepress/dist/NULS1.0/connectMainnet.html new file mode 100644 index 00000000..7e81fcb9 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/connectMainnet.html @@ -0,0 +1,29 @@ + + + + + + Connect Main-net | NULS + + + + + + + +

Connect Main-net

Downloading wallet

The NULS main-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.

Option 1: downloading from the official website (https://nuls.io/newWallet)

1546518367717

Option 2: downloading from github (https://github.com/nuls-io/nuls/releases)

1546518556230

Note: The version marked [Main-net] is the main-net wallet.

Launching wallet

After the wallet is downloaded, unzip it according to specific operating systems.

For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546518956812

Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:

1546519370742

When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:

1546519548787

The appearance of block synchronization means the successful connection to the NULS main-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:

1546520020388

For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546520382686

Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the main-net has been successfully connected, as shown below:

1546520727643

Users can also track the nuls.log in the logs folder to check the latest status of the wallet.

For MAC users, steps are almost the same as the Windows users, so let’s skip it.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/connectTestnet.html b/docs/.vuepress/dist/NULS1.0/connectTestnet.html new file mode 100644 index 00000000..f69d3071 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/connectTestnet.html @@ -0,0 +1,29 @@ + + + + + + Connect Test-net | NULS + + + + + + + +

Connect Test-net

Downloading wallet

The NULS test-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.

Download: downloading from github (https://github.com/nuls-io/nuls/releases)

!1546586728639

Note: The version marked [Testnet] is the test-net wallet.

Launching wallet

After the wallet is downloaded, unzip it according to specific operating systems.

For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546518956812

Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:

1546519370742

When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:

1546519548787

The appearance of block synchronization means the successful connection to the NULS test-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:

1546520020388

For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546520382686

Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the test-net has been successfully connected, as shown below:

1546520727643

Users can also track the nuls.log in the logs folder to check the latest status of the wallet.

For MAC users, steps are almost the same as the Windows users, so let’s skip it.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/developerManual.html b/docs/.vuepress/dist/NULS1.0/developerManual.html new file mode 100644 index 00000000..0277b91e --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/developerManual.html @@ -0,0 +1,796 @@ + + + + + + Development Manual | NULS + + + + + + + +

Development Manual

1. Introduction

NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.

2. Development environment

2.1 Setup of NULS wallet

2.2 Setup of JDK 8

2.3 Setup of IntelliJ IDEA

NULS smart contract adopts IntelliJ IDEA as development tool

2.4 Setup of NULS smart contract plug-ins

Click to download the plugin

NULS smart contract plug-ins provide the following main functions:

  • Newly create NULS contract project
  • Provide the unavailable Java properties, classes ad methods
  • Compile, package and deploy contracts
  • Display and call contract methods

3. NULS smart contract specifications and syntax

NULS smart contract syntax is a subset of Java syntax, with some restrictions

3.1 NULS smart contract specifications

Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.

3.2 Keywords

Java key words are listed as follows and those not applicable for NULS smart contract will be marked

Access control

  • public
  • protected
  • private

Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class

  • class
  • interface
  • abstract
  • implements
  • extends
  • new

Key words of package

  • import
  • package

Key words of data type

  • byte
  • char
  • boolean
  • short
  • int
  • float
  • long
  • double
  • void
  • null
  • true
  • false

Conditional loops (process control)

  • if
  • else
  • while
  • for
  • switch
  • case
  • default
  • do
  • break
  • continue
  • return
  • instanceof

Error processing

  • catch
  • try
  • finally
  • throw
  • throws

Modification method, class, property and variables

  • static
  • final
  • super
  • this
  • native(not supported)
  • strictfp(not supported)
  • synchronized(not supported)
  • transient(not supported)
  • volatile(not supported)

other

  • enum(not supported)
  • assert(not supported)

3.3 Basic syntax

The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java

  • Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign
  • Basic data type: byte short int long float double char boolean
  • Reference data type: class, interface, array
  • Arithmetic operators: + - * /%++ -
  • Relational operator: > <> = <= ==! =
  • Logical Operators: ! &| ^ && ||
  • Bit operator: &| ^~>> << >>>
  • Assignment operator: =
  • Extension assignment operators: + = - = * = / =
  • String link operator: +
  • Conditional operators: ? :
  • Process control sentence (if, switch, for, while, do...while)

3.4 Available class

NULS smart contract can be developed with the following class

  • io.nuls.contract.sdk.Address
  • io.nuls.contract.sdk.Block
  • io.nuls.contract.sdk.BlockHeader
  • io.nuls.contract.sdk.Contract
  • io.nuls.contract.sdk.Event
  • io.nuls.contract.sdk.Msg
  • io.nuls.contract.sdk.Utils
  • io.nuls.contract.sdk.annotation.View
  • io.nuls.contract.sdk.annotation.Required
  • io.nuls.contract.sdk.annotation.Payable
  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Short
  • java.lang.Character
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Float
  • java.lang.Double
  • java.lang.String
  • java.lang.StringBuilder
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.util.Collection
  • java.util.List
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Map
  • java.util.HashMap
  • java.util.LinkedHashMap
  • java.util.Set
  • java.util.HashSet

3.5 Other restrictions

  • Contract class can have one construction method. No restriction for other classes
  • The maximum gas consumption for executing a contract method once is 10 million, including the method of the @View type, Make sure to optimize the contract code as much as possible.

4. Nuls smart contract example

a simple contract

Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract


+package contracts.examples;
+
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+public class SimpleStorage implements Contract {
+
+    private String storedData;
+
+    @View
+    public String getStoredData() {
+        return storedData;
+    }
+
+    @Payable
+    public void setStoredData(@Required String storedData) {
+        this.storedData = storedData;
+    }
+
+}
+

In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details +The project has several classes and interfaces

When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class

After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status

Explanatory comments

@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Required labels the parameter of @Required. When it is called, there must be transfer-in value

Go to download NULS source code on github, and get some contract examples

5. NULS Contract SDK

Contract SDK provides several classes to be convenient for contract development:

io.nuls.contract.sdk.Address

public class Address {
+
+    private final String address;
+
+    public Address(String address) {
+        valid(address);
+        this.address = address;
+    }
+
+    /**
+     * Get the balance of the address (only the balance of contract address)
+     *
+     * @return
+     */
+    public native BigInteger balance();
+
+    /**
+     * Transfer amount to the address from contract 
+     *
+     * @param value transfer amount (in Na)
+     */
+    public native void transfer(BigInteger value);
+
+    /**
+     * Contract method to call the address
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     */
+    public native void call(String methodName, String methodDesc, String[][] args, BigInteger value);
+
+	/**
+     * Call the contract method of this address with a return value(String)
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     * @return return value after calling the contract
+     */
+    public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value);
+    
+    /**
+     * Verify the address 
+     *
+     * @param address
+     * @see io.nuls.kernel.utils.AddressTool#validAddress(String)
+     */
+    private native void valid(String address);
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Address address1 = (Address) o;
+        return address != null ? address.equals(address1.address) : address1.address == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return address != null ? address.hashCode() : 0;
+    }
+
+    @Override
+    public String toString() {
+        return address;
+    }
+
+}
+

io.nuls.contract.sdk.Block

public class Block {
+
+    /**
+     * Given block’s head
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static native BlockHeader getBlockHeader(long blockNumber);
+
+    /**
+     * Current block’s head
+     *
+     * @return
+     */
+    public static native BlockHeader currentBlockHeader();
+    
+    /**
+     * Newest block’s head
+     *
+     * @return 
+     */
+    public static native BlockHeader newestBlockHeader();
+
+    /**
+     * Given block’s hash
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static String blockhash(long blockNumber) {
+        return getBlockHeader(blockNumber).getHash();
+    }
+
+    /**
+     * 
+     * CCurrent block’s miner address
+     *
+     * @return
+     */
+    public static Address coinbase() {
+        return currentBlockHeader().getPackingAddress();
+    }
+
+    /**
+     * 
+     * Current block’s No.
+     *
+     * @return
+     */
+    public static long number() {
+        return currentBlockHeader().getHeight();
+    }
+
+    /**
+     * 
+     * Current block’s time stamp
+     *
+     * @return
+     */
+    public static long timestamp() {
+        return currentBlockHeader().getTime();
+    }
+    
+}
+

io.nuls.contract.sdk.BlockHeader

public class BlockHeader {
+
+    private String hash;
+    private long time;
+    private long height;
+    private long txCount;
+    private Address packingAddress;
+    private String stateRoot;
+
+    public String getHash() {
+        return hash;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getTxCount() {
+        return txCount;
+    }
+
+    public Address getPackingAddress() {
+        return packingAddress;
+    }
+
+    public String getStateRoot() {
+        return stateRoot;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BlockHeader that = (BlockHeader) o;
+
+        if (time != that.time) return false;
+        if (height != that.height) return false;
+        if (txCount != that.txCount) return false;
+        if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
+        if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
+            return false;
+        return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = hash != null ? hash.hashCode() : 0;
+        result = 31 * result + (int) (time ^ (time >>> 32));
+        result = 31 * result + (int) (height ^ (height >>> 32));
+        result = 31 * result + (int) (txCount ^ (txCount >>> 32));
+        result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
+        result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "BlockHeader{" +
+                "hash='" + hash + '\'' +
+                ", time=" + time +
+                ", height=" + height +
+                ", txCount=" + txCount +
+                ", packingAddress=" + packingAddress +
+                ", stateRoot='" + stateRoot + '\'' +
+                '}';
+    }
+
+}
+

io.nuls.contract.sdk.Contract

/**
+ *  Contract interface, implemented by contract class
+ */
+public interface Contract {
+
+    /**
+     * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.
+     */
+    default void _payable() {
+    }
+
+}
+

io.nuls.contract.sdk.Event

/**
+* Event interface, implemented by event class
+*/
+public interface Event {
+}
+

io.nuls.contract.sdk.Msg

public class Msg {
+
+    /**
+     * Remaining gas
+     *
+     * @return
+     */
+    public static native long gasleft();
+
+    /**
+     * sender of the contract
+     *
+     * @return
+     */
+    public static native Address sender();
+
+    /**
+     * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na
+     *
+     * @return
+     */
+    public static native BigInteger value();
+
+    /**
+     * Gas price
+     *
+     * @return
+     */
+    public static native long gasprice();
+
+    /**
+     * Contract address
+     *
+     * @return
+     */
+    public static native Address address();
+
+}
+

io.nuls.contract.sdk.Utils

public class Utils {
+
+    private Utils() {
+    }
+
+    /**
+     *  Check conditions; if conditions are not met, it will roll back.
+     *
+     * @param expression
+     */
+    public static void require(boolean expression) {
+        if (!expression) {
+            revert();
+        }
+    }
+
+    /**
+     * Check conditions; if conditions are not met, it will roll back
+     *
+     * @param expression
+     * @param errorMessage
+     */
+    public static void require(boolean expression, String errorMessage) {
+        if (!expression) {
+            revert(errorMessage);
+        }
+    }
+
+    /**
+     * Terminate implementation and restore status
+     */
+    public static void revert() {
+        revert(null);
+    }
+
+    /**
+     * Terminate implementation and restore status
+     *
+     * @param errorMessage
+     */
+    public static native void revert(String errorMessage);
+
+    /**
+     * Send events
+     *
+     * @param event
+     */
+    public static native void emit(Event event);
+
+	/**
+     * @param seed a private seed
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom(long seed) {
+        int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode();
+        int hash2 = Msg.address().toString().substring(2).hashCode();
+        int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0;
+        int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode();
+
+        long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4;
+
+        seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+        return ((int) (seed >>> 24) / (float) (1 << 24));
+    }
+
+    /**
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom() {
+        return pseudoRandom(0x5DEECE66DL);
+    }
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param src source string (hex encoding string)
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(String hexString);
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param bytes source byte array
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(byte[] bytes);
+    
+    /**
+     * [Testnet]verify signature data(ECDSA)
+     *
+     * @param data(hex encoding string)
+     * @param signature(hex encoding string)
+     * @param pubkey(hex encoding string)
+     * @return verify result
+     */
+    public static native boolean verifySignatureData(String data, String signature, String pubkey);
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @param algorithm Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+        return getRandomSeed(endHeight, seedCount, "SHA3");
+    }
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @param algorithm   Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long startHeight, long endHeight){
+        return getRandomSeed(startHeight, endHeight, "SHA3");
+    }
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+    
+}
+

io.nuls.contract.sdk.annotation.Payable

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Payable {
+}
+

io.nuls.contract.sdk.annotation.Required

@Required labels the parameter of @Required. When it is called, there must be transfer-in value.

@Target({ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Required {
+}
+

io.nuls.contract.sdk.annotation.View

@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface View {
+}
+

6. Main RPC interface of smart contract

See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)

The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001

6.1 Create smart contract

  • POST /api/contract/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
gasLimit* long max. gas consumption
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "gasLimit": 4687,
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "remark": "asd",
+  "args": []
+}
+

6.2 Estimate the gas consumption for creating smart contract

  • POST /api/contract/imputedgas/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "args": []
+}
+

6.3 Call smart contract

  • POST /api/contract/call
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
contractAddress* string address of smart contract
gasLimit* long max. gas consumption
price* long unit price of implementation contract
value long amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)
methodName* string method name
methodDesc string method signature which may be not transferred if the method name is not repeated
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "password": "",
+  "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U",
+  "gasLimit": 8000,
+  "price": 20,
+  "value": 0,
+  "methodName": "balance",
+  "methodDesc": "",
+  "remark": "qwe"
+  "args": []
+}
+

6.4 Estimate the gas consumption for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedgas/call

6.5 Estimate the price for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedprice

6.6 Terminate smart contract (see Swagger UI)

  • POST /api/contract/delete

6.7 Call the smart contract function which is not linked to blockchain (see Swagger UI)

  • POST /api/contract/view

6.8 Get the implementation results of smart contract (see Swagger UI)

  • GET /api/contract/result/{hash}

6.9 Get the basic information of smart contract (see Swagger UI)

  • GET /api/contract/info/{address}

6.10 Verify if it is contract address (see Swagger UI)

  • GET /api/contract/{address}

6.11 Get the NULS balance of smart contract address (see Swagger UI)

  • GET /api/contract/balance/{address}

6.12 Get the transaction details of smart contract (see Swagger UI)

  • GET /api/contract/tx/{hash}

6.13 Get the transaction list of smart contract (see Swagger UI)

  • GET /api/contract/tx/list/{address}

6.14 Inquire contract UTXO as per address and limit (see Swagger UI)

  • GET /api/contract/limit/{address}/{limit}

6.15 Inquire contract UTXO as per address and amount (see Swagger UI)

  • GET /api/contract/amount/{address}/{amount}

6.16 Transfer amount to smart contract (see Swagger UI)

  • POST /api/contract/transfer

7. Example

7.1 Voting smart contract code segments are as follows

Full code: https://github.com/nuls-io/nuls-vote

package io.nuls.vote.contract;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Utils;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.View;
+import io.nuls.vote.contract.func.BaseVote;
+import io.nuls.vote.contract.func.VoteInterface;
+import io.nuls.vote.contract.model.VoteConfig;
+import io.nuls.vote.contract.model.VoteEntity;
+
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Map;
+
+public class VoteContract implements Contract {
+
+    private VoteInterface baseVote;
+
+    public VoteContract(long minRecognizance) {
+        baseVote = new BaseVote(BigInteger.valueOf(minRecognizance));
+    }
+
+    @Payable
+    public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) {
+        VoteEntity voteEntity = baseVote.create(title, desc, items);
+
+        VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify);
+        boolean success = baseVote.init(voteEntity.getId(), config);
+
+        Utils.require(success);
+
+        return voteEntity;
+    }
+
+    public boolean vote(long voteId, long[] itemIds) {
+        return baseVote.vote(voteId, itemIds);
+    }
+
+    public boolean redemption(long voteId) {
+        return baseVote.redemption(voteId);
+    }
+
+    @View
+    public boolean canVote(long voteId) {
+        return baseVote.canVote(voteId);
+    }
+
+    @View
+    public VoteEntity queryVote(long voteId) {
+        return baseVote.queryVote(voteId);
+    }
+
+    @View
+    public Map<Address, List<Long>> queryVoteResult(long voteId) {
+        return baseVote.queryVoteResult(voteId);
+    }
+
+    @View
+    public boolean queryAddressHasVote(long voteId, Address address) {
+        return baseVote.queryAddressHasVote(voteId, address);
+    }
+}
+
+

If the methods of smart contract include the parameter of array type, please use the following method to transfer parameters

Refer to the create method in the aforesaid voting contract code

{
+  "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf",
+  "password": "",
+  "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4",
+  "gasLimit": 200000,
+  "price": 1,
+  "value": 10000000000,
+  "methodName": "create",
+  "methodDesc": "",
+  "remark": "",
+  "args": [
+     "Test voting 1",
+     "Voting contract 1",
+     [
+       "Option 1",
+       "Option 2",
+       "Option 3"
+     ],
+     1536044066056, 1536184066056, false, 300, false
+   ]
+}
+

7.2 Standard Token Smart contract code segments

Full code: https://github.com/nuls-io/nuls-nrc20

package io.nuls.contract.token;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import static io.nuls.contract.sdk.Utils.emit;
+import static io.nuls.contract.sdk.Utils.require;
+
+public class SimpleToken implements Contract, Token {
+
+    private final String name;
+    private final String symbol;
+    private final int decimals;
+    private BigInteger totalSupply = BigInteger.ZERO;
+
+    private Map<Address, BigInteger> balances = new HashMap<Address, BigInteger>();
+    private Map<Address, Map<Address, BigInteger>> allowed = new HashMap<Address, Map<Address, BigInteger>>();
+
+    @Override
+    @View
+    public String name() {
+        return name;
+    }
+
+    @Override
+    @View
+    public String symbol() {
+        return symbol;
+    }
+
+    @Override
+    @View
+    public int decimals() {
+        return decimals;
+    }
+
+    @Override
+    @View
+    public BigInteger totalSupply() {
+        return totalSupply;
+    }
+
+    public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) {
+        this.name = name;
+        this.symbol = symbol;
+        this.decimals = decimals;
+        totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));;
+        balances.put(Msg.sender(), totalSupply);
+        emit(new TransferEvent(null, Msg.sender(), totalSupply));
+    }
+
+    @Override
+    @View
+    public BigInteger allowance(@Required Address owner, @Required Address spender) {
+        Map<Address, BigInteger> ownerAllowed = allowed.get(owner);
+        if (ownerAllowed == null) {
+            return BigInteger.ZERO;
+        }
+        BigInteger value = ownerAllowed.get(spender);
+        if (value == null) {
+            value = BigInteger.ZERO;
+        }
+        return value;
+    }
+
+    @Override
+    public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) {
+        subtractAllowed(from, Msg.sender(), value);
+        subtractBalance(from, value);
+        addBalance(to, value);
+        emit(new TransferEvent(from, to, value));
+        return true;
+    }
+
+    @Override
+    @View
+    public BigInteger balanceOf(@Required Address owner) {
+        require(owner != null);
+        BigInteger balance = balances.get(owner);
+        if (balance == null) {
+            balance = BigInteger.ZERO;
+        }
+        return balance;
+    }
+
+    @Override
+    public boolean transfer(@Required Address to, @Required BigInteger value) {
+        subtractBalance(Msg.sender(), value);
+        addBalance(to, value);
+        emit(new TransferEvent(Msg.sender(), to, value));
+        return true;
+    }
+
+    @Override
+    public boolean approve(@Required Address spender, @Required BigInteger value) {
+        setAllowed(Msg.sender(), spender, value);
+        emit(new ApprovalEvent(Msg.sender(), spender, value));
+        return true;
+    }
+
+    public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) {
+        addAllowed(Msg.sender(), spender, addedValue);
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) {
+        check(subtractedValue);
+        BigInteger oldValue = allowance(Msg.sender(), spender);
+        if (subtractedValue.compareTo(oldValue) > 0) {
+            setAllowed(Msg.sender(), spender, BigInteger.ZERO);
+        } else {
+            subtractAllowed(Msg.sender(), spender, subtractedValue);
+        }
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    private void addAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance);
+        check(value);
+        setAllowed(address1, address2, allowance.add(value));
+    }
+
+    private void subtractAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance, value, "Insufficient approved token");
+        setAllowed(address1, address2, allowance.subtract(value));
+    }
+
+    private void setAllowed(Address address1, Address address2, BigInteger value) {
+        check(value);
+        Map<Address, BigInteger> address1Allowed = allowed.get(address1);
+        if (address1Allowed == null) {
+            address1Allowed = new HashMap<Address, BigInteger>();
+            allowed.put(address1, address1Allowed);
+        }
+        address1Allowed.put(address2, value);
+    }
+
+    private void addBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(value, "The value must be greater than or equal to 0.");
+        check(balance);
+        balances.put(address, balance.add(value));
+    }
+
+    private void subtractBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(balance, value, "Insufficient balance of token.");
+        balances.put(address, balance.subtract(value));
+    }
+
+    private void check(BigInteger value) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
+    }
+
+    private void check(BigInteger value1, BigInteger value2) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0);
+    }
+
+    private void check(BigInteger value, String msg) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg);
+    }
+
+    private void check(BigInteger value1, BigInteger value2, String msg) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0, msg);
+    }
+
+
+
+}
+
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/ideaPlugin.html b/docs/.vuepress/dist/NULS1.0/ideaPlugin.html new file mode 100644 index 00000000..fc3b3fff --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/ideaPlugin.html @@ -0,0 +1,31 @@ + + + + + + IDEA Plugin | NULS + + + + + + + +

IDEA Plugin

1 Install NULS Plugin on IDEA

  • Get NULS plugin ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk

Install

  • Select the said ZIP, and click OK

Install

  • Tick NULS plugin, and click Apply

Install

2 Create a NULS project

create

Input Project name, click finish

create

3 Compile smart contract

Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)

code

4 Set and deploy the node and account for contract

  • Click NULS plugin on the right, and call NULS plugin interface

    code

  • Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address.

    Click + on the top left corner of panel, and select Add Node.

    code

  • Input Node address and clock OK

    code

  • Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.

    code

5 Package contract

  • Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code

    code

  • Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).

    code

  • Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface

    code

    code

6 Deploy contract

  • On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.

    code

  • Parameters following JarFilePath are the parameters of the contract construction function.

    code

  • Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.

    code

  • Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.

    code

  • If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.

    code

  • Review the deployed contract on the top of panel

    code

  • Click the deployed contract to review all method of this contract

    code

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/index.html b/docs/.vuepress/dist/NULS1.0/index.html new file mode 100644 index 00000000..a4723075 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/index.html @@ -0,0 +1,21 @@ + + + + + + Welcome to NULS | NULS + + + + + + + +

Welcome to NULS

NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.

The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.

NULS2.0 Alpha Version is released

Have a try

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/randomImplementations.html b/docs/.vuepress/dist/NULS1.0/randomImplementations.html new file mode 100644 index 00000000..05b4434d --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/randomImplementations.html @@ -0,0 +1,37 @@ + + + + + + Ways of creating random numbers | NULS + + + + + + + +

Ways of creating random numbers

References:

[Solidity Pitfalls: Random Number Generation for Ethereum] +(https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/)

[Predicting Random Numbers in Ethereum Smart Contracts] +(https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620)

1. Linear Congruential Generator (LCG): algorithm to generate pseudorandom numbers

The NULS smart contract SDK provides a way to create random numbers. It takes the current block's miner address, contract address, contract invoker address, and current block’s timestamp as random factors, and uses the algorithm linear congruential generator (LCG) to generate pseudorandom numbers

Invoking like this:

io.nuls.contract.sdk.Utils.pseudoRandom();
+/**
+ * add a random factor
+ */
+io.nuls.contract.sdk.Utils.pseudoRandom(long seed);
+

--

2. Using the BlockHash of the future block

Taking lottery as an example, it needs to invoke contract transactions twice - close the lottery and pick the winner.

Once the lottery is closed, record the current block height H1 and generate a number N. Pick the winner when the height of the future block reaches H1+N

When picking the winner, add up the recorded block height H1 and block number in interval (0~80] (to be determined) to the block height H2, and take the BlockHash of the block H2 as a random seed.

ETH cannot use this way for the following reasons: +

--

3. Random seeds limited to participants

In the case of lottery, we need more arbitrary data for picking our winner. When we determine the winner, we can use the addresses of the players that have entered our lottery smart contract as random factors to generate random numbers.

--

4. commit-reveal

Also take the lottery as an example.

  • The contract sets aside awards for the random number.

  • Each user generates own secret random number N.

  • Users can hash their N and address to generate the hash value of their secret random numbers: String hash = sha3(N + Msg.sender()).

Note: step 2 and 3 should be performed locally, for instance, the user submits N to the lottery application, which performs the hash operation.

  • Users submit their hash to the smart contract.

  • Submission is open until the number of blocks reaches a certain value, or until enough participants join.

  • Once the submission is closed, it’s time to pick the winner.

  • Each user submits their random number N to the smart contract.

  • The contract verifies sha3 (N + Msg.sender()) to match the original submission.

  • If the user fails to submit a valid N in time, his deposit will be forfeited.

  • Perform XOR operation on all-verified N to get random numbers.

  • These numbers are used to determine the winners --> (N % numUsers).

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/randomRPC.html b/docs/.vuepress/dist/NULS1.0/randomRPC.html new file mode 100644 index 00000000..6dbb9f51 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/randomRPC.html @@ -0,0 +1,201 @@ + + + + + + Wallet adds a random seed | NULS + + + + + + + +

Wallet adds a random seed

Wallet adds a random seed RPC interface

The random seed you get is a big number, and notice, it could be a negative number

Get a random seed list based on the height interval

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cutoff height, cannot exceed startHeight+1000

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

Get random seed list according to height interval

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cut-off height,endHeight-startHeight<=1000
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

Smart contracts support random Numbers in the underlying chain

Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code. +Take one of these methods as an exampleUtils.getRandomSeed(long endHeight, int seedCount, String algorithm) Shows how to generate random Numbers using random number seeds.

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @param algorithm Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]According to the height range, a specific algorithm is used to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   Number of original seeds
+ * @param algorithm   Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]Get the set of original seeds according to the height range
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) A dice example shaking at the same time N

2.1) Calculation method 1

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • The original seed is multiplied by the number of tosses, resulting in an array of bytes
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) Calculation method 2

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/rpcToolWebsocketDesign.html b/docs/.vuepress/dist/NULS1.0/rpcToolWebsocketDesign.html new file mode 100644 index 00000000..2235cf95 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/rpcToolWebsocketDesign.html @@ -0,0 +1,291 @@ + + + + + + RPC-TOOL design document | NULS + + + + + + + +

RPC-TOOL design document

[TOC]

1. Overall description

1.1 summary

1.1.1 position of RPC-TOOL

  • NULS 2 according to function partition module, all modules are isolated and can run independently.
  • Interaction between modules through RPC call interface
  • As long as the module implements the required interface, it can be implemented in any language
  • Each module will use RPC, so it will be encapsulated into the same jar file

1.1.2 what will RPC-TOOL did

Data interaction between modules is done through RPC-TOOL

  • RPC Server start
  • Register all CMD commands of the current module
  • Parsing the received CMD command
  • Returns the result by calling the corresponding method based on CMD
  • RPC Client start
  • Interacting with kernel

1.1.3 position

RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.

2. functional design

3. interface design

3.1 interface

status

  • Interface description +Kernel will periodically push the status of the current system to each module, which is used for receiving

  • Request example

    {
    +    "cmd":"status",
    +    "minVersion":1,
    +    "params":[
    +        {
    +            "service":[
    +                "a",
    +                "b",
    +                "c"
    +            ],
    +            "available":true,
    +            "modules":{                
    +                "moduleABC":{
    +                    "name":"moduleABC",
    +                    "status":"READY",
    +                    "available":false,
    +                    "addr":"127.0.0.1",
    +                    "port":19722,
    +                    "rpcList":[
    +                        {
    +                            "cmd":"shutdown",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"cmd1",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"conf_reset",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"terminate",
    +                            "version":1
    +                        }
    +                    ],
    +                    "dependsModule":[
    +                        "m2",
    +                        "m3"
    +                    ]
    +                }
    +            }
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    index parameter required type description
    0 modules_information true map All module information

    modules_information

    parameter required type description
    service true string[] The dependent modules
    available true boolean can start service?
    modules true map<name, module> All module information

    module

    parameter required type description
    name true string name
    status true string status
    available true boolean can start service?
    addr true string ip address/host name
    port true int port
    rpcList true list cmd list
    dependsModule true string[] The dependent modules
  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    +"version": 1.2,
    +  "code":0,
    +  "result":{}
    +} 
    +
  • Response field specification +N/A

shutdown

  • Interface description +Kernel calls the interface to close the module (waiting for all the processing of the current business to complete)

  • Request example

    {
    +    "cmd":"shutdown",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

terminate

  • Interface description +Kernel calls the interface to close the module (immediately terminates).

  • Request example

    {
    +    "cmd":"terminate",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confGet

  • Interface description +Kernel gets module configuration items

  • Request example

    {
    +    "cmd":"confGet",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{
    +        "key1": "value1",
    +        "key2": "value2"
    +    }
    +} 
    +
  • Response field specification +N/A

confSet

  • Interface description +Kernel sets module configuration items

  • Request example

    {
    +    "cmd":"confSet",
    +    "minVersion":1,
    +    "params":[
    +        {
    +        "key1":"value1",
    +        "key2":"value2"
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confReset

  • Interface description +Kernel restore template is configured as initial value.

  • Request example

    {
    +    "cmd":"confReset",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

4. Event description

5. Protocol

6. Configuration

7. Java unique design

Server

  • Start server

    // Port is not necessary. If no port is specified, the system is allocated randomly
    +BaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);
    +
    +// Scan the package in which the CMD command is located
    +server.scanPackage("io.nuls.rpc.mycmd");
    +
    +// Initialization
    +server.init("moduleName", "dependsModule, type is List<String>");
    +
    +// start
    +server.start();
    +
  • Custom CMD

    // extends BaseCmd
    +public class SomeCmd extends BaseCmd
    +
    +//  Custom method to add annotation CmdInfo 
    +@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)
    +public Object methodName(List params) {
    +    System.out.println("I'm version 1");
    +    return success();
    +}
    +
    +Note: rpc-tool automatically transfers the Object[] transferred from client to List<Object>. 
    +
  • There must be and only one CMD class to implement the KernelCmd interface.

    //  Implement interface 
    +public class SomeCmd extends BaseCmd implements KernelCmd 
    +
    +/**
    + *  Receive all module information from kernel 
    + */
    +public Object status(List params);
    +
    +/**
    + * Shut down service: after the existing business is completed
    + */
    +public Object shutdown(List params);
    +
    +/**
    + * Shut down service: close immediately, whether or not the business is completed.
    + */
    +public Object terminate(List params);
    +
    +/**
    + *  Provide local configuration information 
    + */
    +public Object confGet(List params);
    +
    +/**
    + *  Update local configuration information 
    + */
    +public Object confSet(List params);
    +
    +/**
    + *  Reset local configuration information 
    + */
    +public Object confReset(List params);
    +

Client

  • Provide module information to kernel

    RpcClient.versionToKernel();
    +
  • call rpc

    //  CMD corresponds to one interface. 
    +String jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);
    +
    +//  CMD corresponds to multiple interfaces. 
    +String jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);
    +
    +note:
    +params is instance of Object[]     
    +

Data exchange

  • Request

    {
    +  "cmd": "shutdown",
    +  "minVersion": 1.0,  //根据自己需要传最低版本号
    +  "params": [],
    +}
    +
  • Response(success and failure are the same)

    {
    +  "code":0,
    +  "msg": " This property is only available when failed",
    +  "version": "Actually called version",
    +  "result": {}
    +}    
    +

Other

  1. BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:

    @Override
    +@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)
    +public Object status(List params){
    +    return super.status(params);
    +}
    +
  2. There are ways to return to success and failure in BaseCmd.
    +success:

    protected Object success(double version) {
    +    return success(version, null);
    +}
    +
    +protected Object success(double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", 0);
    +    map.put("msg", SUCCESS);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

    fail:

    protected Object fail(String code, String msg, double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", code);
    +    map.put("msg", msg);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

8. supplementary content

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/sdk.html b/docs/.vuepress/dist/NULS1.0/sdk.html new file mode 100644 index 00000000..f1bca089 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/sdk.html @@ -0,0 +1,1001 @@ + + + + + + SDK | NULS + + + + + + + +

SDK

Introduction

This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service.

Convention

  • All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article)
  • The return object described in each interface refers to the content of the data attribute in the Result
  • Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na
  • Before running the SDK, you need to confirm that the NULS service is started and running normally
  • JDK1.8+ is recommended

Releases History

Version Release Date Release Notes
v0.9.11.0 2018-06-19 Provide interfaces for docking basic functions of the NULS service
v0.9.11.1 2018-06-22 Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1
v0.9.14 2018-07-04 Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.)
v0.9.15 2018-07-07 Add four consensus interfaces (4.1-4.4)
v0.9.16 2018-07-11 Add interface 4.5
v1.0.1 2018-07-13 Add error code
v1.1.0 2018-09-28 Add multi-account transfer interface

Quick Start

1. Importing files

Import jar files by using build tool

  • Use maven
<dependency>
+   <groupId>io.nuls.sdk</groupId>
+   <artifactId>sdk-all</artifactId>
+   <version>1.0.1</version>
+</dependency>
+

2. Creating SDK instance

First introduce SDK namespace

// introduce the namespace of the SDK boot class 
+import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+// introduce the namespace of the SDK calls tool   
+import io.nuls.sdk.tool.NulsSDKTool;
+

After importing, create a client instance using the following code

  • Initiate SDK
  • If no parameters are passed in initialization method, the default PRC IP and Port respectively are 127.0.0.1, 8001
//By default 
+SDKBootstrap.init();
+// Pass in the NULS service’s IP and Port
+SDKBootstrap.init("192.168.1.88", "8001");
+
  • Call interface methods using the tool class
Result result = NulsSDKTool.createAccount("nuls123456");
+

e.g a complete example of creating an account with password

import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+// introduce the namespace for corresponding modules as required 
+import io.nuls.sdk.tool.NulsSDKTool;
+
+public static void main(String[] args) {
+	SDKBootstrap.init();
+	Result result = NulsSDKTool.createAccount("nuls123456");
+}
+

--

Accounts AccountService

1.1 Creating account

Interface

Result createAccount(int count, String password);

Instructions

Creates one or more accounts with or without a password depending on the parameters passed in. +The information about the successfully created account will be persisted to the NULS service local database.

Returns a set of successfully created account addresses +
parameter type required or not note
count int optional account count to be created (default 1)
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data":{
+	    "list": [ // Return a set of the created account addresses
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv",
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"
+	    ]
+    }
+}
+

e.g Sample Code

//create an account without password
+createAccount();
+//create an account with password
+createAccount("nuls123456");
+// create three password-less accounts 
+createAccount(3);
+// create three accounts with passwords 
+createAccount(3, "nuls123456");
+

1.2 Creating offline account

Interface

Result createOfflineAccount(int count, String password)

Instructions

Directly create an offline account and return it completely, without underlying interaction with NULS and persistence +Creates an encrypted off-line account (Not saved to the database)

Result.data List<AccountInfo>

parameter type required or not note
count int optional account count to be created (default 1)
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+		"list":[
+			{
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+			},
+			{
+				"address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD",
+				"alias": null,
+				"pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb",
+				"extend": null,
+				"createTime": 1529314943624,
+				"encrypted": true,
+				"priKey": "",
+				"encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"
+			}
+		]
+	}
+}
+

e.g Sample Code

// create an offline account without password
+createOfflineAccount();
+// create an offline account with password
+createOfflineAccount("nuls123456");
+// create three password-less offline accounts
+createOfflineAccount(3);
+// create three offline accounts with passwords
+createOfflineAccount(3, "nuls123456");
+

1.3 Getting account

Interface

Result getAccount(String address)

Instructions

Gets information about the account by account address

Result.data AccountInfo

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if when a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+	}
+}
+

e.g Sample Code

getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.4 Getting the fee for setting alias

Interface

Result getAliasFee(String address, String alias)

Instructions

Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)> +Result.data double, unit is NULS

Note! The unit of the fee returned by this interface is NULS

parameter type required or not note
address String required account address
alias String required alias name to be set

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data":{
+		"value": 0.01 //( unit: NULS)
+	} 
+}
+

e.g Sample Code

getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666");
+

1.5 Getting account list

Interface

Result getAccountList(int pageNumber, int pageSize)

Instructions

Gets a list of accounts based on the paging parameters

Result.data Page List<AccountInfo>

parameter type required or not note
pageNumber int required page number, must be greater than 0
pageSize int required record size displayed per page, ranging from 1 to 100

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+		"pageNumber": 1,
+    	"pageSize": 10,
+    	"total": 100,
+     	"pages": 10,
+		"list": [
+			{
+				
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)			},
+			{
+				"address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP",
+				"alias": null,
+				"pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184",
+				"extend": null,
+				"createTime": 1529311250627,
+				"encrypted": true,
+				"priKey": null,
+				"encryptedPriKey": null
+			}
+			...
+			
+		]
+	}
+}
+

e.g Sample Code

getAccountList(1, 10);
+

1.6 Getting account address by account alias

Interface

Result getAddressByAlias(String alias)

Instructions

Gets the account address by the account alias

Result.data String

parameter type required or not note
alias String required account alias

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g Sample Code

 getAddressByAlias("factory666");
+

1.7 Getting account private key

Interface

Result getPrikey(String address, String password)

Instructions

Gets the private key of the account by account address and password, and returns the private key string

Result.data String

parameter type required or not note
address String required account address
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+		"value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"
+    }
+}
+

e.g Sample Code

// the way of calling the account with password
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+//the way of calling the password-less account
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.8 Verifying the availability of alias

Interface

Result isAliasUsable(String alias)

Instructions

Verifies that the alias is available (if it is not used) by alias name

Result

parameter type required or not note
address String required alias name

Return

  • Return Result object in the following format:
{	// indicate the alias is available
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return the case where the alias is unavailable
{	// indicate the alias is not available
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • Return error cases, such as a parameter error
{	// indicate an error 
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

isAliasUsable("factory666");
+

1.9 Account Backup

Interface

Result backupAccount(String address, String path, String password)

Instructions

Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing.

Result: the generated file address

parameter type required or not note
address String required account address
path String required the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service.
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+	    "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"
+    }
+}
+

e.g Sample Code

// Backup an password-less account to the current directory
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null);
+// Backup an account with password to the /backup directory
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456");
+

1.10 Importing account

Interface

Result importAccountByKeystore

Instrucions

Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified.

Result

parameter type required or not note
path/fileReader String/FileReader required the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file
password String optional the password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported
overwrite boolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g Sample Code

//import an account with password
+importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true);
+importAccountByKeystore(fileReader, "nuls123456", true);
+//import a password-less account
+importAccountByKeystore("/backup/XXXXXX.keystore", false);
+importAccountByKeystore(fileReader, false);
+

1.11 Importing account (private key)

Interface

Result importAccountByPriKey(String privateKey, String password, boolean overwrite)

Instructions

Imports an account by private key

Result

parameter type required or not note
privateKey String required private key of the account
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
overwrite boolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"
+    }
+}
+

e.g Sample Code

// set a password when importing account
+importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true);
+// no password is set when importing account
+importAccountByPriKey("1f9d3ad044e0e120......", true);
+

1.12 Verifying account is encrypted

Interface

Result isEncrypted(String address)

Instructions

Verifies the account is encrypted

Result

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{	// indicate encrypted
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return unencrypted
{
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • Return error cases, such as a parameter error
{	//indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.13 Removing account

Interface

Result removeAccount(String address, String password)

Instructions

Removes an account

Result

parameter type required or not note
address String required account address
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.13 Setting password

Interface

Result setPassword(String address, String password)

Instructions

Sets a password for an unencrypted account. Encrypted account cannot call this interface.

Result

parameter type required or not note
address String required account address
password String required set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.14 Modifying password

Interface

Result resetPassword(String address, String password, String newPassword)

Instructions

Modifys the password for an encrypted account. Unencrypted account cannot call this interface.

Result

parameter type required or not note
address String required account address
password String required the current password of the account
newPassword String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111");
+

1.15 Setting alias

Interface

Result setAlias(String address, String alias, String password)

Instructions

Sets alias name for an account

Result: the hash of the transaction for setting the alias +
parameter type required or not note
address String required account address
alias String required alias name to be set
password String password account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data":{		
+		"value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"
+	}
+}
+
  • Example for error
{
+    "success": false,
+     "data"{
+        "code": "ACT007",
+        "msg": "The account already set an alias"
+     }
+}
+

e.g Sample code

setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111");
+setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666");
+

1.16 Setting offline-account password

Interface

Result setPasswordOffline(String address, String priKey, String password)

Instructions

Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service

Result: the encrypted private key(encryptedPriKey)

parameter type required or not note
address String required account address
priKey String required account’s private key
password String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g Sample Code

setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456");
+

1.17 Modifying offline-account password

Interface

Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)

Instructions

Modifies the password of the offline account independently in SDK, without interaction with NULS service

Result: the encrypted private key generated by the new password (encryptedPriKey)

parameter type required or not note
address String required account address
encryptedPriKey String required encrypted private key
password String required original password
newPassword String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g Sample Code

resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456");
+

Transactions AccountLedgerService

2.1 Creating transfer transaction

Interface

Result createTransaction(List<Input> inputs, List<Output> outputs, String remark)

Instructions

Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. The calculation of the fee will be explained in detail later

Result.data String: serialized transaction string in hexadecimal +
parameter type required or not note
inputs List<Input> required usable output referred by the transaction
outputs List<Output> required usable output newly generated by the transaction
remark String optional transaction remarks

e.g Sample Code

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+
+// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+// the outputs for assembly transaction, the attribute of the output in the example is mandatory.
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createTransaction(inputs, outputs, remark);
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:100000 NA/1KB

Calculation of transaction size:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

2.2 Transaction Signatures

Interface

Result signTransaction(String txHex, String priKey, String address, String password)

Instructions

Signs the transaction by private key

Result.data String: the signed transaction, serialized string in hexadecimal

parameter type required or not note
txHex String required serialized transaction data in hexadecimal
priKey String required private key of the transaction
address String required the address corresponding to the private key, used to verify the validity of the private key.
password String optional the password of the private key, leave it blank if the private key is not encrypted

e.g Sample Code

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8";
+String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM";
+String password = "NULS6352s!f";
+Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password);
+

2.3 Querying transaction details by transaction hash

Interface

Result getTxByHash(String hash)

Instructions

Queries transaction details by transaction hash

Result.data: Transaction

parameter type required or not note
hash String required transaction hash

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+        "type": 2,
+        "time": 1529323198461,
+        "blockHeight": 1884,
+        "fee": 100000,
+        "value": 99900000000,
+        "remark": "transfer",
+        "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+        "status": 1,
+        "confirmCount": 14,
+        "size": 255,
+        "inputs": [
+            {
+                "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                "fromIndex": 0,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9999899000000
+            }
+        ],
+        "outputs": [
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 0,
+                "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                "value": 99900000000,
+                "lockTime": 0,
+                "status": 0
+            },
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 1,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9899998900000,
+                "lockTime": 0,
+                "status": 0
+            }
+        ]
+    }
+}
+

e.g Sample Code

getTxByHash("041f3d2ceed........");
+

2.4 Transfers

Interface

Result transfer(String address, String toAddress, String password, long amount, String remark)

Instructions

Initiates a transfer transaction

Result: the transaction hash

parameter type required or not note
address String required address of the transferor account
toAddress String required address of the transferee account
password String optional password of the transferor account, leave it blank if the account is not encrypted.
amount long required transfer amount (unit: Na)
remark String required remarks

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"
+    }
+}
+

e.g Sample Code

	//account with password
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "remarks 1NULS=10000000Na");
+//account without password
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, " remarks 1NULS=10000000Na");
+

2.5 Querying account balance

Interface

Result getBalance(String address)

Instructions

Gets the account balance

Result.data BalanceInfo

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "balance": 1009899998900000,
+        "usable": 1009899998900000,
+        "locked": 0
+    }
+}
+

e.g Sample Code

getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS");
+

2.6 Broadcasting transaction

Interface

Result broadcastTransaction(String txHex);

Instruction

Broadcasts a transaction

Result.data String: transaction hash

parameter type required or not note
txHex String required serialized transaction data in hexadecimal

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"
+    }
+}
+
+

e.g Sample Code

String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24";
+Result result = service.broadcastTransaction(txHex);
+if(result.isSuccess()) {
+   String txHash = (String)result.getData();
+}
+

2.7 Creating multi-address transfer transaction

Interface

Result createMultipleInputAddressTransaction(List<Input> inputs, List<Output> outputs, String remark)

Instructions

Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. The calculation of the fee will be explained in detail later

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
inputs List<Input> required usable output referred by the transaction
outputs List<Output> required usable output newly generated by the transaction
nInputAccount int required input account number
remark String optional transaction remarks

e.g Sample Code

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+int nInputAccount = 2;
+
+//the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//the outputs for assembly transaction, the attribute of the output in the example is mandatory.
+ Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark);
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:100000 NA/1KB

Calculation of transaction size:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

2.8 Signing multi-address transfer transaction

Interface

Result signMultipleAddressTransaction(String txHex, List<String> privKeys, List<String> passwords)

Instructions

Signs a transaction by private key

Result.data String: signed transaction, serialized string in hexadecimal

parameter type required or not note
txHex String required serialized transaction data in hexadecimal
privKeys List required private key of the transaction
passwords List required password corresponding to the private key (passwords for multiple accounts must be the same) +

e.g Sample Code

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+List<String> priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d");
+List<String> passwords = Arrays.asList("123456","123456");
+Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords);
+

Blocks BlockService

3.1 Getting block header by block height

Interface

Result getblockHeader(int height)

Instructions

Gets a block header by block height

Result.data BlockHeader

parameter type required or not note
height int required block height

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g Sample Code

getblockHeader(10);
+

3.2 Getting block header by block hash

Interface

Result getblockHeader(String hash)

Instructions

Gets a block header by block hash

Result.data BlockHeader

parameter type required or not note
hash String required block hash

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g Sample Code

getblockHeader("041f3d2ceed........");
+

3.3 Getting block by block height

Interface

Result getBlock(int height)

Instructions

Gets a block by block height

Result.data Block

parameter type required or not note
height int required block height

Return

  • Return Result object in the following formats:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "transfer",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g Sample Code

getBlock(10);
+

3.4 Getting block by block hash

Interface

Result getBlock(String hash)

Instructions

Gets a block by block hash

Result.data Block

parameter type required or not note
hash String required block hash

Return

-Return Result object in the following format:

{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "transfer",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g Sample Code

getBlock("041f3d2ceed........");
+

3.5 Getting the latest block header

Interface

Result getNewestBlockHash()

Instrucntions

Gets the latest block header

Result.data BlockHeader

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+
+

e.g Sample Code

getNewestBlockHash();
+

3.6 Getting the latest block’s height

Interface

Result getNewestBlockHight()

Instructions

Gets the height of the latest block

Result.data: height (Long)

Return

-Return Result object in the following format:

{
+    "success": true,
+    "data": {
+        "value": 5210
+    }
+}}
+
+

e.g Sample Code

getNewestBlockHight();
+

3.7 Getting the latest block’s Hash

Interface

Result getNewestBlockHash()

Instructions

Gets the block Hash of the latest block

Result.data: Hash (String)

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"
+    }
+}}
+
+

e.g Sample Code

getNewestBlockHash();
+

Consensus ConsensusService

4.1 Offline assembling transaction for creating node

Interface

Result createAgentTransaction(AgentInfo agentInfo, List<Input> inputs, Na fee)

Instructions

Assembles transaction for creating node offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
agentInfo Object required the information about the node to be created
inputs List required input information
fee Object required transaction fee

e.g Sample Code

// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+// the information about the node to be created, the attribute of AgentInfo in the example is mandatory.
+AgentInfo info = new AgentInfo();
+info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");       // the agent address of the consensus node
+info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ");     // the address of the node actually packing block
+info.setDeposit(200000 * 100000000L);// deposit for creating a node, not less than 20000NULS and not more than 200000NULS
+info.setCommissionRate(10.0); // commission ratio ranging from 1 to 100
+
+//fee for creating a node
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:1000000 NA/1KB

Calculation of transaction size:(288 + 50 * inputs.length)/1024 +210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

4.2 Offline assembling agent consensus transaction

Interface

Result createDepositTransaction(DepositInfo depositInfo, List<Input> inputs, Na fee)

Instructions

Assembles an agent consensus transaction offline.

Result.data String: serialized transaction data in hexadecimal

parameter type required or not note
depositInfo Object required the information about the node to be created
inputs List required input information
fee Object required transaction fee

e.g Sample Code

// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory.
+DepositInfo info = new DepositInfo();
+info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");            //address of the agent consensus node
+info.setDeposit(300000 * 100000000L);// the agent token number ranging from 2000NULS to 500000NULS
+info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");// the id of the transaction for creating consensus node
+ 
+//fee for creating a node
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

** Calculation of fee for creating an agent transaction**: unit price of the fee* transaction size

** unit price of the fee (min)**:1000000 NA/1KB

Calculation of transaction size:(288 + 50 * inputs.length)/1024 +210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

4.3 Offline assembling transaction for canceling agent consensus

Interface

Result createCancelDepositTransaction(Output output)

Instructions

Assembles a transaction for canceling agent consensus offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
output Object required the output locked when participating in the consensus

e.g Sample Code

// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus.
+/ / use the output as a parameter to generate an transaction for canceling agent consensus
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setValue(20000000000000L);
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createCancelDepositTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.4 Offline assembling transaction for stopping consensus node

Interface

Result createStopAgentTransaction(Output output)

Instructions

Assembles a transaction for stopping consensus node offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
output Object required the output locked when creating a node

e.g Sample Code

// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. 
+/ / use the output as a parameter to generate a transaction for canceling agent consensus 
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setValue(20000000000000L);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createStopAgentTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.5 Getting list of agent consensus

Interface

Result getDeposits(String address, int pageNumber, int pageSize)

Instructions

Gets a list of agent consensus by agent address

Result.data List: a list of agent consensus

parameter type required or not note
address String required agent address
pageNumber int required page number
pageSize int required record size displayed per page ranging from 1 to 100<

Return

  • Return Result object in the following format:
{
+  "success":true,
+  "data":{
+    "pageNumber":1,
+    "pageSize":10,
+    "total":1,
+    "pages":1,
+      "list":[
+        {
+        "deposit":20000010000000,
+        "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c",
+        "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA",
+        "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e",
+        "blockHeight":98,
+        "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"
+        }
+      ]
+  }
+}
+

e.g Sample Code

Result result = NulsSDKTool.getDeposits(address, 1, 10);
+

Appendix

Example of Result returned by interface

Result
  • Indicate the normal access to the interface and the specific data returned by the business service.
{	
+"success": true,// interface executes correctly
+"data": data
+}
+
  • Indicate the normal access to the interface, and the business service returns true.
{	// indicate the normal access to the interface, and the business service returns true
+  "success": true,// interface executes correctly
+    "data": {
+		"value":true // the result returned by interface business function
+    }
+}
+
  • Indicate the normal access to the interface, and the business service returns false.
{	
+    "success": true, // interface executes correctly
+    	"data"{
+        "value": false // the result returned by interface business function
+     }
+}
+
  • Return error cases, such as a parameter error, exception, etc.
{	// indicate an error 
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+
  • This is the full result of creating an offline account with password.
{
+    "success": true,
+    //data为List<account>
+    "data": {
+    	"list":[
+        	{
+	           "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr",
+	            "alias": null,
+	            "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0",
+	            "extend": null,
+	            "createTime": 1529041525794,
+	            "encrypted": false,
+	            "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a",
+	            "encryptedPriKey": ""
+	    	}
+	    ]
+    }
+}
+

Account
{
+	"address": String, account address
+	"alias": String, account alias
+	"pubKey": String, public key
+	"extend": String, extension
+	"createTime": Long, create time
+	"encrypted": boolean, encrypted or not
+	"priKey": String, private key(not null only if a password-less offline account is created)
+	"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+}
+

Input
 {
+	"fromHash": String, txHash of the output         
+	"fromIndex": Integer, outIndexof the output
+	"address": String, transfer-in address                   
+	"value": Long, transfer-in amount
+    "lockTime": Long, lock time
+}
+

Output
 {
+	"txHash": String, transaction hash
+	"index": Integer, index
+	"address": String, address
+	"value": Long, amount
+	"lockTime": Long, lock time
+	"status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent)
+}
+

Transaction
{
+	"hash": String, transaction hash
+	"type": Integer, transaction type
+	"time": Long, transaction initiation time 
+	"blockHeight": Long, block height
+	"fee": Long, transaction fee
+	"value": Long, transaction amount
+	"remark": String, remarks
+	"scriptSig": String, signature
+	"status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed)
+	"confirmCount": Long, confirmation count
+	"size": int, size
+	"inputs": [
+		{
+"fromHash": String, txHash of the output         
+			"fromIndex": Integer, outIndexof the output
+			"address": String, transfer-in address                   
+			"value": Long, transfer-in amount
+
+		}
+		],
+	"outputs": [
+		{
+			"txHash": String, transaction hash
+			"index": Integer, index
+			"address": String, address
+			"value": Long, amount
+			"lockTime": Long, lock time
+			"status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent)
+		}
+	]
+}
+

BalanceInfo
{
+	"balance": long, balance
+	"usable": long, available balance
+	“locked": long, locked balance
+}
+

BlockHeader
{
+	"hash": String, transaction hash
+	"preHash": String, hash value of the previous block
+	"merkleHash": String, merkle hash
+	"time": Long, block generation time
+	"height": Long, block height
+	"txCount": Long, count of transactions packaged by the block
+	"packingAddress": String, packing address
+	"scriptSig": String, signature
+	"roundIndex": Long, consensus round
+	"consensusMemberCount": Integer, count of members participating in the consensus
+	"roundStartTime": Long, the start time of the current consensus round
+	"packingIndexOfRound": Integer, the packing index of the current round
+	"confirmCount": Long, confirmation count
+	"reward": Long, consensus reward
+	"fee": Long, packing fee obtained
+	"size": int, size
+}
+

Block
{
+	"hash": String, transaction hash
+	"preHash": String, hash value of the previous block
+	"merkleHash": String, merkle hash
+	"time": Long, block generation time
+	"height": Long, block height
+	"txCount": Long, count of transactions packaged by the block
+	"packingAddress": String, packing address
+	"scriptSig": String, signature
+	"roundIndex": Long, consensus round
+	"consensusMemberCount": Integer, count of members participating in the consensus
+	"roundStartTime": Long, the start time of the current consensus round
+	"packingIndexOfRound": Integer, the packing index of the current round
+	"confirmCount": Long, confirmation count
+	"reward": Long, consensus reward
+	"fee": Long, packing fee obtained
+	"size": int, size
+	"txList": [
+		{
+			"hash": String, transaction hash
+			"type": Integer, transaction type
+			"time": Long, transaction initiation time
+			"blockHeight": Long, block time
+			"fee": Long, transaction fee
+			"value": Long, transaction amount
+			"remark": String, remarks
+			"scriptSig": String, signature
+			"status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed)
+			"confirmCount": Long, confirmation count
+			"size": int, size
+			"inputs": [inputs
+				{
+		"fromHash": String, txHash of the output         
+					"fromIndex": Integer, outIndexof the output
+					"address": String, transfer-in address
+					"value": Long transfer-in amount
+				}
+			],
+			"outputs": [ outputs
+				{
+					"address": String, address
+					"value": Long, amount
+					"lockTime": Long, lock time
+				}
+			]
+		}
+	]
+}
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/smartContractFee.html b/docs/.vuepress/dist/NULS1.0/smartContractFee.html new file mode 100644 index 00000000..3dad7293 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/smartContractFee.html @@ -0,0 +1,49 @@ + + + + + + Service charge | NULS + + + + + + + +

Service charge

1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?

Background: Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.

In the main-net, there are now three more types of transactions: creating a smart contract, invoking a smart contract, deleting a smart contract

The difference between those three transactions and other transactions such as transfer is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.

  • Calculation of smart contract service charge
public static final int COMPARISON = 1 ; //Compare bytecode 
+public static final int CONSTANT = 1 ; //Simple numeric type bytecode 
+public static final int LDC = 1 ; //Numeric constant, string constant (length * LDC) 
+public static final int CONTROL = .5 ; //Control bytecode 
+public static final int TABLESWITCH = 2 ; //Switch bytecode (size * TABLESWITCH) 
+public static final int LOOKUPSWITCH = 2 ; //Switch bytecode (size * LOOKUPSWITCH) 
+public static final int CONVERSION = 1 ; //Value conversion 
+public static final int EXTENDED = 1 ; //Null determine 
+public static final int MULTIANEWARRAY = 1 ; //Multidimensional Array (size * MULTIANEWARRAY) 
+public static final int LOAD = 1 ; / /Send the local variable to the top of the stack 
+public static final int ARRAYLOAD = 5 ; / /Send an item of the array to the top of the stack
+public static final int MATH = 1 ; //Mathematical operations and shift operations 
+public static final int REFERENCE = 10 ; //Object related operations 
+public static final int NEWARRAY = 1 ; //One-dimensional array (size * NEWARRAY) 
+public static final int STACK = 2 ; //Stack operation 
+public static final int STORE = 1 ; // Save the value in the top of the stack to a local variable 
+public static final int ARRAYSTORE = 5; //Save the value of the stack to an array 
+public static final int TRANSFER = 1000 ; //Transfer transaction
+
+
  • Total service charge for invoking a smart contract +The total service charge for a contract transaction consists of three parts
  • The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.

  • The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.

For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.

  • The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.

Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • How much does a contract invoker pay?

To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • Who receives the service charge?

Precondition:This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.

The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/smartContractIDEAPlugin.html b/docs/.vuepress/dist/NULS1.0/smartContractIDEAPlugin.html new file mode 100644 index 00000000..aecb09a5 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/smartContractIDEAPlugin.html @@ -0,0 +1,23 @@ + + + + + + IDEA Plugin | NULS + + + + + + + +

IDEA Plugin

1 Install NULS Plugin on IDEA

  • Get NULS plugin ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk

Install

  • Select the said ZIP, and click OK

Install

  • Tick NULS plugin, and click Apply

Install

2 Create a NULS project

create

Input Project name, click finish

create

3 Compile smart contract

Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)

code

4 Set and deploy the node and account for contract

  • Click NULS plugin on the right, and call NULS plugin interface

    code

  • Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address.

    Click + on the top left corner of panel, and select Add Node.

    code

  • Input Node address and clock OK

    code

  • Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.

    code

5 Package contract

  • Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code

    code

  • Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).

    code

  • Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface

    code

    code

6 Deploy contract

  • On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.

    code

  • Parameters following JarFilePath are the parameters of the contract construction function.

    code

  • Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.

    code

  • Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.

    code

  • If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.

    code

  • Review the deployed contract on the top of panel

    code

  • Click the deployed contract to review all method of this contract

    code

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/sourceCodeStartNULS.html b/docs/.vuepress/dist/NULS1.0/sourceCodeStartNULS.html new file mode 100644 index 00000000..00784763 --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/sourceCodeStartNULS.html @@ -0,0 +1,43 @@ + + + + + + Launching NULS with source code | NULS + + + + + + + +

Launching NULS with source code

Downloading source code

Visit the NULS project on github: https://github.com/nuls-io/nuls

Option 1: downloading the source code directly

After accessing the github, click the "Clone or download" button and select Download ZIP to download the source-code package.
+

Option 2: running the git command to clone the NULS repository

` git clone https://github.com/nuls-io/nuls.git`
+

Option 3: (recommended): cloning the NULS repository with development tools such as IntelliJ IDEA.

Environment description

Operating Systems: macOS, Windows
+
+Building Tools: maven
+
+Development Tools: IntelliJ IDEA
+
+Development Language: Java (JDK1.8)
+

Basic introduction of launching NULS

Since blockchain is a decentralized network composed of multiple nodes, it makes no sense to launch a node with NULS source code alone, and it is also not feasible. This tutorial assumes an existing custom test-net running with NULS source code, and the source code other than the network parameters is not modified when building the network. How can we run the NULS source code and join the network 
+
  1. First install jdk1.8 and the build tool - maven.

2. Run IntelliJ IDEA +     - If you download the source code package, extract it and import the NULS project via IntelliJ IDEA +     - If you download the source code by running git command to clone the NULS repository, import the NULS project via IntelliJ IDEA. +     - Clone the NULS repository via IntelliJ IDEA’s Git plugin. + 3. Configure network environment parameters consistent with the existing network. +     - Open the module.ini configuration file in the client-module project +     - It is recommended to replace the module.ini file with that of other nodes in the known custom test-net to ensure the consistency of the network environment parameters. + 4. Run the NULS boot class Bootstrap.java in the client-module project, located in io.nuls.client package. + 5. The NULS wallet interface will be opened during start-up process and the block height of the custom test-net will be synchronized, indicating that the startup is successful.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS1.0/startSmartContract.html b/docs/.vuepress/dist/NULS1.0/startSmartContract.html new file mode 100644 index 00000000..40e70f9c --- /dev/null +++ b/docs/.vuepress/dist/NULS1.0/startSmartContract.html @@ -0,0 +1,79 @@ + + + + + + Quick Start | NULS + + + + + + + +

Quick Start

1. Running the test-net environment, creating an account, and claiming test tokens.

Preparations for deployment and invocation of smart contracts

2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins

Preparations for the development of smart contract code

[Downloading JDK8] +(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)

[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)

[Downloading NULS smart contract plug-ins] +(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)

[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)

3. Smart contract example

_Quickly compile and deploy a smart contract with the example _

  • Simple example

+Import io.nuls.contract.sdk.Contract;
+Import io.nuls.contract.sdk.Msg;
+Import io.nuls.contract.sdk.annotation.Payable;
+Import io.nuls.contract.sdk.annotation.Required;
+Import io.nuls.contract.sdk.annotation.View;
+
+Import java.math.BigDecimal;
+Import java.math.BigInteger;
+
+Public class SimpleContract implements Contract {
+
+    Private String sayContent;
+
+    @Override
+    @Payable
+    Public void _payable() {
+        // override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets
+        // you can do something else
+        // ...
+    }
+
+    Public String sayContent(@Required String content) {
+        this.sayContent = content;
+        Return "you want say " + content;
+    }
+
+    @Payable
+    Public String transferToContract() {
+        // mark the @Payable annotation. Smart contract can receive NULS when invoking this method
+        BigInteger value = Msg.value();
+        BigDecimal nuls = new BigDecimal(value).movePointLeft(8);
+        // you can do something else
+        // ...
+
+        Return "I received your transfer amount: " + nuls.toPlainString();
+    }
+
+    @View
+    Public String sayWhat() {
+        If(sayContent != null) {
+            Return "you want say " + sayContent;
+        }
+        Return "you want say nothing.";
+    }
+}
+
+

4. Smart contract repository

[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)

[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)

[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)

[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)

5. Deploying and invoking smart contracts

[How to deploy and invoke the wallet smart contract] +(https://dev.nuls.io/zh-cn/contract/smartContract.html)

6. Smart contract specifications and syntax

[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/NRC-20TokenStandard.html b/docs/.vuepress/dist/NULS2.0/NRC-20TokenStandard.html new file mode 100644 index 00000000..1552ec3b --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/NRC-20TokenStandard.html @@ -0,0 +1,50 @@ + + + + + + NRC-20 Token Standard | NULS + + + + + + + +

NRC-20 Token Standard

Simple Summary

A standard interface for tokens.

Abstract

The following standard allows for the implementation of a standard API for tokens within smart contracts. +This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.

Motivation

A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.

Specification

Token

Methods

NOTE: Callers MUST handle false from return boolean. Callers MUST NOT assume that false is never returned!

name

Returns the name of the token - e.g. "MyToken".

@View
+public String name();
+

symbol

Returns the symbol of the token. E.g. "MT".

@View
+public String symbol();
+

decimals

Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

@View
+public int decimals();
+

totalSupply

Returns the total token supply.

@View
+public BigInteger totalSupply();
+

balanceOf

Returns the account balance of another account with address owner.

@View
+public BigInteger balanceOf(@Required Address owner);
+

transfer

Transfers value amount of tokens to address to, and MUST fire the TransferEvent event. +The function SHOULD revert if the from account balance does not have enough tokens to spend.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transfer(@Required Address to, @Required BigInteger value);
+

transferFrom

Transfers value amount of tokens from address from to address to, and MUST fire the TransferEvent event.

The transferFrom method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. +This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. +The function SHOULD revert unless the from account has deliberately authorized the sender of the message via some mechanism, such as calling approve(@Required Address spender, @Required BigInteger value).

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value);
+

approve

Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called again it overwrites the current allowance with value.

public boolean approve(@Required Address spender, @Required BigInteger value);
+

allowance

Returns the amount which spender is still allowed to withdraw from owner.

@View
+public BigInteger allowance(@Required Address owner, @Required Address spender);
+

Events

TransferEvent

MUST trigger when tokens are transferred, including zero value transfers.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

public TransferEvent(Address from, @Required Address to, @Required BigInteger value)
+

ApprovalEvent

MUST trigger on any successful call to approve(@Required Address spender, @Required BigInteger value).

public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value)
+

Implementation

Example implementations are available at

  • https://github.com/nuls-io/nuls-nrc20
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/NULS2.0Introduction.html b/docs/.vuepress/dist/NULS2.0/NULS2.0Introduction.html new file mode 100644 index 00000000..22c0a808 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/NULS2.0Introduction.html @@ -0,0 +1,27 @@ + + + + + + Introduction | NULS + + + + + + + +

Introduction

Why NULS 2.0?

NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.

Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:

  1. Loosened coupling and removal of dependencies between modules;

  2. Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;

  3. Complete elimination of programming language limitations.

The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.

During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:

The first layer is the micro-service infrastructure layer.

The second layer is the basic service layer of the blockchain.

The third layer is the DApp application layer.

This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform. +

This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!

The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages. +

Philosophy of Design

The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentationNULS2.0:Philosophy of Design.The documentation details the NULS2.0 evolutionary path。

Last Updated: 3/28/2019, 11:34:44 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/NULS2.0Introduction.html b/docs/.vuepress/dist/NULS2.0/alpha/NULS2.0Introduction.html new file mode 100644 index 00000000..a077a286 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/NULS2.0Introduction.html @@ -0,0 +1,23 @@ + + + + + + NULS 2.0 Introduction | NULS + + + + + + + +

NULS 2.0 Introduction

Why NULS 2.0?

NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.

Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:

  1. Loosened coupling and removal of dependencies between modules;

  2. Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;

  3. Complete elimination of programming language limitations.

The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.

During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:

The first layer is the micro-service infrastructure layer.

The second layer is the basic service layer of the blockchain.

The third layer is the DApp application layer.

This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform. +

This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!

The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages. +

Philosophy of Design

The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentationNULS2.0:Philosophy of Design.The documentation details the NULS2.0 evolutionary path。

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/accountModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/accountModuleDesign.html new file mode 100644 index 00000000..0a1ae384 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/accountModuleDesign.html @@ -0,0 +1,891 @@ + + + + + + Account module design document | NULS + + + + + + + +

Account module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why have a Account Module

  • Used to manage account generation, security and storage, and access to information.
  • User saves account address, public and private key pair, and verification data signature.

1.1.2 What to do with Account Module

The Account Module is a basic module that provides information about the various functions of the account.It mainly supports the functions of account generation, security and storage, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on RPC. The interface makes the account more practical and personalized. The account is the basic module and the carrier of the user data.

  • Account generation

    Create an account, import an account.

  • Account security and storage

    Backup of account, setting account password, modifying account password, removing account.

  • Access to account information

    Query singel account information, query multiple account information, query account address, query account alias.

  • Other usability and personalization features

    Set account alias, set account remark, verify account encryption, sign, verify account address format, verify account password is correct, etc.

1.1.3 Positioning of the account module in the system

The account is the underlying module that is dependent on the ledger, consensus, transaction, kernel, event bus, and community governance modules.

1、Account module depends on the ledger module

The ledger module needs to handle local transactions and relies on account information.
+
+The account module needs to create an alias transaction, which requires the ledger module to pay the fee.
+
+Account balance inquiry, need to rely on ledger module.
+

2、Account module depends on kernel module

Report module information and share data operations.
+

3、Account module depends on network module

Receive and send data through a network module.
+

4、Account module depends on event bus module

Create an account, delete an account,change a password event,send a message through the event bus module.
+The account module is not strongly dependent on the event bus module,because even if the event fails to send,it does not affect the normal business process.
+

5、Consensus module depends on account module

Consensus requires account information for packaging blocks.
+

6、Transaction management module depends on account module

The transaction management module needs to verify the transaction,relying on the address function in the account to verify whether the address is legal.
+

7、Community Governance Module depends on account Module

Community governance requires account signature
+

1.2 Architecture diagram

1.API: Provides an interface layer externally, providing operations such as creating, backing up, and setting aliases for accounts.

2.Business logic layer: the function of defining accounts, account addresses, and aliases.

3.Data persistence layer: save account, alias data.

2、Function design

2.1 Functional architecture diagram

2.2 Module service

2.2.1 create account

  • Function Description

    Create a user's account, including the account's address, public key, private key creation, account information saved to the database, and create an account to notify other nodes through the event.

  • Process description

    Create Address: Create a satellite chain standard account address

    1.Generate a random public-private key pair
    +2.Get chainId and account type
    +3.Calculate hash160 based on public key
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): address=original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)
    +7.Encrypt the private key according to the password and delete the plaintext of the private key
    +8.Store account information
    +9.Add account to cache
    +10.Send Create Account Event
    +
  • ac_createAccount interface

    • Interface Description

      This interface creates one or more accounts.

    • Request example

    {
    +    "cmd":"ac_createAccount",
    +    "minVersion":1.0,
    +    "params":[
    +        1234,
    +        10,
    +        "123456"
    +    ]
    +}
    +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 count false Integer To create an account number, constraints:1-100.
      2 password false String Account initial password, Can be empty
    • Return example

    {
    +    "code": 0,
    +    "msg": "success",
    +    "version":1.0,
    +    "result": {
    +    	"list":["address","",""]
    +    }
    +}
    +
    • Return field description
    parameter type description
    code Integer Return result status
    msg String Failure message
    result jsonObj Data return object
    list jsonArray Account address list
  • Dependent service

    Event Bus: Send Create Account Event

2.2.2 Create an offline account

  • Function Description

    Create a user's offline account, including the account's address, public key, private key creation, account information is not saved to the database

  • Process description

    Create Address: Create a satellite chain standard account address

    1.Generate a random public-private key pair
    +2.Get chainId and account type
    +3.Calculate hash160 based on public key
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): address=original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)
    +7.Encrypt the private key according to the password and delete the plaintext of the private key
    +8.Return account information, not saved to the database
    +
  • ac_createOfflineAccount interface

    • Interface Description

      This interface creates one or more offline accounts.

    • Request example

      {
      +    "cmd":"ac_createOfflineAccount",
      +    "minVersion":1.0,
      +    "params":[
      +        1234,
      +        10,
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 count false Integer To create an account number, constraints:1-100.
      2 password false String Account initial password, Can be empty
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":["address","",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Account address list

2.2.3 Create a multi-sign account

  • Function Description

    Create a multi-signature account, including the address of the account, the creation of the script, and save the multi-signed account information to the database.

  • Process description

    1. Verify the signature public key list, and verify that the minimum number of signatures is correct.
    +2. create a multi-signature script.
    +3. create a multi-signature type account address according to the multi-sign script.
    +4. save the multi-signature account.
    +5. return multi-signed account information.
    +
  • ac_createMultiSigAccount interface

    • Interface Description

      This interface creates a multi-signature account.

    • Request example

      {
      +  "cmd": "createMultiAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 pubKeys true jsonArray Public key list that needs to be signed
      2 minSigns true String Minimum number of signatures, at least a few public key verifications are required
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "address":"",
      +        "minSigns":"",
      +        "pubKeys":[{
      +            "pubKey":"",
      +            "address":""
      +            },{}
      +        ]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Multi-sign account address
      minSigns Integer Minimum signature number
      pubKeys jsonObj Public key list
      --pubKey String Public key
      --address String Account address
  • Dependent service

    no

2.2.4 Remove account

  • Function Description

    Remove the user's local account, including deleting the address of the local account, and notifying the other nodes through the event

  • Process description

    1. Verify that the account address format is correct.
    +2. Verify that the account exists
    +3. Verify that the account is encrypted. If the account is encrypted and the account is unlocked, you need to verify the password.
    +3.1. Obtain an unencrypted private key according to the account's encrypted private key and password.
    +3.2, get the public key according to the unencrypted private key
    +3.3. Compare the decrypted public key with the queried public key
    +4, delete the data
    +4.1. Delete local account information
    +4.2. Delete account cache information
    +5. send remove account events
    +
  • ac_removeAccount interface

    • Interface Description

      This interface is used to remove the account.

    • Request example

      {
      +  "cmd": "ac_removeAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true Integer Account address to delete
      2 password false String account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean 删除是否成功
  • Dependent service

    Event Bus Module: Send Remove Account Event.

2.2.5 Import account - private key

  • Function Description

    Import accounts based on private keys, generate accounts based on private keys, and import account book data.

  • Process description

    Import account information based on private key

    1. Generate a public-private key pair based on the private key.
    +2. get the chainId and account type.
    +3. calculate hash160 according to Public key.
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Base58(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Base58(chainId)
    +7. Encrypt the private key according to the password and delete the plaintext of the private key.
    +8. storage account information.
    +9. add the account to the cache.
    +10. If you send an import account event: If the account already exists, the new event will not be released, only the update will be made.
    +
  • ac_importAccountByPriKey interface

    • Interface Description

      The interface is imported into the account based on the account private key.

    • Request example

      {
      +  "cmd": "ac_importAccountByPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 priKey true String Account private key
      2 password false String Account password
      3 overwrite true Boolean Whether to overwrite when the account exists
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
  • Dependent service

    Event Bus Module: Send Import Account Event when the account does not exist.

    Account Book: Import Account leger(confirmed transaction)

2.2.6 Import account-keystore

  • Function Description

    According to the keystore import account, according to the keystore parsing and decrypting to get the private key and generate an account, and import the account book data

  • Process description

    1. Verify that the keystore and password match.
    +2. decrypt the private key in the keystore according to the password.
    +3. Generate public and private based on the private key.
    +4. get the chainId and account type.
    +5. spliced byte array to form an address.
    +6. generate an address string.
    +7. Verify that the address string and the address in the keystore are consistent.
    +8. storage account information.
    +9. send import account event: the account already exists, do not post new events, only do the coverage update.
    +
  • ac_importAccountByKeystore interface

    • Interface Description

      This interface is used to import accounts keystore

    • Request example

      {
      +  "cmd": "ac_importAccountByKeystore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "HEX",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 keyStore true String Imported keyStore hex code
      2 password false String Account password
      3 overwrite true Boolean Whether to overwrite when the account exists
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
  • Dependent service

    Event Bus Module: Send Import Account Event when the account does not exist

    Account Book: Import Account leger(confirmed transaction)

2.2.7 Import multi-signed accounts

  • Function Description

    Import a multi-signed account related to the local address, including the address of the account, the creation of the script, and save the multi-signed account information to the database.

  • Process description

    1. Verify that the multi-sign address, the signature public key list, and the minimum number of verified signatures are correct.
    +2. create a multi-signature script.
    +3. Create an account address of multiple signature types according to the multi-signed script.
    +4. Determine whether the imported multi-sign address is the same as the address generated by the script. If it is not the same, it prompts an import error.
    +5. save multi-signed account information, including: address, public key list, minimum number of verification signatures.
    +6. return to multi-signal address.
    +
    +
  • ac_importMultiSigAccount interface

    • Interface Description

      This interface is used to import multi-signature accounts.

    • Request example

      {
      +  "cmd": "ac_importMultiSigAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
      2 pubkeys true jsonArray Public key list that needs to be signed
      3 minSigns true Integer Minimum signature number, At least a few Public key verifications are required
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Multi-sign address

2.2.8 Export Account private key

  • Function Description

    Export Account private key hex code

  • Process description

    Export Account private key

    1. Verify that the account exists and verify that the password is correct.
    +2. decrypt the private key, generate a Hex string
    +
  • ac_exportAccountPriKey interface

    • Interface Description

      This interface is used to export the Account private key.

    • Request example

      {
      +  "cmd": "ac_importMultiSigAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    	"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      priKey String Private key hex

2.2.9 Export account KeyStore

  • Function Description

    Export account keystore

  • Process description

    Export account keystore

    1. Verify that the account exists and verify that the password is correct.
    +2. generate a keystore file.
    +
  • ac_exportAccountKeyStore interface

    • Interface Description

      This interface is used to export the account keystore.

    • Request example

      {
      +  "cmd": "ac_exportAccountKeyStore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "encryptedPrivateKey":"",
      +        "pubKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      encryptedPrivateKey String Encrypted private key
      pubKey String Public key hex

2.2.10 Query all accounts

  • Function Description

    Query all accounts

  • Process description

    1. query all account information
    +
  • ac_getAccountList interface

    • Interface Description

      This interface is used to query all accounts.

    • Request example

      {
      +    "cmd":"ac_getAccountList",
      +    "minVersion":1.0,
      +    "params":[
      +        1234
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":[{
      +         	"address":"",
      +            "alias":"",
      +            "pubkeyHex":"",
      +            "encryptedPrikeyHex":""
      +            },{}]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list List Account list collection
      address String Account address
      alias String alias
      pubkeyHex String Public key hex code
      encryptedPrikeyHex String Encrypted private key hex code

2.2.11 Get an account based on address

  • Function Description

    Get an account based on address

  • Process description

    1. Verify that the address exists.
    +2. get an account based on the address
    +
  • ac_getAccountByAddress interface

    • Interface Description

      This interface is used to get an account based on the address.

    • Request example

      {
      +  "cmd": "ac_getAccountByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "address":"",
      +      "alias":"",
      +      "pubkeyHex":"",
      +      "encryptedPrikeyHex":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      alias String alias
      pubkeyHex String Public key hex code
      encryptedPrikeyHex String Encrypted private key hex code

2.2.12 Query the list of Account addresses

  • Function Description

    Query the list of Account addresses

  • Process description

    1. Check whether the paging parameter is legal. The number of pages and the size of the page cannot be less than 0, and must be an integer.
    +2. Query all accounts.
    +3. Filter accounts that meet the paging conditions.
    +4. Return only the address list of the account.
    +
  • ac_getAddressList interface

    • Interface Description

      This interface is used to query the list of Account addresses.

    • Request example

      {
      +  "cmd": "ac_getAddressList",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        0,
      +        10
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 pageNumber true Integer pageNumber
      2 pageSize true Integer pageSize
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":["","",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Address list collection

2.2.13 Get an address based on alias

  • Function Description

    Get an address based on alias

  • Process description

    1. query whether the existence of alias
    +2. return the Account address used to set the alias, and use Base58 to encode the Account address
    +
  • ac_getAddressByAlias interface

    • Interface Description

      This interface is used to get the address based on alias.

    • Request example

      {
      +  "cmd": "ac_getAddressList",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address, Base58 code

2.2.14 Query Account private key

  • Function Description

    Query Account private key

  • Process description

    1. Check whether the address is correct, use Base58 decoding, and check the Chain ID, address type, and check digit respectively.
    +2. Verify that the account exists.
    +3. If the account is over-densified (with password) and is not unlocked, decrypt it by AES and verify that the password is correct, and obtain the unencrypted private key.
    +4. use hexadecimal encoding, and return to Account private key.
    +
  • ac_getPriKeyByAddress interface

    • Interface Description

      This interface is used to query the Account private key.

    • Request example

      {
      +  "cmd": "ac_getPriKeyByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String address
      2 password false String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      priKey String Private key hex

2.2.15Query all Account private keys

  • Function Description

    Query all Account private keys

  • Process description

    1. Verify that the password format is correct and the password can be empty.
    +2. get all local accounts.
    +3. The encryption information of the local account must be the same. If the parameter password is not empty, the passwords of all accounts must be the same. If the parameter password is empty, all accounts cannot be set. Otherwise, the error is displayed.
    +4. If the account is encrypted, the unencrypted private key is reversed by the password, otherwise the private key is obtained without encryption.
    +5. Add all private keys to the collection and return.
    +
  • ac_getAllPriKey interface

    • Interface Description

      This interface is used to query all Account private keys.

    • Request example

      {
      +  "cmd": "ac_getAllPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      2 password false String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "list":["",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list String Private key collection

2.2.16 set password

  • Function Description

    set password

  • Process description

    1. Verify that the account exists.
    +2. Verify that the password has been set.
    +3. set Account password.
    +
  • ac_setPassword interface

    • Interface Description

      This interface is used to set the Account password.

    • Request example

      {
      +  "cmd": "ac_setPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Data return object, password setting is successful

2.2.17 Set offline Account password

  • Function Description

    Set offline Account password

  • Process description

    1. Verify that the address is correct.
    +2. Verify that the private key is correct.
    +3. create according to the private key.
    +4. set offline Account password.
    +
  • ac_setOfflineAccountPassword interface

    • Interface Description

      This interface is used to set the offline Account password.

    • Request example

      {
      +  "cmd": "ac_setOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 priKey true String Account private key
      3 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      encryptedPriKey String Encrypted private key

2.2.18 change Password

  • Request Body

  • Function Description

    change Password

  • Process description

    1. verify the correctness of the old password.
    +2. Update the private key ciphertext.
    +3. send a password change event.
    +
  • ac_updatePassword interface

    • Interface Description

      This interface is used to modify the Account password.

    • Request example

      {
      +  "cmd": "ac_updatePassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
      3 newPassword true String Account new password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the password modification is successful

2.2.19 Modify offline Account password

  • Function Description

    Modify offline Account password

  • Process description

    1. Verify that the address is correct.
    +2. Generate an offline account based on address, private key, and new password.
    +
  • ac_updateOfflineAccountPassword interface

    • Interface Description

      This interface is used to modify the offline Account password.

    • Request example

      {
      +  "cmd": "ac_updateOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 priKey true String Private key
      3 password true String Account password
      4 newPassword true String Account new password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      encryptedPriKey String Encrypted private key

2.2.20 verify password

  • Function Description

    verify password

  • Process description

    1. Verify that the password is correct.
    +2. return verification results.
    +
  • ac_validationPassword interface

    • Interface Description

      This interface is used to verify the password.

    • Request example

      {
      +  "cmd": "ac_validationPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the password correct

2.2.21 Verify that the account is encrypted

  • Function Description

    Verify that the account is encrypted

  • Process description

    1. Verify that the account exists.
    +2. Verify that the account is encrypted.
    +3. return verification results.
    +
  • ac_isEncrypted interface

    • Interface Description

      This interface is used to verify that the account is encrypted.

    • Request example

      {
      +  "cmd": "ac_isEncrypted",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the account is encrypted

2.2.22 Set up an account alias

  • Function Description

    Set up an account alias

  • Process description

    1. Verify that alias is legal
    +2. generate settings alias transaction
    +3. call ledger to fill transaction fee information
    +4. broadcast transactions
    +5. After the transaction is confirmed, the alias will be saved to the database, and address and alias will be stored as keys respectively. That is, the alias data will store two data, mainly for the convenience of querying according to address and alias.
    +
  • ac_setAlias interface

    • Interface Description

      This interface is used to set the account alias.

    • Request example

      {
      +  "cmd": "ac_setAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password false String Account password
      3 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      txHash String Alias transaction hash
  • Dependent service

    Account module: setting an alias requires a fee

2.2.23 Get set alias fee

  • Function Description

    Get set alias fee

  • Process description

    1. Verify that the account exists and verify that the alias is correct.
    +2. calculate the fees required for the alias setting.
    +
  • ac_getAliasFee interface

    • Interface Description

      This interface is used to get the set alias fee.

    • Request example

      {
      +  "cmd": "ac_getAliasFee",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "fee":"100",
      +        "maxAmount":"10000"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      fee String Alias transaction fee
      maxAmount String Maximum transaction fee

2.3.24 Query alias based on address

  • Function Description

    Query alias based on address

  • Process description

    1. Verify that the account exists.
    +2. query the account corresponding alias from the database
    +
  • ac_getAliasByAddress interface

    • Interface Description

      This interface is used to query aliases based on the address.

    • Request example

      {
      +  "cmd": "ac_getAliasByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "alias":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      alias String Account alias

2.2.25 Verify that alias is available

  • Function Description

    Verify that alias is available

  • Process description

    1. Query whether the alias already exists. If it exists, it is not available. Otherwise, it is available.
    +
  • ac_isAliasUsable interface

    • Interface Description

      This interface is used to verify if alias is available.

    • Request example

      {
      +  "cmd": "ac_isAliasUsable",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 alias true String Account alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is alias available

2.2.26 Set account remark

  • Function Description

    Set account remark

  • Process description

    1. Verify that the account exists.
    +2. modify the remarks information and save
    +
  • ac_setRemark interface

    • Interface Description

      This interface is used to set account remark.

    • Request example

      {
      +  "cmd": "ac_setRemark",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +        "remark1"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 remark true String Account remark
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the setting is successful

2.2.27 Set up multi-sign account alias

  • Function Description

    Set up multi-sign account alias

  • Process description

    1. Verify that the Account address, alias, Account password, and signature address parameters are legal.
    +2. Query whether the Account address and the signature address exist.
    +3. generate a set of multi-sign account alias trading.
    +4, call ledger to fill transaction fee information.
    +5. Sign the transaction using a signed account.
    +6. Save the unconfirmed transaction to the local account when the signed number is equal to the minimum number of signatures.
    +7. Broadcast the transaction.
    +8. return the transaction hash.
    +
  • ac_setMultiSigAlias interface

    • Interface Description

      This interface is used to set the multi-sign account alias.

    • Request example

      {
      +  "cmd": "ac_setMultiSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
      2 signAddress true String Signature address
      3 password false String Account password
      4 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      txHash String Multi-signalias alias transactionhash
  • Dependent service

    Account module: setting a multi-signal alias requires a fee.

2.2.28 Remove multi-signed account

  • Function Description

    Remove multi-signed account

  • Process description

    1. Verify that the Account address is correct.
    +2. delete the multi-signed account in the database.
    +3. return to delete is successful.
    +
  • ac_removeMultiSigAccount interface

    • Interface Description

      This interface is used to remove multi-signed accounts.

    • Request example

      {
      +  "cmd": "ac_setMutilSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the removal was successful

2.2.29 Account all transaction verification

  • Function Description

    account module all transaction verification interface, currently only alias transaction

  • Process description

    1. Is the transaction list empty
    +2. loop through all transaction lists, processing for alias transactions
    +3. Check if the same alias is set in the current transaction list.
    +4. Check whether there is an account duplicate setting alias in the current transaction list.
    +5. If there is no conflict in the transaction list, the verification is passed.
    +
  • ac_accountTxValidate interface

    • Interface Description

      This interface is used to batch verify all transactions in the account module.

    • Request example

      {
      +  "cmd": "ac_accountTxValidate",
      +  "minVersion":1.0,
      +  "params": [chianId, ["txHex","txHex","txHex", ...]]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true array Alias transaction serialization data array

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "list":["txHex", "txHex", "txHex", ...]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Illegal transaction serialization data array

2.2.30 Alias transaction verification

  • Function Description

    alias transaction verification interface

  • Process description

    1. deserialize txHex alias transaction data
    +2. verify the alias format
    +3. Verify that the alias is already occupied.
    +4. Verify that the account has an alias set.
    +5. verify the coinData input and output
    +6. verify the script signature format
    +7. Verify that the signature contains the address of the alias. 
    +If it is not included, it is a malicious foul. 
    +Otherwise, the verification is passed.
    +
  • ac_aliasTxValidate interface

    • Interface Description

      This interface is used for a single alias transaction.

    • Request example

      {
      +  "cmd": "ac_aliasTxValidate",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String alias transaction serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the verification is successful

2.2.31 Alias transaction submit

  • Function Description

    Alias transaction submit, save alias

  • Process description

    1. deserialize txHex alias transaction data
    +2. save the alias alias to the database
    +3. set the alias to account and save to the database
    +4. Re-cache the modified account
    +5. return the alias save is successful
    +
  • ac_aliasTxCommit interface

    • Interface Description

      This interface is used to save aliases.

    • Request example

      {
      +  "cmd": "ac_aliasTxCommit",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String Alias transaction serialization data
      2 secondaryDataHex true String Block header serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex description

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the alias transaction saved successfully

2.2.32 Alias transaction rollback

  • Function Description

    Alias transaction rollback interface

  • Process description

    1. deserialize txHex alias transaction data
    +2. delete the alias object data from the database
    +3. take the corresponding account to clear the alias, re-sent the database
    +4. re-cache account
    +5. return the alias rollback is successful
    +
  • ac_aliasTxRollback interface

    • Interface Description

      This interface is used to roll back an alias.

    • Request example

      {
      +  "cmd": "ac_aliasTxRollback",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String Alias transaction serialization data
      2 secondaryDataHex true String Block header serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex description

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the alias transaction rollback successful

2.3 Module internal function

3、Event description

3.1 Published event

  • create Account

    event_topic : "evt_ac_createAccount"

    data:{
    +    address:''
    +    isEncrypted:true   //Is the password set
    +}
    +
  • remove account

    event_topic : "evt_ac_removeAccount"

    data:{
    +	address:''
    +}
    +
  • change password

    event_topic : "evt_ac_updatePassword"

    data:{
    +	address:''
    +}
    +

3.2 Subscribed event

no

4、protocol

4.1 Network communication protocol

  • no

4.2 Transaction agreement

  • Set alias

    • protocol

      Compared with the general transaction, only the type and txData are different, the specific difference is as follows

    type: n //Set the type of alias transaction
    +txData:{
    +    address:  //VarByte Set the address of alias
    +    alias:   //VarByte Array of bytes converted into an alias string, decoded with UTF-8
    +}
    +
    • Alias transaction parameters
    Len Fields Data Type Remark
    24 address byte[] Set the address of alias
    32 alias byte[] Array of bytes converted into an alias string, decoded with UTF-8
    • Validator
    1. alias format legality verification.
    +2. the address must be the satellite chain address, and an address can only be set to an alias.
    +3. burn a token unit.
    +4. Transaction fee.
    +5. signature: set address, input, signature verification.
    +
    • processor
    1. the asset processor.
    +2. store alias data.
    +3. Update local account information.
    +

5、Module configuration item

server.ip:0.0.0.0   //Native ip, used to provide services to other modules
+server.port:8080    //Service port
+

6、Java-specific design

  • Account Object design

    The key used when the table is stored:

    NULS system:chainId+type+hash160

    non-NULS system:chainId+length+address

Field name type Description
chainId short Chain ID
address String Account address(Base58(address)+Base58(chainId))
alias String Account alias
status Integer Account Status
pubKey byte[] Public key
priKey byte[] Private key - not encrypted
encryptedPriKey byte[] Encrypted private key
extend byte[] Extended data
remark String ramark
createTime long create time
  • Address object design (not persistent storage)
Field name type Description
chainId short Chain ID
addressType byte Address type
hash160 byte[] Public key hash
addressBytes byte[] Address byte array
  • Alias object design

    The key used when the table is stored:

    Address and alias are stored as keys respectively, and alias data is stored in two copies.

    Need to create different alias tables according to different chains.

Field name type Description
address byte[] Account address
alias String Account alias
  • MultiSigAccount object design
Field name type Description
address String Account address
pubKeyList List<byte[]> Public key list that needs to be signed
minSigns long Minimum number of signatures

7、to add on

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/blockModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/blockModuleDesign.html new file mode 100644 index 00000000..ae2b955c --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/blockModuleDesign.html @@ -0,0 +1,653 @@ + + + + + + Block management module design documents | NULS + + + + + + + +

Block management module design documents

[TOC]

Chapter 1. General description

1.1 The module overview

1.1.1 Why do you should have the block management module

All transaction data in the blockchain is stored in the block, so there is a module responsible for the saving and management of the block, so that other modules can obtain the block when verifying the data in the block and processing the business etc.

When the blockchain program is started for the first time, it is necessary to synchronize the full blocks from the network to the local. This process is generally time consuming, and the transaction cannot be initiated when the synchronization is not completed, so it is suitable for the work to be performed by a separate module.

In summary, it is necessary to provide a unified block data service for other modules, and it is also better to separate the management of the block from the specific service of the block. The modules who used the block do not have to care about the details of block's acquire.

1.1.2 Block management module's tasks

  1. When the system starts, it is judged whether the height of the local block reaches the latest height of most nodes on the network. If it is not reached, the block is downloaded from the network to the local, and then the block will be verified. If the verification is passed, the data is saved to the local database. This is called synchronization of blocks.

  2. After the block synchronization is completed, the system starts normal operation.Let's discuss separately below

  • If the self-node performs the packing block, the consensus module broadcasts the block information to the network before the packaged block is handed over to the block management module. The block management module verifies whether the block is legal, if legal then save it to the database, and respond to requests from other nodes on the network to get this block.

  • If other nodes on the network are packing blocks, the local node will receive the forwarding block message sent from the network. At this time, the block information is obtained from other nodes, verified and saved.

  1. In the abnormal case, the block's verification fails, and the new block cannot be connected to the last block on the main chain. The block is regarded as a forked block and placed in the forked chain set for maintenance. When it is found that one of the forked chains A is longer than the main chain B, the switching is performed, and the bifurcation chain A is the latest main chain, and the original main chain B enters the bifurcation chain assembly maintenance.

  2. Provide block header and block's query services for other modules or clients.

1.1.3 The position of block management module in the system

Block management is one of the underlying modules. The following sub-functions discuss module dependencies.

rely

  • Block synchronization - depends on the communication interface of the network module, relying on the serialization tool of the tool module
  • Block storage, rollback-dependent tool module database storage tool, consensus module, transaction management module
  • Block forwarding - dependent on the network module's broadcast message interface

Be dependent

  • The entire system can initiate transactions - block synchronization
  • Consensus module: block detailed verification, packing - block query, block saving, block broadcasting, block rollback

1.2 Architecture diagram

Chapter 2. Functional design

2.1 Functional architecture diagram

  1. Provide the API to block storage, query, rollback operations.
  2. Synchronous latest blocks from the Internet, a preliminary verification, validation, bifurcation without bifurcate, call consensus in a consensus based verification, the trading module dual authentication, all validation after saved to the local.
  3. Block synchronization, broadcasting, forwarding message process
  4. Fork blocks judgment and storage
  5. Fork chains maintenance and switch

2.2 The module service

2.2.1 Get the latest local block header

  • Interface specification
  1. Query the DB according to the chain ID and the latest block height in the cache to get the latest block header HASH.
  2. According to the HASH query DB to get the block header byte array
  3. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_bestBlockHeader",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block HASH
preHash String pre block HASH
merkleHash String block's MerkleHash
height Long block height
size Integer block size
time Long packing timestamp
txCount Integer count of transactions
packingAddress String packing address
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String block's signature

2.2.2 Get the latest local block

  • Interface specification:
  1. Get the latest local block header according to the the chain ID
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_bestBlock",
    +  "minVersion":"1.1",
    +  "params": [“888”]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +                "chainId": "888", //chain Id
    +                "height": "1", //block height
    +                "hash": "1", //transaction HASH
    +                "remark": "1", //transaction remark
    +                "size": "1", //transaction size
    +                "time": "1", //transaction timestamp
    +                "type": "1", //transaction type
    +                "transactionSignature": "1", //transaction sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”//Transaction sequence number and increasing
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “locktime”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //Special transaction data HEX
    +    	    },
    +    	    {...}
    +    	], //transaction list
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.3 get block header according to the height

  • Interface specification
  1. Query DB according to the chain ID and height, get the latest block header HASH
  2. Query DB according to the HASH to get the block header byte array
  3. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderByHeight",
    +  "minVersion":"1.1",
    +  "params": ["111","888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 height true Long block's height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.4 get block according to the height

  • Interface specification:
  1. Get the block header according to the chain ID and height
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_getBlockByHeight",
    +  "minVersion":"1.1",
    +  "params": [“111”,"888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 height true Long block's height
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +                "chainId": "888",//chain ID
    +                "height": "1", //block's height
    +                "hash": "1", //transaction's hash
    +                "remark": "1", //transaction's remark
    +                "size": "1", //transaction's size
    +                "time": "1", //transaction's timestamp
    +                "type": "1", //transaction's type
    +                "transactionSignature": "1", //transaction's sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”  
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //HEX
    +    	    },
    +    	    {...}
    +    	], 
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.5 get block header according to the hash

  • Interface specification
  1. According to the chain ID, HASH query DB to get the block header byte array
  2. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderByHash",
    +  "minVersion":"1.1",
    +  "params": ["888","aaa"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 hash true String block hash
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.6 get block according to the hash

  • Interface specification:
  1. Get the block header according to the chain ID and hash
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_getBlockByHash",
    +  "minVersion":"1.1",
    +  "params": ["888",“aaa”]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 hash true String block hash
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +    	    "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +    	        "chainId": "888",
    +                "height": "1", //block's height
    +                "hash": "1", //transaction's hash
    +                "remark": "1", //transaction's remark
    +                "size": "1", //transaction's size
    +                "time": "1", //transaction's timestamp
    +                "type": "1", //transaction's type
    +                "transactionSignature": "1", //transaction's sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”  
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //HEX
    +    	    },
    +    	    {...}
    +    	], 
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.7 get sync status

  • Interface specification

When the block synchronization on a ChainID is completed, the cached synchronization status identifier is updated. It is forbidden to initiate a transaction when the block synchronization is not completed.

  • Sample request

    {
    +  "cmd": "bl_getSynchronizeInfo",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"sync": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
sync String Block the synchronization to be achieved

2.2.8 get block header according to the height range

  • Interface specification
  1. Make queryHash = endHash
  2. Query DB according to queryHash to get block header byte array
  3. Deserialization for block header object blockHeader, added to the List as a return value
  4. If the blockHeader.Hash!= startHash, make queryHash = blockHeader.preHash, repeat step 2
  5. Return to the List
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 startHeight true Long start Height
2 endHeight true Long end Height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        “list” : [
    +            {
    +           "chainId": "888",
    +           "hash": "xxxxxxx",
    +           "preHash": "xxxxxxx",
    +           "merkleHash": "1",
    +           "height": 1,
    +           "size": 1,
    +           "time": 1,
    +           "txCount": 1,
    +           "packingAddress": "1",
    +           "reward": 0,
    +           "fee": 0,
    +           "extend": xxxxxxx,HEX
    +           "scriptSig": "1"
    +           }
    +        ]
    +
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.9 get block according to the height range

  • Interface specification
  1. make queryHash=endHash
  2. Query DB according to the chain ID, queryHash to get the block byte array
  3. Deserialize to block object block, add to List as return value
  4. If block.hash!=startHash, make queryHash=block.preHash, repeat step 2
  5. Return to List
  • Sample request

    {
    +  "cmd": "bl_getBlockBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 startHeight true Long start Height
2 endHeight true Long end Height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        “list” : [
    +            {
    +                "blockHeader": {
    +                    "chainId": "888",
    +                    "hash": "xxxxxxx",
    +                    "preHash": "xxxxxxx",
    +                    "merkleHash": "1",
    +                    "height": 1,
    +                    "size": 1,
    +                    "time": 1,
    +                    "txCount": 1,
    +                    "packingAddress": "1",
    +                    "reward": 0,
    +                    "fee": 0,
    +                    "extend": xxxxxxx,HEX
    +                    "scriptSig": "1"
    +                }, //block header
    +                "transactions": [
    +                    {
    +                        "chainId": "888",
    +                        "height": "1", //block's height
    +                        "hash": "1", //transaction's hash
    +                        "remark": "1", //transaction's remark
    +                        "size": "1", //transaction's size
    +                        "time": "1", //transaction's timestamp
    +                        "type": "1", //transaction's type
    +                        "transactionSignature": "1", //transaction's sign
    +                        "coinData": {
    +                            "from" : [
    +                                {
    +                                    “fromAssetsChainId”:“”  
    +                                    “fromAssetsId”:“”
    +                                    “fromAddress”:“”
    +                                    “amount”:“”
    +                                    “nonce”:“”
    +                                },{...}
    +                            ]
    +                            "to" : [
    +                                {
    +                                    “toAssetsChainId”:“”  
    +                                    “toAssetsId”:“”
    +                                    “toAddress”:“”
    +                                    “amount”:“”
    +                                    “nonce”:“”
    +                                },{...}
    +                            ]
    +                        }
    +                        "txData": XXXX, //HEX
    +                    },
    +                    {...}
    +                ], 
    +           }
    +        ]
    +
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.10 Receive the latest packaging block

  • Interface specification

After the local node's consensus module paking a block, this interface is called to save the block data.

  • Sample request

    {
    +  "cmd": "bl_receivePackingBlock",
    +  "minVersion":"1.1",
    +  "params": [
    +  	blockhex
    +  ]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"sync": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
sync String wherther the Block's save is completed

2.2.11 run a chain

  • Interface specification

After the chain factory releases a chain, the core module calls the interface of the block management module, initializes the block and the forked chain database according to the chainID, starts a series of work threads corresponding to the chainID, and prepares for running the new chain.

  • Sample request

    {
    +  "cmd": "bl_startChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
result String whether the new chain started successfully

2.2.12 stop a chain

  • Interface specification

After stopping a chain in the chain factory, the core module will call the interface of the block management module, delete the cache block and the fork chain data of the chain, and stop a series of work threads corresponding to the chainID.

  • Sample request

    {
    +  "cmd": "bl_stopChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
result String whether the new chain started successfully

2.3 module's internal function

2.3.1 module's boot

  • Functional specifications:

    omit

  • process description

  1. Load block module configuration information
  2. Register block module's message handlers
  3. Register block module's service interfaces
  4. Register block module's events
  5. Start the synchronization thread, the block monitoring thread, branching chain processing thread.
  • Dependent service

    Tool module、kernel module

2.3.2 block's storage

  • Functional specifications:

Description storage table division

  • main chain's storage

A complete block consists of a block header and a transaction, and the block header is stored separately from the transaction. +Block header: (in the block management module) +Key(block's height)-value(block header hash) block-header-index +Key(block headerhash)-value(complete block header) block-header +Trading: (put in the transaction management module)

  • fork chain's storage +Cache each forked chain (starting height, starting hash, ending height, ending hash) in memory, and cache full forked chain data in the hard disk +         There are different tables for the bifurcation chain collection of different chains. The table name is added with the chainID suffix. Each bifurcation chain object is as follows: +             Key (start block height + start block hash) - value (complete chains) fork chains +         Private chain chain; +                 Private String id; +                 Private String preChainId; +                 Private BlockHeader startBlockHeader; +                 Private BlockHeader endBlockHeader; +                 Private List blockHeaderList; +                 Private List blockList;

  • process description

    omit

  • Dependent service

    Database storage tool of tool modules

2.3.2 block's Synchronization

  • Functional specifications:

    omit

  • process description

    • Block synchronization main flow

    • Get a list of available nodes on the network
        1. Traverse the node and count the two MAPs, assuming that each node (the latest HASH+ latest height) is the key
    +    2. A key with the key as the number of statistics
    +    3. A key is used to record the list of nodes holding the key.
    +    4. Finally, the most frequently occurring key is obtained, and the current trusted latest height and latest hash, as well as the list of trusted nodes are obtained.
    +    
    +    for example:
    +    Now connect to 10 nodes at the same time. The latest block's height of 4 nodes (A, B, C, D) is 100, the latest block hash is aaa, and the latest block's height of 6 nodes (E, F, G, H, I, J) is 101. The latest block hash is bbb.
    +    Finally return (101, bbb, [E, F, G, H, I, J]).
    +
    • Download block logic

            Before the official download of the block, it is necessary to determine whether the local and the network are forked, and whether it needs to be rolled back. In order to find the exact block download height.
    +        The following discussion is divided into:
    +        Take the result of the previous step (101, bbb, [E, F, G, H, I, J]), while LH(N) represents the hash of the local Nth block, and RH(N) represents the hash of the Nth block on the network. .
    +        1. Local height 100 < network height 101, LH (100) == RH (100), normal, behind the remote node, download block
    +        2. Local height 100 < network height 101, LH (100)! = RH (100), think local fork, roll back the local block, if LH (99) == RH (99)
    +        At the end of the rollback, download from 99 blocks. If LH(99)!=RH(99), continue to roll back and repeat the above logic. However, if you roll back 10 blocks at most, it will stop and wait for the next synchronization. This will avoid being attacked by malicious nodes and roll back normal blocks in large quantities.
    +        3. Local height 102> network height 101, LH (101) == RH (101), normal, leading than remote node, no need to download block
    +        4. Local height 102> network height 101, LH (101)! = RH (101), think local fork, first roll back to the height and remote consistency, repeat scene 2
    +        5. Local height 101 = network height 101, LH (101) == RH (101), normal, consistent with the remote node, no need to download the block
    +        6. Local height 101 = network height 101, LH (101)! = RH (101), think local fork, repeat scene 2
    +        
    +        In the scenario that needs to be rolled back, the number of available nodes (10) > configuration, the number of consistent available nodes (6) accounted for more than 80%, and avoiding too few nodes leads to frequent rollback. The above two conditions are not met, empty the connected nodes, and re-acquire the available nodes.
    + 
    +        When you actually download the block, give a chestnut:
    +        The current height is 100, the network height is 500, 12 nodes are available, 10 nodes are consistently available, and each node downloads 2 blocks at a time.
    +        Then calculate that you need to download 400 blocks, 400/(2*10)=20 rounds of downloading, and you can calculate the height range of each node download block per round.
    +        Pseudo code representation
    +            For (20 rounds){
    +                For (10 nodes) {
    +                    Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process
    +                }
    +            }
    +        Consider the case where the node is dropped during the download process. It is possible that 20 rounds cannot be downloaded, so the outer layer is added to the loop.
    +            While (not downloaded){
    +                Recalculate the round, download the block's height interval for each node
    +                For (20 rounds){
    +                    For (10 nodes) {
    +                        Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process
    +                    }
    +                }
    +            }
    +
    • Download blocks from a height interval from a node

  • Dependent service

    Database storage tool of tool modules、RPC tool

2.3.3 block's validation

  • Functional specifications:

    Verify the correctness of the block's own data, verify during the download process, verify that there is no problem with the block data itself, and discard the block if the verification fails.

  • process description

    • block's basic validation

    • block header's validation

    • Merkelhash validation

  • Dependent service

    Database storage tool of tool modules

2.3.4 fork block management

  • Functional specifications:

    Verify the correctness of the block context. After the download is complete, verify that the block is connected to the main chain. +The verification failure indicates that the block is bifurcated and enters the forked chain processing logic.

  • process description

    • Define a main chain (MasterChain), a fork chain set (forkChains) +    - Define the block to be verified as Block +    - Define the main chain height MG, to be verified block's heightBG +    - Define the latest block HASH of the main chain as MH, the HASH of the block to be verified is BH, and the PHHASH of the block to be verified is BPH +     +    - Discussion in six situations +    - 1.MG==BG, MH==BH, indicating that the latest main chain block is repeatedly received and discarded. +    - 2.MG==BG, MH!=BH, indicating network fork +        - Traverse the existing set of forked chains to determine if this block already exists +            - discard the block if it already exists +            - If it does not exist, create a new fork chain +              - Determine if you can connect to other fork chains (if you can connect, connect to other fork chains as a chain) +              - Recursive judgment +    - 3.MG==BG-1, MH==BPH, indicating that the block is continuous and saved to the main chain +    - 4.MG==BG-1, MH!=BPH, indicating network fork, processing the same as step 2 +    - 5.MG<BG-1, indicating network fork, processing the same as step 2 +    - 6.MG>BG, indicating network fork, processing the same as step 2 +     +    The height difference is less than 1000 cached to disk, the disk space is limited in size, and the height is discarded. +If the cache space is full, the forked chain is cleared in the order of adding cache time.
  • Dependent service

    Database storage tool of tool modules

2.3.5 fork chain management

  • Functional specifications:

    Determine if the fork chain and the main chain need to be switched

  • process description +​

    • Check if there is an orphan chain that links to the main chain or the forked chain, if any
    • Take the longest one of the fork chains and compare the length of the main chain to determine whether you need to switch the main chain +
      • If the length of the fork chain is longer than the length of the main chain by 3 (configured), you need to switch the main chain.
      • Find the bifurcation point of the main chain and the longest bifurcation chain
      • Verify the block in the forked chain if the verification continues by going down
      • Roll back the main chain block
      • Switch the fork chain as the main chain
  • Dependent service

    Database storage tool of tool modules

2.3.6 forward block

  • Functional specifications:

    omit

  • process description

  1. Use the blockHash to assemble the ForwardSmallBlockMessage and send it to the target node.
  2. After receiving the ForwardSmallBlockMessage, the target node takes out the hash to determine whether it is duplicated. If it does not repeat, use the hash assembly GetSmallBlockMessage to send to the source node.
  3. After the source node receives the GetSmallBlockMessage, it takes out the hash, queries the SmallBlock and assembles the SmallBlockMessage, and sends it to the target node.
  4. Subsequent interaction process reference broadcast block
  • Dependent service

    Database storage tool of tool modules

2.3.7 braodcast block

  • Functional specifications:

    omit

  • process description

  1. Get BlockHeader, TxList according to HASH, assemble into SmallBlock,
  2. Put a SmallBlock into the memory. If it is not deleted actively, it will be automatically cleared when the cache is full or exists for more than 1000 seconds.
  3. Local cache blockHash for filtering duplicate downloads
  4. Assem the SmallBlockMessage and call the RPC module to send a message to the target node.
  5. After receiving the message, the target node determines which transactions are not locally based on txHashList, and then assembles GetTxGroupRequest to the source node.
  6. After receiving the information, the source node assembles the TxGroupMessage according to the hashlist and returns it to the target node.
  7. All block data has been sent to the target node.
  • Dependent service

    Database storage tool of tool modules

2.3.8 Block monitoring

  • Functional specifications:

    omit

  • process description

    • Start monitoring scheduled tasks, once every minute
    • Take the local latest block header
    • Verify that the network module needs to be restarted (if the latest local block has not been updated for 3 minutes, the network module needs to be disconnected and reconnected randomly)
    • to be perfected
  • Dependent service

    Database storage tool of tool modules

Chapter 3. Events

3.1 published event

3.1.1 Synchronization completed

Description: The synchronization is completed. When the height of the area is the same as the height of the network, the event is released.

Event_topic : "bl_blockSyncComplete",

Data:{
+     chainId
+     Height
+     Hash
+}
+

3.1.2 save block event

Description:Each save a block, release the event

event_topic : "evt_bl_saveBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.1.3 rollback block event

Description:Each roll back a block, release the event

event_topic : "evt_bl_rollbackBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.2 Subscribed event

omit
+

Chapter 4. Network Message

4.1 Network communication protocol

omit
+

4.2 Message protocol

4.2.1 Forward block message-ForwardSmallBlockMessage

  • Message description:Used for the "forward block" function

  • Message type(cmd)

    ForwardSmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? hashLength VarInt array's length
? hash byte[] hash
  • Message validation

    omit

  • Message processing logic

  1. After receiving the message, the target node first determines whether the hash in the cache is duplicated according to the chainID.
  2. If it is repeated, it indicates that the SmallBlock forwarded by another node has been received, and the message is discarded.
  3. If there is no duplication, assemble GetSmallBlockMessage with hash and send it to the source node.

4.2.2 Get small block message-GetSmallBlockMessage

  • Message description:Used for the "forward block" function

  • Message type(cmd)

    GetSmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? hashLength VarInt array's length
? hash byte[] hash
  • Message validation

    omit

  • Message processing logic

  1. Get the SmallBlock object according to the hash
  2. Assem the SmallBlockMessage and send it to the source node

4.2.3 Block broadcast message-SmallBlockMessage

  • Message description:Used for "forwarding block" and "broadcast block" functions

  • Message type(cmd)

    SmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? preHashLength VarInt preHash array's length
? preHash byte[] preHash
1 digestAlgType byte digest algorithm identifier
? merkleHashLength VarInt merkleHash array's length
? merkleHash byte[] merkleHash
48 time Uint48 time
32 height Uint32 block's height
32 txCount Uint32 count of transactions
? extendLength VarInt extend array's length
? extend byte[] extend
32 publicKeyLength Uint32 public key array's length
? publicKey byte[] public key
1 signAlgType byte Signature algorithm type
? signBytesLength VarInt sign array's length
? signBytes byte[] sign bytes
? txHashListLength VarInt transaction's hash list array's length
1 digestAlgType byte digest algorithm identifier
? txHashLength VarInt transaction's hash array's length
? txHash byte[] transaction's hash
  • Message validation

    omit

  • Message processing logic

  1. Determine whether the block timestamp is greater than (current time +10s). If it is greater than this time, it is determined to be maliciously prematurely out of the block, ignoring the message.
  2. Determine whether the message is repeated according to the block hash. If it is repeated, ignore the message (requires maintenance of a set to store the received block hash)
  3. Query the DB according to the block hash to see if the block already exists in the local area. If it already exists, ignore the message.
  4. Verify the block header, if the verification fails, ignore the message
  5. Take txHashList, determine that tx is not local, assemble GetTxGroupMessage, and send it to the source node.

4.2.4 Get block message based on height-GetBlocksByHeightMessage

  • Message description:For the "sync block" function

  • Message type(cmd)

    GetBlocksByHeight

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
32 startHeight uint32 start Height
32 endHeight uint32 end Height
  • Message validation

    omit

  • Message processing logic

  1. Height parameter verification
  2. Return the response message ReactMessage
  3. Find the Block from endHeight, assemble the BlockMessage, and send it to the target node.
  4. Find the startHeight, assemble the CompleteMessage, and send it to the target node.

4.2.5 Get block message-GetBlockMessage

  • Message description:Used for "block synchronization"

  • Message type(cmd)

    GetBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Return the response message ReactMessage
  2. Find the Block according to the hash, assemble the BlockMessage, and send it to the target node.
  3. Assemble the CompleteMessage and send it to the target node.

4.2.6 Complete block message-BlockMessage

  • Message description:Used for "block synchronization"

  • Message type(cmd)

    Block

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? preHashLength VarInt preHash array's length
? preHash byte[] preHash
1 digestAlgType byte digest algorithm identifier
? merkleHashLength VarInt merkleHash array's length
? merkleHash byte[] merkleHash
48 time Uint48 time
32 height Uint32 block's height
32 txCount Uint32 count of transactions
? extendLength VarInt extend array's length
? extend byte[] extend
32 publicKeyLength Uint32 public key array's length
? publicKey byte[] public key
1 signAlgType byte Signature algorithm type
? signBytesLength VarInt sign array's length
? signBytes byte[] Signature of block
16 type uint16 transaction's type
48 time uint48 transaction's timestamp
? remarkLength VarInt remark array's length
? remark byte[] remark bytes
32 fromCount Uint32 count of froms
32 fromAssetsChainId Uint32 chain id
32 fromAssetsId Uint32 asset id
? fromAddress VarChar from account address
48 amount Uint48 Transfer amount
32 nonce Uint32 Transaction sequence number, increment
32 toCount Uint32 count of tos
32 toAssetsChainId Uint32 chain id
32 toAssetsId Uint32 asset id
? toAddress VarChar to account address
48 amount Uint48 Transfer amount
32 lockTime Uint32 lock time
? txData T data of special transaction
? txSignLength VarInt transaction's sign array's length
? txSign byte[] transaction's sign
  • Message validation

    omit

  • Message processing logic

  1. Put into the cache queue
  2. Wait for other blocks to be synchronized

4.2.7 Data message not found-NotFoundMessage

  • Message description:A generic message for an asynchronous request that marks the target node not finding the corresponding information.

  • Message type(cmd)

    NotFound

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 msgType byte Data type not found
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, set the processing result flag to complete, and set the return result to null.

4.2.8 Response message-ReactMessage

  • Message description:A generic message, used for asynchronous requests, to flag that the target node receives the request and is processing it.

  • Message type(cmd)

    React

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to wait.

4.2.9 Request completion message-CompleteMessage

  • Message description:A generic message for asynchronous requests that marks the end of asynchronous request processing.

  • Message type(cmd)

    Complete

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
1 success byte flag
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to complete.

4.2.10 Get the message of the transaction list-GetTxGroupRequest

  • Message description:Used for "forwarding blocks"

  • Message type(cmd)

    GetTxGroup

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
? ArrayLength VarInt Hash list length
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. After receiving the message, the target node takes out the hashList, traverses the hashList, obtains Tx according to txHash, assembles TxGroupMessage, and sends it to the source node.

4.2.11 Transaction list message-TxGroupMessage

  • Message description:Used for "forwarding blocks"

  • Message type(cmd)

    TxGroup

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? requestHashLength VarInt requestHash array's length
? requestHash byte[] requestHash
? txCount VarInt count of transactions
16 type uint16 transaction's type
48 time uint48 transaction's timestamp
? remarkLength VarInt remark array's length
? remark byte[] remark bytes
32 fromCount Uint32 count of froms
32 fromAssetsChainId Uint32 chain id
32 fromAssetsId Uint32 asset id
? fromAddress VarChar from account address
48 amount Uint48 Transfer amount
32 nonce Uint32 Transaction sequence number, increment
32 toCount Uint32 count of tos
32 toAssetsChainId Uint32 chain id
32 toAssetsId Uint32 asset id
? toAddress VarChar to account address
48 amount Uint48 Transfer amount
32 lockTime Uint32 lock time
? txData T data of special transaction
? txSignLength VarInt transaction's sign array's length
? txSign byte[] transaction's sign
  • Message validation

    omit

  • Message processing logic

    omit

Chapter 5. The module configuration

{
+    {
+        "name": "serverIp",
+        "remark": "service ip",
+        "changable": "true",
+        "default": "127.0.0.1"
+    },
+    {
+        "name": "serverPort",
+        "remark": "service port",
+        "changable": "true",
+        "default": ""
+    },
+    {
+        "name": "blockSize",
+        "remark": "block size",
+        "changable": "false",
+        "default": "3m"
+    },
+    {
+        "name": "resetTime",
+        "remark": "When the block height is not updated for a long time, the available nodes are reacquired",
+        "changable": "true",
+        "default": "180"
+    },
+    {
+        "name": "forkCount",
+        "remark": "When the fork chain is higher than the main chain, switch",
+        "changable": "false",
+        "default": "3"
+    },
+    {
+        "name": "cacheSize",
+        "remark": "forked chain cache size",
+        "changable": "true",
+        "default": "50m"
+    },
+    {
+        "name": "heightRange",
+        "remark": "Cache to the height range of the forked chain",
+        "changable": "false",
+        "default": "1000"
+    },
+    {
+        "name": "maxRollback",
+        "remark": "How many blocks are rolled back at most each time",
+        "changable": "true",
+        "default": "20"
+    },
+    {
+        "name": "consistencyNodePercent",
+        "remark": "The lowest percentage of consistent nodes available, below this number of unsynchronized blocks",
+        "changable": "false",
+        "default": "80"
+    },
+    {
+        "name": "minNodeAmount",
+        "remark": "The minimum number of available nodes, lower than this number of unsynchronized blocks",
+        "changable": "false",
+        "default": "10"
+    },
+    {
+        "name": "downloadNumber",
+        "remark": "How many blocks are downloaded from one node each time during synchronization",
+        "changable": "true",
+        "default": "20"
+    },
+    {
+        "name": "extendMaxSize",
+        "remark": "block header extension field maximum value",
+        "changable": "false",
+        "default": "1024"
+    }
+}
+

Chapter 6. Java's design

  • Block Object design
field name field type instruction
blockHeader BlockHeader block header
transactions List transaction's list
  • SmallBlock Object design
field name field type instruction
blockHeader BlockHeader block header
transactions List transaction's hash list
subTxList List Transactions that other nodes must not have (such as consensus reward transactions, red and yellow card transactions, etc.
  • BlockHeader Object design
field name field type instruction
chainId long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height int block's height
size short block's size
time long block's packing timestamp
txCount short count of transactions
packingAddress String address of packing
extend byte[] Extension field
blockSignature BlockSignature Signature of block
  • BlockSignature Object design
field name field type instruction
signData String Signature of block
publicKey byte[] public key

Chapter 7. additional content

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/chainModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/chainModuleDesign.html new file mode 100644 index 00000000..44ce30a3 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/chainModuleDesign.html @@ -0,0 +1,186 @@ + + + + + + Chain management module design document | NULS + + + + + + + +

Chain management module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why do you have a Chain Management module

In NULS 1.0, there is only one chain (NULS main network), so no chain management module is required.

In NULS 2.0, the NULS main network can register other friend information, including:

  • Chains in the NULS ecosystem: Derived from the same set of code as the NULS main network.
  • Other chains: Bitcoin, Ethereum, etc.

The Chain Management module is used to manage all the friends that join the NULS main network.

Glossary:

  • NULS main network: Unlike NULS 1.0, it is another chain that runs independently, also known as NULS 2.0."Chain Management" is one of the modules of the NULS main network.
  • Friends Chain: Other chains registered on the NULS main website.

Hypothesis 1: Friendship A, which owns asset A

Hypothesis 2: Friendship B, which owns asset B

  • Cross-chain trading: +
    • Friend chain A transfers asset A to friend chain B
    • Friendship B internal transfer of assets A
    • Friend Chain B turns asset A back to friend chain A
    • Friendship B transfers asset A to other friends (C, D, etc.)
  • Non-cross-chain trading: +
    • Friend Chain A Internal Transfer Asset A
    • Friendship B internal transfer of assets B

Remarks: Regardless of the assets in the chain or the assets outside the chain, as long as the assets are traded across the chain, the main network needs to be confirmed.

1.1.2 What does "Chain Management" do?

The Chain Management module is used to manage basic information about the chain that joins the NULS main network, including:

  • Sign up for a new friend chain
  • Destroy existing friendship chains
  • Query friend information
  • Increase the asset type for a specific friend chain
  • Destroy asset type for a specific friend chain
  • Cross-chain asset verification

1.1.3 The Positioning of "Chain Management" in the System

"chain management" dependent module:

  • Kernel module

  • Network module

  • Transaction management module

  • Account module

    "chain management" weakly dependent module:

  • Event bus module

1.2 Module internal architecture diagram

2、feature design

2.1 Functional architecture diagram

2.2 Module service

2.2.1 Sign up for a new friend chain

  • Function Description:

    he NULS main network will provide an entry (web page) through which you can register a new friend chain to the NULS main network.

  • Process description

步骤描述:

Step description:

1> The user registers the registration chain information with the terminal and the asset information initialized with the chain.
+
+2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.
+     During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.
+      And the seed node information of the cross-chain is obtained through the network module and returned to the user.
+
+3>The transaction module will perform a callback of the data check during the transaction process.
+
+4>The chain management module performs registration data submission through the transaction module callback interface of the “submission chain registration transaction”.
+
+5> The chain management module stores the data and sends the registration information to the network module.
+
+6> The registration chain requires 1000NULS, of which 20% is directly destroyed, 80% is used for mortgages, and is returned when assets are deleted.
+
  • Interface definition

    • Interface Description

    ​ Register friendchain information with the chain management module.

    ​ method : cm_chainReg

    • Request example
    {
    +        "chainId": 152,
    +        "chainName": "nuls chain",
    +        "addressType": "1",
    +        "magicNumber":454546,
    +        "supportInflowAsset":"1",
    +        "minAvailableNodeNum":5,
    +        "singleNodeMinConnectionNum":5,
    +        "txConfirmedBlockNum":30,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"NULS CHAIN",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    chainName true string Chain name
    addressType true int The address type of the account created on the chain: 1 within the ecological 2 non-ecological
    magicNumber true string Network magic parameter
    minAvailableNodeNum true int Minimum number of available nodes
    singleNodeConMinNodeNum true int Minimum number of single node connections
    txConfirmBlockNum true int Transaction confirmation block number
    symbol true string Asset symbol
    assetName true string Asset Name
    initNumber true string Initial value of assets
    decimalPlaces true int Minimum asset separable digits
    address true string Create the primary network address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"
      +}
      +
      +
    • Return field description

    parameter type description
    seeds String Seed node
  • Dependent service

    • Network management module
    • Transaction management module, send transaction
    • Account book module, get the book information

2.2.2 Log out of existing friends

  • Function Description:

    The NULS main network will provide an entry (web page) through which you can log out existing friends.

  • Process description

    1>The chain is created with the asset, so the logout chain must be checked for assets. Only the last asset will be deleted and the chain will be logged off.

    2>Conditions for determining whether to allow cancellation:

​ Assets and chains exist.

​ There is only one last asset with the chain.

​ Chain assets have n% of assets in their own main chain.

3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.

​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.

4>The transaction module will perform a callback of the data check during the transaction process.

5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.

6>The chain management module stores the data and sends the registration information to the network module.

7>Deleting the chain with the cancelled assets will return 80% of the mortgage deposit.

  • Interface definition

    • Interface Description

    ​ Unregister the chain information to the chain management module (the asset logout interface is called because the chain is logged off with the last asset)

    ​ method : cm_assetDisable

    • Request example
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    address true string Create the main network account address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Network management module
    • Transaction management module, send transaction
    • Ledger module, checkbook information

2.2.3 Increase asset information

  • Function Description:

    The NULS main network will provide an entry (web page) through which the selection chain and registered assets can be registered.

  • Process description

Step description: +​ 1>The user enters the asset information through the terminal selection chain and the chain: judge whether the assets overlap. +​ 2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module. +​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module. +​ 3> The transaction module will perform a callback of the data check during the transaction process. +​ 4> The chain management module performs registration data submission through the transaction module callback interface of “submit asset registration transaction”. +​ 5> Registered assets receive 1000NULS, of which 20% are directly destroyed, 80% are used for mortgage, and returned when assets are deleted.

  • Interface definition

    • Interface Description

    ​ Register asset information with the chain management module

    ​ method : cm_assetReg

    • Request example
    {
    +        "chainId": 152,
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"NULS",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +         "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int Chain identification
    symbol true string Asset symbol
    assetName true string Asset Name
    initNumber true string Initial value of assets
    decimalPlaces true int Minimum asset separable digits
    address true string Create the primary network address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +

      Success

      Unified RPC standard format
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, send transaction
    • Account book module, get the book information

2.2.4 Deleting an asset type for a specific friend chain

  • Function Description:

    The NULS main network will provide an entry (web page) through which the assets can be destroyed for the specified friend chain.

  • Process description

    Step description: +1> When there are multiple assets registered, the single asset is allowed to be written off. If there is only one asset, the asset is written off along with the chain. +2> Conditions for determining whether to allow cancellation: +​ There are multiple assets in the chain. +​ Chain assets have n% of assets in their own main chain. +3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module. +​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module. +4>The transaction module will perform a callback of the data check during the transaction process. +5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”. +6>The cancellation of the assets will be refunded 80% of the mortgage deposit.

  • Interface definition

    • Interface Description

    ​ Log out asset information to the chain management module

    ​ method : cm_assetDisable

    • Request example
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    address true string Create the main network account address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
    • Dependent service

      • Transaction management module, send transaction
      • Ledger module, checkbook information

2.2.5 Chain asset verification for cross-chain transactions

  • Function Description:

    When the transaction module generates a cross-chain transaction, the interface is called to perform cross-chain asset verification.

  • Process description

    1>Check chain and assets are registered normally in the cross-chain module

    2>Check if the amount of assets on the chain is overdrawn.

    3>Verify that the asset status is normal.

  • Interface definition

    • Interface Description

    ​ Submit verification to chain management when cross-chain assets are in circulation

    ​ method : cm_assetCirculateValidator

    • Request example
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • Request parameter description
    parameter required type description
    coinDatas true String Trading the HEX value of coindata
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, cross-chain transaction verification call

2.2.6 Chain asset submission for cross-chain trading

  • Function Description:

    When the transaction module generates a cross-chain transaction and verifies the pass, it calls the interface to submit the cross-chain asset.

  • Process description

    Used to change chain assets and manage them for chain assets

    Direct call cm_assetCirculateCommit

  • Interface definition

    • Interface Description

    ​ When the cross-chain asset is circulated, the transaction can be submitted to the chain management when the verification is passed and the confirmation is submitted.

    ​ method : cm_assetCirculateCommit

    • Request example
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • Request parameter description
    parameter required type description
    coinDatas true String Trading the HEX value of coindata
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, cross-chain transaction call

2.2.7 Registration of chain management transaction processing functions

  • Function Description:

    When the module is started, registration of the transaction callback function is required, so that the transaction module performs callback processing when performing related type transaction processing.

    The registration function is divided into 4 categories: 1> transaction verification 2> transaction submission 3> transaction rollback 4> module batch transaction verification within a block

  • Process description

    1>Chain management module startup.

    2>Determine whether the transaction module RPC call status is accessible.

    3>Submit callback interface.

  • Interface definition

    See the "Registering a Transaction" section in the Transaction Module Design Document.

  • Dependent service

    • Transaction management module

2.2.8 Query chain information

  • Function Description:

    Query registration chain information

  • Process description

​ NA

  • Interface definition

    • Interface Description

    ​ Query registration friend information

    ​ method : cm_chain

    • Request example
    {
    +   "chainId":4545 
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "chainName": "nuls chain",
      +        "addressType": 1,
      +        "magicNumber":454546,
      +        "supportInflowAsset":"1",
      +        "minAvailableNodeNum":5,
      +        "singleNodeMinConnectionNum":5,
      +        "txConfirmedBlockNum":30,
      +        "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "regTxHash":"FFFFF", 
      +        "selfAssetKeyList":["1232_32","528_8"],
      +        "totalAssetKeyList":["1232_32","528_8"],
      +        "createTime":1212131
      +}
      +
    • Return field description

    parameter type description
    chainId int Chain identification
    chainName string Chain name
    addressType int The address type of the account created on the chain: 1 within the ecological 2 non-ecological
    magicNumber string Network magic parameter
    minAvailableNodeNum int Minimum number of available nodes
    singleNodeConMinNodeNum int Minimum number of single node connections
    txConfirmBlockNum int Transaction confirmation block number
    regTxHash string Transaction hash
    regAddress string Create the primary network address of the chain
    selfAssetKeyList list List of assets registered under the chain, asset key value combined by chainId_assetId
    totalAssetKeyList list List of assets circulating under the chain, asset key value combined by chainId_assetId
    createTime long Creation time
  • Dependent service

    NA

2.2.9 Query chain asset information

  • Function Description:

    Query a chain asset information

  • Process description

​ NA

  • Interface definition

    • Interface Description

    ​ Query the asset management module for an asset information.

    ​ method : cm_asset

    • Request example
    {
    +   "chainId":4545, 
    +   "assetId":45
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "assetId":85,
      +        "symbol":"NULS",
      +        "assetName":"NULS ASSET",
      +        "initNumber":"1000000000",
      +        "decimalPlaces":8,
      +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "txHash":"xxxxxxxxxxxxx",
      +        "createTime":125848
      +        }
      +
    • Return field description

    parameter type description
    chainId int Chain identification
    symbol string Asset symbol
    assetName string Asset Name
    initNumber string Initial value of assets
    decimalPlaces int Minimum asset separable digits
    address string Create the primary network address of the chain
    txHash string Transaction hash
    createTime long Creation time
  • Dependent service

    NA

3、Event description

  • Chain registration event
  • Chain logout event
  • New asset event
  • Logout asset event

4、protocol

4.1 Network communication protocol

4.1.1 Asking the friend chain for the total amount of assets issued

  • Message description: Periodic chain management initiates the issue of total asset data request message to the friend chain
  • cmd:requestAssetAmount
Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
4 randomCode uint32 random number

4.1.1 Receive the total amount of assets returned by the friend chain

  • Message Description: Received a reply from the friend chain to the asset.
  • cmd:responseAssetAmount
Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
48 biginteger Total assets amount
4 randomCode uint32 random number

4.2 Transaction agreement

4.2.1 Sign up for a new friend chain

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10101

txData definition

Length Fields Type Remark
2 chainId uint16 Chain ID
name byte[] Chain Name
1 addressType uint8 address type
4 magicNumber uint32 Magic parameter
1 supportInflowAsset uint8 Whether to spend asset inflows
2 minAvailableNodeNum uint16 Minimum number of available nodes
2 singleNodeMinConnectionNum uint16 Single node minimum connection number
address byte[] Account address
2 assetId uint16 Asset id
symbol byte[] symbol
assetName byte[] Asset name
2 depositNuls uint16 Mortgage NULS quantity
48 initNumber Biginteger Initial quantity of assets
1 decimalPlaces uint8 Minimum number of assets
4.2.2 Log out of existing friends

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10102

txData definition:Same as 4.2.1 chain registration transaction

4.2.3 New friend chain assets

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10103

txData definition:

Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
symbol byte[] symbol
assetName byte[] Asset name
2 depositNuls uint16 Mortgage NULS quantity
48 initNumber Biginteger Initial quantity of assets
1 decimalPlaces uint8 Minimum number of assets
address byte[] Account address
4.2.2 Log out of existing assets

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10104

txData definition:New transactions with 4.2.3 assets

5、Module configuration

[system]
+language = en
+encoding = UTF-8
+
+[db]
+rocksdb.datapath = ../data
+
+[param]
+asset_symbol_max = 5
+asset_name_max = 20
+asset_depositNuls = 200000
+asset_depositNuls_destroy_rate = 0.2
+asset_depositNuls_lock_rate = 0.8
+asset_initNumber_min = 10000
+asset_initNumber_max = 100000000
+asset_decimalPlaces_min = 4
+asset_decimalPlaces_max = 8
+asset_recovery_rate = 0.9
+
+[defaultAsset]
+nuls_chain_id = 8964
+nuls_chain_name = nuls chain
+nuls_asset_id = 1
+nuls_asset_initNumber_max = 100000000
+nuls_asset_symbol = NULS
+

6、Java-specific design

NA

7、to add on

NA

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/consensusModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/consensusModuleDesign.html new file mode 100644 index 00000000..c9505b5e --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/consensusModuleDesign.html @@ -0,0 +1,1134 @@ + + + + + + Consensus module design document | NULS + + + + + + + +

Consensus module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why do you have a consensus module

​ As we all know, the core of the blockchain is the consensus mechanism. Unlike the traditional Internet's clipet-server architecture, the agents of the blockchain are peer-to-peer, without the center, and everyone has the same rights; so in order to make the data consistent, let a network without a center maintain a set of books that everyone agrees with. This is the role of the consensus mechanism.

​ Broadly speaking, the consensus mechanism is the rule or algorithm that each agent of the blockchain adheres to, and is the basis for mutual trust. In this way, it can achieve decentralized unsupervised and maintain the normal operation of the entire platform.

​ In a narrow sense, the consensus mechanism determines the mechanism by which each agent verifies and validates transactions on the blockchain.

1.1.2 What does the consensus module do

​ Each transaction in the blockchain must be approved by each agent, and the transaction is completed only after the entire network has reached a consensus. It is like in a democratic election, the voting method or rules must be recognized by the whole people, based on which the election can be completed. In the blockchain, the main performance of the consensus mechanism is the incentive system, which is the reward for the miners. Under the guarantee of the consensus mechanism, every miner can be rewarded, and the entire blockchain can operate in an orderly manner, providing a fair, transparent and trusting environment. Therefore, the consensus module needs to provide a specific algorithm to maintain, that is, the consensus algorithm.

​ There are many public chain consensus mechanisms, and the mainstream is POW, POS, and DPOS. The NULS main network adopts the self-originated POC (Proof Of Credit) consensus mechanism, which inherits the security and high efficiency of the Dpos consensus mechanism. At the same time, it has made great improvements in collaboration, which can be regarded as an upgraded version. Dpos.

​ POC Consensus module responsibility:

  • Legality verification after block synchronization

  • Create consensus agents, delegate participation consensus, cancel delegation, and cancel consensus agents ★

  • Consensus agent packs out blocks

  • Disbursement of network maintenance incentives

  • Bad agent punishment ★

    PS:Different consensus mechanisms have different consensus algorithms. The above marked ★ is unique to POC consensus.

1.1.3 《Consensus module》Positioning in the system

​ The consensus module is a relatively core piece in the system. It is mainly responsible for packing transactions, verifying block headers, managing consensus agent information in the management system, entrusting information, and penalizing information.

1.2 Architecture diagram

Description:

  • Services: +
    • tx service : Additions, deletions and changes to transactions
    • consensus service : Consensus activities and state management, functional design
  • Validator +
    • tx Validator: Validator for consensus-related transactions for verifying consensus-related transactions
  • Processor +
    • Tx Processor:Consensus module related transaction processor for submitting rollback detection transactions
  • Task/Thread: +
    • consensus Task: Consensus packaging
    • Reward Task : Data statistics
  • Storage:Store consensus module related transaction data

2.0 Functional architecture diagram

2.1Consensus module functional requirements analysis

2.1.1 Support multi-chain parallelism

​ The NULS 2.0 design concept is to provide modular services, and each module should support multiple chains of data running at the same time, so the consensus module needs to implement algorithms with different consensus mechanisms. When the consensus module is started, it can simultaneously support multiple chains to run at the same time.

2.1.2 POC consensus mechanism

​ The main network of NULS adopts the independent POC consensus mechanism. To realize POC, you first need to know the design concept and business rules of POC. The following content is taken from the introduction part of the NULS white paper POC consensus. If you are familiar, you can skip it directly.

Consensus mechanism——POC
+	The NULS main chain defaults to the credit consensus mechanism POC (Proof-Of-Credit). In the case where the agent credit is up to standard, a certain margin can be locked to join the consensus. After the consensus agent is reordered, each round will flow out of the block, and the margin will be unlocked when the consensus is exited.
+	
+1、Consensus entry and exit mechanism
+	Anyone can join the NULS consensus at any time, as long as they meet the conditions and follow the rules, that is, they can continue to receive NULS token rewards. The addition of POC is divided into hard indicators and soft indicators. The hard indicator means that the credit score must reach a certain standard line, and exclude some agents that have been evil. The soft index refers to the need to freeze a certain amount of NULS tokens as a margin, in order to prevent the proliferation of agents and make the whole system more fair. The number of margins can be freely selected by anyone except the minimum value. The amount of the deposit will be tied to the final reward.
+	
+1.1 Yellow card penalty
+	Due to the hardware configuration of the agent or the network, the disconnection, crash, etc. during the consensus period cannot be blocked. It is not a violation, but it will affect the whole system. Therefore, the system has a mild warning mechanism for such cases. : lower the agent credit value.
+	
+1.2 Red card penalty
+	For some double-split, repeated block-outs, attempts to fork the system, and malicious human-induced damage that does not comply with system rules, the NULS system is firmly resisted, and all agents can detect this kind of situation; once a malicious agent tries to challenge the system, Then the corresponding margin will be locked for 2 months, and the credit rating will never reach the consensus threshold.
+	
+2、Credit Rating
+	In the NULS system, credit is the credit factor of the account in the system, and the credit of all accounts is automatically calculated by the credit rating algorithm formula in the interval [-1, 1].
+	
+	Credit evaluation formula: credit base = capacity coefficient + responsibility coefficient
+	Capacity factor: calculated based on the number of historical blocks
+	Responsibility factor: Calculated according to violations and correctness of the block
+	
+3、Consensus reward
+	For the balance and fairness of the entire NULS system, the consensus reward is calculated based on the margin and consensus agent credits submitted by all consensus agents. Consensus reward calculation formula: see (Figure p1)
+	
+4、Subchain consensus mechanism
+	There are two types of sub-chains that access NULS. The first one is accessed through the standard interface protocol of the NULS system, and the second is deployed through the NULS program.
+	
+	NULS is a common blockchain underlying infrastructure that does not run any application services on its main chain, and all application services are run by sub-chains. Through the NULS system, NULS-based sub-chains can be quickly deployed, and various operational parameters of the sub-chain can be flexibly customized, including whether to support basic tokens, encryption algorithms, consensus mechanisms, and storage mechanisms.
+	
+	NULS defines a standard consensus module to provide interfaces that are compatible with different consensus mechanisms. The NULS community will develop consensus mechanisms such as POW, DPOS, POS, PBFT, and POOL verification pools for users to choose freely.
+
+

Figure p1: Consensus reward calculation formula:

In the POC system, there are four roles: agent, principal, packager, and rewarder
  • Agent - the consensus agent creator. The NULS holder initiates a transaction to create a consensus agent, which is recorded in the chain and tells everyone that I want to be a consensus agent. The basic condition for agent creation is that 20,000-200,000 NULS need to be locked, and there is no red card penalty record. The purpose of setting up this basic condition is to prove that you are really trying to maintain the basic network of NULS.
  • Packager- When creating a consensus agent, the agent can specify a packager. This packager can be his own other account, or a friend who knows technology. The most important thing is that the packager can not hold any NULS. Even if the server participating in the consensus is hacked, the user will not have a huge loss, and the loss will only be affected by the earnings after the attack. It should be noted that the packager is a real out-of-the-box account. Each time you package a block, you need to sign the block. Therefore, you must not set a password for the packaged account.
  • Rewarding people- When creating a consensus agent, an agent can not only specify a packager, but also designate a beneficiary to specify who can get the reward generated by the consensus.
  • The principal-NULS holder can entrust the NULS he holds to the agent according to the agent's credit value and the influence of the agent, etc., and enjoy the corresponding consensus. Revenue, if the agent agent quality or integrity is found to decrease, the principal may withdraw its entrustment and change to others at any time.
In the POC system, there are four business logics: creating a proxy (creating a consensus agent), stopping a proxy agent (exiting consensus), delegating a consensus, and canceling a delegation.
  • Create proxy (create consensus agent): Lock 20,000-200,000 NULS and initiate a registration proxy transaction. After packaging, the whole network can be seen. Others can lock the NULS delegation to the proxy agent.
  • Stop the agent agent (exit consensus): The agent can stop its agent qualification at any time, initiate a transaction to delete the agent agent, and after the transaction is packaged and confirmed, it will quickly withdraw from the consensus and no longer participate in the production of the new block. The 20,000 NULS locked during the registration of the agent will be unlocked after 72 hours, and the rest of the NULS delegated to the agent will be unlocked immediately.
  • Delegate consensus: Users with NULS of 2000 or above can choose a proxy agent to commission and obtain the corresponding block revenue. Before exiting, the corresponding delegated NULS will be locked out of use. A proxy agent can accept up to 500,000 NULS delegates.
  • Cancellation of the delegation: The user can cancel the previous entrustment. After the revocation, the locked NULS will immediately explain and no longer enjoy the corresponding consensus revenue.
Two punishment mechanisms for POC systems
  • Yellow card penalty: When the block agent is disconnected from the network, card machine and other uncertain reasons, the block will not be out of the block, or the block is not used, then the yellow card will be punished in the next round. The yellow card penalty will affect the agent's income; when 100 consecutive yellow card penalties are awarded, a red card will be imposed.
  • Red card penalty: When the block agent makes malicious fork, double flower and other behaviors that seriously endanger the stability of the network, or when it receives 100 yellow card penalties continuously, the system will give a red card penalty. The agent that receives the red card penalty will be forced to stop the consensus. The deposit when the agent is created is frozen for 3 months, and the agent can never be created again; the corresponding agent of the agent that received the red card penalty is immediately unlocked.
Hidden functional requirements of POC internal systems
  • Maintain a consensus agent information table and update based on the above four transactions received in real time.
  • Maintain a round of information table, so that each round of agents who meet the conditions of the outbound block are randomly queued out.
  • The proxy agent that meets the condition of the outbound condition verifies and packages the transaction of the memory pool, assembles it into a new block and broadcasts it to the whole network.

The above is a functional analysis of the implementation of the consensus module POC consensus mechanism. The details of each function implementation are described in the next section.

2.2 Module service

​ The consensus module is the core module of the blockchain. Due to the different consensus mechanisms, the services provided by the outside are not the same. The module service will describe in detail the services shared by the consensus module and the services specific to the POC mechanism.

2.2.1 Create agent

  • Function Description:

    	Create an address that specifies the packaged block (the fast address when the consensus agent satisfies the packageable condition), the commission ratio (the commission ratio of other accounts participating in the agent consensus), and the consensus reward settlement address (the reward for the consensus agent) The consensus agent of the home address, waiting for other agents to delegate consensus, when the commissioned consensus amount reaches the standard amount, the agent can package the block to earn the reward.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	By creating a agent interface, the NULS user can initiate the creation of a agent transaction, and after the transaction is confirmed and packaged, the consensus agent can be successfully created.
      +
    • Request example

      {
      +    "method":"cs_createAgent",
      +    "version:"1.0",
      +    "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 agentAddress true String Request to create a agent account address
      1 packingAddress true String Packing block address
      2 rewardAddress false String Reward settlement address (default is the same as the agent address)
      3 commissionRate true double Commission rate
      4 deposit true long Create a agent's margin
      5 password false String password
      6 chainId true String chain ID
    • Return example

      success

      {
      + 	"version": 1.0,
      +    "code":0,
      +    "msg" :"Success message",
      +    "result":{
      +        "value":"tx.getHash().getDigestHex()" //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +	"version": 1.0,
      +   	 "code":1,
      +   	 "msg" :"Error message",
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the generated transaction hash value

2.2.2 Create agent transaction verification

  • Function Description:

    Create a validator for agent transactions
    +
  • Process description

    - Verify that the transaction contains agent information
    +- Verify that the trade creator is correct
    +- agent address and package address cannot be verified
    +- agent reward address and package address cannot be verified
    +- Commission proportional validity verification
    +- Create a agent's margin validity verification
    +- Signature correctness verification
    +- CoinData verification (lock time verification)
    +
  • Interface definition

    • Interface Description

      	This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.
      +
    • Request example

      {
      +    "method":"cs_createAgentValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                           //Prompt message                          
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                                //error code
      +   	 "msg" :"错误Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      无
      +

2.2.3 Create a agent transaction submission

  • Function Description:

    Save the created consensus node information
    +
  • Process description

    - Save node information to the database
    +
  • Interface definition

    • Interface Description

      Save consensus node information to the database
      +
    • Request example

      {
      +    "method":"cs_createAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.4 Create agent transaction rollback

  • Function Description:

    Delete consensus agent information
    +
  • Process description

    - Delete consensus agent information
    +
  • Interface definition

    • Interface Description

      Remove consensus agent information from the data
      +
    • Request example

      {
      +    "method":"cs_createAgentRollBack",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set 
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.5 Logout consensus agent

  • Function Description:

    	Log out a consensus agent created by yourself, and the consensus amount and consensus bonus of the agents participating in the consensus after unregistering the agent will be thawed after a certain time.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	By deregistering the agent interface, the NULS user can initiate a transaction to cancel the agent created by himself. After the transaction is confirmed to be packaged, the consensus agent can be successfully logged out.
      +
    • Request example

      {
      +    "method":"cs_stopAgent",
      +    "version:"1.0",
      +    "params":["address","password",chainId]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Create the address of the logout agent trading account
      1 password false String password
      2 chainId true String chian ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message        
      +    "result": {                                 //Returned business data set 
      +  		"value":"tx.getHash().getDigestHex()"   //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the generated transaction hash value

2.2.6 Logout agent transaction verification

  • Function Description:

    Verify the correctness of the logout agent transaction验证注销节点交易的正确性
    +
  • Process description

    - Verify that the deleted consensus agent exists and that the consensus agent has       been logged out
    +- Verify that the trade creator is correct
    +- CoinData verification (output address must exist)
    +- Query all consensus information participating in the consensus agent and the total   consensus amount of the agent
    +- Check whether the total amount of UTXO spent in the logout agent transaction is     equal to the consensus agent entrusted amount in the database query. If not,         verify the fail.
    +- Verify that each UTXO unlocked in the logout agent transaction is correct
    +
  • Interface definition

    • Interface Description

      Verify that the logout agent transaction is correct.
      +
    • Request example

      {
      +    "method":"cs_stopAgentValid",
      +    "version:"1.0",
      +    "params":["tx",chainId]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Logout serialized data for agent transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.7 Logout agent transaction submission

  • Function Description:

    Submit logout agent data transaction
    +
  • Process description

    - Set all delegate data under the consensus agent to deleted
    +- Set the consensus agent data to deleted
    +
  • Interface definition

    • Interface Description

      	Log out the consensus agent and set all the delegate data and consensus agents under the consensus agent to the deleted state.
      +
    • Request example

      {
      +    "method":"cs_stopAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.8 Logout agent transaction rollback

  • Function Description:

    Logout agent transaction data rollback
    +
  • Process description

    - Set all delegate data under the consensus agent to not deleted
    +- Set the consensus agent data to not deleted
    +
  • Interface definition

    • Interface Description

      Rollback logout agent transaction data
      +
    • Request example

      {
      +    "method":"cs_stopAgentRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Logout serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chian ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.9 Apply to join the consensus

  • Function Description:

    	Entrust the specified amount to the consensus agent to participate in the consensus to earn consensus rewards. The entrusted amount and consensus reward will be frozen during the consensus period.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	Through this interface, users can entrust the specified agent address to join the consensus and earn bonuses.
      +
    • Request example

      {
      +    "method":"cs_depositToAgent",
      +    "version:"1.0",
      +    "params":["address","agentHash",20000,"password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Apply for a consensus account address
      1 agentHash true String Consensus agent id
      2 deposit true long Amount of participation in the consensus
      3 password false String Apply for a password for participating in the consensus account
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		"value":"tx.getHash().getDigestHex()"     //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the transaction hash value

2.2.10 Commissioned consensus transaction verification

  • Function Description:

    Entrusted consensus transaction correctness verification委托共识交易正确性验证
    +
  • Process description

    - Verify that the consensus agent to apply for is valid
    +- Verify that the consensus agent that applied to join has reached the maximum         number allowed to join the consensus
    +- Verify that the entrusted amount is valid
    +- Verify that the transaction was created by the account that requested the           application.
    +- Verify that the commission amount is equal to the output UTXO amount, and that     the output UTXO lock time is correct.
    +
  • Interface definition

    • Interface Description

      	Verify the validity of the entrusted agent in the entrusted transaction, verify the correctness of the entrusted amount, verify whether the entrusted transaction creator is correct, and whether the UTXO output by the entrusted transaction is correct. Verify that the logout agent transaction is correct.
      +
    • Request example

      {
      +    "method":"cs_depositValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for commissioned consensus transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.11 Entrusted consensus transaction submission

  • Function Description:

    Entrusted transaction submission
    +
  • Process description

    - Save commissioned transaction information
    +
  • Interface definition

    • Interface Description

      Save commissioned transaction data
      +
    • Request example

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for transactions
      1 height true long The height of the block where the commissioned transaction is packaged
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.12 Delegate consensus transaction rollback

  • Function Description:

    Delegate consensus transaction rollback, delete delegate consensus transaction data
    +
  • Process description

    - Delete delegate consensus transaction information
    +
  • Interface definition

    • Interface Description

      	When the commissioned consensus transaction commits an error, this interface needs to be dropped to delete the delegate consensus transaction data.
      +
    • Request example

      {
      +    "method":"cs_depositRollback",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for commissioned consensus transactions
      1 height true long The height of the consigned consensus transaction is packaged
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.13 Revoke commission

  • Function Description:

    	Apply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	Apply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.
      +
    • Request example

      {
      +    "method":"cs_withdraw",
      +    "version:"1.0",
      +    "params":["address","txHash","password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Apply to withdraw from the consensus account address
      1 txHash true String Transaction hash when joining consensus
      2 password false String password
      3 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		"value":"tx.getHash().getDigestHex()"   //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the transaction hash value

2.2.14 Exit consensus transaction verification

  • Function Description:

    Verify that the exit consensus transaction is correct
    +
  • Process description

    - Verify that the consensus to exit has been delegated before and has not exited
    +- Verify that the account that created the transaction is correct
    +
  • Interface definition

    • Interface Description

      	Before exiting, verify that the account has participated in the delegate and is still in the delegate. Also verify that the transaction creator is the principal.
      +
    • Request example

      {
      +    "method":"cs_withdrawValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Exit serialized data for a trusted transaction
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message  
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.15 Exit consensus transaction submission

  • Function Description:

    	Exit the consensus transaction submission, save the data related to the exit consensus transaction
    +
  • Process description

    - Save exit consensus transaction related data
    +
  • Interface definition

    • Interface Description

      	Save the transaction-related data by calling the interface after exiting the consensus transaction verification success
      +
    • Request example

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0", 
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.16 Exit consensus transaction rollback

  • Function Description:

    Exit consensus transaction data rollback
    +
  • Process description

    - Rollback exit consensus transaction data
    +
  • Interface definition

    • Interface Description

      	When exiting the consensus transaction submission error, you need to call this interface to roll back the data to ensure the correctness of the data.
      +
    • Request example

      {
      +    "method":"cs_withdrawRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Exit serialized data for a trusted transaction
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.17 Query consensus agent list

  • Function Description:

    	Obtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of consensus agents on the local primary chain
    +- Filter the list of consensus agents to get a list of consensus agents that meet the   criteria
    +- Consensus agent list sorting
    +- Pagination
    +- Return to the list of consensus agents
    +
  • Interface definition

    • Interface Description

      	Obtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query
      +
    • Request example

      {
      +    "method":"cs_getAgentList",
      +    "version:"1.0",
      +    "params":[1,10,"address","keyword","sortType","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 pageNumber true int page number
      1 pageSize true int Amount of data per page
      2 keyword false String Keyword (agent address, packed address, agent alias, agent ID)
      3 sortType false String The sort type (deposit creates the lock amount of the consensus agent, the commissionRate commission ratio, the creditVal reward amount, the total amount of the total deposit consensus, the comprehensive sort of comprehensive)
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "agentHash":"",                  //agent hash
      +                "agentAddress";"",            //Create the address of the agent
      +                "packingAddress";"",            //Packed address
      +                "rewardAddress";"",             //Reward address
      +                "deposit";,                     //Margin
      +                "commissionRate";,              //Commission rate
      +                "agentName";"",                 //agent name
      +                "agentId";"",                   //agent ID
      +                "introduction";"",              //Introduction
      +                "time";,                        //Creation time
      +                "blockHeight";,                 //Block height
      +                "delHeight":,                   //Block height at which the consensus agent is deleted
      +                "status":,                      //status                    
      +                "creditVal":,                   //Reputation value
      +                "totalDeposit":,                //Total amount of participation in the consensus
      +                "txHash":"",                    //Transaction hash
      +                "memberCount":,                 //Number of people joining the agent consensus
      +                "version":                       //version
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int Total data volume
      pages int total pages
      data List Consensus agent list

      Agent:

      parameter type description
      agentHash String agnet hash
      agentAddress String Create the address of the agent
      packingAddress String Packed address
      rewardAddress String Reward address
      deposit long Margin
      commissionRate double Commission rate
      agentName String agent name
      agentId String agent ID
      introduction String Introduction
      time long Creation time
      blockHeight long Create the height of the block where the agent is trading
      delHeight long Write off the height of the block where the transaction is located
      status int status
      creditVal double Reputation value
      totalDeposit long Total commission amount
      txHash String Transaction hash
      memberCount int Number of orders
      version String Protocol version

2.2.18 Query agent details (basic information, credit value, agent status)

  • Function Description:

    	Query detailed information of the specified consensus agent, including the creation time of the consensus agent, margin, commission ratio, agent address, package address, consensus status, credit value, commission amount, consensus number, etc.
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of consensus agents on the local primary chain
    +- Find the corresponding agent information from the list
    +
  • Interface definition

    • Interface Description

      Query the details of the agent through the agent hash
      +
    • Request example

      {
      +    "method":"cs_getAgent",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 agentHash true String Consensus agent id
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +                "agentHash":"",                  
      +                "agentAddress";"",              
      +                "packingAddress";"",          
      +                "rewardAddress";"",             
      +                "deposit";,                     
      +                "commissionRate";,              
      +                "agentName";"",                 
      +                "agentId";"",                   
      +                "introduction";"",              
      +                "time";,                       
      +                "blockHeight";,                 
      +                "delHeight":,                   
      +                "status":,                                      
      +                "creditVal":,                   
      +                "totalDeposit":,               
      +                "txHash":"",                  
      +                "memberCount":,                 
      +                "version":       
      +         }
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      agentHash String agent hash
      agentAddress String Create the address of the agent
      packingAddress String Packed address
      rewardAddress String Reward address
      deposit long Margin
      commissionRate double Commission rate
      agentName String agent name
      agentId String agent ID
      introduction String Introduction
      time long Creation time
      blockHeight long Create the height of the block where the agent is trading
      delHeight long Write off the height of the block where the transaction is located
      status int status
      creditVal double Reputation value
      totalDeposit long Total commission amount
      txHash String tx hash
      memberCount int Number of orders
      version String Protocol version

2.2.19 Query agent penalty list (all, red, yellow)

  • Function Description:

    	Obtain the penalty record (red card and yellow card penalty) obtained by the consensus agent. The user can customize the query for all penalty records or only the red card or yellow card penalty information.
    +
  • Process description

    - Verify parameter correctness
    +- Get the penalty based on the type of query
    +
  • Interface definition

    • Interface Description

      Query the penalty record specifying the block address
      +
    • Request example

      {
      +    "method":"cs_getPunishList",
      +    "version:"1.0",
      +    "params":["address",0,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Block address
      1 type true int Penalty type 1 yellow card, 2 red card, 0 all
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "type",,                        
      +                "address","",                   
      +                "time","",                      
      +                "height",,                     
      +                "roundIndex",,                              
      +                "reasonCode",""                 
      +            },{
      +               ......
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int Total data
      pages int total pages
      data List Penalty list data

      Punish:

      parameter type description
      type byte Type of punishment
      address String address
      time String punishment time
      height long Punish the height of the block
      roundIndex long round
      reasonCode String Reason for punishment

2.2.20 Query the list of delegates (according to the principal, according to the agent)

  • Function Description:

    1. Query the list of all delegation information participating in the specified 	      address
    +2. Query the delegation information of the specified consensus agent participating      in the specified account
    +3. Query the specified consensus agent trust list information
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of participating consensus information on the local primary chain
    +- Filter the consensus list to get the consensus list of the specified account       participation or the consensus list information of the specified agent
    +
  • Interface definition

    • Interface Description

      	Obtain the consensus list information accepted by the specified account or specified by the consensus agent. When querying all the consensus lists of the specified account, the agentHash field is passed "". When all the delegated lists of the specified agent need to be queried, the address field is passed "".
      +
    • Request example

      {
      +    "method":"cs_getDepositList",
      +    "version:"1.0",
      +    "params":[1,10,"address","agentHash","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 pageNumber true int page number
      1 pageSize true int Amount of data per page
      2 address false String The account address of the participating delegation (the entrusted information of the query agent is the designated pass "")
      3 agentHash false String Specify the proxy agent ID (this field is passed "" when querying all account delegation information)
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "agentHash":"",                  
      +                "address";"",                   
      +                "deposit";,                     
      +                "time";,                        
      +                "blockHeight";,                 
      +                "delHeight":,                         
      +                "txHash":"",                    
      +                "status":,                       
      +                "agentName":"",                  
      +                "agentAddress":""  
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int otal data
      pages int page number
      data List Json string of consensus data list

      Deposit:

      parameter type description
      agentHash String agent hash
      address String Apply to join the consensus account address
      deposit long Commission amount
      time long Commission time
      blockHeight long The height of the block where the transaction is located
      delHeight long Exit the height of the commissioned exchange
      txHash String tx hash
      status int Consensus agent status (to be agreed, consensus)
      agentName String agent name
      agentAddress String agent address

2.2.21 Query the consensus status of the entire network

  • Function Description:

    	Query the overall information of the network consensus, including the number of agents, total mortgage, total number of participating consensus accounts, etc.
    +
  • Process description

    - Get a list of network-wide consensus agents
    +- Filter the list of consensus agents and wait until the list of valid consensus       agents
    +- Get current package round information
    +- According to the current package round information, the total amount of accounts   and the total amount of entrusted funds that the current network participates in   the consensus
    +
  • Interface definition

    • Interface Description

      	Query the number of agents in the whole network, the total commission amount, the accounts participating in the consensus, and the number of consensus agents that meet the packaging conditions.
      +
    • Request example

      {
      +    "method":"cs_getWholeInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "agentCount":,                     
      +            "totalDeposit":,                    
      +            "rewardOfDay":,                   
      +            "consensusAccountNumber":,          
      +            "packingAgentCount":     
      +    	}
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      agentCount int Number of agents
      totalDeposit long Total amount of entrusted amount
      rewardOfDay long Reward amount within 24 hours
      consensusAccountNumber int Number of accounts participating in the consensus
      packingAgentCount int Current rounded number of consensus agents

2.2.22 Query individual account consensus status

  • Function Description:

    Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.
    +
  • Process description

     - Get a list of network-wide consensus nodes
    +

- Check if there is a consensus node created by the account in the consensus node list +   - Get the current network delegate list +   - Get the list of delegates participating in the account from the delegate list +   - Obtain commission information for the account from the delegate list of the account


+- Interface definition
+
+- Interface Description
+
+
Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.
+```
+
  • Request example

    {
    +    "method":"cs_getInfo",
    +    "version:"1.0",
    +    "params":["address","chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 address true String Account address
    1 chainId true String chain ID
  • Return example

    success

    {
    +    "code": 0,                                  //error code
    +    "msg": "success",                           //Prompt message
    +    "version":"1.0",                            
    +    "result": {                                 //Returned business data set  
    +    	"data":{
    +            "agentCount":,                      
    +            "totalDeposit":,                    
    +            "joinAgentCount":,                 
    +            "usableBalance":,                   
    +            "reward":,                          
    +            "rewardOfDay":,                     
    +            "agentHash":""                    
    +    	}
    +    }
    +}
    +

    fail

    {
    +     "version": 1.0,
    +   	 "code":1,                         //error code
    +   	 "msg" :"错误Prompt message",             //Prompt message
    +     "result":{
    +        
    +  	  }
    +}
    +
  • Return parameter description

    parameter type description
    data Object Consensus information
    agentCount int The number of agents created by this account
    totalDeposit long The total commission amount of the account
    joinAgentCount int The number of consensus agents participating in the account
    usableBalance long Available Balance
    reward long All rewards for account participation consensus
    rewardOfDay long Consensus rewards obtained within 24 hours of the account
    agentHash String The hash of the agent created by the account

2.2.23 Verify block correctness

  • Function Description:

    Verify the block round information, package the person, the transaction information in the block, whether the CoinBase is correct, and verify whether there is red and yellow card transaction generation.
    +
  • Process description

     - Verify fork (call block management module interface), generate red card trade with fork
    +

- Verify double flower (call transaction module interface), generate double card transaction with double flower and return to verify fail directly +   - Generate red card trades and place red card trades in the trading pool to be packaged +   - Verify block rotation information and packager correct +   - Verify transaction correctness in the block (call transaction module interface) +   - Verify CoinBase transactions


+- Interface definition
+
+- Interface Description
+
+
This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.
+```
+
  • Request example

    {
    +    "method":"cs_validSmallBlock",
    +    "version:"1.0",
    +    "params":["SmallBlock","chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 smallBlock true String SmallBlock serialization data
    1 chainId true String chain ID
  • Return example

    success

    {
    +    "version":"1.0",  
    +    "code": 0,                                  //error code
    +    "msg": "Prompt message",                    //Prompt message                          
    +    "result": {                                 //Returned business data set  
    +  		
    +    }
    +}
    +
    +

    fail

    {
    +     "version": 1.0,
    +   	 "code":1,                            //error code
    +   	 "msg" :"Prompt message",             //Prompt message
    +     "result":{
    +        
    +  	  }
    +}
    +
  • Return parameter description

    nothing
    +

2.2.24 Consensus module batch verification

  • Function Description:

    Consensus module transaction batch verification, verify the correctness of each transaction, verify transaction conflict
    +
  • Process description

     - Cycle to verify that each transaction is correct
    +

- Verify that there is a conflicting transaction in the transaction list


+- Interface definition
+
+- Interface Description
+
+
Loop to verify that each transaction in the incoming transaction list is correct and verify that there is a conflicting transaction in the transaction list
+```
+
  • Request example

    {
    +    "method":"cs_batchValid",
    +    "version:"1.0",
    +    "params":[["tx1","tx2","tx3"],"chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 tx1,tx2,tx3...... true String Serialized data for transactions
    1 chainId true String chain id
  • Return example

    {
    +    "version":"1.0",  
    +    "code": 0,                                  //error code
    +    "msg": "Prompt message",                    //Prompt message                          
    +    "result": {                                 //Returned business data set  
    +  		"data":[							 
    +  				"tx1_hash",
    +  				"tx2_hash",
    +  				"tx3_hash"
    +  			  ]
    +    }
    +}
    +
  • Return parameter description

    parameter type description
    data String Verify the list of transactions that failed
    tx1_hash,tx2_hash,tx3_hash..... String Verify the hash of the transaction that failed

2.2.25 Get current round information

  • Function Description:

    Query the package round information of the current network consensus node, including the consensus node of the current network in the packed state, the start end time of the current round of packaging, and the basic information of all the packed nodes in the current round.
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Query the current network consensus node packaging round information
      +
    • Request example

      {
      +    "method":"cs_getRoundInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "totalWeight":,                      
      +            "index":,                    
      +            "startTime":,                     
      +            "endTime":,          
      +            "memberCount":,
      +            "memberList":[
      +                {
      +                    "agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"Weight":
      +                },{
      +                    
      +                }
      +            ],
      +            "myMember":{
      +                	"agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"weight":
      +            }
      +    	}
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                         //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      data

      parameter type description
      totalWeight double Total weight (used to calculate consensus rewards)
      index long Current round subscript
      startTime long Current round start packing time
      endTime long Current end of packaging time
      memberCount int Current number of packaged packages
      memberList List Current round packed agent packing information
      myMember MeetingMember Current agent packing information

      MeetingMember

      parameter type description
      agentAddress String agent address
      packingAddress String Packed address
      agentHash String agent ID
      packingIndexOfRound int The consensus agent packs the subscript in the current round
      creditVal double Credit value
      packStartTime long Consensus agent packaging start time
      packEndTime long Consensus agent packaging end time
      weight double Current consensus agent weight (total commission amount * credit value)

2.2.26 Specify consensus agent status query

  • Function Description:

    Query the current status of the specified consensus agent (consensus, packaged)
    +
  • Process description

    - Query whether the agent exists
    +- Query agent status
    +
  • Interface definition

    • Interface Description

      Query the current status of the specified consensus agent
      +
    • Request example

      {
      +    "method":"cs_getAgentStatus",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 agentHash true String agnet ID
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "status":1                            
      +    	}
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      parameter type description
      status int agent status (0 consensus, 1 package)

2.2.27 Modify agent packing status

  • Function Description:

    	When the local agent starts, notify the consensus module to package after the block management module synchronizes the block.
    +
  • Process description

    - Modify agent packing status
    +
  • Interface definition

    • Interface Description

      Modify agent packing status
      +
    • Request example

      {
      +    "method":"cs_updatePackStatus",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      nothing
      +

2.2.28 Stop chain

  • Function Description:

    Pause a running chain
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Pause a running chain
      +
    • Request example

      {
      +    "method":"cs_stopChain",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      nothing
      +

2.2.29 Run a new chain

  • Function Description:

    Run a new subchain locally 
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Run a new subchain locally
      +
    • Request example

      {
      +    "method":"cs_runChain",
      +    "version:"1.0",
      +    "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]
      +}
      +
      +
    • Request parameter description(待完善)

      index parameter required type description
      0 chainId true String chain ID
      1 packing_interval true long Packing interval (unit: s)
      2 packing_amount true long Minimum amount of the block
      3 coinbase_lockHeight true long Bonus lock block number
      4 redPublish_lockTime true long Get red card margin lock time (unit: s)
      5 stopAgent_lockTime true long Logout agent margin lock time (unit: s)
      6 commissionRate_min true double Commission ratio minimum
      7 commissionRate_max true double Commission ratio maximum
      8 deposit_min true int Create a agent margin minimum amount
      9 deposit_max true int Create a agent margin maximum amount
      10 commission_min true int Commissioned consensus minimum amount
      11 Commission_max true int Maximum amount of commissioned consensus
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
      +
    • Return parameter description

2.3 Module internal function

​ The POC consensus mechanism is to take the agent round out of the block that participates in the consensus, reach a consensus, and jointly maintain a set of books. However, due to network reasons or some consensus agents do evil (send different packing blocks to different agents), there will be bifurcation. For this malicious agent system, different penalties will be given according to the severity, when it is a turn When the agent fails to issue the block at the specified time, the system will give the agent a yellow card penalty. The penalty will lower the credit value of the agent. When the agent credit value drops to -1, the agent will be punished with a red card; The agent will be directly punished with a red card. The agent that receives the red card penalty will stop packing and the agent will never be able to create a consensus agent again, and the margin will be frozen for a certain period of time. The other commissioned amount of the agent will be returned to the client; When a normal block is issued, the agent will receive a block reward, and the account entrusted to the agent will also receive a corresponding proportion of the bonus according to the amount of the commission.

​ In addition to providing packaged blocks, the consensus module will also do the statistical work of bonuses, statistics on the total amount of rewards issued within 24 hours, the amount of rewards accumulated in local accounts within 24 hours, and the details of rewards within 24 hours.

  • Consensus module startup process

    initialization:

    • Load consensus module configuration information (out of block interval, bonus lock block number)
    • Register Consensus Module Transaction, Transaction Verifier, Transaction Processor (registered with Transaction Module)
    • Register Consensus Module Service Interface (registered with the core module)
    • Register consensus module event (register with event bus module)

    start up:

    • Get the latest round of block information in the database and calculate the round information
    • Get current protocol version information and cache
    • Start each relevant thread
  • Package out process

    • Determine if the agent meets the requirements for becoming a packed agent
    • Calculate packaging round information
    • Waiting for packing out
    • Receive the latest block. If you wait for 5 seconds and have not received the latest block, the default last block agent does not have a block, and the current agent continues to perform the packing operation.
    • Verify the transactions that need to be packaged, and eliminate the new package after the duplicate package transaction
    • Verify the packaged new block and save the relevant data to the database
    • Broadcast block

  • Consensus reward statistics

    • Get a list of local accounts
    • Get a list of blocks within 24 hours
    • Traverse block list to get CoinBase transactions
    • According to the CoinBase transaction, update the total reward amount within 24 hours, the accumulated bonus amount of the local account within 24 hours, and the reward details within 24 hours.

4、Event description

4.1 Published event

4.1.1 Block packaging success event

Description: This event is released when a new zone is successfully packaged successfully.
+
 event_topic : "evt_cs_packing"
+
data:{
+    "chainId":88,
+    "smallBlock":"Serialize a smallBlock object into a hex string"
+}
+

4.1.2 Create agent

Description: Issue the event after the create agent transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_createAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //List of consensus agents created in the packaging block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.3 Logout agent

Description: Issue the event after the logout agent transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_stopAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //List of consensus agents that are logged out in the packaging block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.4 Consensus agent state change (in the consensus, out of the block)

Description: Issue the event when the consensus agent status changes
+
 event_topic : "evt_cs_agentStatusChage"
+
data:{
+    "chainId":88,
+    "agentList":{    //The list of consensus agents for the table in the state of the packed block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.5Commission consensus

Description: Issue the event after the delegate consensus transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_deposit"
+
data:{
+    "chainId":88,
+    "depositList":{     //Delegate list in the packaging block
+        "deposit1",     /Deposit object serialized to a hex string
+        "deposit2"
+    }
+}
+

4.1.6 Exit consensus

Description: Issue the event after the exit consensus transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_withdraw"
+
data:{
+    "chainId":88,
+    "depositList":{     //Exit the delegation list in the packaging block
+        "deposit1",     //The deposit object is serialized as a hex string
+        "deposit2"
+    }
+}
+

4.1.7 Yellow card penalty

Description: When there is a consensus agent to get a yellow card penalty is to issue the event
+
 event_topic : "evt_cs_yellowPublish"
+
data:{
+    "chainId":88,
+    "yellowPublishList":{    //Yellow card list in the packing block
+        "yellowPublish1",    //YellowPublish object serialized to a hex string
+        "yellowPublish2"
+    }
+}
+

4.1.8 Red card penalty

Description: Obtain the event when there is a consensus agent to get a red card transaction
+
 event_topic : "evt_cs_redPublish"
+
data:{
+    "chainId":88,
+    "redPublishList":{    //Red card list in the package block
+        "redPublish1",    //Serializing a RedPublish object to a hex string
+        "redPublish2"
+    }
+}
+

4.2 Subscribed event

nothing
+

五、protocol

5.1 Network communication protocol

broadBlock

  • Send a new block (SmallBlock)
  • Get blocks based on hash
  • Send a full block
  • Get multiple blocks based on height
  • Get a list of transactions based on the trade hash list
  • Send a list of transactions
  • Get SmallBlock based on hash
  • Get block hash list based on height interval
  • Get the SmallBlock list based on the height interval

New area for broadcast packaging

Length Fields Type Remark
4 chainId int chain ID
?? smallBlock String SmallBlock object serialized hex string

六、Module configuration

{
+    {
+        "name": "packing_interval",
+        "remark": “packaging interval”,
+        "changable": "true",
+        "default": "10秒"
+    },
+    {
+    	"name": "packing_amount",
+        "remark": “minimum amount of the block”,
+        "changable": "true",
+        "default": "200000"
+    },
+    {
+    	"name": "coinbase_unlock_height",
+        "remark": “Number of bonus lock blocks”,
+        "changable": "true",
+        "default": "100"
+    },
+    {
+    	"name": "redPublish_lockTime",
+        "remark": “Get red card margin lock time”,
+        "changable": "true",
+        "default": "3 months"
+    },
+    {
+    	"name": "stopAgent_lockTime",
+        "remark": “Logout agent margin lock time”,
+        "changable": "true",
+        "default": "3 days"
+    },
+    {
+    	"name": "commissionRate_min",
+        "remark": “minimum and minimum commission ratio”,
+        "changable": "true",
+        "default": "10"
+    },
+    {
+    	"name": "commissionRate_max",
+        "remark": “Maximum commission ratio”,
+        "changable": "true",
+        "default": "80"
+    },
+    {
+    	"name": "deposit_min",
+        "remark": “Create the minimum margin for the agent”,
+        "changable": "true",
+        "default": "20000"
+    },
+    {
+    	"name": "deposit_max",
+        "remark": “Create the maximum margin for the agent”,
+        "changable": "true",
+        "default": "700000"
+    },
+    {
+    	"name": "commission_min",
+        "remark": “trust the maximum amount”,
+        "changable": "true",
+        "default": "2000"
+    },
+    {
+    	"name": "commission_max",
+        "remark": “delegate the minimum amount”,
+        "changable": "true",
+        "default": "680000"
+    }
+}
+

七、Java-specific design

八、to add on

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/eventBusModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/eventBusModuleDesign.html new file mode 100644 index 00000000..5ed04863 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/eventBusModuleDesign.html @@ -0,0 +1,119 @@ + + + + + + Event bus module design document | NULS + + + + + + + +

Event bus module design document

[TOC]

1. Overall description

1.1 Module Overview

1.1.1 Why should I have the Event Bus module?

The Event Bus Module is a functional module designed to receive and notify processing module events, managing all module events.

1.1.2 What is the "Event Bus"?

Provide event subscription, receiving, sending and other functions, which is an event transfer station between modules

1.1.3 Positioning of Event Bus in the System

The event module is an edge system that provides some major asynchronous messaging, which means that even without an event bus, the system can operate normally, is lightweight, and does not depend on other module systems.

1.2 Architecture

event-bus-module

  • The event bus module mainly contains 2 parts of interactive logic: +  - Microservice registration and service information acquisition with the system core module. +  - Event message creation, subscription, and forwarding management with other base modules.

2. functional design

2.1 Functional Architecture

event-bus-content

2.2 Module Service

event-bus-model

This module provides event subscriptions, event forwarding

2.2.1 Modifying system operating parameters

Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,

2.3 Module internal function

event-bus-function

Module internal work mainly includes, subscription manager, event manager, and forwarding manager.

  • Microservice interface information synchronization management +  - for synchronizing the service interface with the kernel service management module
  • Event Storage Management (eventBus) +  - Used to create event information, subscribe to other storage, and initialize the information when the module is restarted.
  • Event subscription management (subscribe) +  - Maintain a "configuration table" for subscription events: including important parameters for all individual module subscriptions
  • Event forwarding management (dispatcher) +  - The open interface is used for event reception, the receiving event is forwarded by subscription, and the forwarding call interface is obtained through the service information management interface.
  • Function Interface Management (rpc) +  - Open query interface for external query

2.4 Event Bus Process

  • Event processing timing

event-bus-seq-flow

  • Event processing basic process

event-bus-main-flow

2.5 Business Logic

Exception logic processing in case of event forwarding failure (such as network reason), according to the following two logics:

    1. Retaining event calls Repeat calls by queue until the forwarding is successful.
    1. Discard it directly after trying many times. (Tentatively 5 times) Retry every 10 seconds.

3. Interface Design

3.1 Module Interface

3.1.1 Event Theme Subscription

cmd: subscribe

Parameter Description (Request body)
{
+  "cmd": "subscribe",
+  "min_version": 1.0,
+  "params":[
+    "app.nuls.network.bandwidth",//topic event topic
+    "moduleId" //moduleId subscriber module id
+  ]
+}
+
Return value description (Response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+    "app_secret": "xxxxxxxxxxxx" // app_secret, temporarily not needed, may need to be verified later if it is not required to be called locally
+  }
+}
+

3.1.2 Event Unsubscribe

cmd: unsubscribe

Parameter Description (request body)
{
+  "cmd": "unsubscribe",
+  "min_version": 1.0,
+  "params":[
+    "app.nuls.network.bandwidth", //topic event topic
+    "moduleId" //moduleId subscriber module id
+  ]
+}
+
Return value description: (response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.1.3 Event Sending [Automatically Create Topic]

Do you keep a certain amount of time when no one is subscribed?

cmd: send

Parameter description (request body)
{
+ "cmd": "send",
+ "min_version": 1.0,
+ "params":[
+   "app.nuls.network.bandwidth",//topic event topic
+   "moduleId", //moduleId subscriber module id
+   {"key" : "data value"} // event to be sent, jsonObj
+ ]
+}
+
return value description (response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.1.4 Event broadcast (push push or dispatcher)

I need each interface to provide an interface when subscribing to events. I can call it when I broadcast. I am using multithreading to remove your interface. You need to return the correct code, otherwise there will be a retry mechanism.

Parameter description (request body)
{
+ "cmd": "dispatcher",
+ "min_version": 1.0,
+ "params":[
+   {} //data event to be sent, payload
+ ]
+}
+
return value description (response content)
{
+  "version": 1.2,
+  "code": 0, // ​​must return correctly, do not need to tell you whether the business logic is wrong, as long as you receive it, tell me that you have successfully received it.
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.2 Function Interface

The functional interface is the interface provided to the interface and command line tools

Get event topic information

cmd: topics

Parameter description (request body)
{
+ "cmd": "topics",
+ "min_version": 1.0,
+ "params":[]
+}
+
Response Body (response content)
{
+  "version": 1.2,
+  "code": 0, // ​​must return correctly, do not need to tell you whether the business logic is wrong, as long as you receive it, tell me that you have successfully received it.
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+    "topics":[{
+        "topic": "", //topic id
+        "createTime":"", //Create time
+        "moduleId":"", // theme creator (module) Id
+        "subscribes":[//subscriber information
+            {
+                "moduleId":"", //subscriber
+                "subscribeTime":"" //Subscription time
+            }
+        ]}
+    ]
+  }
+}
+

Get event topic information (including all event information on this topic?) Every event I don't care about.

cmd : get_topic

4. Description of the event

does not depend on any events

5. agreement

5.1 Network Communication Protocol

no

5.2 Trading Agreement

6. Module Configuration

6.1 Configuration Instructions

General support configuration, port, number of retries, retry time, thread pool size of default executor, network call timeout configuration, etc.

Server:
+  Ip: 127.0.0.1 // local ip, used to provide services to other modules, you can not fill, the default is automatically obtained
+  Port: 8080 //The port that provides the service, you can leave it blank, the default is automatically obtained.
+

6.2 Module Dependencies

  • Kernel module +  - Module registration +  - Module logout +  - Module status escalation (heartbeat) +  - Service interface data acquisition and timing update

7. Java-specific design

Core object class definition, storing data structures, ...

8. supplementary content

Required content not covered above

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/generalProtocol.html b/docs/.vuepress/dist/NULS2.0/alpha/generalProtocol.html new file mode 100644 index 00000000..496bfbb5 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/generalProtocol.html @@ -0,0 +1,66 @@ + + + + + + Protocol design | NULS + + + + + + + +

Protocol design

[TOC]

Common standards

Hashes

Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time SHA-256 hashes are used, however RIPEMD-160 is also used when a shorter hash is desirable (for example when creating a NULS address).

Example of double-SHA-256 encoding of string "nuls":

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)
+7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)
+
+

For NULS addresses (RIPEMD-160) this would give:

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)
+f8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)
+

Merkle Trees

Merkle trees are binary trees of hashes. Merkle trees in NULS use a double SHA-256, the SHA-256 hash of the SHA-256 hash of something.

If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.

First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.

Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.

This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the Merkle root of the tree.

For example, imagine a block with three transactions a, b and c. The Merkle tree is:

d1 = dhash(a)
+d2 = dhash(b)
+d3 = dhash(c)
+d4 = dhash(c)            # a, b, c are 3. that's an odd number, so we take the c twice
+
+d5 = dhash(d1 concat d2)
+d6 = dhash(d3 concat d4)
+
+d7 = dhash(d5 concat d6)
+
+

where

dhash(a) = sha256(sha256(a))
+
+

d7 is the Merkle root of the 3 transactions in this block.

Addresses

A NULS address is in fact the hash of a ECDSA public key, computed this way:

ChainId = 2 byte,The ID of the chain in which the account belongs.
+addressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……
+pkh = 20 byte , RIPEMD-160(SHA-256(public key))
+xor = 1 byte, XOR(chainId+addressType+pkh)
+address = Base58Encode(chainId+addressType+pkh+xor)
+

非nuls体系的地址格式如下:

例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定

address = Base58Encode(chainId+原始地址长度+原始地址+xor)
+

Message Structre

Satellite-chain uses custom messaging for communication over the TCP protocol.

  • Digital binary stream using little endian。
  • Floating point numbers convert to integers and transfer by little endian

Message

The message consists of a 24-byte header and payload.

*---------------------------------------------------------------*
+|       Header(24 Byte)         |            Payload            |
+*---------------------------------------------------------------*
+

message header

The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.

Len Fields Data Type Remark
4 MagicNumber uint32 Packet valid flag
12 command char[12] ASCII string identifying the packet content, NULL padded
4 PayloadLength uint32 Length of payload in number of bytes
4 checksum uint32 First 4 bytes of sha256(sha256(payload))

[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.

Common Structre

VarInt

Variable-length integers that can be encoded based on the values expressed to save space.

Value Len Structure
< 0xfd 1 uint8
<= 0xffff 3 0xfd + uint16
<= 0xffffffff 5 0xfe + uint32
> 0xffffffff 9 0xff + uint64

VarString

A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.

Len Fields Data Type Remark
? length VarInt Length of the string
length value uint8[length] The string itself

VarByte

Variable-length buffer, consistent with the VarString implementation.

Len Fields Data Type Remark
? length VarInt Length of payload in number of bytes
length data byte[length] payload

Int48

6-byte number.

Network address

When a network address is needed somewhere, this structure is used.

Len Fields Data type Remark
16 IPv6/4 char[16] IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte
2 port1 uint16 port number, network byte order
2 port2 uint16 port number,for cross-chain module

Block_headers

Len Fields Data Type Remark
4 version uint32 version bumber
32 preHash byte[32]
32 merkleRoot byte[32]
stateRoot VarByte
4 time uint32 second
2 txCount uint16
extends VarByte 本字段内容不同的链可设置不同的约束
? signature Varbyte

Transactions

Len Fields Data Type Remark
2 type uint16 交易类型
4 time uint32 时间,精确到秒
txData VarByte 业务数据
coinData VarByte 资产数据
remark VarString 备注
sig VarByte 只包含签名,不包含pubkey

交易特性

多账户转出
+多账户转入
+多资产转账
+

coinData结构

froms://List<CoinForm>格式,
+tos://List<CoinTo>格式
+

CoinForm结构[40]

address:  //byte[24] 账户地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount:  //uint128,转出数量
+nonce  : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节
+locked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定
+

CoinTo结构[44]

address:  //byte[24],目标地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount :  //uint128,转账金额
+lockTime://uint32,解锁高度或解锁时间,-1为永久锁定
+

手续费

forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)
+

Message Types

参考各个模块

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/howToUseNulsBuildChain.html b/docs/.vuepress/dist/NULS2.0/alpha/howToUseNulsBuildChain.html new file mode 100644 index 00000000..978ba7b2 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/howToUseNulsBuildChain.html @@ -0,0 +1,96 @@ + + + + + + [Alpha]如何使用NULS搭建区块链 | NULS + + + + + + + +

[Alpha]如何使用NULS搭建区块链

NULS2.0 开发环境搭建

NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。

1 环境准备

  • 安装JDK
  • 安装Maven
  • 安装IntelliJ IDEA开发工具
  • 安装git

2 clone源代码

git clone git@github.com:nuls-io/nuls_2.0.git

3 IDEA导入nuls_2.0中所有maven项目

4 建立自己的maven项目

5 运行所有需要启动的模块

使用NULS2.0核心模块搭建基础链

NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。

NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。

1 理解NULS 2.0的微服务架构

img

NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。

因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。

理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。

2 修改基础配置信息

一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。

NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf

modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:

section param name remark
common chain.id 本链id Uint16,NULS主网为1,测试网为2
common address.prefix 地址前缀 大小字母+数字,2-5个字符
common data.root.dir 数据存储路径 为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径
common encoding 编码方式 默认UTF-8,不建议修改
common asset.id 本来主资产编码 NULS为1
common log.root.dir 日志根目录 用于存放各个模块的日志文件
common log.level 日志级别 日志打印级别debug/info/warn/error.
block data.folder data子文件夹 用于存储block模块数据,该文件夹放在#{data.root.dir}下
block block.max.size 区块最大size 区块大小限制,避免太大区块太高参与门槛
block block.interval 出块间隔
block max.rollback 最大回滚数量 当超过这个数量后,系统将停止回滚,避免出现重大问题
block header.extend.max.size 扩展最大size 区块头中的扩展字段的大小限制
block genesis.block.json.path 创世块描述文件 创世块的描述文件
consensus data.folder data子文件夹 用于存储共识模块数据,该文件夹放在#{data.root.dir}下
consensus packing.interval 出块间隔
consensus inflation.token.count 每年增发数量 增发数量用于通过coinbase交易奖励给节点
consensus block.max.size 区块最大size
consensus seed.addresses 共识种子地址 多个地址用","分隔
consensus packing.address.pwd 地址密码 用于打包的地址的密码
consensus agent.deposit.min 创建节点时最小保证金数量
consensus agent.deposit.max 创建节点时最大保证金数量
consensus commission.rate.max 佣金比例最大值,不能大于100
consensus commission.rate.min 佣金比例最小值
consensus deposit.min 单笔委托最小金额
consensus agent.total.deposit.max 节点接受委托的最大金额
consensus packing.token.min 当节点的委托达到该值则开始出块
consensus red.punish.lock.time 红牌锁定时间
consensus agent.stop.lock.time 停止节点锁定时间
network data.folder data子文件夹
network seeds 种子节点,多个之间用","隔开
network magic.number 魔法数字,用于隔离其他网络
network port 端口
network nuls.seed 需要进行跨链时,配置NULS2.0种子节点
network cross.listener.port
network nuls.magic.number
contract nrc20.file.path NRC20协议描述json文件路径
tx data.folder data子文件夹
Ledger data.folder data子文件夹
api mongodb.ip mongodb地址
api mongodb.port mongodb端口
api rpc.listener.ips rpc监听ip 可以配置多个
api rpc.port rpc监听端口
api req.allow.per.s 并发限制

表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。

3 打包和启动

链的配置项修改完成后,则可直接参考本文档的第4部分:打包和启动

搭建包含业务模块的区块链

在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。

1 业务模块说明

1.1 何为业务模块

基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。

业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。

1.2 如何扩展协议

NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:

  • 通过转账交易的remark字段进行扩展

将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。

  • 通过制定的业务扩展交易进行扩展

NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。

示例:

假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。

1 功能设计

1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;
+
+2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;
+
+3. 解密查看:从数据库中获取记录,解密,展示解密结果
+
+4. 删除记事:app本地删除,不删除区块链中数据
+

2 区块链交互

以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。

  • 第一个功能的实现思路如下:
首先设计数据格式,如下
+
+{
+
+  address:"",//记事所属人
+
+  time:"",//记事时间点
+
+  content:""//加密后的记事内容
+
+}
+
+根据数据格式,组装上链数据:address+time+content;
+
+确定应用的魔法数字,假设为12345678.
+
+则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。
+
  • 第二个功能的实现思路如下:
监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,
+如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)
+如果成功解析了数据,则将数据存储到本地数据库中
+

3 其他业务实现

所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。

使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。

2 需求分析

在动手开发模块之前,首先要确定几个问题:

  • 自己需要的是什么样的功能?
  • 是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?
  • 用哪种方式实现这个模块? +
    • 扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。
    • 增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要
    • 修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。

3 模块设计

在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。

那么如何设计自己的业务?举例说明:

3.1 扩展基础协议的方式:

第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。
+比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。
+
+第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。
+一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。
+

3.2 新增协议的方式

如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。
+这里我们就用nuls的poc共识机制来举例
+功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。
+nuls的poc共识机制的业务功能有:
+1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。
+2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。
+3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。
+4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。
+
+协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。
+poc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易
+交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。
+例如创建共识节点:
+	1)创建节点的账户不能重复多次创建共识节点;
+	2)保证金在2-20万nuls之间;
+	3)账户是否有过红牌记录;
+存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。
+例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等
+
+接口设计:需要对外提供的RPC接口
+例如:查询共识节点信息,查询共识委托信息等
+
+其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里
+

3.3 修改基础链的方式

本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。
+修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。
+

4 模块实现

首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。

1、nuls-service-base-lib(baselib):

通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。

2、module-self:

模块本身,在一下几方面需要做出自己的实现:

  • 模块管理

    1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。

    2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。

    3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理

  • 协议相关

    当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。

  • 网络消息

    当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。

  • 数据存储

    NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。

  • 功能实现

    如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。

  • 功能接口

    根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。

  • 日志记录

    NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。

总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。

5 定义自己的协议

  • 设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。

  • 网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。

  • 交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。

6 调试

完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。

1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;
+
+2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;
+
+3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;
+
+4、检查交易验证逻辑是否严谨,不要出现安全漏洞;
+
+5、测试自身模块的业务是否正确、完整。
+

全部测试都完成后,便可进入打包和启动阶段了

打包和启动

1 打包

NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试

cd /home/nuls2/nuls_2.0
+./package.sh -m
+

确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。

2 启动

  • 编译成功 会生成如下路径文件
/home/nuls2/nuls_2.0/RELEASE/bin
+
  • 执行如下命令,即可一键批量启动所有模块
cd /home/nuls2/nuls_2.0/RELEASE/bin
+./start.sh -c ./moudle.json(指定moudle.json配置文件启动)
+
  • linux指令 jps 查看所有模块进程:
 ./start.sh  --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws
+
  • 查看模块启动状态
./checkstatus.sh  
+
  • 停止 工程模块:
kill  进程号(进程号对应jps显示出来的 mykernel 模块的进程)
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/interfaceStandard.html b/docs/.vuepress/dist/NULS2.0/alpha/interfaceStandard.html new file mode 100644 index 00000000..be6dfb79 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/interfaceStandard.html @@ -0,0 +1,35 @@ + + + + + + JSON-RPC Interface interaction format and specification | NULS + + + + + + + +

JSON-RPC Interface interaction format and specification

Request Body

{
+  "cmd": "nuls_accounts",
+  "params": ["param1", "param2"],
+  "min_version": 1.0,
+}
+
  • parameters
parameter required type description
cmd true string The command to call
params true array parameters
min_version false float The minimum version of the interface to call

Response Body

  • success
{
+  "code":0,
+  "msg": "Success",
+  "result": {}
+}
+
  • returns
parameter required type description
code ture int The result status of the request, 0 means success. Otherwise return an error code
msg true string User-friendly request execution result description
result true object Method return value

Error Code

JSON RPC Standard errors

Code Possible Return message Description
0 Success Operation success
1 Parse error Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
2 Invalid Request The JSON sent is not a valid Request object.
3 Method not found The method does not exist / is not available.
4 Invalid params Invalid method parameter(s).
5 Internal error Internal JSON-RPC error.
6 Unauthorized Should be used when some action is not authorized, e.g. sending from a locked account.
7 Action not allowed Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).
8 Timeout Should be used when an action timedout.
9 Conflict Should be used when an action conflicts with another (ongoing?) action.
10 Execution error Will contain a subset of custom errors in the data field. See below.
11 to 100 Server error Reserved for implementation-defined server-errors.

Custom error fields

Custom error 10 can contain custom error(s) to further explain what went wrong.

{
+    code: 10,
+    msg: 'Execution error',
+}
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/ledgerModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/ledgerModuleDesign.html new file mode 100644 index 00000000..516b59ec --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/ledgerModuleDesign.html @@ -0,0 +1,123 @@ + + + + + + Account Ledger module design document | NULS + + + + + + + +

Account Ledger module design document

[TOC]

1. Overall description

1.1 Module Overview

1.1.1 Why do you have a "Ledger module"?

The ledger module is the data hub of the blockchain. The balances and transactions of all accounts are saved in the ledger module. +  A network-wide account ledger is saved on each network node to ensure complete, open and transparent data, while ensuring that data cannot be tampered and traceable.

1.1.2 What should be done in the Ledger Module?

Provide data support for assembly transactions, mainly accounting and auditing, verify the legality of the transaction, such as: whether there is sufficient balance, whether to repeat payment (double flower)

1.1.3 Positioning of the "Ledger module" in the system

The ledger module is the data hub, which stores the result data of all existing transactions in the system. It does not depend on any business modules, and other modules depend on it as needed.

1.1.4 Explanation of terms in "Ledger module"

  • The random number of the transaction (nonce, a 32-bit hash value) +
    • nonce: A scalar value equal to the number of transactions sent at this address, which will be included in every transaction initiated by the user.
    • Each transaction in the account needs to save the nonce (hash) of the previous transaction
    • Strictly speaking, a nonce is an attribute of the originating address (it only makes sense in the context of the sending address). However, the nonce is not explicitly stored in the blockchain as part of the account status.
    • The nonce value is also used to prevent incorrect calculation of account balances. For example, suppose an account has 10 NULS balances and signs two transactions, all of which cost 6 NULS with nonce 1 and nonce 2, respectively. Which of the two transactions is valid? In a blockchain distributed system, nodes may receive transactions out of order. Nonce forces transactions of any address to be processed in order, regardless of the interval, regardless of the order in which the nodes receive. This way, all nodes will calculate the same balance. The transaction paying 6 Ethereum will be successfully processed and the account balance will be reduced to 4 ether. Whenever it is received, all nodes believe that the transaction with nonce 2 is invalid. If a node receives a nonce 2 transaction first, it will hold it, but will not verify it until it receives and processes the nonce 1 transaction.
    • Use nonce to ensure that all nodes calculate the same balance and correctly sort the transactions, which is equivalent to the mechanism used in Bitcoin to prevent "double payment". However, because Ethereum tracks account balances and does not track individual coins separately (called UTXO in Bitcoin), "double payments" occur only when the account balance is incorrectly calculated. The nonce mechanism prevents this from happening.

1.2 Architecture

The core of the Ledger is assets management and ledger management.

ledger-arch.png

2. functional design

2.1 Functional Architecture

ledger-functions.png

2.2 Module Service

2.2.1 System Service of the Ledger Module

ledger-service.png

The RPC interface call provided by the ledger module. For detailed interface, please refer to the interface design section.

2.2.2 Modifying system operating parameters

Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,

2.3 Module internal function

2.3.1 Hot (online) transaction processing

Module internal work mainly includes asset management, obtaining account address balance and nonce, and verifying transaction coinData.

  • asset Management +
    • Total assets of the account
    • Available assets
    • Freeze assets. For locked assets, separate record and locked asset information, including chain ID, asset ID, asset amount, lock time, lock height, etc.
    • In the asset unlocking process, when the user's locked asset time or height reaches the unlock condition, the account will unlock the asset information, accumulate the available balance, and delete the asset lock record of the local data.
    • Multi-asset situation, need to join chainId.
  • Get account address balance and nonce +
    • Get account address balance
    • Get the account address nonce (the nonce is a hash value, meaning that the nonce of the first transaction is 0. Each transaction in the account will contain the nonce value of the previous transaction)
  • Verify the transaction +
    • Double flower verification (nonce mechanism prevents double payment)
    • Transaction creator verification, verifying that the issuer of the transaction has sufficient balance to verify that the nonce of the transaction creator is legal
    • Continuous transaction verification
  • Function Interface Management (rpc) +
    • rpc interface for use by other modules

2.3.2 Cold (offline) transaction processing

A cold wallet is an unconnected wallet, also called an offline wallet. A hot wallet is a wallet that keeps online, that is, an online wallet. Cold wallets are not more secure than hot wallets.

Since the cold wallet only signs the transaction information, the signed hex string is transmitted to the server through the hot wallet, and then the server performs unified transaction processing, so the client needs to perform the offline signature function. +The offline transaction system maintains the storage information of the nonce. After using a nonce, the nonce is saved in the business system.

2.4 Ledger flowcharts

2.4.1 Transfer Transaction Process

  • User enters the address of the transfer and the transferred address and the transferred amount
  • The system signs the transfer information by the private key of the transferred address (used to prove that the transaction was actually initiated by me)
  • The system verifies the transaction information +
    • Balance verification
    • Fee verification
    • nonce continuity verification
    • Signature and input account verification
  • Put this transaction into the local TxPool (that is, the account unconfirmed trading pool)
  • Broadcast transaction information to other nodes
  • Packing blocks, verifying blocks
  • Confirm transaction +
    • Update the balance of all accounts related (transferred or transferred)
    • Update the nonce corresponding to the account asset

2.4.2 Ordinary transaction process (reference example)

eth-transaction-flow.png

2.4.3 Transaction verification process

trx-validate-flow.png

3.Interface design

3.1 Module core interaction interface

3.1.1 Get account balance

cmd: getBalance

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y int Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
Return value description (response)
{ 
+       "available": "10000000000",
+       "freeze": "200000000",
+       "total": "12000000000"
+}
+

remarks: 1NULS=10^8Na

Field type DESC
available BigInteger Available Balance
freeze BigInteger freeze
total BigInteger total = available+freeze

3.1.2 Get the current account nonce value

cmd: getNonce

Parameter Description(request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
Return value description(response)
{
+   "nonce":"xxxxxxxxxxx",
+   "nonceType":1
+}
+
Field Type Desc
nonce String Spending transaction hash
nonceType int 1The last transaction has been confirmed, 0 the transaction has not been confirmed

3.1.3 Get balance and nonce value

cmd: getBalanceNonce

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":"34",
+    "assetId":"5",
+}
+
Return value description:(response)
{
+    "available": "10000000000",
+    "nonce": "xxxxx"
+}
+
Field Type Desc
available BigInteger User available balance
nonce String A random value of the account that holds the hash of the user's last transaction.

3.1.4 Verify coinData

cmd: validateCoinData

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+    "chainId": 458,
+    "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "validateCode":1,
+    "validateDesc":"success" 
+}
+
Field Type Desc
validateCode int 1 check pass, 2 orphan trade 3 double flower 4 other abnormalities
validateDesc String Check return description

3.1.5 Submit unconfirmed transaction

cmd: commitUnconfirmedTx

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+    "chainId": 21,
+    "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
value int 1 submission passed, 0 submission failed

3.1.6 Batch verification notify

cmd: bathValidateBegin

Parameter Description (request)
Field Required or not Type desc
chainId Y int 接口调用链的链Id
{
+     "chainId": 21  
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1成功,0失败

3.1.7 Receive batch verification one by one

cmd: bathValidatePerTx

Parameter Description (request)
Field Required or not Type Desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "result":1
+}
+
Field Type Desc
result int 1 success, 0 failed

3.1.8 Submit confirmation transactions one by one

cmd: commitConfirmTx

Parameter Description (request)
Field Required or not Type Desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1Success,0 failed

3.1.9 Rollback transaction

cmd: rollBackConfirmTx

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1Success,0 failed

3.2 Other interface

3.2.1 Obtain asset information based on asset id

cmd: getAsset

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+  "chainId": 5,
+  "assetChainId": 12,
+  "assetId": 41
+}
+
Return value description (response)
{
+    "chainId": 5,
+    "assetChainId": 12,
+    "assetId": 41,
+    "balance" : {
+      "available": "10000000000",
+      "freeze": "200000000",
+      "total": "12000000000"
+    }
+}
+
Field Type Desc
chainId int The chain ID of the initiating call
assetChainId int Asset-initiated chain id
assetId int Asset ID
balance.available BigInteger Available Balance
balance.freeze BigInteger Freeze balance
balance.total BigInteger total = available+freeze

4. Description of the event

does not depend on any events

5. agreement

5.1 Network Communication Protocol

NA

5.2 Trading Agreement

6. Module Configuration

6.1 Configuration Instructions

6.2 Module Dependencies

  • Kernel module +
    • Module registration
    • Module logout
    • Module status escalation (heartbeat)
    • Service interface data acquisition and timing update

7. Java-specific design

Core object class definition, storing data structures, ...

8. supplementary content

References Literature


+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/linuxTutorial.html b/docs/.vuepress/dist/NULS2.0/alpha/linuxTutorial.html new file mode 100644 index 00000000..4cf252bc --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/linuxTutorial.html @@ -0,0 +1,673 @@ + + + + + + [Alpha]Linux CLI tutorial | NULS + + + + + + + +

[Alpha]Linux CLI tutorial

Introduction

This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.

Version update history

Versions Date Contents
V1.0.0 2018-03-18 alpha

Preparation

Server hardware configuration

The server for NULS node should be not lower than the following configuration:

CPU Memory Disk space Bandwidth
4-Core 3.0 GHz 16GB 128GB 20Mbps uplink

Recommended configuration:

CPU Memory Disk space Bandwidth
8-core 3.0 GHz 32GB 256GB 100Mbps uplink

System and kernel version

Linux system

  • CentOS 6, 7

The Linux kernel version is recommended to use 2.6.32 and above

Get started

Download

  • Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release
  • After entering the interface of NULS official wallet download, select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.

To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:

  $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
+

Note: the download address may be different if there are subsequent versions.

Installation

  • Extract the downloaded file in Linux
  $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz
+

Run

  • Enter the extracted directory and run the boot script to start the full node wallet
  $ cd NULS-Wallet-linux64-2.0.0-alpha-1
+  $ ./start.sh
+

Use wallet

Quick start

  • After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.

Enter the cmdclient/1.0.0 directory and execute the following command:

  $ cd cmdclient/1.0.0
+  $ ./cmd.sh
+

At this point, you can see the input prompt nuls>>>, now you can directly type NULS wallet command to operate. +For example, to create an account you can do like this:

  nuls>>> create
+  Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+  Enter your password:*********
+  Please confirm new password:*********
+  [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
+  nuls>>>
+

Command create means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.

Convention

  • Password rules: password length varies from 8 to 20 and must contain both letters and digits.
  • Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.

Wallet command

Help command

Print all valid commands,

  • command: help [-a]|[group]|[command]
Parameter Description
-a format the printed command, optional
command view instructions for the specific command
group view all instructions for the commands in the specific command group

Return: help

getaccount <address> --get account information
+

Return: help-a

getaccount <address> --get account information
+    OPTIONS:
+    <address> the account address - Required
+

Example

nuls>>> help
+nuls>>> help -a
+nuls>>> help account
+nuls>>> help create
+

Create an account

Create an account and return the set of account addresses

  • command: create [number]
Parameter Description
[number] the number of accounts you want to create, optional

When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.

Return: accounts set

[ "5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r", "5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p" ]
+

Example

Create a single account

nuls>>> create 
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]
+

Create multiple accounts at once

nuls>>> create 3
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]
+

Back up account

To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account

  • command: backup <address> [path]
Parameter Description
<address> account address, required
[path] the directory where the generated backup file is included, current directory by default, optional

Return

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Example: backup an account with password

shell
+nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj
+Enter account password
+***************
+The path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+

Remove account

Enter the password to remove a local account based on the account address

  • command: remove <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+Enter your password for account**********
+Success
+

Modify account password

Set a new password according to the account address and password.

  • command:resetpwd <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N
+Enter your old password:**********
+Enter new password**********
+Please confirm new password:**********
+Success
+

Set alias

Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source

  • command: setalias <address> <alias>
Parameter Description
<address> account address, required
<alias> alias name, required

Return: transaction hash

txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Example

nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj
+Enter your account password**********
+txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582
+

Import account keystore

Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.

  • command: importkeystore <path>
Parameter Description
<path> path of the keystore file to be imported, required

Note: the original password is required to import the keystore file to generate the account

Return: address of the imported account

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+

Import account private key

Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.

  • command: import <privatekey>
Parameter Description
<privatekey> account's private key, required
"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+

Query account information

Query account information with the account address

  • ** command: getaccount <address>**
Parameter Description
<address> account address, required

Return

{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  // the encrypted private key
+  "alias" : "zlj",  // alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets 
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets 
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //public key
+}
+

Example

nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //encrypted private key 
+  "alias" : "zlj",  //alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key 
+}
+

Query account list

Query the account list with the paging parameters and return all accounts in descending order by creation time.

  • ** command: getaccounts <pageNumber> <pageSize>**
Parameter Description
<pageNumber> page number indicating the page to query, required
<pageSize> number of rows displayed per page, required

Return: accounts set

[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Example: get accounts list

nuls>>> getaccounts
+[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //encrypted public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //encrypted private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Query account's private key

Query the account’s private key with the account address and password

  • command: getprikey <address>
Parameter Description
<address> account address, required

Return: the private key of the imported account (unencrypted)

00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+

Example

nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9
+Enter your account password**********
+7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678
+

Query account balance

Query account balance with the account address

  • command: getbalance <address>
Parameter Description
<address> account address, required

Return: the address of the imported account

{
+"total": "9999998.99",// balance
+"freeze": "0", // locked balance
+"available": "9999998.99"// usable balance
+}
+

Example

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "total" : "9999998.99",
+  "freeze" : "0",
+  "available" : "9999998.99"
+}
+

Transfer

Transfer NULS to the specific account with the account address

  • command:transfer <formAddress>|<formAlias> <toAddress>|<toAlias> <amount> [remark]
Parameter Description
<fromAddress> sender address(Select any item with the fromAlias)
<fromAlias> sender address alias(Select any item with the fromAddress)
<toAddress> receiver address(Select any item with the toAlias)
<toAlias> receiver address(Select any item with the toAddress)
<amount> transfer amount, required
[remark] remark, optional

Return: transfer transaction hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Example

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer
+Please enter the password.
+Enter your password: *********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Query transaction details

Query the transaction details with the transaction hash

  • ** command: gettx <hash>**
Parameter Description
<hash> transaction hash, optional

Return: transaction details

{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Example: query transfer transaction

nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f
+{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Enumeration type description

/** coinbase transaction*/
+    int TX_TYPE_COINBASE = 1;
+    /** transfer */
+    int TX_TYPE_TRANSFER = 2;
+    /** set alias */
+    int TX_TYPE_ALIAS = 3;
+    /** create consensus node */
+    int TX_TYPE_REGISTER_AGENT = 4;
+    /** agent (join consensus) */
+    int TX_TYPE_JOIN_CONSENSUS = 5;
+    /** cancel agent (cancel consensus)*/
+    int TX_TYPE_CANCEL_DEPOSIT = 6;
+    /** yellow punish */
+    int TX_TYPE_YELLOW_PUNISH = 7;
+    /** red punish */
+    int TX_TYPE_RED_PUNISH = 8;
+    /** stop node (stop consensus node)*/
+    int TX_TYPE_STOP_AGENT = 9;
+    /** cross-chain transfer */
+    int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;
+    /** register chain */
+    int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;
+    /** destroy chain*/
+    int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;
+    /** add asset to chain*/
+    int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;
+    /** remove asset from chain*/
+    int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;
+    /** create contract */
+    int TX_TYPE_CREATE_CONTRACT = 100;
+    /** call contract */
+    int TX_TYPE_CALL_CONTRACT = 101;
+    /** delete contract*/
+    int TX_TYPE_DELETE_CONTRACT = 102;
+

Transfer by alias

Transfer to an external address with an account alias

  • order: transfer <address> <toAddress> <amount> [remark]
Parameter Description
<address> sender address, required
<toAddress> receiver address, required
<amount> transfer amount, required
[remark] remark, optional

Return: transaction hash

00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Example: transfer 10,000 NULS to external address through alias "zlj"

nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000
+Enter your account password**********
+00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Create node

To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.

  • command: createagent <agentAddress> <packingAddress> <commissionRate> <deposit>
Parameter Description
<agentAddress> account address to create a node, required
<packingAddress> account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)
<commissionRate> agent commission ratio with a range from 10 to 100, required
<deposit> deposit to create a node, no less than 2000 NULS, required

Return: agent hash of the node

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password: **********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Join consensus (agent node)

Join consensus by account address and node agentHash, which requires at least 2,000NULS

  • command: deposit <address> <agentHash> <deposit>
Parameter Description
<address> account address, required
<agentHash> agentHash of the node, optional
<deposit> deposit required to join consensus, no less than 2000NULS, required

Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Example

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Cancel consensus (cancel agent)

Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.

  • command: withdraw <address> <txHash>
Parameter Description
<address> account address, required
<txHash> hash of the agent transaction, required

Return: transaction hash to cancel consensus

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Example

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Stop agent

Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.

  • command: stopagent <address>
Parameter Description
<address> account address, required

Return: transaction hash to stop a node

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Example

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Get the latest information of block header

Get the latest block header’s information

  • command: getbestblockheader

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash 
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block 
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block singnature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  // packing address
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example

nuls>>> getbestblockheader
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",
+  "time" : "2019-03-19 18:26:20.020",
+  "height" : 1479,
+  "txCount" : 0,
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",
+  "size" : 0,
+  "packingAddress" : null,
+  "roundIndex" : 155299118,
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1,
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Query block header information

Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.

  • command: getblock <hash> | <height>
Parameter Description
<hash> block hash
<height> block height

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example: get block with block height

nuls>>> getblock 28115
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Create smart contracts

This interface is called to create a smart contract on the chain

  • command:createcontract <sender> <gaslimt> <price> <contractCode> [remark]
Parameter Description
<sender> Create the account address for the smart contract
<gaslimt> Consumes of the gas for creating the contract
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractCode> Hex code of the contract code
[remark] remark

Returns the transaction hash for which the contract was created and the address of the contract

{
+  "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f",  //transaction hash
+  "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address
+}
+

The example creates a contract (contractCode omits the middle)

nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo
+The arguments structure: 
+[ {
+  "type" : "String",
+  "name" : "name",
+  "required" : true
+}, {
+  "type" : "String",
+  "name" : "symbol",
+  "required" : true
+}, {
+  "type" : "BigInteger",
+  "name" : "initialAmount",
+  "required" : true
+}, {
+  "type" : "int",
+  "name" : "decimals",
+  "required" : true
+} ]
+Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'").
+Enter the arguments:"KQB","KQB",10000,2
+{
+  "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"
+}
+

Get contract basic information

Gets the description of the intelligent contract and the argument list of the constructor and the calling method

  • command:getcontractinfo <contract address>
Parameter Description
<contract address> contract address

Return

Skip
+

example


+nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+{
+  "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+  "createTime" : 1553563706022,
+  "blockHeight" : 46,
+  "isNrc20" : true,
+  "nrc20TokenName" : "QKB",
+  "nrc20TokenSymbol" : "QKB",
+  "decimals" : 2,
+  "totalSupply" : "200000000",
+  "status" : "normal",
+  "method" : [ {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },{
+    "name" : "transfer",
+    "desc" : "(Address to, BigInteger value) return boolean",
+    "args" : [ {
+      "type" : "Address",
+      "name" : "to",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "value",
+      "required" : true
+    } ],
+    "returnArg" : "boolean",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  }]
+}
+
+

Invoke smart contracts

Call the functions provided by the smart contract

  • command:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]
Parameter Description
<senderAddress> The account address of the invocation contract
<gasLimit> This contract is the largest consumption of Gas
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractAddress The contract address of the call
<methodName> The method name of the contract
<value> If transfer is to be made to the contract, the amount of transfer
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract
[-r remark] remark

Returns: transaction hash

"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash
+

The example calls the nrc20-token transfer function for a specified contract, Example tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L NRC20 contract address, number of input parameters for receiving address and account transfer

nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+Please Enter your account passwordzhoujun172
+**********
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2
+"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"
+

Delete smart contract

Stop an available smart contract

  • commmand:deletecontract <senderAddress> <contractAddress>
Parameter Description
<senderAddress> The account address of the invocation contract
<contractAddress> The contract address of the call

Returns: trading hash

"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash
+

example

nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+Please enter your account passwordzhoujun172
+**********
+"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"
+

Call the contract view method

Calling the contract view method immediately returns the result and no transaction is generated

  • commmand:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract
Parameter Description
<contractAddress> The contract address of the call
<methodName> Method called
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract

The return value

The return value varies depending on the function being called
+

The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address

nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+{
+  "result" : "20000000"
+}
+

Transfer money to the contract address

To the specified contract address into the main network currency

  • command:transfertocontract <senderAddress> <contractAddress> <amount> [remark]
Parameter Description
<senderAddress> Transfer out account address
<contractAddress transfer into the contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

Example passes two NULS to the specified contract

nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark
+Please enter your account password
+**********
+"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

token transfer

NRC20 token transfer

  • command:tokentransfer <formAddress> <toAddress> <contractAddress> <amount> [remark]
Parameter Description
<formAddress> sender address
<toAddress receiver address
<contractAddress> contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

example token transfer:

nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD  tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta  tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000
+Please enter your account password
+**********
+"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

Get contract transaction

Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results

  • command:getcontracttx <hash>
Parameter Description
<hash> transaction hash

return value

skip 
+

example

nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "type" : "100",
+  "time" : "2019-03-26 09:28:26",
+  "blockHeight" : 46,
+  "fee" : 0.0,
+  "value" : 0.0,
+  "remark" : null,
+  "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",
+  "status" : "confirm",
+  "confirmCount" : 0,
+  "size" : 6686,
+  "inputs" : [ {
+    "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "assetsChainId" : 2,
+    "assetsId" : 1,
+    "amount" : "5700000",
+    "nonce" : "ffffffff",
+    "locked" : 0,
+    "value" : 0.0
+  } ],
+  "outputs" : [ ],
+  "txData" : {
+    "data" : {
+      "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "value" : 0.0,
+      "hexCode" : "504b03040a0000080...........31600000000",
+      "gasLimit" : 200000,
+      "price" : "0.00000025",
+      "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]
+    }
+  },
+  "contractResult" : {
+    "success" : true,
+    "errorMessage" : null,
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "result" : null,
+    "gasLimit" : 200000,
+    "gasUsed" : 14029,
+    "price" : "0.00000025",
+    "totalFee" : 0.0,
+    "txSizeFee" : 0.0,
+    "actualContractFee" : 0.0,
+    "refundFee" : 0.0,
+    "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+    "value" : 0.0,
+    "stackTrace" : null,
+    "balance" : 0.0,
+    "transfers" : [ ],
+    "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+    "tokenTransfers" : [ {
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "from" : null,
+      "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "value" : "200000000",
+      "name" : "QKB",
+      "symbol" : "QKB",
+      "decimals" : 2
+    } ],
+    "remark" : "create"
+  }
+}
+
+
+

Get the contract execution result

Gets the execution result of a contract

  • command:getcontractresult <hash>
Parameter Description
<hash> transaction hash

return value

skip
+

example

nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "success" : true,
+  "errorMessage" : null,
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "result" : null,
+  "gasLimit" : 200000,
+  "gasUsed" : 14029,
+  "price" : "0.00000025",
+  "totalFee" : 0.0,
+  "txSizeFee" : 0.0,
+  "actualContractFee" : 0.0,
+  "refundFee" : 0.0,
+  "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+  "value" : 0.0,
+  "stackTrace" : null,
+  "balance" : 0.0,
+  "transfers" : [ ],
+  "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+  "tokenTransfers" : [ {
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "from" : null,
+    "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "value" : "200000000",
+    "name" : "QKB",
+    "symbol" : "QKB",
+    "decimals" : 2
+  } ],
+  "remark" : "create"
+}
+
+

Get the contract constructor

Gets the list of parameters that need to be passed in to create the specified contract

  • command:getcontractcontructor <contractCode>
Parameter Description
<contractCode> Hex code of the contract code

return value

skip
+

example

nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000
+{
+  "constructor" : {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },
+  "isNrc20" : true
+}
+
+

Gets the list of contracts created for the specified account

Gets the list of contracts created by the specified account address

  • command:getaccountcontracts <createAddress>
Parameter Description
<createAddress> account address

return value

{
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}
+

example

nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD
+[ {
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",
+  "createTime" : "2019-03-25 16:08:25.025",
+  "height" : 253,
+  "confirmCount" : 195,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",
+  "createTime" : "2019-03-25 15:33:54.054",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+} ]
+

Query network information

Query network basic information

  • command: network info

Return

{
+  "localBestHeight" : 35317,//latest block height locally 
+  "netBestHeight" : 35317,//latest block height of the network 
+  "timeOffset" : "0ms",//network time offset 
+  "inCount" : 0,//number of in-nodes 
+  "outCount" : 1//number of out-nodes 
+}
+

Example

nuls>>> network info
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

Query network node IP

Query the network node IP

  • command: network nodes

Return information

[" 192.168.1.223 "]
+

Example: get a block with the block height

nuls>>> network nodes
+[ "192.168.1.223" ]
+

Exit the wallet CLI

Exit the command line that operates the wallet, while it won’t stop the launched wallet node.

  • command: exit

Example

nuls>>> exit
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/networkModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/networkModuleDesign.html new file mode 100644 index 00000000..4339f5d6 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/networkModuleDesign.html @@ -0,0 +1,425 @@ + + + + + + Network module design document | NULS + + + + + + + +

Network module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why have a Network Module

The network module guarantees the communication between the decentralized nodes and +provides the lowest level of network communication and node discovery services for one of the NULS basic modules. The network foundation of the blockchain is Peer to Peer, or P2P. All participants in the P2P network can be either a server or a client. Features of P2P networks: decentralization, scalability, robustness, cost-effectiveness, privacy protection, and load balancing.

1.1.2 What to do with Network Module

The network module is the basic module of the entire system, which is used to manage the connection between nodes, nodes and connections, and the transmission and reception of data. Network modules do not involve complex business logic.

  • The received network message is pushed in the corresponding processing module according to the instruction service mapping relationship in the kernel module.
  • The open interface is used to push the message encapsulation of other modules to the specified peer node and broadcast to the specified network group.

1.1.3 The positioning of "Network Module" in the system

  • The network module is the underlying application module. Any module that needs network communication must send and receive messages through the network module.
  • Network modules rely on kernelmodules for service interface governance。
  • The network module builds different networks by network id (magic parameter).
  • When the nodes of the network module in the satellite chain are configured for cross-chain networking, a chain management module is required to provide cross-chain configuration information.
  • The nodes of the network module in the sub-chain need to provide cross-chain configuration information when the cross-chain network is built.

1.2 Architecture diagram

2、function design

2.1 Functional architecture diagram

​ The network module has functions in the business: node management, node group management, p2p network connection management, and message transmission and management.

​ The internal infrastructure functions include: state management of the module (including startup and shutdown management), and management of external interfaces. Thread task management, data storage management, etc. 。

  • Peer Nodes Management

    Manage all connectable, connected node information, status, and provide node operation interfaces

    • Node discovery
    • Node storage
  • Node Groups Management

    Manage different network nodes, divide nodes into different collections, and manage each collection separately. The magic parameters of the nodes connected in each set are the same and are different from the magic parameters of other sets.

    Each NodeGroup is initialized according to the information registered in the chain or the network information configured by itself (magic parameters, number of nodes, etc.) .Every time a NodeGroup is initialized, the network service listens for more than one MagicNumber.

  • Connection Management

    • Initialize the connection +
      • Satellite chain node: random connection
      • Cross-chain nodes: fixed algorithm connections, the goal is to spread and cross-link nodes across the chain
    • Connection Management: Heartbeat Maintenance
    • Disconnect
  • Message Management

    • Message receiver

    Receiving the message sent by the network node, making a simple judgment on the message +(judging command), and sending the message to the module service of interest +according to the message cmd field.

    [^ps]: RPC API Service interface information (url) is periodically obtained and cached from the kernel module.

    • Message receiver

      • NodeGroup broadcast message
      • Send a message to a node

  • Module Management

    • Start, turn off logic processing
    • Maintenance and management of the status of its own module: management module operation status, internal function status, etc.
  • RPC Api Management

    • Register your own interface into the kernel module

    • Synchronize module information and status to the kernel module

    • Get the list of RPC services to the local module

    • Open external interface call

  • Thread task management

    • heartbeat thread

    • Node discovery/elimination mechanism thread

    • Interface information synchronization thread

2.2 Module service

2.2.1 Network message recieve

  • Function Description:

    Receiving the message sent by the (external) network node, making a simple judgment on +the message (determining the magic parameter), and sending the message to the module service of interest according to the command field contained in the message header.

  • Process description

  • Message verification :

​ payload validate :First 4 bytes of sha256(sha256(payload))

​ magicNumbe :Determine if the nodegroups collection contains the magicNumber

  • External module network message receiving interface constraint

    • method : *** //Same as the CMD instruction in the message header, constraining 12 bytes

      Interface description: The network module transparently forwards the message to the external module.

    • params

    0:chainId  
+    1:nodeId  
+    2:messageBody
+    ......
+

+
  • Dependent service

    Parsing the command parameter in the message header, relying on the remote service interface data provided by the kernel module when calling the remote interface processing.

2.2.2 Network messaging

Forwards messages encapsulated by other or own modules, including broadcast messages and designated nodes to send messages.

2.2.2.1、Broadcast network message

Function Description:

Forwarding messages encapsulated by other or its own modules, and providing interfaces for forwarding calls to external modules have the following two cases:

a> Broadcast a message to a NodeGroup (specify a network).

b> Broadcast messages to the NodeGroup (specify a network) and exclude certain nodes.

  • Process description

  • Interface definition

    • Interface Description

    ​ method : nw_broadcast

    ​ Other modules can broadcast messages through this interface

    • Request example

      {
      +    "method":"nw_broadcast",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        "10.13.25.36:5003,20.30.25.65:8009",
      +        "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",
      +        "getBlock"
      +       
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 excludeNodes true String Exclude nodes, comma separated
      2 message true String Object hexadecimal character
      3 command true String message command,12 byte
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
  • Dependent service

​ nothing

2.2.2.2、The specified node sends a network message

Function Description:

Forwarding messages encapsulated by other or its own modules, you can specify that +certain nodes (which can be 1 node) send messages.

  • Process description

  • Interface definition

    • Interface Description

      External modules can broadcast messages through this interface

      method : nw_sendPeersMsg

    • Request example

      {
      +    "method":"nw_sendPeersMsg",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        "10.13.25.36:5003,20.30.25.65:8009",
      +        "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",
      +        "getBlock"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 nodes true String Send node, comma split
      2 message true String Object hexadecimal character
      3 command true String message command,12 byte
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

​ nothing

2.2.3 Create a node group

In addition to its own satellite network, the satellite chain also has n cross-chain networks. In addition to its own network, there is also a cross-chain network.

Node groups are used to manage different network information. The network module isolates and maintains different networks through node groups.

Node group type: 1> own network 2> cross-chain network (satellite chain cross-chain network & friend chain cross-chain network)

The network module is a call to receive an external module to create a node group. The basic network configuration information of the cross-chain is mainly obtained through two ways:

1> The own configuration file is loaded to create its own network group.

2> Cross-chain network:

As a satellite chain node, after the registration is registered by the chain management module, the system generates a transaction verification confirmation and then calls to generate a cross-chain network group.

As a friend chain node, when started by the cross-chain protocol module, the cross-chain protocol module obtains cross-chain configuration information from the module configuration, and notifies the network module,The network module triggers a cross-chain connection.

  • Process description

    The actual creation of a NodeGroup also has two kinds of logic:

    1> Generate your own network group (or data load call) by loading the configuration file.

    2> Call by external module: Create a network group as confirmed by registering cross-chain transactions.

2.2.3.1 Create a node group with its own network
  • Function Description:

    ​ The own network corresponds to its own chainId, and a magic parameter, through the configuration initialization to create a node group.

  • Process description

    Create a node group by loading the configuration file

  • Interface definition

​ Created internally, no external interface。

  • Dependent service

​ none

2.2.3.2 Create a cross-chain node group
  • Function Description:

    The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.

  • Process description

1> The satellite chain is triggered by the chain management module to trigger the creation of a cross-link node group.

2> The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.

  • interface definition

    • Interface Description

      Receive a call to an external module to create a node group

      method : nw_createNodeGroup

    • Request example

      {
      +    "method":"nw_createNodeGroup",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        232342,
      +        10,
      +        100,
      +        20,
      +        "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",
      +        0
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 magicNumber true long magicNumber
      2 maxOut true int Maximum active connections
      3 maxIn true int Maximum number of passive connections
      4 minAvailableCount true int Minimum number of links in the friend chain
      5 seedIps true String Seed section group comma segmentation
      6 isMoonNode true int Whether satellite chain node, default 0
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

Relies on remote service interface data provided by the kernel module.

2.2.3.3 Friend chain activates cross-chain connection
  • Function Description:

    The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.

  • Process description

    The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.

  • Interface definition

    • Interface Description

      Receive calls from cross-chain modules, activate friend chain cross-chain

      method : nw_activeCross

    • Request example

      {
      +    "method":"nw_activeCross",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        10,
      +        100,
      +        "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int Chain identification
      1 maxOut true int Maximum active connections
      2 maxIn true int Maximum number of passive connections
      3 seedIps true String Seed node, comma segmentation
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

​ Relies on remote service interface data provided by the kernel module.

2.2.4 delete node group

  • Function Description:

    Receive a call from an external module and unregister the cross-chain node group.

    As a satellite chain node, the chain management module performs deregistration, and the system generates a transaction verification confirmation and then calls it.

  • Process description

  • Interface definition

  • Interface Description

    Receive calls from external modules, delete node groups

    method : nw_delNodeGroup

  • Request example

    {
    +    "method":"nw_delNodeGroup",
    +    "minVersion":1.1,
    +    "params":[
    +        1234
    +    ]}
    +
  • Request parameter description

    index parameter required type description
    0 chainId true int chainId
  • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +       
    +    }
    +}
    +
  • Return field description

    parameter type description
  • Dependent service

    Relies on remote service interface data provided by the kernel module.

2.2.5 Cross-chain seed node provision

  • Function Description:

    The seed node is a node used to provide peer connection information when the network is initialized. When the chain management module performs chain registration, it needs to +obtain the seed node information on the satellite chain for initializing +the connection.

  • Process description

    no

  • Interface definition

    • Interface Description

      Obtain satellite chain seed node

      method : nw_getSeeds

    • Request example

      {
      +    "method":"nw_getSeeds",
      +    "minVersion":1.1,
      +    "params":[
      +        1234
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +      seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" 
      +    }
      +}
      +
    • Return field description

      parameter type description
      seedsIps
  • Dependent service

    Relies on remote service interface data provided by the kernel module.

2.2.6 Add a connection node

  • Function Description:

    Add a peer connection information to a network under the cmd command.

  • Process description

    The added node triggers the network connection process。

  • Interface definition

    • Interface Description

      Add network peer node

      method : nw_addNodes

    • Request example

      {
      +    "method":"nw_addNodes",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        1,
      +       "10.20.23.02:5006,53.26.65.58:8003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 isCross true int 0 false 1 true
      2 nodes true String nodes
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter
  • Dependent service

    none

2.2.7 Delete connection node

  • Function Description:

    Under the cmd command, the peer connection information is deleted for a network.

  • Process description

    Deleting a node triggers the disconnection of the network node。

  • Interface definition

    • Interface Description

      Delete network peer nodes

      method : nw_delNodes

    • Request example

      {
      +    "method":"nw_addNodes",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +       "10.20.23.02:5006,53.26.65.58:8003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 nodes true String peer nodes
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter
  • Dependent service

    none

2.2.8 Reconnect to the specified network

  • Function Description:

    Network reconnection of the specified nodeGroup under the cmd command

  • Process description

    After receiving the command, disconnect all the peers under the specified nodeGroup and reconnect to the network.

​ Refresh the peer connection under nodegroup and restart the network connection.

​ If the peer connection is owned by multiple network services, you only need to cancel the association. If only the service is used by itself, you can disconnect.

  • Interface definition

    • Interface Description

      Obtain satellite chain seed node

      method : nw_reconnect

    • Request example

      {
      +    "method":"nw_reconnect",
      +    "minVersion":1.1,
      +    "params":[
      +        1234
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int 链标识
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service +none

2.2.9 Get the list of nodeGroup

  • Function Description:

    Get a list of all networks managed by the node。

  • Process description

    none

  • Interface definition

    • Interface Description

      Get node group information

      method : nw_getGroups

    • Request example

      {
      +    "method":"nw_getGroups",
      +    "minVersion":1.1,
      +    "params":[
      +        1,
      +        10
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 startPage true int page of starts
      1 pageSize true int Number of records per page
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +        list:[{
      +            chainId:1212, 
      +            magicNumber:324234, 
      +            totalCount:2323,  
      +            inCount:22,    
      +            outCount:33,   
      +            isActive:1, 
      +            isCrossChain:1  
      +            },{}
      +            ]
      +    }
      +}
      +
    • Return field description

      parameter type description
      chainId int chainId
      magicNumber int magicNumber
      totalCount int Total number of connections
      inCount int Passive connection number
      outCount int ctive connections
      isActive int 0 is not activated, 1 is activated
      isCrossChain int 0 is not a cross-chain network, 1 cross-chain network
  • Dependent service

    none

2.2.10 Get the connection under the nodeGroup

  • Function Description:

    Get information about all nodes under the specified network id

  • Process description

    none

  • Interface definition

    • Interface Description

    ​ Get node information

    ​ method : nw_getNodes

    • Request example

      {
      +    "method":"nw_reconnect",
      +    "minVersion":1.1,
      +    "params":[
      +        1598,
      +        0,
      +        1,
      +        50
      +    ]
      +}
      +
      +
    • Request parameter description

    index parameter required type description
    0 chainId true int chainId
    1 state true int 0 all connected, 1 working connected
    2 startPage true int page of starts
    3 pageSize true int Number of records per page
    • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +
    +
    +

    Success

     {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +       list:[{
    +                chainId:122,
    +                nodeId:"20.20.30.10:9902"
    +                magicNumber:134124,
    +                version:2,
    +                blockHeight:6000,   //区块高度
    +                blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
    +                     ea1a960f207778150ffb9f2c173ff",  //区块Hash值
    +                ip:"200.25.36.41",
    +                port:54, 
    +                state:"已连接",
    +                isOut:"1", 
    +                time:"6449878789", 
    +	     },{}
    +	     ]
    +    }
    +}
    +
    +
    • Return field description
    parameter type description
    chainId int chainId
    nodeId String nodeId
    magicNumber int magicNumber
    version int protocol version
    blockHeight long latest block height
    blockHash String latest block hash
    ip String peer Ip address
    port int Server port
    state String connect state
    isOut int 0 passive connection, 1 active connection
    time long Recent connection time
  • Dependent service

    none

2.2.11 Get the specified chain network profile information

  • Function Description:

    Gets the network information of the specified chainId.

  • Process description

    none

  • Interface definition

    • Interface Description

    ​ Gets the network information of the specified chainId.

    ​ method : nw_getNodes

    • Request example

      {
      +    "method":"nw_getGroupByChainId",
      +    "minVersion":1.1,
      +    "params":[
      +        103
      +    ]}
      +
      • Request parameter description
    index parameter required type description
    0 chainId true int chainId
    • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +

    Success

    {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +     
    +            chainId:1212, 
    +            magicNumber:324234,
    +            totalCount:2323, 
    +            inCount:22,  
    +            outCount:33, 
    +            blockHeight:6000,   
    +            blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
    +                     ea1a960f207778150ffb9f2c173ff", 
    +            isActive:1,
    +            isCrossActive:1,
    +            isMoonNet:0
    +    }
    +}
    +
    +
    • Return field description
    parameter type description
    chainId int chainId
    magicNumber int magicNumber
    totalCount int total connect
    blockHeight long latest block height
    blockHash String latest block hash
    isActive int 0 is not activated, 1 is activated
    isCrossActive int 0 is not a cross-chain network, 1 cross-chain network
    outCount int active connection count
    inCount int passive connection count
    isMoonNet int 0 not moon node,1 moon node
  • Dependent service

    none

2.2.12 Update the information of the peer connection node

  • Function Description:

    The network connection has the height and hash value of the peer node when the +handshake connection is made, and the height and hash value of the subsequent peer connection node are called and updated by the external module (block management module).

  • Process description

    1> Wait for the block management interface after the node starts Initialization, and then call the block management interface to get the latest block height and hash value.

    2> When the handshake is performed, the node related information is placed in the Verion information and sent to the peer.

    3> After the connection is established, the block management module will call the interface to update the latest block height and hash value.

  • Interface definition

    • Interface Description

    ​ The block management module calls to update the height of the node and the hash value.

    ​ method : nw_updateNodeInfo

    • Request example

      {
      +    "method":"nw_updateNodeInfo",
      +    "minVersion":1.1,
      +    "params":[
      +       1598,
      +        "10.20.30.20:8856",
      +        10,
      +        "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"
      +    ]
      +}
      +
    • Request parameter description

    index parameter required type description
    0 chainId true int 网络id
    1 nodeId true String 网络节点id
    2 blockHeight true long 区块高度
    3 blockHash true Sting 区块最新hash

    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +
      +

      Success

      {
      + "version": 1.2,
      + "code":0,
      + "msg" :"xxxxxxxxxxxxxxxxxx",
      + "result":{
      +   
      +    }
      +}
      +
      +
      +
    • 返回字段说明

    parameter type description
  • Dependent service

    none

2.3 Module internal function

2.3.1Module start

  • Function Description:

    When the module is started, the configuration information is initialized, the +registration service is initialized, and the initialization of each internal function management database information is performed.

  • Process description

1> load local configuration data, database node group and node information data loading.

2 > When the status of the listening block management module is initialized and the interface is callable, the call obtains the block height and Hash value of the latest local node.

3> initialization completes and enters peer node connection.

4 > The network module notifies the block management module of the maximum block height and hash value after the connection is stable. The block management module provides interfaces for network module calls.

The criteria for the stability of network module start-up connection are: no new handshake connection occurs in X seconds, and no height increase in X seconds. X=10

5 > After network stabilization, the network is in a working state, and the business state of each chain is released to other modules in an event manner.

  • Dependent service

    none

2.3.2 Module off

  • Function Description:

    When the module is closed, the connection is closed, the thread management is +closed, the resources are released, and the status is notified to the core interface.。

  • Process description

  • Dependent service

    none

2.3.3 Peer node discovery

  • Function Description:

    After the network module is started, the peer node is managed.

    The ways for node acquisition are:

    1> Connect to the seed node and request address acquisition.

    2> Receive the broadcasted node message.

    2> The connection of a cross-chain network, for example, as a connection between a node and a sub-chain on a satellite chain, or a connection between a node on a sub-chain and a satellite chain.

  • Process description

  • Dependent service

​ none

2.3.4 connection

  • Function Description:

    A node acts as the client, actively connecting to a known peer node, and is also a server, waiting for the peer node to connect.

    A connection can work normally, and it needs to send a version protocol message to each other through a handshake protocol. For the specific definition of the protocol, see the following.

    "Protocol - Network Communication Protocol Part".

  • Process description

​ After the TCP connection is complete with the server, the client needs to handshake through the rervice version protocol. Only the connection with successful handshake can forward the service. The state in the connection cannot be transitioned to connected after X minutes, and the connection is actively disconnected.

PS: In order to meet the requirements of one process carrying multiple-chain services at the same time, after a node peer connection is established, multiple NodeGroup services should be satisfied.

That is, the node peer connection and the nodeGroup object are many-to-many, n:n relationships.

  • Dependent service

    none

2.3.5Heartbeat detection

  • Function Description:

    Check if the connection is still connected. Maintain the keep-alive by ping-pong message from client and server. Refer to the "Protocol - Network Communication Protocol" section for the definition of the ping-pong protocol involved.

  • Process description

  • Dependent service

​ none

2.3.6 Connection quantity verification

  • Function Description:

    When a node connection is established, the number of connections is made, and +if the maximum is reached, the connection is actively disconnected.。

  • Process description

    • Dependent service

​ none

2.3.7 Node external network IP storage

  • Function Description:

​ A node may have multiple network cards, or it may be in a local area network. Therefore, when establishing a connection, it does not know its own external network IP address.

The node needs to know its own external network IP address to broadcast its own address for the external network peers to connect. In our design, the external network of the node is carried by the version protocol message.

  • Process description

    When the client receives the version message, it can know its own IP address information.

  • Dependent service

​ none

2.3.8 Node external network connection detection

  • Function Description:

​ When a node establishes a connection, it can broadcast its own external network IP+port to other nodes. However, if a node is in a local area network, the IP address of the external network cannot be directly connected. Therefore,in order to detect whether the external network IP of the node is +available, you can connect to your own server through your own client. If the connection is successful, the IP can be used for broadcasting. If it is unsuccessful, the external network IP of the node cannot be +broadcast to other nodes.

  • Process description

    Self-connection +may succeed or fail. If it is successful, the external network IP is reachable, and it can be broadcasted to other nodes in the network when the connection is established. If it is unreachable, the connection +cannot be established.。

  • Dependent service

    none

2.3.9 Peer node broadcast

  • Function Description:

    Broadcast +its own nodes to other nodes in the network. In the design, we will +broadcast through the self-connection established above。

  • Process description

    Constraint: The address broadcast is not carried out between peers in the cross-chain +network, that is, the nodes in the satellite chain are not broadcast to the sub-chain, and the nodes in the same sub-chain are found not to be broadcast to the satellite chain. The satellite chain and the sub-chain need to establish a connection. The initial peer node can send a getAdrr message to request the connection address.

  • Dependent service

none

2.3.10 Request/reply getaddr protocol message

  • Function Description:

    Request an address protocol message for more network connections

  • Process description

    Request getaddr:

    1> When a connection in a nodeGroup does not reach the network service required threshold minAvailableCount, the address list is requested from the seed node.

    2> The cross-chain nodeGroup in the satellite chain node can directly request the obtained address from the connected peer node.

    Reply getaddr:

    1>peer cross-link connection, node reply address list (IP+cross-chain port)

    2>peer own network connection, the node will reply to the address list (IP+ own chain port)

  • Dependent service

2.3.11 send/receive address logic

  • Function Description:

    Send & Receive network protocol addr protocol message processing logic

  • Process description

    Send addr:

​ 1> When a new node is accessed, an addr message is broadcast to other peers of the same nodegroup.

​ 2> When the getaddr message is requested, the addr message will be replied.

​ Receive addr:

​ 1> Determine whether the address is already owned locally. If you do not forward it, get the new addr.

​ 2>PEER is not cross-chain network forwarding

​ 3> Own network, add addr>0, store and broadcast forwarding (except receiving peer)

  • Dependent service

    none

3、Event description

3.1 Published event

[^remark]: Here is the topic of the event, the format protocol of the event (accurate to byte), and the occurrence of the event.

3.1.1 NodeGroup reaches the lower limit of the number of nodes

Description: The NodeGroup reaches the lower limit of the number of nodes and the event is advertised.

 event_topic : "evt_nw_inNodeLimit",
+
  data:{
+      chainId
+      magicNumber
+      nodeCount
+      nodeLimit
+      time
+  }
+  
+
+

3.1.2 NodeGroup is less than the minimum number of nodes

Description: The NodeGroup is less than the lower limit of the number of nodes. The event is advertised.

 event_topic : "evt_nw_lessNodeLimit",
+
  data:{
+      chainId
+      magicNumber
+      nodeCount
+      nodeLimit
+      time
+  }
+  
+
+

3.1.3 Node handshake succeeded

Description: The node handshake is successful and the event is advertised.

 event_topic : "evt_nw_connectSuccess",
+
  data:{
+      chainId
+      magicNumber
+      nodeId
+      time
+      version
+  }
+  
+
+

3.1.4 Node disconnected

Description: The node is disconnected and the event is published

 event_topic : "evt_nw_nodeDisconnect",
+
  data:{
+      chainId
+      magicNumber
+      nodeId
+      time
+      version
+  }
+  
+
+

3.2 Subscribed event

​     none
+

4、protocol

4.1 Network communication protocol

version

Used to establish a connection (handshake)

Length Fields Type Remark
4 version uint32 Protocol version identifier used by the node
20 addr_you byte[20] The peer network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [10.32.12.25 8003 9003] 16byte+2byte+2byte
20 addr_me byte[20] The self network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [20.32.12.25 8003 9003] 16byte+2byte+2byte
4 block_height uint32 node latest block height
block_hash varInt node latest block hash
6 network_time uint48 Network time
?? extend VarByte extended field, no more than 10 bytes

verack

Used to answer version

Length Fields Type Remark
1 ack_code uint8 Return code, 1 means normal, 2 means the connection is full

ping

Used to maintain the connection. After receiving a message for a certain node for a 
+

period of time, the message is sent. If the pong message is received, the node remains connected. Otherwise, the connection is closed and the node is deleted.

Length Fields Type Remark
4 randomCode uint32 random number

pong

reply for ping
+
Length Fields Type Remark
4 randomCode uint32random number

getaddr

Used to obtain connection information of available nodes in the network, no message body

addr

Used to reply getaddr, or announce the existence of itself to the network. After receiving the message, the node determines whether the node is known. If it is an unknown node, it propagates the message to the network.

Length Fields Type Remark
?? addr_list network address 18 bytes per node (16 bytes IP + 2 bytes port)

Bye

Used for peer connection to disconnect actively, rejecting service message connection

Length Fields Type Remark
1 byeCode uint8 预留字段

4.2 Transaction agreement

​        none
+

5、Module configuration

  [network]
+  network.self.server.port=8003
+  network.self.chainId=9861
+  network.self.magic=68866996
+  network.self.max.in=100
+  network.self.max.out=10
+  network.self.seed.ip=127.0.0.1:8003
+  #Satellite chain configuration information
+  network.moon.node=true
+  network.moon.server.port=8004
+  network.moon.max.in=100
+  network.moon.max.out=10
+  network.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003
+  
+
+

6、Java-specific design

[^remark]: Core object class definition, storing data structures,......

7、 to add on

[^remark]: Required content not covered above

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/randomRPC.html b/docs/.vuepress/dist/NULS2.0/alpha/randomRPC.html new file mode 100644 index 00000000..15178c0a --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/randomRPC.html @@ -0,0 +1,193 @@ + + + + + + Wallet adds a random seed | NULS + + + + + + + +

Wallet adds a random seed

一、Wallet adds a random seed RPC interface

The random seed you get is a big number, and notice, it could be a negative number

Get a random seed list based on the height interval

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cutoff height, cannot exceed startHeight+1000

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

Get random seed list according to height interval

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cut-off height,endHeight-startHeight<=1000
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

二、Smart contracts support random Numbers in the underlying chain

Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code. +Take one of these methods as an exampleUtils.getRandomSeed(long endHeight, int seedCount, String algorithm) Shows how to generate random Numbers using random number seeds.

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @param algorithm Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]According to the height range, a specific algorithm is used to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   Number of original seeds
+ * @param algorithm   Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]Get the set of original seeds according to the height range
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) A dice example shaking at the same time N

2.1) Calculation method 1

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • The original seed is multiplied by the number of tosses, resulting in an array of bytes
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) Calculation method 2

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/rpcToolWebsocketDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/rpcToolWebsocketDesign.html new file mode 100644 index 00000000..f77c7566 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/rpcToolWebsocketDesign.html @@ -0,0 +1,283 @@ + + + + + + RPC-TOOL design document | NULS + + + + + + + +

RPC-TOOL design document

[TOC]

1. Overall description

1.1 summary

1.1.1 position of RPC-TOOL

  • NULS 2 according to function partition module, all modules are isolated and can run independently.
  • Interaction between modules through RPC call interface
  • As long as the module implements the required interface, it can be implemented in any language
  • Each module will use RPC, so it will be encapsulated into the same jar file

1.1.2 what will RPC-TOOL did

Data interaction between modules is done through RPC-TOOL

  • RPC Server start
  • Register all CMD commands of the current module
  • Parsing the received CMD command
  • Returns the result by calling the corresponding method based on CMD
  • RPC Client start
  • Interacting with kernel

1.1.3 position

RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.

2. functional design

3. interface design

3.1 interface

status

  • Interface description +Kernel will periodically push the status of the current system to each module, which is used for receiving

  • Request example

    {
    +    "cmd":"status",
    +    "minVersion":1,
    +    "params":[
    +        {
    +            "service":[
    +                "a",
    +                "b",
    +                "c"
    +            ],
    +            "available":true,
    +            "modules":{                
    +                "moduleABC":{
    +                    "name":"moduleABC",
    +                    "status":"READY",
    +                    "available":false,
    +                    "addr":"127.0.0.1",
    +                    "port":19722,
    +                    "rpcList":[
    +                        {
    +                            "cmd":"shutdown",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"cmd1",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"conf_reset",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"terminate",
    +                            "version":1
    +                        }
    +                    ],
    +                    "dependsModule":[
    +                        "m2",
    +                        "m3"
    +                    ]
    +                }
    +            }
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    index parameter required type description
    0 modules_information true map All module information

    modules_information

    parameter required type description
    service true string[] The dependent modules
    available true boolean can start service?
    modules true map<name, module> All module information

    module

    parameter required type description
    name true string name
    status true string status
    available true boolean can start service?
    addr true string ip address/host name
    port true int port
    rpcList true list cmd list
    dependsModule true string[] The dependent modules
  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    +"version": 1.2,
    +  "code":0,
    +  "result":{}
    +} 
    +
  • Response field specification +N/A

shutdown

  • Interface description +Kernel calls the interface to close the module (waiting for all the processing of the current business to complete)

  • Request example

    {
    +    "cmd":"shutdown",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

terminate

  • Interface description +Kernel calls the interface to close the module (immediately terminates).

  • Request example

    {
    +    "cmd":"terminate",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confGet

  • Interface description +Kernel gets module configuration items

  • Request example

    {
    +    "cmd":"confGet",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{
    +        "key1": "value1",
    +        "key2": "value2"
    +    }
    +} 
    +
  • Response field specification +N/A

confSet

  • Interface description +Kernel sets module configuration items

  • Request example

    {
    +    "cmd":"confSet",
    +    "minVersion":1,
    +    "params":[
    +        {
    +        "key1":"value1",
    +        "key2":"value2"
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confReset

  • Interface description +Kernel restore template is configured as initial value.

  • Request example

    {
    +    "cmd":"confReset",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

4. Event description

5. Protocol

6. Configuration

7. Java unique design

Server

  • Start server

    // Port is not necessary. If no port is specified, the system is allocated randomly
    +BaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);
    +
    +// Scan the package in which the CMD command is located
    +server.scanPackage("io.nuls.rpc.mycmd");
    +
    +// Initialization
    +server.init("moduleName", "dependsModule, type is List<String>");
    +
    +// start
    +server.start();
    +
  • Custom CMD

    // extends BaseCmd
    +public class SomeCmd extends BaseCmd
    +
    +//  Custom method to add annotation CmdInfo 
    +@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)
    +public Object methodName(List params) {
    +    System.out.println("I'm version 1");
    +    return success();
    +}
    +
    +Note: rpc-tool automatically transfers the Object[] transferred from client to List<Object>. 
    +
  • There must be and only one CMD class to implement the KernelCmd interface.

    //  Implement interface 
    +public class SomeCmd extends BaseCmd implements KernelCmd 
    +
    +/**
    + *  Receive all module information from kernel 
    + */
    +public Object status(List params);
    +
    +/**
    + * Shut down service: after the existing business is completed
    + */
    +public Object shutdown(List params);
    +
    +/**
    + * Shut down service: close immediately, whether or not the business is completed.
    + */
    +public Object terminate(List params);
    +
    +/**
    + *  Provide local configuration information 
    + */
    +public Object confGet(List params);
    +
    +/**
    + *  Update local configuration information 
    + */
    +public Object confSet(List params);
    +
    +/**
    + *  Reset local configuration information 
    + */
    +public Object confReset(List params);
    +

Client

  • Provide module information to kernel

    RpcClient.versionToKernel();
    +
  • call rpc

    //  CMD corresponds to one interface. 
    +String jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);
    +
    +//  CMD corresponds to multiple interfaces. 
    +String jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);
    +
    +note:
    +params is instance of Object[]     
    +

Data exchange

  • Request

    {
    +  "cmd": "shutdown",
    +  "minVersion": 1.0,  //根据自己需要传最低版本号
    +  "params": [],
    +}
    +
  • Response(success and failure are the same)

    {
    +  "code":0,
    +  "msg": " This property is only available when failed",
    +  "version": "Actually called version",
    +  "result": {}
    +}    
    +

Other

  1. BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:

    @Override
    +@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)
    +public Object status(List params){
    +    return super.status(params);
    +}
    +
  2. There are ways to return to success and failure in BaseCmd.
    +success:

    protected Object success(double version) {
    +    return success(version, null);
    +}
    +
    +protected Object success(double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", 0);
    +    map.put("msg", SUCCESS);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

    fail:

    protected Object fail(String code, String msg, double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", code);
    +    map.put("msg", msg);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

8. supplementary content

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/alpha/transactionModuleDesign.html b/docs/.vuepress/dist/NULS2.0/alpha/transactionModuleDesign.html new file mode 100644 index 00000000..383a5a36 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/alpha/transactionModuleDesign.html @@ -0,0 +1,430 @@ + + + + + + Transaction Management Module Design | NULS + + + + + + + +

Transaction Management Module Design

[TOC]

一、Overview

1.1 Transaction Module

1.1.1 Why need "Transaction Management"

​ In the NULS 2.0 ecosystem, transactions are traded within the blockchain or between chains and chains. The nodes of each chain not only deal with transactions within the chain, but also deal with cross-chain transactions. So each node needs to process more and more transactions, and more complex, so we need a single but separate module to handle various transactions. And from the architectural design of NULS 2.0, we need a separate module to collecting transactions, verification, storage and forwarding of transactions. For all transactions, these functions are shared and unified,so we designed the transaction management as a separate module.

1.1.2 "Transaction Management" What can do

The core work of transaction management has the following two points:

一、Handling of ordinary transactions

  • Collecting transactions
  • Local verification
  • Extract packageable transactions
  • Submit, rollback transaction
  • Save unconfirmed, packageable, and confirmed transactions
  • Provide data query for transactions

二、Processing cross-chain transactions

The transaction management module needs to perform cross-chain verification on cross-chain transactions, while cross-chain verification involves interaction between different nodes in different chains. There are mainly three types of cross-chain transactions that need to be processed.

  1. Friend chain sends a transaction to NULS mainnet

The friend chain node initiates a new cross-chain transaction, which is confirmed inside the friend chain. When the friend chain reaches a certain number of confirmation blocks, the friend chain node will send the cross-chain transaction to the NULS mainnet nodes. For example, the friend chain node A sends the cross-chain transaction to the NULS mainnet node S, and the node S sends the transaction to the node other than the node A in the friend chain for verification. The NULS mainnet node S will receive the verification result of multiple friend chain nodes, and then calculate the node S's own cross-chain verification result, and then broadcast it to other nodes of the NULS mainnet, so each node of the NULS mainnet will The verification result of all other nodes is received, and finally the final verification result of the NULS mainnet is calculated.

  • The transaction management module will receive new cross-chain transactions from the friend chain
  • Verify cross-chain transactions with other nodes in the friend chain
  • Count the verification results of each node
  1. NULS mainnet sends a transaction to the friend chain

The NULS main-net node initiates a new cross-chain transaction. When a certain number of confirmation blocks is reached in the NULS mainnet, the transaction management module will take out the cross-chain transaction and send it to the target chain. For example, the NULS mainnet node S sends the transaction to the target chain node A, and the target chain node A will send the transaction to the NULS mainnet except the node S for verification. After the A node obtains the results of multiple NULS mainnet nodes, it calculates the final cross-chain verification result of the A node and broadcasts it to the target chain. The nodes of the target chain will receive the results of all other nodes, and then calculate the final verification result of the target chain.

  • Send cross-chain transactions to the target chain
  • Receiving the verification request of the target chain node, extracting the corresponding transaction and sending it back
  1. Send a transaction between the friend chain and another friend chain

Since the transaction protocol between the friends chain may be incompatible, the transaction between them needs to be transferred by the NULS mainnet. The process of sending a friend chain to another friend chain is actually to complete the transaction of the friend chain to the NULS mainnet, and the NULS mainnet sends the transaction to the friend chain. The transaction management module plays the same role.

1.1.3 Positioning

Transaction management controls the verification and circulation of all transactions throughout the system.

The following modules need to be used during normal operation.

  • Kernel Module
  • Network Module
  • Chain Manager Module
  • Ledger Module

1.2 Architecture diagram

The module is divided into three parts: interface, implementation layer, local storage

The implementation layer contains 4 parts:

  • Functional implementation logic of the interface
  • Validator manager, call transaction validator as needed
  • Queue for transaction reception, asynchronous verification processing, and push consensus
  • Cache, maintain node group, chain data and other basic data

二、Feature Design

2.1 Functional Architecture Diagram

2.2 The Core Processes

2.2.1 Transaction management caches data from other modules

The basic data of other modules needs to be obtained when the module starts

  • Maintain the basic data of all chains in the chain management module

    The way to get the data is:

    1. After the chain management is started, the chain management module interface is called
    2. When a new chain completes registration, it is acquired periodically, event notification
  • Maintain a collection correspondence between transaction and its validator, processor submission interface, and rollback interface with the transaction type as the key.

    The way to get the data is:

    After each module starts, it calls the transaction management module registration transaction interface to register itself.

2.2.2 Collect new transactions

  • Collect new transactions created by each module of this node

    Newly created transactions for each module (including cross-chain transactions), collected via the interface newTx provided by the transaction management module, When a new transaction is received, basic verification is performed first, then placed in the local transaction queue to be verified, waiting for the verification process.

    Note: There are also cross-chain transactions in the pending local trading queue, which is the local verification process for all transactions.

  • Collect cross-chain transactions broadcast by other nodes

    Cross-chain transactions broadcast by other nodes (provided that the cross-chain transaction has been packaged to confirm a certain height in the chain in which the transaction was created), will be sent by means of network messages, first sent the transaction hash, transaction management module Once received, send a message requesting a full transaction before receiving a full cross-chain transaction. After receiving, the basic verification will also be carried out, and then placed in the cross-chain transaction queue to be verified, waiting for the verification process.

2.2.3 Cross-chain transaction detailed process

For example: initiate a transaction atx from the a address of the A chain, and transfer aCoin to the B chain b address (A --> NULS mainnet --> B)

  • The a address in the A chain is the address of the NULS system format, Start with the A chainId
  • The b address in the B chain is the address of the NULS system format, Start with the B chainId
  • When the asset is transferred to the b address, the b address is not allowed to initiate a transaction in the A chain.

That is: other chain addresses cannot initiate transactions in this chain.

(1) Local process of cross-chain Transaction in the A chain

  1. The ledger module create the transfer transaction atx . If the cross-chain transaction is generated, the cross-chain module needs to be called to create the atx_trans of the NULS mainnet protocol and sign.

    • According to the NULS mainnet protocol, the type, time, remark, and txData are extracted from the atx into the newly generated atx_trans.

    • Extract the CoinData data. If it is a UTXO model, calculate the actual payment amount based on the assets, input, output, and fee, and generate the NULS mainnet protocol (account balance model) "from"

      from_total = input_utxo_total - output_utxo(not change) - fee

      Recalculate the "to" of the NULS mainnet protocol

      to = output_utxo(not change)

      Note: Consider multi-address transfer. Calculate "from" to the owner of UTXO in input. If it is utxo of multiple addresses, calculate the multiple inputs and the output as the utxo owner.

      For example: input has 3 addresses of utxo, transferred to 2 different addresses (not change),and the "from" of the three account balance models is calculated

      from_1 = input_utxo1

      from_2 = input_utxo2

      from_3 = from_total - input_utxo1 - input_utxo2

      to_1 = output(not change)_addr_1

      to_2 = output(not change)_addr_2

      The end result must be:from_total <= input_utxo_total、to_total = output_utxo(total except for change)。

    • If it is the account balance model, extract the corresponding "from" and "to", and generate CoinData of the NULS mainnet protocol.

    • The txData of the atx_trans transaction contains the hash of the atx transaction.

    • Finally, sign the atx_trans transaction and set up scriptSig

  2. The atx_trans cross-chain transaction is sent to the transaction management module via the interface newCrossTx for broadcast. After the atx transfer transaction is generated in the A chain, it is sent to the transaction management module, and the basic format and legality of the transaction data are basically verified by the newTx interface, and then stored in the local transaction queue to be verified.

    • Receive transaction to deserialize data

    • Verify the basic format, legality, and integrity of Transaction data

    • Check the basic format, legality, and integrity of the chain and asset in coinData

  3. The task that validates the transaction will take the transaction from the queue. First, the coinData is verified by the ledger module. After the verification, the corresponding transaction validator is found from the cache with the transaction type, and then the verification interface is called to verify. The verified transaction is broadcasted to other nodes in the chain through newHash, and the transaction atx_trans of the mainnet protocol is broadcasted through newCrossHash, and will be placed in the transaction management module to be packaged in the transaction memory pool, waiting for the consensus package.

    • Check out the pending transaction at regular intervals

    • CoinData is verified by calling the account module interface

    • Verify the transaction by calling the validator interface of the transaction

    • Verify that the passed transaction is placed in the transaction memory pool to be packaged

  4. When the consensus needs to be packaged, the tx_packableTxs interface is called to obtain the packageable transaction set according to the chain id, the specified end packing time, and the maximum capacity value of the transaction data. At this time, the transaction management module obtains the transaction from the transaction memory pool to be packaged, and then performs the transaction. verification.

    • First, take a transaction from the transaction memory pool to be packaged, and then perform a separate verification process (which is basically the same as step 2), and then put the corresponding collection by module.

    • This process is repeated until the specified end packing time or transaction maximum capacity value is reached.

  5. According to the unified verifier of the ledger module, the CoinData of all transactions is verified at one time, the unverified transaction is obtained, and the unverified transaction is filtered out. and the transaction set of each module is verified according to each module unified transaction validator, and the unverified verification is obtained. The transaction then summarizes the results and then returns a packageable transaction set to the consensus module.

  6. After the packaged block is verified, the block management module will call the tx_commit submission interface corresponding to the transaction, call the account module interface to update the balance and other book data, and finally call the save transaction interface tx_save, which means that the transaction is blocked. Chain confirmation.

    PS: If a transaction is a non-cross-chain transaction, the normal transaction process is completed by this step.

(2) Cross-chain transactions enter the cross-chain process

  1. The transaction management module of the A-chain node will always scan the cross-chain transactions in the blockchain. When the atx transaction is confirmed by the blockchain to confirm n heights, the A-chain node transaction management module sends a message to send the atx_trans transaction to the connected NULS mainnet nodes

    Send cross-chain transaction process

    1. The A-chain node Anode1 broadcasts the hash of the atx_trans transaction to the connected NULS mainnet node through the message interfacenewCrossHash.
    2. After the transaction management module obtains the transaction hash, it sends a message to acquire the complete cross-chain transaction to the A-chain node Anode1 through askCrossTx.
    3. The A-chain node Anode1 receives the request, and then sends the complete atx_trans cross-chain transaction to the main network node Mn through newMnTx, and the main network node transaction management module parses and processes the atx_trans transaction.
  2. The NULS mainnet node transaction management module deserializes the atx_trans transaction and then performs a check.

    • Verify the basic format, legality, and integrity of the transaction data
    • Check the basic format, legality, and integrity of the chain and assets in coinData.
  3. For cross-chain verification, the NULS primary network node Mn will send atx_hash (transaction hash before protocol conversion) and atx_trans_hash (complete transaction hash after protocol conversion received by NULS mainnet) through the message interface verifyFc to the node except the Anode1 in the node connected to the A chain to verify the atx_trans transaction.

    Verification logic of node Anode2 performing verification in A chain

    1. After receiving the message, the network module sends the message to the transaction management through the interface verifyFc. The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.
    2. The atx transaction is protocol converted to generate a new Anode2_atx_trans, and then the received atx_trans_hash is consistent with Anode2_atx_trans_hash.

    After the above two verifications, the node Anode2 will send the atx_trans_hash and the acknowledgement height to the NULS mainnet node Mn through verifyResult.

    Note : When the NULS mainnet node sends the cross-chain verification message verifyFc to the A-chain node group through the network module, the transaction management will cache the node information of successful transmission and failure. If the number of nodes successfully sent is less than S (the connection between Mn and A-chain) 51% of the number of nodes is resent to the failed node until S is not less than 51%.

  4. The NULS mainnet node Mn (consensus node) receives the message that the A chain node Anode2 verifies the transaction atx_trans, and sends it to the transaction management through the transaction management verifyResult interface. The transaction management will store the verification result with the successfully sent node. After Mn receives all the verification results sent by the self, it calculates the percentage of the verification pass. If more than 51% of the nodes of all the link nodes pass the verification, the node Mn determines that the verification of the transaction atx_trans is passed, The node that failed to send is considered as failed to pass the verification.

    Summary: The number of verification results received by the node Mn cannot be less than S. If it is less than S, the verifyFc is resent to the node that has not responded to the result. The ordinary node of the NULS mainnet queries any node of the A chain, and the mainnet consensus node queries all nodes of the A chain. The normal node is deemed to have passed the transaction and forwarded the transaction if it is confirmed by any three nodes.

  5. The consensus node Mn signs the cross-chain transaction atx_trans_hash and broadcasts the hash and signature data to the NULS mainnet through the crossNodeRs.

  6. The NULS mainnet consensus nodes receive messages sent by all other consensus nodes, and are collected and summarized by the transaction management module interface crossNodeRs. When the signer of a transaction exceeds 80% of the total number of consensus nodes, it is determined that the cross-chain transaction passed the verification of the mainnet, put in the transaction memory pool to be packaged, and wait for the package confirmation.

  7. When the NULS mainnet node consensus module is to be packaged, the transaction module first takes the transaction (similar to step 4) and verifies the number of signatures of the cross-chain transaction atx_trans again (PS: Since the extracted transaction set contains transactions created by the NULS mainnet, such transactions do not have the step of verifying the number of signatures). CoinData is then verified by the ledger module, and if the transaction meets the requirements, the consensus module is sent into the block.

(3) Cross-chain transactions into the process of the B chain

  1. The transaction management module of the NULS mainnet node will always scan the cross-chain transactions in the blockchain. When the atx_trans transaction is found to be n heights by the blockchain, the atx_trans transaction is sent out to the connected B-chain nodes

    Send a cross-chain transaction process (similar to step 7)

    1. The NULS primary network node Mn first broadcasts the hash of the atx_trans transaction to the connected B-chain node via the message newCrossHash.
    2. The transaction hash obtained by the transaction management module is sent through the askCrossTx to obtain the message of the complete cross-chain transaction to the NULS mainnet node Mn.
    3. After receiving the message, the Mn network module sends the complete atx_trans cross-chain transaction to Bnode1 via newMnTx. After receiving the message, Bnode1 needs to use the cross-chain module to process the atx_trans transaction.
  2. The B-node node Bnode1 transaction management module sends the atx_trans transaction hash (which has been obtained in step 14-2) through verifyMn to the node other than Mn in the node connected to the NULS mainnet to verify the atx_trans transaction.

    Verification logic of node Mn2 performing verification in NULS mainnet

    1. After receiving the message, the network module sends the message to the transaction management through the interface verifyMn. The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.

    After verification, node Mn2 will send the atx_trans_hash and the acknowledgement height to the B-chain node Bnode1 via verifyResult.

  3. When the B-chain node sends the cross-chain verification message verifyMn to the NULS mainnet node group through the network module, the transaction management will cache the node information of the successful transmission and the failure. If the number of successfully sent nodes is smaller than S (S is 51% of the number of nodes connected to the NULS mainnet by Node Bnode1), the information is resent to the failed node. Until S is not less than 51%.

  4. (Similar to step 10) The B-chain node Bnode1 receives the message that the mainnet node Mn verifies the transaction atx_trans, and sends it to the transaction management through the transaction management verifyResult interface, Transaction management caches the verification results against the successful nodes that were sent. After receiving all the verification results sent by the self, Bnode1 calculates the percentage of the verification pass. If more than 51% of the nodes pass the verification, the node Bnode1 determines that the verification of the transaction atx_trans is passed (The node that failed to send is considered as not passing).

  5. After the verification is passed, the transaction management module calls the cross-chain module to convert the atx_trans transaction through the protocol to generate the B-chain protocol transaction btx and broadcast it to the B-chain network through the crossNodeRs. If the Bnode1 node is the B-chain nearest x-block outperger (POW needs Adaptation), the transaction needs to be signed and broadcast to the B-chain network via the crossNodeRs.

  6. The B-chain node receives the messages sent by other nodes, collects and summarizes the transaction management module interface crossNodeRs, and counts the signature of the transaction. When the signer reaches 80% of the latest 20 blockers, the transaction is verified and placed. Enter the packaged transaction memory pool and wait for the package confirmation (The packager also confirms the transaction and the packaged transaction contains all signatures).

  7. (Similar to step 13)When the B-chain node consensus module is packaged, the transaction module first takes out the transaction consistently, verifies the signature number of the transaction btx again, and then verifies the CoinData through the account book module. If the requirements are met, the transaction transmission consensus module is packaged into the block.

  8. When the new block verification is finalized, the entire cross-chain transaction process is completed.

2.3 Module Service

2.3.1 Registration transaction

  • Function description

    The transaction type of each module, the corresponding transaction validator and the processor interface are cached.

  • Process description

    When the NULS mainnet is started, each module needs to register its transaction type, validator and other information with the transaction management module. The transaction management module will cache each transaction and the corresponding validator and processor interface. When a new transaction needs to be verified by the validator, the transaction management module will take out the corresponding validator interface name and call the validator interface for verification.

  • Interface definition

    • method: tx_register

      Interface description:The registration transaction needs to pass the transaction type, the verifier name, and the processor name to return whether the registration is successful.

    • Request

      {
      +    "cmd": "tx_register",
      +    "minVersion": "1.0",
      +    "params":[
      +        "moduleCode", 
      +        "moduleValidateCmd",
      +        [
      +            [
      +                "txType",
      +                "validateCmd",
      +                "commitCmd",
      +                "rollbackCmd",
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ],
      +             [
      +                "txType",
      +                "validateCmd",
      +                "commitCmd",
      +                "rollbackCmd",
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ]
      +         ]
      +    ]
      +}
      +
    • Request parameter

      index type description
      0 String Module code
      1 String Module unified verifier interface name
      2 Array Module transaction registration information list
    • Object of the module transaction registration information list

      index type description
      0 int Transaction Type
      1 String Single transaction validator interface name
      2 String Transaction processor submit interface name
      3 String Transaction processor rollback interface name
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true	
      +  	}
      +}
      +
    • Return

      parameter type description
      value boolean Success
2.3.1.1 Transaction validator, processor interface specification
  • Module unified transaction verifier interface specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chianId", ["txHex","txHex","txHex"]]
      +}
      +
    • Request parameter

      index type description
      0 chianId Chian Id
      1 array Transaction serialization data array
    • Response

      • result:Verify the failed transaction list
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "list":["txHex", "txHex", "txHex"]
      +	}
      +}
      +
      parameter type description
      list jsonArray Verify the failed transaction serialization data array
  • Transaction validator interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex"]
      +}
      +
    • Request parameter

      index type description
      0 int chainId
      1 String Transaction serialization data
    • Response

      • result:Verify the failed transaction list
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Verification passed return true
  • Transaction processor commit interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex","secondaryDataHex"]
      +}
      +
    • Request parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      • result:Commit successfully returns true, failure returns error message
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Commit successfully returns true
  • Transaction processor rollback interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["txHex","secondaryDataHex"]
      +}
      +
    • Request parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      • result:Rollback successfully returns true, failure returns error message
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Rollback successfully returns true

2.3.2 Receive local new transactions

  • Function description:

    Collect newly created transactions from other modules of this node

  • Process description

    When other modules in a node have new transactions, you need to call this interface for unified collection and processing. The transaction management module will place the new transaction in the unconfirmed queue and wait for the transaction thread to process it.

    1. Basic verification of transactions, removal of duplicate transactions, illegally discarding

    2. Put in pending verification local transation queue

  • Interface definition

    • method: newTx

      Interface description:Receive a new transaction serialization data

    • Requset

      {
      +    "cmd": "newTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.3 Get packageable transaction list

  • Function description:

    Extract a packaged transaction list based on the packaging end time and transactions total size

  • Process description

    When the node needs to be packaged, the packaged transaction is obtained according to the chain id, the specified end packing time and transactions total size. The transaction management module will take out the corresponding transaction set from the transaction memory pool to be packaged, and then verify the coinData of all transactions in the collection from the account module at one time, filter out the unverified transaction, obtain the verified collection, and then unify through each module. The transaction validator verifies the transaction set of the respective module and then summarizes the results back to the packageable transaction list.

  • Interface definition

    • method: tx_packableTxs

      Interface description:Return a packaged transaction list

    • Requset

      {
      +    "cmd": "tx_packableTxs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "endtimestamp", "maxTxDataSize"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 long End packaging timestamp
      2 int Transactions total size
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"list":[]
      +  	}
      +}
      +
    • Result

      parameter type description
      list Transaction Transaction list

2.3.4 Transaction commit

  • Function description:

    Execute the transaction processor commit

  • Process description

    The transaction commit interface is invoked when the transaction is packaged into a block and the block validation passes

  • Interface definition

    • method: tx_commit

      Interface description:Call the transaction handler commit interface

    • Requset

      {
      +    "cmd": "tx_commit",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.5 Transaction rollback

  • Function description:

    Execute transaction processor rollback

  • Process description

    The transaction rollback interface is invoked when the transaction is packaged into a block and the block verification fails, or the block is rolled back and the transaction is not a cross-chain transaction.

  • Interface definition

    • method: tx_rollback

      Interface description:Call the transaction handler rollback interface

    • Requset

      {
      +    "cmd": "tx_rollback",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data array
      2 String Block header hash, height, time serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.6 Save transaction

  • Function description:

    Save the transaction in the new block that was verified to the database

  • Process description

    When the block management saves the block, the transaction is sent to the transaction management module for saving.

  • Interface definition

    • method: tx_save

    • Requset

      {
      +    "cmd": "tx_save",
      +    "minVersion": "1.0",
      +    "params": ["chainId", ["txHex", "txHex"]]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 array Transaction serialization data array
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.7 Get transaction

  • Function description:

    Get the transaction that have been packaged into the block from the database

  • Interface definition

    • method: tx_getTx

      Interface description:return transaction serialization data

    • Requset

      {
      +    "cmd": "tx_getTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"tx":"txHex"
      +  	}
      +}
      +
    • Result

      parameter type description
      tx String Transaction serialization data

2.3.8 Delete saved transaction

  • Function description:

    Delete transactions that have been packaged into blocks from the database, block rollback, etc.

  • Interface definition

    • method:tx_delete

      Interface description:return execution result

    • Requset

      {
      +    "cmd": "tx_delete",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.9 Verify transaction

  • Function description:

    Local validation of transactions (including cross-chain transactions), including calling the validator, verifying the coinData. Cross-chain verification of cross-chain transactions is not included.

  • Interface definition

    • method:tx_verify

      Interface description:return execution result

    • Requset

      {
      +    "cmd": "tx_verify",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.10 Receive new transaction hash

  • Function description:

    Receive a message of a new transaction hash broadcast by other nodes in the chain

  • Interface definition

    • method:newHash Receive new transaction hash message

      Interface description:Receive transaction hash serialization data

    • Requset

      {
      +    "cmd": "newHash",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHashHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.11 Receive new cross-chain transaction hash

  • Function description:

    Receive messages for new cross-chain transaction hashes sent by other chains

  • Process description

    When a cross-chain transaction has been confirmed to a certain height within the chain, it will be sent by the transaction module to the target chain (NULS mainnet or the friend chain), and the target chain will receive the transaction for verification. The hash of the transaction is sent first before the transaction is sent, and the interface will receive the hash.

  • Interface definition

    • method: newCrossHash Receive new cross transaction hash

      Interface description:Receive a new transaction hash hex

    • Requset

      {
      +    "cmd": "newCrossHash", 
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHashhex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.12 Receive a new cross-chain transaction for the friend chain (Deprecated)

  • Function description:

    Processing message for new cross-chain transactions sent from other chains to the NULS mainnet

  • Process description

    When the NULS mainnet node receives the cross-chain transaction hash of other chain broadcasts, it will request the complete transaction from the sent hash node. At this time, the node will send the complete transaction and the original hash to the NULS mainnet node.

  • Interface definition

    • method: newFcTx Receive new cross transaction

      Interface description:Receive a new full cross-chain transaction, and the original hash of the transaction (The hash value of the transaction before the conversion of the friend chain agreement).

    • Requset

      {
      +    "cmd": "newFcTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Original transaction hash,and transaction serialization data of NULS mainnet protocol after protocol conversion
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.13 Receive a new complete cross-chain transaction on the mainnet

  • Function description:

    Processing message for new cross-chain transactions sent from the NULS mainnet to the friend chain

  • Process description

    When the friend chain node receives the cross-chain transaction hash broadcast by the NULS mainnet, it will request a complete transaction from the sent hash node, and the node will send the complete transaction partner chain node.

  • Interface definition

    • method: newMnTx Receive new mainnet cross transaction

      Interface description:Transaction serialization data hex

    • Requset

      {
      +    "cmd": "newMnTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.14 Ask for a complete cross-chain transaction

  • Function description:

    Take a complete cross-chain transaction with a certain height confirmed according to the transaction hash, and then send it back by message.

  • Process description

    NULS mainnet has new cross-chain transactions sent to the target chain (or the ordinary chain has a cross-chain transaction sent to the NULS mainnet), the hash is sent to the target chain first, and the target chain node requests a complete transaction from the NULS mainnet according to the hash, and the interface processes the message.

  • Interface definition

    • method: askCrossTx send cross transaction

      Interface description:Receiving the transaction hash sent by the network node

    • Requset

      {
      +    "cmd": "askCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.15 Verify to the friend chain whether the transaction is confirmed

  • Function description:

    The friend chain node receives the message of the cross-chain verification request of the NULS mainnet node

  • Process description

    The NULS mainnet node newly receives the cross-chain transaction, and will verify the transaction to the friend chain (nodes other than the sender) that sent the transaction, and the message to be sent will be processed by the interface.

  • Interface definition

    • method: verifyFc

    • Interface description:Receive cross-chain transaction hash and original hash of the transaction, return confirmation result through network message

    • Requset

      {
      +    "cmd": "verifyFc",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHashHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String [txOriginalHash] Raw transaction hash (before protocol conversion) , [txCrossHash] Cross-chain transaction hash (after protocol conversion)
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.16 Verify to the mainnet whether the transaction is confirmed

  • Function description:

    The NULS mainnet node receives the message of the cross-chain verification request of the friend chain node

  • Process description

    The friend chain node newly receives the cross-chain transaction, and will verify the transaction to the NULS mainnet node (node other than the sender) that sent the transaction, and the message to be sent during the verification is processed by the interface.

  • Interface definition

    • method: verifyMn

    • Interface description:receive cross-chain transaction hash, return confirmation result via network message

    • Requset

      {
      +    "cmd": "verifyMn",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.17 Receive cross-chain verification results

  • Function description:

    Process messages that receive cross - chain transaction validation result

  • Process description

    The NULS mainnet verifies cross - chain transactions to other chain nodes, which send verification results

  • Interface definition

    • method: verifyResult cross result

    • Interface description:receive cross-chain transaction verification results

    • Requset

      {
      +    "cmd": "verifyResult",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "rsHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash and confirmation of highly serialized data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.18 Receive in-chain node verification results for cross-chain transactions

  • Function description:

    Receive in-chain node verification results for cross-chain transactions and statistics.

  • Process description

    The node performs cross-chain verification on a cross-chain transaction, and obtains the cross-chain verification result of the node for the transaction. The node broadcasts the result to other nodes of the chain, and the other node will invoke the interface after receiving the message.

  • Interface definition

    • method: crossNodeRs cross tx node result

    • Interface description:receive sender's signature, cross-chain transaction hash, node verification result

    • Requset

      {
      +    "cmd": "crossNodeRs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "nodeRsHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Sender's signature, cross-chain transaction hash, node verification result Serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.19 View transaction pool information

  • Function description:

    View data in the transaction memory pool

  • Interface definition

    • method: tx_getTxsInfo

    • Interface description:Statistics transaction memory pool data

    • Requset

      {
      +    "cmd": "tx_getTxsInfo",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "localTxCount":111,	
      +      "crossChainTxCount":111,
      +      "pushingCount":111
      +  }
      +}
      +
    • Result

      parameter type description
      localTxCount int Number of local transactions
      crossChainTxCount int Number of cross-chain transactions
      pushingCount int Number of transactions to be packaged

2.3.20 Get transaction registration information

  • Function description:

    Returns the relationship list of the transaction and its corresponding commit processor and rollback processor

  • Interface definition

    • method: tx_getTxProcessors

    • Interface description:return Map<List<String>> jsonObject

    • Requset

      {
      +    "cmd": "tx_getTxProcessors",
      +    "minVersion": "1.0",
      +    "params": ["txType"]
      +}
      +
    • Requset parameter

      index type description
      0 int Transaction type (Fill in NULL to return all types)
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "2":["commitCmd","rollbackCmd"],
      +      "3":["commitCmd","rollbackCmd"],
      +      "4":["commitCmd","rollbackCmd"]
      +  }
      +}
      +
    • Result

      parameter type description
      0 String Commit interface name
      1 String Rollback interface name

2.3.21 Query transaction records

  • Function description:

    Query the transaction list based on conditions such as account, chain, asset, and paging information.

  • Interface definition

    • method: tx_getTxs

    • Interface description:return Page<Transaction>

    • Requset

      {
      +    "cmd": "tx_getTxs",
      +    "minVersion": "1.0",
      +    "params": [
      +    	"ChainId",
      +    	"assetId",
      +    	"type",
      +    	"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",
      +    	"pageSize",
      +    	"pageNumber"
      +    ]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 int AssetId
      2 int Transaction type (Fill in NULL to return all types)
      3 String Address
      4 int Page size
      5 int Page number
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +     "pageNumber": 1,
      +     "pageSize": 10,
      +     "total": 31,
      +     "pages": 4,
      +     "list": []
      +  }
      +}
      +
    • Result

      parameter type description
      pageNumber int Page number
      pageSize int Page size
      total int Total number of records
      pages int Total page number
      list Page Records

2.3.22 Receive cross-chain transactions for local new primary network protocols

  • Function description:

    Collect a complete transaction for the new NULS mainnet protocol for broadcast

  • Interface definition

    • method: newCrossTx

    • Requset

      {
      +    "cmd": "newCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  	value:true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.23 Run chain

  • Function description:

    Run a new subchain locally

  • Interface definition

    • method: tx_runChain

    • Interface description:run a new subchain locally

    • Requset

      {
      +    "cmd": "tx_runChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 Int chainId
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  	"value":true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.24 Stop chain

  • Function description:

    Stop a running subchain locally

  • Interface definition

    • method: tx_stopChain

    • Interface description:Stop a running subchain locally

    • Requset

      {
      +    "cmd": "tx_stopChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

四、Event description

4.1 Published event

​ nothing

4.2 Subscribed event

  • Chain registration event

    Chain information interface for sending verification tx coinData

  • Chain logout event

    Confirmation for terminating the chain transaction

五、Network message body protocol

5.1 BroadcastCrossTxHashMessage

  • Broadcast new cross-chain trading hash

  • Message description:Messages sent when a cross-chain transaction needs to be broadcast to nodes of other nodes or other chains after the chain is confirmed

  • cmd:newCrossHash

Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Hash array
  • Message processing

    • Upon receipt of this message, newCrossHash will send askCrossTxMessage to get the complete cross-chain transaction.

5.2 ReceiveCrossTxMessage

  • Message description:Requesting a complete cross-chain transaction message, for example, the NULS mainnet receives a new cross-chain transaction hash of the friend chain, and the mainnet node will obtain a complete transaction from the friend chain node.
  • cmd:askCrossTx
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
  • Message processing +
    • The message is processed by askCrossTx and will send a SendcrossTxMessage/SendHashcrossTxMessage message to deliver the complete transaction.

5.3 SendHashCrossTxMessage (Deprecated)

  • Message description:The friend chain sends the complete cross-chain transaction converted by the protocol to the NULS mainnet, and the original transaction hash
  • cmd:newFcTx
Length Fields Type Remark
2 chainId uint16 Chain Id
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
1 originalHashDigestAlgType byte Abstract algorithm identifier
? originalHashLength VarInt Hash array length
? originalHash byte[] originalHash友链原始交易hash
  • Message processing +
    • newFcTx will process the transaction after receiving the message, and then cross-chain verification through the message

5.4 VerifyCrossWithFCMessage

  • Message description:Transmit the transaction hash before the protocol conversion, the transaction hash after the protocol conversion, and verify the cross-chain transaction to the friend chain node.
  • cmd:verifyFc
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Transaction hash after converting NULS mainnet protocol
1 originalHashDigestAlgType byte Abstract algorithm identifier
? originalHashLength VarInt Original hash array length
? originalHash byte[] Friends chain original transaction hash
  • Message processing +
    • verifyFc processes the message, validates the result and sends it back via VerifyCrossResultMessage

5.5 VerifyCrossResultMessage

  • Message description:After the node receives the cross-chain verification request, it sends the verification result back.
  • cmd:verifyResult
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
32 hight uint32 Confirm height
  • Message processing +
    • verifyResult calculates the result of its own node after receiving the cross-chain verification result

5.6 SendCrossTxMessage

  • Message description:Send a message for a complete cross-chain transaction
  • cmd:newMnTx
Length Fields Data Type Remark
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
  • Message processing +
    • newMnTx will perform a series of verifications after receiving the transaction. If the node that is not the transaction origin chain receives the transaction, it will perform cross-chain verification.

5.7 VerifyCrossWithMainMessage

  • Message description:The friend chain node sends the cross-chain transaction hash after the protocol conversion, and verifies the cross-chain transaction to the mainnet node.
  • cmd:verifyMn
Length Fields Type Remark
32 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Converted cross-chain transaction hash
  • Message processing +
    • verifyMn processes the message to verify that the transaction is confirmed in the NULS mainnet and sends the result back via the VerifyCrossResultMessage message.

5.8 BroadcastCrossNodeRsMessage

  • Message description:Broadcast the verification result of this node for a cross-chain transaction to other nodes in the chain
  • cmd:crossNodeRs
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
Signature VarByte The verified node's signature on the transaction
2 result boolean Validation result
  • Message processing +
    • The crossNodeRs receives the message, counts the results of all other nodes, and finally calculates the verification result of the transaction for the transaction.

5.9 BroadcastTxMessage

  • Message description:The transaction created by this node broadcasts the hash to other nodes after the local authentication is completed.
  • cmd:newHash
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Hash array
  • Message processing +
    • The newHash interface processes the message and sends the full transaction back.

5.10 SendTxMessage

  • Message description:Send the transaction to other nodes in the chain
  • cmd:newTx
Length Fields Data Type Remark
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
  • Message processing +
    • Enter a new transaction process

六、Module configuration item

[tx-manager]
+bootstrap=io.module.TxManagerModuleBootstrap
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/developModule.html b/docs/.vuepress/dist/NULS2.0/developModule.html new file mode 100644 index 00000000..b6e073e2 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/developModule.html @@ -0,0 +1,29 @@ + + + + + + Develop Business Modules | NULS + + + + + + + +

Develop Business Modules

Before reading this article, please read Package Generation

NULS 2.0 is a blockchain project based on modular development. According to the characteristics of the blockchain and the unique NULS POC consensus mechanism, we have built-in accounts, ledger, network, block management, transaction management, consensus, and intelligent contract modules. These modules can meet the normality of the NULS2.0 blockchain node. run. But the underlying module is unlikely to meet all of the business needs. This article will guide developers on how to add their own modules and how to add their own protocols.

Before adding modules, we should first analyze the requirements of the business. We need to know clearly that the added modules only encapsulate and process the existing protocols, or that the existing protocols do not meet the needs of the business and must be added. The logic of the protocol and protocol handles the function.

This article uses api-module and account two developed modules to illustrate how to add their own modules (both modules are JAVA development, can be downloaded at https://github.com/nuls-io/nuls_2.0 Source code reading).

Only add modules

The api-module module is responsible for secondary parsing of the stored block data in the wallet, providing the wallet page and the browser with information that can be displayed. Therefore the module does not require an additional protocol.

  1. Add a new module to the ModuleE enumeration class

1553663833553

  1. Create a module's Bootstrap startup class

The startup class needs to inherit the RpcModule class for easy management of the mykernel core module. After inheritance, you need to implement a unique method, as shown below:

1553663980380

Add dependent modules: If your module needs to call other modules' interfaces to query related data, or if you need other modules to run, your module can run normally, you need to add the dependent modules here. As shown below:

1553664139545

Module initialization: If the module has data that needs to be initialized, it can be implemented here. The init method must call super.init() to ensure that the dependency injection is successful. As shown below:

1553670103524

Start running: Start the running process to start your own service process, return true after the startup succeeds, if the startup fails, the program will return false after catching the exception, and inform the mykernel core module. As shown below:

1553672430011

The dependent module has been started: Going to this step, the modules you depend on have been successfully started, and you can call the interfaces of other modules at this time.

The main function of the api-module module is to query the interfaces of other modules, and then parse the data and return it to the wallet page display. Therefore, the real operation of the module is done in the scheduleManager.start() step. The internal implementation is detailed in the source code.

1553673258491

At this point, the api-module module has successfully joined nusl2.0. Since there is no new protocol, the module only needs to write the business functions of the module itself.

Add new protocols

​We use the alias trading of the account module to illustrate how to add a new protocol. Alias ​​trading, as its name implies, is that the account sends a transaction with the alias information that the account wants to set. Once the transaction is successfully packaged into the block by the consensus node, it indicates that the account setting alias is successful. The page displays the account alias when the account information is displayed.

Step 1: Add a transaction type

Each transaction requires a separate set of its own transaction type. The transaction type cannot be duplicated with the transaction type of other modules. See the RPC documentation for the transaction types of other modules.

Step 2: Create a transaction logic object

The transaction logic object belongs to the business logic data stored in the transaction, such as the alias information stored in the alias transaction, and the object needs to inherit the TransactionLogicData class. As shown below:

1553678236166

Since the logical data is eventually serialized as a byte array to be broadcast over the network, methods for serialization and deserialization are also needed. As shown below:

1553678379934

Step 3: Create a transaction-related RPC interface. The interface should include creating transactions, verifying transactions, processing transactions, and rolling back transactions.

Users can successfully assemble transactions and broadcast to the entire network by creating a trading interface;

The verification transaction interface will be uniformly called by the transaction management module, and the transaction that fails verification will be discarded;

The verified transaction will be uniformly called by the consensus module to process the transaction interface and stored in the local database;

When there is a block rollback, the block management module uniformly calls the rollback transaction interface to clear the transaction related data stored locally;

For details on the implementation of the code, see: io.nuls.account.rpc.cmd.AliasCmd

Step 4: Start the module registration transaction

When the module is started, you need to register the new transaction of the module with the transaction management module in doStart(), and the corresponding validator and processor, as shown below:

1553680391073

1553680314226

Then, just like api-module, add code related to other business logic in your own module.

Finally, remember to add the module.ncf configuration file under the module's class, as shown below:

1553680677761

1553680686807

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/developerManual.html b/docs/.vuepress/dist/NULS2.0/developerManual.html new file mode 100644 index 00000000..a63cdf6d --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/developerManual.html @@ -0,0 +1,796 @@ + + + + + + Development Manual | NULS + + + + + + + +

Development Manual

1. Introduction

NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.

2. Development environment

2.1 Setup of NULS wallet

2.2 Setup of JDK 8

2.3 Setup of IntelliJ IDEA

NULS smart contract adopts IntelliJ IDEA as development tool

2.4 Setup of NULS smart contract plug-ins

Click to download the plugin

NULS smart contract plug-ins provide the following main functions:

  • Newly create NULS contract project
  • Provide the unavailable Java properties, classes ad methods
  • Compile, package and deploy contracts
  • Display and call contract methods

3. NULS smart contract specifications and syntax

NULS smart contract syntax is a subset of Java syntax, with some restrictions

3.1 NULS smart contract specifications

Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.

3.2 Keywords

Java key words are listed as follows and those not applicable for NULS smart contract will be marked

Access control

  • public
  • protected
  • private

Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class

  • class
  • interface
  • abstract
  • implements
  • extends
  • new

Key words of package

  • import
  • package

Key words of data type

  • byte
  • char
  • boolean
  • short
  • int
  • float
  • long
  • double
  • void
  • null
  • true
  • false

Conditional loops (process control)

  • if
  • else
  • while
  • for
  • switch
  • case
  • default
  • do
  • break
  • continue
  • return
  • instanceof

Error processing

  • catch
  • try
  • finally
  • throw
  • throws

Modification method, class, property and variables

  • static
  • final
  • super
  • this
  • native(not supported)
  • strictfp(not supported)
  • synchronized(not supported)
  • transient(not supported)
  • volatile(not supported)

other

  • enum(not supported)
  • assert(not supported)

3.3 Basic syntax

The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java

  • Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign
  • Basic data type: byte short int long float double char boolean
  • Reference data type: class, interface, array
  • Arithmetic operators: + - * /%++ -
  • Relational operator: > <> = <= ==! =
  • Logical Operators: ! &| ^ && ||
  • Bit operator: &| ^~>> << >>>
  • Assignment operator: =
  • Extension assignment operators: + = - = * = / =
  • String link operator: +
  • Conditional operators: ? :
  • Process control sentence (if, switch, for, while, do...while)

3.4 Available class

NULS smart contract can be developed with the following class

  • io.nuls.contract.sdk.Address
  • io.nuls.contract.sdk.Block
  • io.nuls.contract.sdk.BlockHeader
  • io.nuls.contract.sdk.Contract
  • io.nuls.contract.sdk.Event
  • io.nuls.contract.sdk.Msg
  • io.nuls.contract.sdk.Utils
  • io.nuls.contract.sdk.annotation.View
  • io.nuls.contract.sdk.annotation.Required
  • io.nuls.contract.sdk.annotation.Payable
  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Short
  • java.lang.Character
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Float
  • java.lang.Double
  • java.lang.String
  • java.lang.StringBuilder
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.util.Collection
  • java.util.List
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Map
  • java.util.HashMap
  • java.util.LinkedHashMap
  • java.util.Set
  • java.util.HashSet

3.5 Other restrictions

  • Contract class can have one construction method. No restriction for other classes
  • The maximum gas consumption for executing a contract method once is 10 million, including the method of the @View type, Make sure to optimize the contract code as much as possible.

4. Nuls smart contract example

a simple contract

Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract


+package contracts.examples;
+
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+public class SimpleStorage implements Contract {
+
+    private String storedData;
+
+    @View
+    public String getStoredData() {
+        return storedData;
+    }
+
+    @Payable
+    public void setStoredData(@Required String storedData) {
+        this.storedData = storedData;
+    }
+
+}
+

In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details +The project has several classes and interfaces

When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class

After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status

Explanatory comments

@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Required labels the parameter of @Required. When it is called, there must be transfer-in value

Go to download NULS source code on github, and get some contract examples

5. NULS Contract SDK

Contract SDK provides several classes to be convenient for contract development:

io.nuls.contract.sdk.Address

public class Address {
+
+    private final String address;
+
+    public Address(String address) {
+        valid(address);
+        this.address = address;
+    }
+
+    /**
+     * Get the balance of the address (only the balance of contract address)
+     *
+     * @return
+     */
+    public native BigInteger balance();
+
+    /**
+     * Transfer amount to the address from contract 
+     *
+     * @param value transfer amount (in Na)
+     */
+    public native void transfer(BigInteger value);
+
+    /**
+     * Contract method to call the address
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     */
+    public native void call(String methodName, String methodDesc, String[][] args, BigInteger value);
+
+	/**
+     * Call the contract method of this address with a return value(String)
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     * @return return value after calling the contract
+     */
+    public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value);
+    
+    /**
+     * Verify the address 
+     *
+     * @param address
+     * @see io.nuls.kernel.utils.AddressTool#validAddress(String)
+     */
+    private native void valid(String address);
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Address address1 = (Address) o;
+        return address != null ? address.equals(address1.address) : address1.address == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return address != null ? address.hashCode() : 0;
+    }
+
+    @Override
+    public String toString() {
+        return address;
+    }
+
+}
+

io.nuls.contract.sdk.Block

public class Block {
+
+    /**
+     * Given block’s head
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static native BlockHeader getBlockHeader(long blockNumber);
+
+    /**
+     * Current block’s head
+     *
+     * @return
+     */
+    public static native BlockHeader currentBlockHeader();
+    
+    /**
+     * Newest block’s head
+     *
+     * @return 
+     */
+    public static native BlockHeader newestBlockHeader();
+
+    /**
+     * Given block’s hash
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static String blockhash(long blockNumber) {
+        return getBlockHeader(blockNumber).getHash();
+    }
+
+    /**
+     * 
+     * CCurrent block’s miner address
+     *
+     * @return
+     */
+    public static Address coinbase() {
+        return currentBlockHeader().getPackingAddress();
+    }
+
+    /**
+     * 
+     * Current block’s No.
+     *
+     * @return
+     */
+    public static long number() {
+        return currentBlockHeader().getHeight();
+    }
+
+    /**
+     * 
+     * Current block’s time stamp
+     *
+     * @return
+     */
+    public static long timestamp() {
+        return currentBlockHeader().getTime();
+    }
+    
+}
+

io.nuls.contract.sdk.BlockHeader

public class BlockHeader {
+
+    private String hash;
+    private long time;
+    private long height;
+    private long txCount;
+    private Address packingAddress;
+    private String stateRoot;
+
+    public String getHash() {
+        return hash;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getTxCount() {
+        return txCount;
+    }
+
+    public Address getPackingAddress() {
+        return packingAddress;
+    }
+
+    public String getStateRoot() {
+        return stateRoot;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BlockHeader that = (BlockHeader) o;
+
+        if (time != that.time) return false;
+        if (height != that.height) return false;
+        if (txCount != that.txCount) return false;
+        if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
+        if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
+            return false;
+        return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = hash != null ? hash.hashCode() : 0;
+        result = 31 * result + (int) (time ^ (time >>> 32));
+        result = 31 * result + (int) (height ^ (height >>> 32));
+        result = 31 * result + (int) (txCount ^ (txCount >>> 32));
+        result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
+        result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "BlockHeader{" +
+                "hash='" + hash + '\'' +
+                ", time=" + time +
+                ", height=" + height +
+                ", txCount=" + txCount +
+                ", packingAddress=" + packingAddress +
+                ", stateRoot='" + stateRoot + '\'' +
+                '}';
+    }
+
+}
+

io.nuls.contract.sdk.Contract

/**
+ *  Contract interface, implemented by contract class
+ */
+public interface Contract {
+
+    /**
+     * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.
+     */
+    default void _payable() {
+    }
+
+}
+

io.nuls.contract.sdk.Event

/**
+* Event interface, implemented by event class
+*/
+public interface Event {
+}
+

io.nuls.contract.sdk.Msg

public class Msg {
+
+    /**
+     * Remaining gas
+     *
+     * @return
+     */
+    public static native long gasleft();
+
+    /**
+     * sender of the contract
+     *
+     * @return
+     */
+    public static native Address sender();
+
+    /**
+     * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na
+     *
+     * @return
+     */
+    public static native BigInteger value();
+
+    /**
+     * Gas price
+     *
+     * @return
+     */
+    public static native long gasprice();
+
+    /**
+     * Contract address
+     *
+     * @return
+     */
+    public static native Address address();
+
+}
+

io.nuls.contract.sdk.Utils

public class Utils {
+
+    private Utils() {
+    }
+
+    /**
+     *  Check conditions; if conditions are not met, it will roll back.
+     *
+     * @param expression
+     */
+    public static void require(boolean expression) {
+        if (!expression) {
+            revert();
+        }
+    }
+
+    /**
+     * Check conditions; if conditions are not met, it will roll back
+     *
+     * @param expression
+     * @param errorMessage
+     */
+    public static void require(boolean expression, String errorMessage) {
+        if (!expression) {
+            revert(errorMessage);
+        }
+    }
+
+    /**
+     * Terminate implementation and restore status
+     */
+    public static void revert() {
+        revert(null);
+    }
+
+    /**
+     * Terminate implementation and restore status
+     *
+     * @param errorMessage
+     */
+    public static native void revert(String errorMessage);
+
+    /**
+     * Send events
+     *
+     * @param event
+     */
+    public static native void emit(Event event);
+
+	/**
+     * @param seed a private seed
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom(long seed) {
+        int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode();
+        int hash2 = Msg.address().toString().substring(2).hashCode();
+        int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0;
+        int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode();
+
+        long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4;
+
+        seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+        return ((int) (seed >>> 24) / (float) (1 << 24));
+    }
+
+    /**
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom() {
+        return pseudoRandom(0x5DEECE66DL);
+    }
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param src source string (hex encoding string)
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(String hexString);
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param bytes source byte array
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(byte[] bytes);
+    
+    /**
+     * [Testnet]verify signature data(ECDSA)
+     *
+     * @param data(hex encoding string)
+     * @param signature(hex encoding string)
+     * @param pubkey(hex encoding string)
+     * @return verify result
+     */
+    public static native boolean verifySignatureData(String data, String signature, String pubkey);
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @param algorithm Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+        return getRandomSeed(endHeight, seedCount, "SHA3");
+    }
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @param algorithm   Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long startHeight, long endHeight){
+        return getRandomSeed(startHeight, endHeight, "SHA3");
+    }
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+    
+}
+

io.nuls.contract.sdk.annotation.Payable

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Payable {
+}
+

io.nuls.contract.sdk.annotation.Required

@Required labels the parameter of @Required. When it is called, there must be transfer-in value.

@Target({ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Required {
+}
+

io.nuls.contract.sdk.annotation.View

@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface View {
+}
+

6. Main RPC interface of smart contract

See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)

The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001

6.1 Create smart contract

  • POST /api/contract/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
gasLimit* long max. gas consumption
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "gasLimit": 4687,
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "remark": "asd",
+  "args": []
+}
+

6.2 Estimate the gas consumption for creating smart contract

  • POST /api/contract/imputedgas/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "args": []
+}
+

6.3 Call smart contract

  • POST /api/contract/call
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
contractAddress* string address of smart contract
gasLimit* long max. gas consumption
price* long unit price of implementation contract
value long amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)
methodName* string method name
methodDesc string method signature which may be not transferred if the method name is not repeated
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "password": "",
+  "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U",
+  "gasLimit": 8000,
+  "price": 20,
+  "value": 0,
+  "methodName": "balance",
+  "methodDesc": "",
+  "remark": "qwe"
+  "args": []
+}
+

6.4 Estimate the gas consumption for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedgas/call

6.5 Estimate the price for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedprice

6.6 Terminate smart contract (see Swagger UI)

  • POST /api/contract/delete

6.7 Call the smart contract function which is not linked to blockchain (see Swagger UI)

  • POST /api/contract/view

6.8 Get the implementation results of smart contract (see Swagger UI)

  • GET /api/contract/result/{hash}

6.9 Get the basic information of smart contract (see Swagger UI)

  • GET /api/contract/info/{address}

6.10 Verify if it is contract address (see Swagger UI)

  • GET /api/contract/{address}

6.11 Get the NULS balance of smart contract address (see Swagger UI)

  • GET /api/contract/balance/{address}

6.12 Get the transaction details of smart contract (see Swagger UI)

  • GET /api/contract/tx/{hash}

6.13 Get the transaction list of smart contract (see Swagger UI)

  • GET /api/contract/tx/list/{address}

6.14 Inquire contract UTXO as per address and limit (see Swagger UI)

  • GET /api/contract/limit/{address}/{limit}

6.15 Inquire contract UTXO as per address and amount (see Swagger UI)

  • GET /api/contract/amount/{address}/{amount}

6.16 Transfer amount to smart contract (see Swagger UI)

  • POST /api/contract/transfer

7. Example

7.1 Voting smart contract code segments are as follows

Full code: https://github.com/nuls-io/nuls-vote

package io.nuls.vote.contract;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Utils;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.View;
+import io.nuls.vote.contract.func.BaseVote;
+import io.nuls.vote.contract.func.VoteInterface;
+import io.nuls.vote.contract.model.VoteConfig;
+import io.nuls.vote.contract.model.VoteEntity;
+
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Map;
+
+public class VoteContract implements Contract {
+
+    private VoteInterface baseVote;
+
+    public VoteContract(long minRecognizance) {
+        baseVote = new BaseVote(BigInteger.valueOf(minRecognizance));
+    }
+
+    @Payable
+    public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) {
+        VoteEntity voteEntity = baseVote.create(title, desc, items);
+
+        VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify);
+        boolean success = baseVote.init(voteEntity.getId(), config);
+
+        Utils.require(success);
+
+        return voteEntity;
+    }
+
+    public boolean vote(long voteId, long[] itemIds) {
+        return baseVote.vote(voteId, itemIds);
+    }
+
+    public boolean redemption(long voteId) {
+        return baseVote.redemption(voteId);
+    }
+
+    @View
+    public boolean canVote(long voteId) {
+        return baseVote.canVote(voteId);
+    }
+
+    @View
+    public VoteEntity queryVote(long voteId) {
+        return baseVote.queryVote(voteId);
+    }
+
+    @View
+    public Map<Address, List<Long>> queryVoteResult(long voteId) {
+        return baseVote.queryVoteResult(voteId);
+    }
+
+    @View
+    public boolean queryAddressHasVote(long voteId, Address address) {
+        return baseVote.queryAddressHasVote(voteId, address);
+    }
+}
+
+

If the methods of smart contract include the parameter of array type, please use the following method to transfer parameters

Refer to the create method in the aforesaid voting contract code

{
+  "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf",
+  "password": "",
+  "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4",
+  "gasLimit": 200000,
+  "price": 1,
+  "value": 10000000000,
+  "methodName": "create",
+  "methodDesc": "",
+  "remark": "",
+  "args": [
+     "Test voting 1",
+     "Voting contract 1",
+     [
+       "Option 1",
+       "Option 2",
+       "Option 3"
+     ],
+     1536044066056, 1536184066056, false, 300, false
+   ]
+}
+

7.2 Standard Token Smart contract code segments

Full code: https://github.com/nuls-io/nuls-nrc20

package io.nuls.contract.token;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import static io.nuls.contract.sdk.Utils.emit;
+import static io.nuls.contract.sdk.Utils.require;
+
+public class SimpleToken implements Contract, Token {
+
+    private final String name;
+    private final String symbol;
+    private final int decimals;
+    private BigInteger totalSupply = BigInteger.ZERO;
+
+    private Map<Address, BigInteger> balances = new HashMap<Address, BigInteger>();
+    private Map<Address, Map<Address, BigInteger>> allowed = new HashMap<Address, Map<Address, BigInteger>>();
+
+    @Override
+    @View
+    public String name() {
+        return name;
+    }
+
+    @Override
+    @View
+    public String symbol() {
+        return symbol;
+    }
+
+    @Override
+    @View
+    public int decimals() {
+        return decimals;
+    }
+
+    @Override
+    @View
+    public BigInteger totalSupply() {
+        return totalSupply;
+    }
+
+    public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) {
+        this.name = name;
+        this.symbol = symbol;
+        this.decimals = decimals;
+        totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));;
+        balances.put(Msg.sender(), totalSupply);
+        emit(new TransferEvent(null, Msg.sender(), totalSupply));
+    }
+
+    @Override
+    @View
+    public BigInteger allowance(@Required Address owner, @Required Address spender) {
+        Map<Address, BigInteger> ownerAllowed = allowed.get(owner);
+        if (ownerAllowed == null) {
+            return BigInteger.ZERO;
+        }
+        BigInteger value = ownerAllowed.get(spender);
+        if (value == null) {
+            value = BigInteger.ZERO;
+        }
+        return value;
+    }
+
+    @Override
+    public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) {
+        subtractAllowed(from, Msg.sender(), value);
+        subtractBalance(from, value);
+        addBalance(to, value);
+        emit(new TransferEvent(from, to, value));
+        return true;
+    }
+
+    @Override
+    @View
+    public BigInteger balanceOf(@Required Address owner) {
+        require(owner != null);
+        BigInteger balance = balances.get(owner);
+        if (balance == null) {
+            balance = BigInteger.ZERO;
+        }
+        return balance;
+    }
+
+    @Override
+    public boolean transfer(@Required Address to, @Required BigInteger value) {
+        subtractBalance(Msg.sender(), value);
+        addBalance(to, value);
+        emit(new TransferEvent(Msg.sender(), to, value));
+        return true;
+    }
+
+    @Override
+    public boolean approve(@Required Address spender, @Required BigInteger value) {
+        setAllowed(Msg.sender(), spender, value);
+        emit(new ApprovalEvent(Msg.sender(), spender, value));
+        return true;
+    }
+
+    public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) {
+        addAllowed(Msg.sender(), spender, addedValue);
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) {
+        check(subtractedValue);
+        BigInteger oldValue = allowance(Msg.sender(), spender);
+        if (subtractedValue.compareTo(oldValue) > 0) {
+            setAllowed(Msg.sender(), spender, BigInteger.ZERO);
+        } else {
+            subtractAllowed(Msg.sender(), spender, subtractedValue);
+        }
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    private void addAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance);
+        check(value);
+        setAllowed(address1, address2, allowance.add(value));
+    }
+
+    private void subtractAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance, value, "Insufficient approved token");
+        setAllowed(address1, address2, allowance.subtract(value));
+    }
+
+    private void setAllowed(Address address1, Address address2, BigInteger value) {
+        check(value);
+        Map<Address, BigInteger> address1Allowed = allowed.get(address1);
+        if (address1Allowed == null) {
+            address1Allowed = new HashMap<Address, BigInteger>();
+            allowed.put(address1, address1Allowed);
+        }
+        address1Allowed.put(address2, value);
+    }
+
+    private void addBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(value, "The value must be greater than or equal to 0.");
+        check(balance);
+        balances.put(address, balance.add(value));
+    }
+
+    private void subtractBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(balance, value, "Insufficient balance of token.");
+        balances.put(address, balance.subtract(value));
+    }
+
+    private void check(BigInteger value) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
+    }
+
+    private void check(BigInteger value1, BigInteger value2) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0);
+    }
+
+    private void check(BigInteger value, String msg) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg);
+    }
+
+    private void check(BigInteger value1, BigInteger value2, String msg) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0, msg);
+    }
+
+
+
+}
+
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/howToUseNulsBuildChain.html b/docs/.vuepress/dist/NULS2.0/howToUseNulsBuildChain.html new file mode 100644 index 00000000..a561cd9e --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/howToUseNulsBuildChain.html @@ -0,0 +1,107 @@ + + + + + + Build Chain | NULS + + + + + + + +

Build Chain

Development environment setup

NULS2.0 is an open and non-restricted language underlying platform for blockchain. This paper only refers to the core business modules of blockchain to write the Java environment building process.

1 Environment to prepare

  • install the JDK
  • install Maven
  • install the IntelliJ IDEA development tools
  • install git

2 Clone source code

git clone git@github.com:nuls-io/nuls_2.0.git

3 IDEA imports all maven projects in nuls_2.0

4 Build your own maven project

5 Run all the modules that need to be started

Using NULS2.0 core module to build the basic chain

NULS is a global open source blockchain underlying infrastructure. Making the blockchain simpler is the mission of NULS. This article will describe how to use the NULS core module to quickly build a basic blockchain.

NULS does not limit the attributes of the blockchain. Using the NULS underlying layer, you can build a private chain, a coalition chain, and a public chain. You can build a coin blockchain or build a currency-free blockchain.

1 Understanding the Microservice Architecture of NULS 2.0

img

NULS 2.0 is built on a micro-service architecture with built-in blockchain core business modules, including accounts, transactions, blocks, consensus, etc. When we build a basic blockchain based on NULS 2.0, we will be based on the NULS 2.0 blockchain. The basic functional layer is extended.

Because NULS2.0 already contains the basic functions of the blockchain, when developing its own blockchain, it only needs to organize its own unique business functions, abstract the corresponding protocol, and develop the function into a module inserted into NULS2. 0 can be. For example: Suppose we want to implement a "Notepad Chain". On the basis of NULS, we need to design a "Notepad" business transaction, such as a note transaction, delete a note transaction, our business module needs to do, in this The business logic code is added to the module, and the verification, processing, and rollback functions of the two transactions are implemented, and then the transaction information is reported to the transaction management module to process the transaction related logic.

Understand how to expand the blockchain function, you can design your own functional modules according to the following steps.

2 Modify basic configuration information

To run a blockchain, you need a lot of basic configuration. Each blockchain must have its own configuration parameters. When building a new blockchain, the first thing is to configure its own operating parameters.

The startup script of NULS2.0 supports the way to send configuration files to start the blockchain. The usage is as follows: sh start.sh -c modules.ncf

The modules.ncf can be configured with parameters of each module. The developer can modify the running parameters according to the situation of the own chain. The specific operating parameters are preset as follows:

section param name remark
common chain.id This chain id Uint16, NULS main network is 1, test network is 2
common address.prefix address prefix size letters + numbers, 2-5 characters
common data.root.dir Data Storage Path For all modules to be stored in the same directory, special paths can be configured in any module if needed
common encoding Encoding method Default UTF-8, not recommended to modify
common asset.id Original Master Asset Code NULS 1
common log.root.dir Log Root Log files for each module
common log.level log level log print level debug/info/warn/error.
block data.folder data subfolder used to store block module data, placed under #{data.root.dir}
Block block.max.size Block size max Block size limit, avoid too large blocks too high to participate in the threshold
block block.interval Block Interval
block max.rollback Maximum rollback quantity When this number is exceeded, the system will stop rolling back to avoid major problems
block header.extend.max.size Extended Maximum size Size Limits for Extended Fields in Block Headers
block genesis.block.json.path Genesis Block Description File Genesis Block Description File
consensus data.folder data subfolder used to store consensus module data, placed under #{data.root.dir}
consensus packing.interval Blocking interval
consensus inflation.token.count Annual Issues The number of additional issuances used to reward nodes via coinbase transactions
consensus block.max.size Block size
consensus seed.addresses Consensus Seed Address Multiple Addresses Separated by ","
consensus packing.address.pwd Address Password Password for the packaged address
consensus agent.deposit.min Minimum Margin Quantity When Creating Nodes
consensus agent.deposit.max Maximum Margin Quantity When Creating Nodes
consensus commission.rate.max The maximum commission rate, no more than 100
consensus commission.rate.min Commission Ratio Minimum
consensus deposit.min Single commission minimum amount
consensus agent.total.deposit.max Maximum amount of nodes to accept delegates
consensus packing.token.min When the node's delegate reaches this value, it starts to block
consensus red.punish.lock.time Red Card Lock Time
consensus agent.stop.lock.time Stop Node Lock Time
network data.folder data subfolder
network seeds Seed nodes, separated by ","
network magic.number Magic numbers for isolating other networks
network port port
network nuls.seed NULS2.0 seed node configuration when cross-chaining is required
network cross.listener.port
network nuls.magic.number
contract nrc20.file.path NRC20 protocol description json file path
tx data.folder data subfolder
Ledger data.folder data subfolder
api mongodb.ip mongodb address
api mongodb.port mongodbport
api rpc.listener.ips rpc listener ip can configure multiple
api rpc.port rpc listening port
api req.allow.per.s Concurrency Limits

The table lists the most common configuration items, not all. After the alpha version and the beta version, the team will sort out the list of available configurations for all NULS 2.0 for the majority of blockchain developers to configure their own areas. Blockchain.

[^Note]: Since the NULS2.0-alpha version does not complete the docking of Nulstar, the individual parameters may be modified later, which is subject to the final online version.

### 3 Packaging and booting

After the configuration items of the chain have been modified, you can directly refer to Part 4 of this document: [Packing and Booting] (#Packing and Booting)

Building a blockchain containing business modules

After building your own blockchain using the modular infrastructure of NULS 2.0, you need to develop a business module and integrate it into the base chain to achieve your own unique business. The following sections can provide some guidance on how to develop a business module of your own.

1 Business Module Description

1.1 What is a business module?

A functional module with a custom service based on the bottom of the blockchain. The module can be a microservice module that can communicate with other modules according to the NULS2.0 module protocol, or can be an independent, only through the RPC interface. External application for basic module communication.

The service module does not add or modify the protocol, only extends the basic protocol, and implements its own business through the extension of the protocol.

1.2 How to extend the agreement

NULS provides two ways to extend the protocol. The two methods are similar, as follows:

  • Expand by remark field of transfer transaction

Serialize the data you want to wind up into a byte array and place it in the remark field of the transfer transaction. Place your own magic number at the very beginning of the byte array to distinguish other transfer transactions. Monitor the transfer transactions in all blocks in your own application, and parse and process the business when you find remarks that start with your own magic number.

  • Expanded through established business expansion transactions

NULS provides a specific transaction type for business expansion. The transaction can freely fill in txData, serialize the data to be chained, into a byte array, and put it into the txData of the transfer transaction. Place your own magic numbers in front of the byte array to distinguish between transactions that are not of interest. Monitor the business extension transactions in all blocks in your own application, and find txData with its own module number for parsing and business processing.

Example:

Suppose now that an application is to be implemented, the application's business is: private notepad, the core business is that each address can store the encrypted note text on the blockchain, and can be decrypted and viewed at any time.

1 functional design

1. Add a note: Encrypt the note content and send the encrypted data to the chain;
+
+2. Parse the block data extraction note data: obtain the data of the application from the blockchain, and store the data to the local database;
+
+3. Decrypt view: Get records from the database, decrypt, display decryption results
+
+4. Delete the note: the app is deleted locally, and the data in the blockchain is not deleted.
+

2 blockchain interaction

The above function design needs to interact with the blockchain is 1 new note and 2 parsing block data extraction note data.

  • The implementation of the first function is as follows:
First design the data format as follows
+
+{
+
+  Address:"", / / ​​note owner
+
+  Time:"", / / ​​note time point
+
+  Content:""//Encrypted note content
+
+}
+
+According to the data format, assemble the uplink data: address+time+content;
+
+Determine the magic number of the app, assuming 12345678.
+
+Then assemble the DataTransaction (business extension transaction), set the value of txData to the spliced ​​byte array of 12345678, address, time, content. After paying a sufficient fee, sign the transaction and broadcast the transaction to the network.
+
  • The implementation of the second function is as follows:
Listen to all the blocks, find the 'business expansion transaction' to analyze, first parse to txData, first determine whether it has started 12345678,
+If not, discard the transaction. If yes, continue to parse and determine if address+time+content was successfully obtained (to avoid data confusion caused by repeated magic numbers)
+If the data is successfully parsed, store the data in a local database
+

3 other business implementation

All services that do not need to interact with the blockchain can be designed through conventional application methods, so that a simple blockchain application is completed.

Developing applications using business extensions is a simple, fast and efficient way. NULS's support for business expansion is full and friendly, and it is hoped that more and more people will join the NULS ecosystem.

2 Demand Analysis

Before you start developing modules, you must first identify a few issues:

  • What kind of functions do you need?
  • Is it necessary to add modules to achieve business needs? Can it be implemented in an easier way with existing features?
  • In which way is this module implemented?
  • Ways to extend the basic protocol: no longer add new protocols, expand your own business based on the basic agreement to meet your own needs.
  • Add a new protocol method: you need to add a new protocol, the business logic corresponding to the new protocol, in order to meet your own needs.
  • Modify the basic chain: The above two can not achieve their own business, you need to modify the basic module to meet your own needs.

3 Module Design

After you have identified your needs, you need to design your own modules. The module design depends on the overall design of NULS2.0. When designing its own module, it can focus on designing its own business, and other parts are implemented according to the basic module.

So how do you design your own business? for example:

3.1 Ways to extend the basic protocol:

Case I: Our need is just to store some key information in the chain without complicated logic processing.
+For example, we just want to store a contract related information in the chain, and can be queried at any time in the chain. At this time, we actually don't have to develop any modules. Nuls2.0 provides a transaction (DataTransaction) for storing data. The user only needs to convert the data into a byte array and store it in the txData field or remark field of the transaction. After the broadcast transaction to the whole network, the data can be successful. Winding up. Through the query trading interface provided by nuls2.0, you can query the relevant data of transactions and transactions at any time. Such other business functions can be designed and developed in the form of general software.
+
+Case II: Our needs need to store some key information on the chain and require simple logic processing.
+In general, we recommend users to consider using smart contracts to develop DAPP, such as simple quiz games.
+

3.2 How to add a new agreement

If our requirements are complex and have related logic processes, we must do so by adding new protocols.
+Here we use the nuls poc consensus mechanism to give examples
+Functional design: first organize the functions to be provided according to the requirements, and design new protocols according to the functions.
+The business functions of the nuls poc consensus mechanism are:
+1. The user can create a consensus node by sending a request for the consensus node transaction, and lock the 2-20 million nuls. After the node meets the block condition, it can participate in the package and get the block reward.
+2. Users can participate in the consensus by sending at least 2000 nuls by sending a transaction that joins the consignment consensus, and get a block reward.
+3. The user can unlock the nuls locked by the consignment consensus by sending a transaction that cancels the entrusted consensus. After canceling the entrustment, the reward will not be continued.
+4. The user can send the transaction to let the node exit the consensus. After exiting, all the nuls on the node will be unlocked, and the node will no longer participate in the block.
+
+Protocol design: including protocol serialization and deserialization, transaction validator, transaction confirmation processor, transaction rollback processor, need to pay attention to avoid conflicts with the underlying protocol.
+4 protocols of the poc consensus mechanism: create consensus node transactions, commission transactions, cancel commission transactions, node exit consensus transactions
+Transaction Verifier: Each protocol will have an associated business verifier. When the node receives a new transaction or receives a new block, it will execute the verifier, and the failed transaction will be rejected.
+For example, create a consensus node:
+1) The account that creates the node cannot create the consensus node multiple times;
+2) The margin is between 20,000 and 200,000 nuls;
+3) Whether the account has a red card record;
+Storage design: Stores business data in the protocol as formatted data for providing user functions.
+For example, after creating a consensus node, the bottom layer stores the transaction data of the created node, and also stores related information of the node, such as the name of the consensus node, the current total amount of the consensus node, the credit value of the consensus node, etc.
+
+Interface design: RPC interface that needs to be provided externally
+For example: query consensus node information, query consensus delegation information, etc.
+
+Other: Other internal processing mechanisms are implemented within the module itself according to different business needs. For example, the core processing of the poc consensus is in the ConsensusProcess.
+

3.3 How to modify the base chain

This method differs from the second method only in that it involves the modification of the basic chain. When modifying, you need to fully understand the services of the basic chain. After adapting your own services, you need to perform sufficient tests.
+The modified method can be the way to replace the module: get the source code of the base chain module, modify it, and then release its own module to replace the original base module.
+

4 Module implementation

First of all, the module consists of the following two parts. For the first part, the official version only provides the Java version of lib, and will continue to provide C++, Go and other language versions.

1 nuls-service-base-lib (baselib):

Common, all modules have the same functionality, providing basic communication, interface format, general code, etc. If the developer uses a language that does not provide baselib, you need to develop baselib yourself.

2 module-self:

The module itself needs to make its own implementation in the following ways:

  • Module management

1. Start and stop the script: Provide the module's start and stop scripts in your own module, and ensure that any timing to execute the start and stop scripts will not have a significant impact on the business and data.

2. After the startup, the state management is firstly connected to the Nulstar (microservice manager) through the startup parameters, reporting the information of the module itself, obtaining the information of the dependent module, attempting to communicate with the dependent module, and completing the initialization of the module during this period. And change the state of your own module. After all the modules that are dependent are ready, start running the business of your own module.

3. After the dependent module status changes, the module should be processed according to the changed status.

  • Agreement related

After a new transaction is created in the module, it is necessary to register its own protocol information with the transaction management module each time the module is started, and report the transaction verifier, confirmation processor, and rollback processor information.

  • Network message

After the new module adds the network protocol, the network module needs to subscribe to the message of the network that it needs, so that the network module can send the message to the message processor of the module after receiving the message.

  • data storage

NULS2.0 does not impose any restrictions on data storage, and can freely design and implement its own data storage function according to its own business needs.

  • Function realization

If there are other functions that need to be implemented, you can develop according to your own habits or industry standard specifications. NULS2.0 does not impose any restrictions.

  • Function interface

According to the product design, the implementation of the function interface, NULS2.0 will provide a unified interface call mode, and will support access methods such as JSONRPC2.0/restFul/CMD/WebSocket.

  • Logging

In principle, NULS2.0 does not limit the logging mode of the expansion module. However, it is recommended to collect all the logs into one root directory by referring to the basic chain, which is convenient for backup and viewing.

Summary: The extension of the business module can refer to the underlying infrastructure chain. All modules are equal in the architecture of NULS2.0. If you are unclear, you can learn or copy the solution of the basic module by looking at the basic module code. The follow-up will continue to open up some of the project's extension modules, so that developers can learn from it, making the development module more and more simple.

5 Defining your own agreement

  • The principle of the design agreement: data is streamlined, do not add redundant data in the protocol, and reduce the data size as much as possible.

  • Network messages: message formats, serialization methods, deserialization methods, computational data size methods, subscription interfaces, and logical processors.

  • Trading: transaction format, serialization method, deserialization method, calculation data size method, validator, processor, rollback processor, etc.

6 Debugging

After the design and development work is completed, it is inevitable to test. This part does not include the unit test part of the development process. Only the methods and precautions of the integration test are explained here.

1 Start all modules through NULSTAR to see if their new modules can be started and stopped normally.
+
+2 Test whether the transaction of the newly added module can be sent, and whether various interfaces can be called normally;
+
+3 The main network test, whether the block can be packaged normally, whether the new transaction can be confirmed or rolled back;
+
+4 check the transaction verification logic is rigorous, do not appear security loopholes;
+
+5 Test whether the business of its own module is correct and complete.
+

After all the tests are completed, you can enter the packaging and startup phase.

Packing and launching

1 Packaging

NULS2.0 has its own code packaging mechanism. Because it involves different languages ​​and different development environments, we have developed a unique packaging specification. Please ensure that the new development module follows the packaging specification and has provided the dependencies, scripts, etc. required by the specification. Components and testing the packaging process

Cd /home/nuls2/nuls_2.0
+./package.sh -m
+

After confirming that there is no problem, complete the development of the blockchain, you can hand over the packaged package to the relevant parties for public testing. After testing for a period of time, no problem can be found, you can formally assemble the blockchain network and start your own business. .

2 Startup

  • Compiled successfully will generate the following path file
/home/nuls2/nuls_2.0/RELEASE/bin
+
  • Execute the following command to start all modules in batches with one click
Cd /home/nuls2/nuls_2.0/RELEASE/bin
+./start.sh -c ./moudle.json (specify the moudle.json configuration file to start)
+
  • linux command jps view all module processes:
 ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws
+ ```
+
+- View module startup status
+
+

./checkstatus.sh


+- Stop Engineering Module:
+

Kill process number (the process number corresponds to the process of the mykernel module displayed by jps)

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/ideaPlugin.html b/docs/.vuepress/dist/NULS2.0/ideaPlugin.html new file mode 100644 index 00000000..5b0908e8 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/ideaPlugin.html @@ -0,0 +1,31 @@ + + + + + + IDEA Plugin | NULS + + + + + + + +

IDEA Plugin

1 Install NULS Plugin on IDEA

  • Get NULS plugin ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk

Install

  • Select the said ZIP, and click OK

Install

  • Tick NULS plugin, and click Apply

Install

2 Create a NULS project

create

Input Project name, click finish

create

3 Compile smart contract

Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)

code

4 Set and deploy the node and account for contract

  • Click NULS plugin on the right, and call NULS plugin interface

    code

  • Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address.

    Click + on the top left corner of panel, and select Add Node.

    code

  • Input Node address and clock OK

    code

  • Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.

    code

5 Package contract

  • Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code

    code

  • Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).

    code

  • Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface

    code

    code

6 Deploy contract

  • On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.

    code

  • Parameters following JarFilePath are the parameters of the contract construction function.

    code

  • Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.

    code

  • Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.

    code

  • If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.

    code

  • Review the deployed contract on the top of panel

    code

  • Click the deployed contract to review all method of this contract

    code

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/index.html b/docs/.vuepress/dist/NULS2.0/index.html new file mode 100644 index 00000000..a1a0f800 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/index.html @@ -0,0 +1,21 @@ + + + + + + NULS2.0 Alpha Version is released | NULS + + + + + + + +

NULS2.0 Alpha Version is released

Dear users:

It is a great honor to announce that the NULS2.0 Alpha version has been released at 10:30 am, Beijing time: 2019-03-28. We sincerely invite you to participate in the internal test.

The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture.

The Alpha version test mainly includes:

  • Full functionality of the Linux wallet, such as account creation, import, transfer, node creation, etc
  • Build blockchain based on NULS2.0 core modules
  • Build blockchain including business module

Join Test:

1 Download linux client

2 linux CLI Manual

3 Apply for test NULS and reply: Alpha+address

4 Access blockchain explorer: http://alpha.nulscan.io/

5 Build Blockchain based on NULS2.0

6 Submit bug:https://github.com/nuls-io/nuls_2.0/issues

To learn more about us, visit nuls.io.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/linuxTutorial.html b/docs/.vuepress/dist/NULS2.0/linuxTutorial.html new file mode 100644 index 00000000..cdaf1b26 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/linuxTutorial.html @@ -0,0 +1,681 @@ + + + + + + Linux CLI Manual | NULS + + + + + + + +

Linux CLI Manual

Introduction

This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.

Version update history

Versions Date Contents
V1.0.0 2018-03-18 alpha

Preparation

Server hardware configuration

The server for NULS node should be not lower than the following configuration:

CPU Memory Disk space Bandwidth
4-Core 3.0 GHz 16GB 128GB 20Mbps uplink

Recommended configuration:

CPU Memory Disk space Bandwidth
8-core 3.0 GHz 32GB 256GB 100Mbps uplink

System and kernel version

Linux system

  • CentOS 6, 7

The Linux kernel version is recommended to use 2.6.32 and above

Get started

Download

  • Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release
  • After entering the interface of NULS official wallet download, select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.

To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:

  $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
+

Note: the download address may be different if there are subsequent versions.

Installation

  • Extract the downloaded file in Linux
  $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz
+

Run

  • Enter the extracted directory and run the boot script to start the full node wallet
  $ cd NULS-Wallet-linux64-2.0.0-alpha-1
+  $ ./start.sh
+

Use wallet

Quick start

  • After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.

Enter the cmdclient/1.0.0 directory and execute the following command:

  $ cd cmdclient/1.0.0
+  $ ./cmd.sh
+

At this point, you can see the input prompt nuls>>>, now you can directly type NULS wallet command to operate. +For example, to create an account you can do like this:

  nuls>>> create
+  Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+  Enter your password:*********
+  Please confirm new password:*********
+  [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
+  nuls>>>
+

Command create means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.

Convention

  • Password rules: password length varies from 8 to 20 and must contain both letters and digits.
  • Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.

Wallet command

Help command

Print all valid commands,

  • command: help [-a]|[group]|[command]
Parameter Description
-a format the printed command, optional
command view instructions for the specific command
group view all instructions for the commands in the specific command group

Return: help

getaccount <address> --get account information
+

Return: help-a

getaccount <address> --get account information
+    OPTIONS:
+    <address> the account address - Required
+

Example

nuls>>> help
+nuls>>> help -a
+nuls>>> help account
+nuls>>> help create
+

Create an account

Create an account and return the set of account addresses

  • command: create [number]
Parameter Description
[number] the number of accounts you want to create, optional

When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.

Return: accounts set

[ "5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r", "5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p" ]
+

Example

Create a single account

nuls>>> create 
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]
+

Create multiple accounts at once

nuls>>> create 3
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]
+

Back up account

To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account

  • command: backup <address> [path]
Parameter Description
<address> account address, required
[path] the directory where the generated backup file is included, current directory by default, optional

Return

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Example: backup an account with password

shell
+nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj
+Enter account password
+***************
+The path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+

Remove account

Enter the password to remove a local account based on the account address

  • command: remove <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+Enter your password for account**********
+Success
+

Modify account password

Set a new password according to the account address and password.

  • command:resetpwd <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N
+Enter your old password:**********
+Enter new password**********
+Please confirm new password:**********
+Success
+

Set alias

Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source

  • command: setalias <address> <alias>
Parameter Description
<address> account address, required
<alias> alias name, required

Return: transaction hash

txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Example

nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj
+Enter your account password**********
+txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582
+

Import account keystore

Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.

  • command: importkeystore <path>
Parameter Description
<path> path of the keystore file to be imported, required

Note: the original password is required to import the keystore file to generate the account

Return: address of the imported account

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+

Import account private key

Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.

  • command: import <privatekey>
Parameter Description
<privatekey> account's private key, required
"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+

Query account information

Query account information with the account address

  • ** command: getaccount <address>**
Parameter Description
<address> account address, required

Return

{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  // the encrypted private key
+  "alias" : "zlj",  // alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets 
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets 
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //public key
+}
+

Example

nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //encrypted private key 
+  "alias" : "zlj",  //alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key 
+}
+

Query account list

Query the account list with the paging parameters and return all accounts in descending order by creation time.

  • ** command: getaccounts <pageNumber> <pageSize>**
Parameter Description
<pageNumber> page number indicating the page to query, required
<pageSize> number of rows displayed per page, required

Return: accounts set

[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Example: get accounts list

nuls>>> getaccounts
+[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //encrypted public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //encrypted private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Query account's private key

Query the account’s private key with the account address and password

  • command: getprikey <address>
Parameter Description
<address> account address, required

Return: the private key of the imported account (unencrypted)

00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+

Example

nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9
+Enter your account password**********
+7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678
+

Query account balance

Query account balance with the account address

  • command: getbalance <address>
Parameter Description
<address> account address, required

Return: the address of the imported account

{
+"total": "9999998.99",// balance
+"freeze": "0", // locked balance
+"available": "9999998.99"// usable balance
+}
+

Example

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "total" : "9999998.99",
+  "freeze" : "0",
+  "available" : "9999998.99"
+}
+

Transfer

Transfer NULS to the specific account with the account address

  • command:transfer <formAddress>|<formAlias> <toAddress>|<toAlias> <amount> [remark]
Parameter Description
<fromAddress> sender address(Select any item with the fromAlias)
<fromAlias> sender address alias(Select any item with the fromAddress)
<toAddress> receiver address(Select any item with the toAlias)
<toAlias> receiver address(Select any item with the toAddress)
<amount> transfer amount, required
[remark] remark, optional

Return: transfer transaction hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Example

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer
+Please enter the password.
+Enter your password: *********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Query transaction details

Query the transaction details with the transaction hash

  • ** command: gettx <hash>**
Parameter Description
<hash> transaction hash, optional

Return: transaction details

{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Example: query transfer transaction

nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f
+{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Enumeration type description

/** coinbase transaction*/
+    int TX_TYPE_COINBASE = 1;
+    /** transfer */
+    int TX_TYPE_TRANSFER = 2;
+    /** set alias */
+    int TX_TYPE_ALIAS = 3;
+    /** create consensus node */
+    int TX_TYPE_REGISTER_AGENT = 4;
+    /** agent (join consensus) */
+    int TX_TYPE_JOIN_CONSENSUS = 5;
+    /** cancel agent (cancel consensus)*/
+    int TX_TYPE_CANCEL_DEPOSIT = 6;
+    /** yellow punish */
+    int TX_TYPE_YELLOW_PUNISH = 7;
+    /** red punish */
+    int TX_TYPE_RED_PUNISH = 8;
+    /** stop node (stop consensus node)*/
+    int TX_TYPE_STOP_AGENT = 9;
+    /** cross-chain transfer */
+    int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;
+    /** register chain */
+    int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;
+    /** destroy chain*/
+    int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;
+    /** add asset to chain*/
+    int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;
+    /** remove asset from chain*/
+    int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;
+    /** create contract */
+    int TX_TYPE_CREATE_CONTRACT = 100;
+    /** call contract */
+    int TX_TYPE_CALL_CONTRACT = 101;
+    /** delete contract*/
+    int TX_TYPE_DELETE_CONTRACT = 102;
+

Transfer by alias

Transfer to an external address with an account alias

  • order: transfer <address> <toAddress> <amount> [remark]
Parameter Description
<address> sender address, required
<toAddress> receiver address, required
<amount> transfer amount, required
[remark] remark, optional

Return: transaction hash

00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Example: transfer 10,000 NULS to external address through alias "zlj"

nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000
+Enter your account password**********
+00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Create node

To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.

  • command: createagent <agentAddress> <packingAddress> <commissionRate> <deposit>
Parameter Description
<agentAddress> account address to create a node, required
<packingAddress> account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)
<commissionRate> agent commission ratio with a range from 10 to 100, required
<deposit> deposit to create a node, no less than 2000 NULS, required

Return: agent hash of the node

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password: **********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Join consensus (agent node)

Join consensus by account address and node agentHash, which requires at least 2,000NULS

  • command: deposit <address> <agentHash> <deposit>
Parameter Description
<address> account address, required
<agentHash> agentHash of the node, optional
<deposit> deposit required to join consensus, no less than 2000NULS, required

Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Example

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Cancel consensus (cancel agent)

Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.

  • command: withdraw <address> <txHash>
Parameter Description
<address> account address, required
<txHash> hash of the agent transaction, required

Return: transaction hash to cancel consensus

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Example

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Stop agent

Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.

  • command: stopagent <address>
Parameter Description
<address> account address, required

Return: transaction hash to stop a node

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Example

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Get the latest information of block header

Get the latest block header’s information

  • command: getbestblockheader

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash 
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block 
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block singnature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  // packing address
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example

nuls>>> getbestblockheader
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",
+  "time" : "2019-03-19 18:26:20.020",
+  "height" : 1479,
+  "txCount" : 0,
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",
+  "size" : 0,
+  "packingAddress" : null,
+  "roundIndex" : 155299118,
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1,
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Query block header information

Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.

  • command: getblock <hash> | <height>
Parameter Description
<hash> block hash
<height> block height

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example: get block with block height

nuls>>> getblock 28115
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Create smart contracts

This interface is called to create a smart contract on the chain

  • command:createcontract <sender> <gaslimt> <price> <contractCode> [remark]
Parameter Description
<sender> Create the account address for the smart contract
<gaslimt> Consumes of the gas for creating the contract
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractCode> Hex code of the contract code
[remark] remark

Returns the transaction hash for which the contract was created and the address of the contract

{
+  "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f",  //transaction hash
+  "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address
+}
+

The example creates a contract (contractCode omits the middle)

nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo
+The arguments structure: 
+[ {
+  "type" : "String",
+  "name" : "name",
+  "required" : true
+}, {
+  "type" : "String",
+  "name" : "symbol",
+  "required" : true
+}, {
+  "type" : "BigInteger",
+  "name" : "initialAmount",
+  "required" : true
+}, {
+  "type" : "int",
+  "name" : "decimals",
+  "required" : true
+} ]
+Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'").
+Enter the arguments:"KQB","KQB",10000,2
+{
+  "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"
+}
+

Get contract basic information

Gets the description of the intelligent contract and the argument list of the constructor and the calling method

  • command:getcontractinfo <contract address>
Parameter Description
<contract address> contract address

Return

Skip
+

example


+nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+{
+  "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+  "createTime" : 1553563706022,
+  "blockHeight" : 46,
+  "isNrc20" : true,
+  "nrc20TokenName" : "QKB",
+  "nrc20TokenSymbol" : "QKB",
+  "decimals" : 2,
+  "totalSupply" : "200000000",
+  "status" : "normal",
+  "method" : [ {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },{
+    "name" : "transfer",
+    "desc" : "(Address to, BigInteger value) return boolean",
+    "args" : [ {
+      "type" : "Address",
+      "name" : "to",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "value",
+      "required" : true
+    } ],
+    "returnArg" : "boolean",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  }]
+}
+
+

Invoke smart contracts

Call the functions provided by the smart contract

  • command:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]
Parameter Description
<senderAddress> The account address of the invocation contract
<gasLimit> This contract is the largest consumption of Gas
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractAddress The contract address of the call
<methodName> The method name of the contract
<value> If transfer is to be made to the contract, the amount of transfer
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract
[-r remark] remark

Returns: transaction hash

"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash
+

The example calls the nrc20-token transfer function for a specified contract, Example tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L NRC20 contract address, number of input parameters for receiving address and account transfer

nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+Please Enter your account passwordzhoujun172
+**********
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2
+"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"
+

Delete smart contract

Stop an available smart contract

  • commmand:deletecontract <senderAddress> <contractAddress>
Parameter Description
<senderAddress> The account address of the invocation contract
<contractAddress> The contract address of the call

Returns: trading hash

"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash
+

example

nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+Please enter your account passwordzhoujun172
+**********
+"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"
+

Call the contract view method

Calling the contract view method immediately returns the result and no transaction is generated

  • commmand:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract
Parameter Description
<contractAddress> The contract address of the call
<methodName> Method called
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract

The return value

The return value varies depending on the function being called
+

The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address

nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+{
+  "result" : "20000000"
+}
+

Transfer money to the contract address

To the specified contract address into the main network currency

  • command:transfertocontract <senderAddress> <contractAddress> <amount> [remark]
Parameter Description
<senderAddress> Transfer out account address
<contractAddress transfer into the contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

Example passes two NULS to the specified contract

nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark
+Please enter your account password
+**********
+"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

token transfer

NRC20 token transfer

  • command:tokentransfer <formAddress> <toAddress> <contractAddress> <amount> [remark]
Parameter Description
<formAddress> sender address
<toAddress receiver address
<contractAddress> contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

example token transfer:

nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD  tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta  tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000
+Please enter your account password
+**********
+"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

Get contract transaction

Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results

  • command:getcontracttx <hash>
Parameter Description
<hash> transaction hash

return value

skip 
+

example

nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "type" : "100",
+  "time" : "2019-03-26 09:28:26",
+  "blockHeight" : 46,
+  "fee" : 0.0,
+  "value" : 0.0,
+  "remark" : null,
+  "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",
+  "status" : "confirm",
+  "confirmCount" : 0,
+  "size" : 6686,
+  "inputs" : [ {
+    "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "assetsChainId" : 2,
+    "assetsId" : 1,
+    "amount" : "5700000",
+    "nonce" : "ffffffff",
+    "locked" : 0,
+    "value" : 0.0
+  } ],
+  "outputs" : [ ],
+  "txData" : {
+    "data" : {
+      "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "value" : 0.0,
+      "hexCode" : "504b03040a0000080...........31600000000",
+      "gasLimit" : 200000,
+      "price" : "0.00000025",
+      "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]
+    }
+  },
+  "contractResult" : {
+    "success" : true,
+    "errorMessage" : null,
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "result" : null,
+    "gasLimit" : 200000,
+    "gasUsed" : 14029,
+    "price" : "0.00000025",
+    "totalFee" : 0.0,
+    "txSizeFee" : 0.0,
+    "actualContractFee" : 0.0,
+    "refundFee" : 0.0,
+    "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+    "value" : 0.0,
+    "stackTrace" : null,
+    "balance" : 0.0,
+    "transfers" : [ ],
+    "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+    "tokenTransfers" : [ {
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "from" : null,
+      "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "value" : "200000000",
+      "name" : "QKB",
+      "symbol" : "QKB",
+      "decimals" : 2
+    } ],
+    "remark" : "create"
+  }
+}
+
+
+

Get the contract execution result

Gets the execution result of a contract

  • command:getcontractresult <hash>
Parameter Description
<hash> transaction hash

return value

skip
+

example

nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "success" : true,
+  "errorMessage" : null,
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "result" : null,
+  "gasLimit" : 200000,
+  "gasUsed" : 14029,
+  "price" : "0.00000025",
+  "totalFee" : 0.0,
+  "txSizeFee" : 0.0,
+  "actualContractFee" : 0.0,
+  "refundFee" : 0.0,
+  "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+  "value" : 0.0,
+  "stackTrace" : null,
+  "balance" : 0.0,
+  "transfers" : [ ],
+  "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+  "tokenTransfers" : [ {
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "from" : null,
+    "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "value" : "200000000",
+    "name" : "QKB",
+    "symbol" : "QKB",
+    "decimals" : 2
+  } ],
+  "remark" : "create"
+}
+
+

Get the contract constructor

Gets the list of parameters that need to be passed in to create the specified contract

  • command:getcontractcontructor <contractCode>
Parameter Description
<contractCode> Hex code of the contract code

return value

skip
+

example

nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000
+{
+  "constructor" : {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },
+  "isNrc20" : true
+}
+
+

Gets the list of contracts created for the specified account

Gets the list of contracts created by the specified account address

  • command:getaccountcontracts <createAddress>
Parameter Description
<createAddress> account address

return value

{
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}
+

example

nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD
+[ {
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",
+  "createTime" : "2019-03-25 16:08:25.025",
+  "height" : 253,
+  "confirmCount" : 195,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",
+  "createTime" : "2019-03-25 15:33:54.054",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+} ]
+

Query network information

Query network basic information

  • command: network info

Return

{
+  "localBestHeight" : 35317,//latest block height locally 
+  "netBestHeight" : 35317,//latest block height of the network 
+  "timeOffset" : "0ms",//network time offset 
+  "inCount" : 0,//number of in-nodes 
+  "outCount" : 1//number of out-nodes 
+}
+

Example

nuls>>> network info
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

Query network node IP

Query the network node IP

  • command: network nodes

Return information

[" 192.168.1.223 "]
+

Example: get a block with the block height

nuls>>> network nodes
+[ "192.168.1.223" ]
+

Exit the wallet CLI

Exit the command line that operates the wallet, while it won’t stop the launched wallet node.

  • command: exit

Example

nuls>>> exit
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/packageGeneration.html b/docs/.vuepress/dist/NULS2.0/packageGeneration.html new file mode 100644 index 00000000..84c9b2d2 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/packageGeneration.html @@ -0,0 +1,43 @@ + + + + + + Package Generation | NULS + + + + + + + +

Package Generation

Essential knowledge

The Nuls2 base module is developed using java11, which uses a distributed multi-module micro-service architecture, and uses websocket for communication between modules. However, there is no language requirement between modules. The language that can support the websocket protocol for network programming can be a module of NULS2, so you need to have a certain understanding of the websocket protocol.

Get the program source code

The source code for NULS2 is hosted on github.com and is freely available to anyone. Project address nuls_2.0, see git for how to get it.

Debugger

If you want to develop or debug the source code of NULS2, you need to prepare the development environment, install JDK11.0.2, apache maven 3.3, and a development tool. We recommend IntelliJ IDEA. After the development environment and source code are ready, import the program module in IDEA by importing the maven project.

modules

The module with the module.ncf file in the root directory of the module is defined as the nuls2 submodule, where mykernel is the core scheduling module, which is responsible for other submodule registration services. The startup class of each module is named XXXXBootstrap, and the main function of the startup class is used to start the module.

In the development environment, you first need to start the mykernel module, and then start other modules, the dependencies between modules are automatically controlled by the framework. When the "MYKELNEL STARTED. PORT:8887" is printed in the log, the mykernel module is successfully started.

Start other modules (take the ledger module as an example), find the LedgerBootstrap class, and run the main function.

When the log prints "RMB:module state : Running", the module starts successfully.

Generating executable packages

Once you have the source code, you can generate your own scripts from the source code. Run the script package.sh in the nuls2.0 root directory to execute the automatic packager (the script needs to rely on jdk11, maven3.3, git).

Execute the packager and copy the JDK in the /usr/local/java/jdk11.0.2 directory to the runtime directory to the wallet directory. The wallet can run the program output to the relative directory of ../NULS2.

./package.sh -J /usr/local/java/jdk11.0.2 -o ../NULS2
+

When the log outputs XXXX PACKAGE FINISH, the packager is successfully generated.

More package.sh script parameters can be viewed with help in -h.

Lijunzhou:nuls_2.0 zhoulijun$ ./package.sh -h
+     Desc: Use this script to generate an executable submodule that conforms to the NULSTAR specification.
+     All submodules are configured according to module.ncf, packaged with the mvn command, and generate start and stop scripts.
+     Usage: ./package.sh
+     -b <branch> Synchronize the latest code before packaging. Parameter is the remote branch name for synchronization.
+     -p Synchronize the latest code before packing. Pull from the master branch
+     -o <directory> specifies the output directory
+     -h View help
+     -j JAVA_HOME
+     -J outputs the jvm virtual machine directory, the script will copy this directory to the program dependencies
+     -i skip mvn package
+     -z generates a tarball
+     Author: zlj
+

Please refer to the [Command Line User Manual] (/zh/NULS2.0/linuxTutorial.html) for how to use the wallet.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/quickStart.html b/docs/.vuepress/dist/NULS2.0/quickStart.html new file mode 100644 index 00000000..f90dc2bc --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/quickStart.html @@ -0,0 +1,53 @@ + + + + + + Quick Start | NULS + + + + + + + +

Quick Start

Install JDK11

Download JDK11 to the server and extract it.

1 download jdk11

Jdk11 download address: [jdk11 download] (https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html)

2 upload to the server and extract

Tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz
+

20190327142342

3 configuration environment

vi /ect/profile

Copy the following code to the file

JAVA_HOME=/home/nuls2/jdk-11.0.2
+PATH=$PATH:$JAVA_HOME/bin
+CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
+Export JAVA_HOME PATH CLASSPATH
+

ps: /home/nuls2/jdk-11.0.2 is the path after jdk is pressurized, please configure according to your actual path.

source /ect/profile The configuration of this command takes effect.

View the jdk version via java -version:

20190327143435

Download and install the wallet

1 download NULS wallet

Go to GitHub and download the latest version of the NULS2.0 Alpha1 wallet: [download address] (https://github.com/nuls-io/nuls_2.0/releases)

2 upload to the server and extract

Tar -zxvf NULS-Walltet-linux64-alpha1.tar.gz
+

20190327144549

Enter the CLI

1 start the wallet

After the wallet is decompressed, go to the start.sh file directory: /home/nuls2/NULS-Walltet-linux64-alpha1/bin

20190327150757

Execute the command: ./start.sh -D

2 enter the command line

After the wallet is started, execute cmd.sh (./cmd.sh) in the same directory to enter the wallet command line. The NULS command prompts the prompt: nuls>gt;&gt;, enter the NULS wallet operation command, and operate .

20190327223858

Part of Instructions

1 create an account

Command: create [Number]

Number: The number of account addresses created. The default is 1 and the maximum is 100.
+

2 Backup keystore

Command: backup <address> [Path]

Address: Account address to be backed up (required)
+Path: The directory where the backup file is generated. The default is the current directory (optional)
+

3 Get the private key

Command: getprikey <address>

Address: Account address for obtaining the private key (required)
+

4 remove the account

Command: remove <address>

Address: address to be removed (required)
+

5 modify the account password

Command: resetpwd <address>

Address: Account address to change the password (required)
+

6 Transfer

Command: transfer <FormAddress/FormAlias> <ToAddress/ToAlias><amount> [Remark]

FormAddress/FormAlias: Transfer the address or export the alias, choose one (required)
+ToAddress/ToAlias: Receive address or receive alias, choose one (required)
+

7 create a consensus node

Command: createagent <AgentAddress> <PackingAddress> <CommissionRate> <Deposit> [RewardAddress]

AgentAddress: Consensus node creation address (required)
+PackingAddress: The address of the consensus node is packed. The password must be the same as the configuration file. The default is: nuls123456 (required)
+CommissionRate: commission ratio, range: 10-100, maximum decimal place 2 digits (required) Deposit: margin, range: 20000-200000, maximum decimal place 8 digits (required) RewardAddress: reward address, default is node creation address ( Optional)
+

ps: Save the hash of the consensus node (or query in [Browser] (http://alpha.nulscan.io)), join the consensus and query consensus node information needs to be used; Ensure that the consensus node creates an address and a packaged address in one wallet, and one wallet cannot create two consensus nodes at the same time.

8 join the consensus

Command: deposit<Address><AgentHash><Deposit>

Address: Account address to join the consensus (required)
+AgentHash: Create a hash of the consensus node (required)
+Deposit: Join the consensus deposit, 2000-500000, up to 8 decimal places (required)
+

ps: Save the consensus hash, you need to use the exit consensus

9 Exit the consensus

Command: withdraw<Address><TxHash>

Address: Exit consensus address (required)
+TxHash: transaction hash at the time of delegation (required)
+

10 stop consensus node

Command: stopagent<Address>

Address: Consensus node creation address (required)
+

11 query consensus node information

Command: getagent<AgentHash>

AgentHash: Consensus node creates hash (required)
+
Last Updated: 3/28/2019, 11:34:44 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/smartContractFee.html b/docs/.vuepress/dist/NULS2.0/smartContractFee.html new file mode 100644 index 00000000..d19af3a7 --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/smartContractFee.html @@ -0,0 +1,45 @@ + + + + + + Service Charge | NULS + + + + + + + +

Service Charge

1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?

Background: Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.

In the main-net, there are now three more types of transactions: creating a smart contract, invoking a smart contract, deleting a smart contract

The difference between those three transactions and other transactions such as transfer is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.

  • Calculation of smart contract service charge
public static final int COMPARISON = 1 ; //Compare bytecode 
+public static final int CONSTANT = 1 ; //Simple numeric type bytecode 
+public static final int LDC = 1 ; //Numeric constant, string constant (length * LDC) 
+public static final int CONTROL = . 5 ; //Control bytecode 
+public static final int TABLESWITCH = 2 ; //Switch bytecode (size * TABLESWITCH) 
+public static final int LOOKUPSWITCH = 2 ; //Switch bytecode (size * LOOKUPSWITCH) 
+public static final int CONVERSION = 1 ; //Value conversion 
+public static final int EXTENDED = 1 ; //Null determine 
+public static final int MULTIANEWARRAY = 1 ; //Multidimensional Array (size * MULTIANEWARRAY) 
+public static final int LOAD = 1 ; / /Send the local variable to the top of the stack 
+public static final int ARRAYLOAD = 5 ; / /Send an item of the array to the top of the stack
+public static final int MATH = 1 ; //Mathematical operations and shift operations 
+public static final int REFERENCE = 10 ; //Object related operations 
+public static final int NEWARRAY = 1 ; //One-dimensional array (size * NEWARRAY) 
+public static final int STACK = 2 ; //Stack operation 
+public static final int STORE = 1 ; // Save the value in the top of the stack to a local variable 
+public static final int ARRAYSTORE = 5; //Save the value of the stack to an array 
+public static final int TRANSFER = 1000 ; //Transfer transaction
+
+
  • Total service charge for invoking a smart contract +The total service charge for a contract transaction consists of three parts
  • The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.

  • The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.

For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.

  • The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.

Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • How much does a contract invoker pay?

To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • Who receives the service charge?

Precondition:This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.

The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULS2.0/startSmartContract.html b/docs/.vuepress/dist/NULS2.0/startSmartContract.html new file mode 100644 index 00000000..bc30d2bf --- /dev/null +++ b/docs/.vuepress/dist/NULS2.0/startSmartContract.html @@ -0,0 +1,79 @@ + + + + + + Quick Start | NULS + + + + + + + +

Quick Start

1. Running the test-net environment, creating an account, and claiming test tokens.

Preparations for deployment and invocation of smart contracts

2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins

Preparations for the development of smart contract code

[Downloading JDK8] +(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)

[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)

[Downloading NULS smart contract plug-ins] +(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)

[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)

3. Smart contract example

_Quickly compile and deploy a smart contract with the example _

  • Simple example

+Import io.nuls.contract.sdk.Contract;
+Import io.nuls.contract.sdk.Msg;
+Import io.nuls.contract.sdk.annotation.Payable;
+Import io.nuls.contract.sdk.annotation.Required;
+Import io.nuls.contract.sdk.annotation.View;
+
+Import java.math.BigDecimal;
+Import java.math.BigInteger;
+
+Public class SimpleContract implements Contract {
+
+    Private String sayContent;
+
+    @Override
+    @Payable
+    Public void _payable() {
+        // override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets
+        // you can do something else
+        // ...
+    }
+
+    Public String sayContent(@Required String content) {
+        this.sayContent = content;
+        Return "you want say " + content;
+    }
+
+    @Payable
+    Public String transferToContract() {
+        // mark the @Payable annotation. Smart contract can receive NULS when invoking this method
+        BigInteger value = Msg.value();
+        BigDecimal nuls = new BigDecimal(value).movePointLeft(8);
+        // you can do something else
+        // ...
+
+        Return "I received your transfer amount: " + nuls.toPlainString();
+    }
+
+    @View
+    Public String sayWhat() {
+        If(sayContent != null) {
+            Return "you want say " + sayContent;
+        }
+        Return "you want say nothing.";
+    }
+}
+
+

4. Smart contract repository

[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)

[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)

[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)

[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)

5. Deploying and invoking smart contracts

[How to deploy and invoke the wallet smart contract] +(https://dev.nuls.io/zh-cn/contract/smartContract.html)

6. Smart contract specifications and syntax

[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/NULS2.0Introduction.html b/docs/.vuepress/dist/NULSInfrastructure/NULS2.0Introduction.html new file mode 100644 index 00000000..350f9a41 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/NULS2.0Introduction.html @@ -0,0 +1,23 @@ + + + + + + NULS 2.0 Introduction | NULS + + + + + + + +

NULS 2.0 Introduction

Why NULS 2.0?

NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.

Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:

  1. Loosened coupling and removal of dependencies between modules;

  2. Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;

  3. Complete elimination of programming language limitations.

The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.

During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:

The first layer is the micro-service infrastructure layer.

The second layer is the basic service layer of the blockchain.

The third layer is the DApp application layer.

This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform. +

This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!

The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages. +

Philosophy of Design

The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentationNULS2.0:Philosophy of Design.The documentation details the NULS2.0 evolutionary path。

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/accountModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/accountModuleDesign.html new file mode 100644 index 00000000..5cac3f0c --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/accountModuleDesign.html @@ -0,0 +1,891 @@ + + + + + + Account module design document | NULS + + + + + + + +

Account module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why have a Account Module

  • Used to manage account generation, security and storage, and access to information.
  • User saves account address, public and private key pair, and verification data signature.

1.1.2 What to do with Account Module

The Account Module is a basic module that provides information about the various functions of the account.It mainly supports the functions of account generation, security and storage, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on RPC. The interface makes the account more practical and personalized. The account is the basic module and the carrier of the user data.

  • Account generation

    Create an account, import an account.

  • Account security and storage

    Backup of account, setting account password, modifying account password, removing account.

  • Access to account information

    Query singel account information, query multiple account information, query account address, query account alias.

  • Other usability and personalization features

    Set account alias, set account remark, verify account encryption, sign, verify account address format, verify account password is correct, etc.

1.1.3 Positioning of the account module in the system

The account is the underlying module that is dependent on the ledger, consensus, transaction, kernel, event bus, and community governance modules.

1、Account module depends on the ledger module

The ledger module needs to handle local transactions and relies on account information.
+
+The account module needs to create an alias transaction, which requires the ledger module to pay the fee.
+
+Account balance inquiry, need to rely on ledger module.
+

2、Account module depends on kernel module

Report module information and share data operations.
+

3、Account module depends on network module

Receive and send data through a network module.
+

4、Account module depends on event bus module

Create an account, delete an account,change a password event,send a message through the event bus module.
+The account module is not strongly dependent on the event bus module,because even if the event fails to send,it does not affect the normal business process.
+

5、Consensus module depends on account module

Consensus requires account information for packaging blocks.
+

6、Transaction management module depends on account module

The transaction management module needs to verify the transaction,relying on the address function in the account to verify whether the address is legal.
+

7、Community Governance Module depends on account Module

Community governance requires account signature
+

1.2 Architecture diagram

1.API: Provides an interface layer externally, providing operations such as creating, backing up, and setting aliases for accounts.

2.Business logic layer: the function of defining accounts, account addresses, and aliases.

3.Data persistence layer: save account, alias data.

2、Function design

2.1 Functional architecture diagram

2.2 Module service

2.2.1 create account

  • Function Description

    Create a user's account, including the account's address, public key, private key creation, account information saved to the database, and create an account to notify other nodes through the event.

  • Process description

    Create Address: Create a satellite chain standard account address

    1.Generate a random public-private key pair
    +2.Get chainId and account type
    +3.Calculate hash160 based on public key
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): address=original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)
    +7.Encrypt the private key according to the password and delete the plaintext of the private key
    +8.Store account information
    +9.Add account to cache
    +10.Send Create Account Event
    +
  • ac_createAccount interface

    • Interface Description

      This interface creates one or more accounts.

    • Request example

    {
    +    "cmd":"ac_createAccount",
    +    "minVersion":1.0,
    +    "params":[
    +        1234,
    +        10,
    +        "123456"
    +    ]
    +}
    +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 count false Integer To create an account number, constraints:1-100.
      2 password false String Account initial password, Can be empty
    • Return example

    {
    +    "code": 0,
    +    "msg": "success",
    +    "version":1.0,
    +    "result": {
    +    	"list":["address","",""]
    +    }
    +}
    +
    • Return field description
    parameter type description
    code Integer Return result status
    msg String Failure message
    result jsonObj Data return object
    list jsonArray Account address list
  • Dependent service

    Event Bus: Send Create Account Event

2.2.2 Create an offline account

  • Function Description

    Create a user's offline account, including the account's address, public key, private key creation, account information is not saved to the database

  • Process description

    Create Address: Create a satellite chain standard account address

    1.Generate a random public-private key pair
    +2.Get chainId and account type
    +3.Calculate hash160 based on public key
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): address=original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)
    +7.Encrypt the private key according to the password and delete the plaintext of the private key
    +8.Return account information, not saved to the database
    +
  • ac_createOfflineAccount interface

    • Interface Description

      This interface creates one or more offline accounts.

    • Request example

      {
      +    "cmd":"ac_createOfflineAccount",
      +    "minVersion":1.0,
      +    "params":[
      +        1234,
      +        10,
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 count false Integer To create an account number, constraints:1-100.
      2 password false String Account initial password, Can be empty
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":["address","",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Account address list

2.2.3 Create a multi-sign account

  • Function Description

    Create a multi-signature account, including the address of the account, the creation of the script, and save the multi-signed account information to the database.

  • Process description

    1. Verify the signature public key list, and verify that the minimum number of signatures is correct.
    +2. create a multi-signature script.
    +3. create a multi-signature type account address according to the multi-sign script.
    +4. save the multi-signature account.
    +5. return multi-signed account information.
    +
  • ac_createMultiSigAccount interface

    • Interface Description

      This interface creates a multi-signature account.

    • Request example

      {
      +  "cmd": "createMultiAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID, indicating which chain the account belongs to
      1 pubKeys true jsonArray Public key list that needs to be signed
      2 minSigns true String Minimum number of signatures, at least a few public key verifications are required
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "address":"",
      +        "minSigns":"",
      +        "pubKeys":[{
      +            "pubKey":"",
      +            "address":""
      +            },{}
      +        ]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Multi-sign account address
      minSigns Integer Minimum signature number
      pubKeys jsonObj Public key list
      --pubKey String Public key
      --address String Account address
  • Dependent service

    no

2.2.4 Remove account

  • Function Description

    Remove the user's local account, including deleting the address of the local account, and notifying the other nodes through the event

  • Process description

    1. Verify that the account address format is correct.
    +2. Verify that the account exists
    +3. Verify that the account is encrypted. If the account is encrypted and the account is unlocked, you need to verify the password.
    +3.1. Obtain an unencrypted private key according to the account's encrypted private key and password.
    +3.2, get the public key according to the unencrypted private key
    +3.3. Compare the decrypted public key with the queried public key
    +4, delete the data
    +4.1. Delete local account information
    +4.2. Delete account cache information
    +5. send remove account events
    +
  • ac_removeAccount interface

    • Interface Description

      This interface is used to remove the account.

    • Request example

      {
      +  "cmd": "ac_removeAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true Integer Account address to delete
      2 password false String account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean 删除是否成功
  • Dependent service

    Event Bus Module: Send Remove Account Event.

2.2.5 Import account - private key

  • Function Description

    Import accounts based on private keys, generate accounts based on private keys, and import account book data.

  • Process description

    Import account information based on private key

    1. Generate a public-private key pair based on the private key.
    +2. get the chainId and account type.
    +3. calculate hash160 according to Public key.
    +4.Stitching byte arrays to form addresses
    +4.1.If it is the NULS system address: address=type+hash160
    +4.2、If non-NULS system address (bitcoin): original address length + original address
    +5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string
    +5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)
    +5.2.If non-NULS system check digit: xor=XOR(length+address)
    +6. base58 calculation generates the address string:
    +    NULS system address: Base58 (type+hash160+xor)+Base58(chainId)
    +    Non-NULS system address: Base58 (length+address+xor)+Base58(chainId)
    +7. Encrypt the private key according to the password and delete the plaintext of the private key.
    +8. storage account information.
    +9. add the account to the cache.
    +10. If you send an import account event: If the account already exists, the new event will not be released, only the update will be made.
    +
  • ac_importAccountByPriKey interface

    • Interface Description

      The interface is imported into the account based on the account private key.

    • Request example

      {
      +  "cmd": "ac_importAccountByPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 priKey true String Account private key
      2 password false String Account password
      3 overwrite true Boolean Whether to overwrite when the account exists
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
  • Dependent service

    Event Bus Module: Send Import Account Event when the account does not exist.

    Account Book: Import Account leger(confirmed transaction)

2.2.6 Import account-keystore

  • Function Description

    According to the keystore import account, according to the keystore parsing and decrypting to get the private key and generate an account, and import the account book data

  • Process description

    1. Verify that the keystore and password match.
    +2. decrypt the private key in the keystore according to the password.
    +3. Generate public and private based on the private key.
    +4. get the chainId and account type.
    +5. spliced byte array to form an address.
    +6. generate an address string.
    +7. Verify that the address string and the address in the keystore are consistent.
    +8. storage account information.
    +9. send import account event: the account already exists, do not post new events, only do the coverage update.
    +
  • ac_importAccountByKeystore interface

    • Interface Description

      This interface is used to import accounts keystore

    • Request example

      {
      +  "cmd": "ac_importAccountByKeystore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "HEX",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 keyStore true String Imported keyStore hex code
      2 password false String Account password
      3 overwrite true Boolean Whether to overwrite when the account exists
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
  • Dependent service

    Event Bus Module: Send Import Account Event when the account does not exist

    Account Book: Import Account leger(confirmed transaction)

2.2.7 Import multi-signed accounts

  • Function Description

    Import a multi-signed account related to the local address, including the address of the account, the creation of the script, and save the multi-signed account information to the database.

  • Process description

    1. Verify that the multi-sign address, the signature public key list, and the minimum number of verified signatures are correct.
    +2. create a multi-signature script.
    +3. Create an account address of multiple signature types according to the multi-signed script.
    +4. Determine whether the imported multi-sign address is the same as the address generated by the script. If it is not the same, it prompts an import error.
    +5. save multi-signed account information, including: address, public key list, minimum number of verification signatures.
    +6. return to multi-signal address.
    +
    +
  • ac_importMultiSigAccount interface

    • Interface Description

      This interface is used to import multi-signature accounts.

    • Request example

      {
      +  "cmd": "ac_importMultiSigAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
      2 pubkeys true jsonArray Public key list that needs to be signed
      3 minSigns true Integer Minimum signature number, At least a few Public key verifications are required
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Multi-sign address

2.2.8 Export Account private key

  • Function Description

    Export Account private key hex code

  • Process description

    Export Account private key

    1. Verify that the account exists and verify that the password is correct.
    +2. decrypt the private key, generate a Hex string
    +
  • ac_exportAccountPriKey interface

    • Interface Description

      This interface is used to export the Account private key.

    • Request example

      {
      +  "cmd": "ac_importMultiSigAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    	"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      priKey String Private key hex

2.2.9 Export account KeyStore

  • Function Description

    Export account keystore

  • Process description

    Export account keystore

    1. Verify that the account exists and verify that the password is correct.
    +2. generate a keystore file.
    +
  • ac_exportAccountKeyStore interface

    • Interface Description

      This interface is used to export the account keystore.

    • Request example

      {
      +  "cmd": "ac_exportAccountKeyStore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "encryptedPrivateKey":"",
      +        "pubKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      encryptedPrivateKey String Encrypted private key
      pubKey String Public key hex

2.2.10 Query all accounts

  • Function Description

    Query all accounts

  • Process description

    1. query all account information
    +
  • ac_getAccountList interface

    • Interface Description

      This interface is used to query all accounts.

    • Request example

      {
      +    "cmd":"ac_getAccountList",
      +    "minVersion":1.0,
      +    "params":[
      +        1234
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":[{
      +         	"address":"",
      +            "alias":"",
      +            "pubkeyHex":"",
      +            "encryptedPrikeyHex":""
      +            },{}]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list List Account list collection
      address String Account address
      alias String alias
      pubkeyHex String Public key hex code
      encryptedPrikeyHex String Encrypted private key hex code

2.2.11 Get an account based on address

  • Function Description

    Get an account based on address

  • Process description

    1. Verify that the address exists.
    +2. get an account based on the address
    +
  • ac_getAccountByAddress interface

    • Interface Description

      This interface is used to get an account based on the address.

    • Request example

      {
      +  "cmd": "ac_getAccountByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "address":"",
      +      "alias":"",
      +      "pubkeyHex":"",
      +      "encryptedPrikeyHex":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address
      alias String alias
      pubkeyHex String Public key hex code
      encryptedPrikeyHex String Encrypted private key hex code

2.2.12 Query the list of Account addresses

  • Function Description

    Query the list of Account addresses

  • Process description

    1. Check whether the paging parameter is legal. The number of pages and the size of the page cannot be less than 0, and must be an integer.
    +2. Query all accounts.
    +3. Filter accounts that meet the paging conditions.
    +4. Return only the address list of the account.
    +
  • ac_getAddressList interface

    • Interface Description

      This interface is used to query the list of Account addresses.

    • Request example

      {
      +  "cmd": "ac_getAddressList",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        0,
      +        10
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 pageNumber true Integer pageNumber
      2 pageSize true Integer pageSize
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"list":["","",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Address list collection

2.2.13 Get an address based on alias

  • Function Description

    Get an address based on alias

  • Process description

    1. query whether the existence of alias
    +2. return the Account address used to set the alias, and use Base58 to encode the Account address
    +
  • ac_getAddressByAlias interface

    • Interface Description

      This interface is used to get the address based on alias.

    • Request example

      {
      +  "cmd": "ac_getAddressList",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      address String Account address, Base58 code

2.2.14 Query Account private key

  • Function Description

    Query Account private key

  • Process description

    1. Check whether the address is correct, use Base58 decoding, and check the Chain ID, address type, and check digit respectively.
    +2. Verify that the account exists.
    +3. If the account is over-densified (with password) and is not unlocked, decrypt it by AES and verify that the password is correct, and obtain the unencrypted private key.
    +4. use hexadecimal encoding, and return to Account private key.
    +
  • ac_getPriKeyByAddress interface

    • Interface Description

      This interface is used to query the Account private key.

    • Request example

      {
      +  "cmd": "ac_getPriKeyByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String address
      2 password false String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      priKey String Private key hex

2.2.15Query all Account private keys

  • Function Description

    Query all Account private keys

  • Process description

    1. Verify that the password format is correct and the password can be empty.
    +2. get all local accounts.
    +3. The encryption information of the local account must be the same. If the parameter password is not empty, the passwords of all accounts must be the same. If the parameter password is empty, all accounts cannot be set. Otherwise, the error is displayed.
    +4. If the account is encrypted, the unencrypted private key is reversed by the password, otherwise the private key is obtained without encryption.
    +5. Add all private keys to the collection and return.
    +
  • ac_getAllPriKey interface

    • Interface Description

      This interface is used to query all Account private keys.

    • Request example

      {
      +  "cmd": "ac_getAllPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      2 password false String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "list":["",""]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list String Private key collection

2.2.16 set password

  • Function Description

    set password

  • Process description

    1. Verify that the account exists.
    +2. Verify that the password has been set.
    +3. set Account password.
    +
  • ac_setPassword interface

    • Interface Description

      This interface is used to set the Account password.

    • Request example

      {
      +  "cmd": "ac_setPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Data return object, password setting is successful

2.2.17 Set offline Account password

  • Function Description

    Set offline Account password

  • Process description

    1. Verify that the address is correct.
    +2. Verify that the private key is correct.
    +3. create according to the private key.
    +4. set offline Account password.
    +
  • ac_setOfflineAccountPassword interface

    • Interface Description

      This interface is used to set the offline Account password.

    • Request example

      {
      +  "cmd": "ac_setOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 priKey true String Account private key
      3 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      encryptedPriKey String Encrypted private key

2.2.18 change Password

  • Request Body

  • Function Description

    change Password

  • Process description

    1. verify the correctness of the old password.
    +2. Update the private key ciphertext.
    +3. send a password change event.
    +
  • ac_updatePassword interface

    • Interface Description

      This interface is used to modify the Account password.

    • Request example

      {
      +  "cmd": "ac_updatePassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
      3 newPassword true String Account new password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the password modification is successful

2.2.19 Modify offline Account password

  • Function Description

    Modify offline Account password

  • Process description

    1. Verify that the address is correct.
    +2. Generate an offline account based on address, private key, and new password.
    +
  • ac_updateOfflineAccountPassword interface

    • Interface Description

      This interface is used to modify the offline Account password.

    • Request example

      {
      +  "cmd": "ac_updateOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 priKey true String Private key
      3 password true String Account password
      4 newPassword true String Account new password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      encryptedPriKey String Encrypted private key

2.2.20 verify password

  • Function Description

    verify password

  • Process description

    1. Verify that the password is correct.
    +2. return verification results.
    +
  • ac_validationPassword interface

    • Interface Description

      This interface is used to verify the password.

    • Request example

      {
      +  "cmd": "ac_validationPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password true String Account password
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the password correct

2.2.21 Verify that the account is encrypted

  • Function Description

    Verify that the account is encrypted

  • Process description

    1. Verify that the account exists.
    +2. Verify that the account is encrypted.
    +3. return verification results.
    +
  • ac_isEncrypted interface

    • Interface Description

      This interface is used to verify that the account is encrypted.

    • Request example

      {
      +  "cmd": "ac_isEncrypted",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the account is encrypted

2.2.22 Set up an account alias

  • Function Description

    Set up an account alias

  • Process description

    1. Verify that alias is legal
    +2. generate settings alias transaction
    +3. call ledger to fill transaction fee information
    +4. broadcast transactions
    +5. After the transaction is confirmed, the alias will be saved to the database, and address and alias will be stored as keys respectively. That is, the alias data will store two data, mainly for the convenience of querying according to address and alias.
    +
  • ac_setAlias interface

    • Interface Description

      This interface is used to set the account alias.

    • Request example

      {
      +  "cmd": "ac_setAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 password false String Account password
      3 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      txHash String Alias transaction hash
  • Dependent service

    Account module: setting an alias requires a fee

2.2.23 Get set alias fee

  • Function Description

    Get set alias fee

  • Process description

    1. Verify that the account exists and verify that the alias is correct.
    +2. calculate the fees required for the alias setting.
    +
  • ac_getAliasFee interface

    • Interface Description

      This interface is used to get the set alias fee.

    • Request example

      {
      +  "cmd": "ac_getAliasFee",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "fee":"100",
      +        "maxAmount":"10000"
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      fee String Alias transaction fee
      maxAmount String Maximum transaction fee

2.3.24 Query alias based on address

  • Function Description

    Query alias based on address

  • Process description

    1. Verify that the account exists.
    +2. query the account corresponding alias from the database
    +
  • ac_getAliasByAddress interface

    • Interface Description

      This interface is used to query aliases based on the address.

    • Request example

      {
      +  "cmd": "ac_getAliasByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "alias":""
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      alias String Account alias

2.2.25 Verify that alias is available

  • Function Description

    Verify that alias is available

  • Process description

    1. Query whether the alias already exists. If it exists, it is not available. Otherwise, it is available.
    +
  • ac_isAliasUsable interface

    • Interface Description

      This interface is used to verify if alias is available.

    • Request example

      {
      +  "cmd": "ac_isAliasUsable",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 alias true String Account alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is alias available

2.2.26 Set account remark

  • Function Description

    Set account remark

  • Process description

    1. Verify that the account exists.
    +2. modify the remarks information and save
    +
  • ac_setRemark interface

    • Interface Description

      This interface is used to set account remark.

    • Request example

      {
      +  "cmd": "ac_setRemark",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +        "remark1"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Account address
      2 remark true String Account remark
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the setting is successful

2.2.27 Set up multi-sign account alias

  • Function Description

    Set up multi-sign account alias

  • Process description

    1. Verify that the Account address, alias, Account password, and signature address parameters are legal.
    +2. Query whether the Account address and the signature address exist.
    +3. generate a set of multi-sign account alias trading.
    +4, call ledger to fill transaction fee information.
    +5. Sign the transaction using a signed account.
    +6. Save the unconfirmed transaction to the local account when the signed number is equal to the minimum number of signatures.
    +7. Broadcast the transaction.
    +8. return the transaction hash.
    +
  • ac_setMultiSigAlias interface

    • Interface Description

      This interface is used to set the multi-sign account alias.

    • Request example

      {
      +  "cmd": "ac_setMultiSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
      2 signAddress true String Signature address
      3 password false String Account password
      4 alias true String alias
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      txHash String Multi-signalias alias transactionhash
  • Dependent service

    Account module: setting a multi-signal alias requires a fee.

2.2.28 Remove multi-signed account

  • Function Description

    Remove multi-signed account

  • Process description

    1. Verify that the Account address is correct.
    +2. delete the multi-signed account in the database.
    +3. return to delete is successful.
    +
  • ac_removeMultiSigAccount interface

    • Interface Description

      This interface is used to remove multi-signed accounts.

    • Request example

      {
      +  "cmd": "ac_setMutilSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    ]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 address true String Multi-sign account address
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the removal was successful

2.2.29 Account all transaction verification

  • Function Description

    account module all transaction verification interface, currently only alias transaction

  • Process description

    1. Is the transaction list empty
    +2. loop through all transaction lists, processing for alias transactions
    +3. Check if the same alias is set in the current transaction list.
    +4. Check whether there is an account duplicate setting alias in the current transaction list.
    +5. If there is no conflict in the transaction list, the verification is passed.
    +
  • ac_accountTxValidate interface

    • Interface Description

      This interface is used to batch verify all transactions in the account module.

    • Request example

      {
      +  "cmd": "ac_accountTxValidate",
      +  "minVersion":1.0,
      +  "params": [chianId, ["txHex","txHex","txHex", ...]]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true array Alias transaction serialization data array

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "list":["txHex", "txHex", "txHex", ...]
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      list jsonArray Illegal transaction serialization data array

2.2.30 Alias transaction verification

  • Function Description

    alias transaction verification interface

  • Process description

    1. deserialize txHex alias transaction data
    +2. verify the alias format
    +3. Verify that the alias is already occupied.
    +4. Verify that the account has an alias set.
    +5. verify the coinData input and output
    +6. verify the script signature format
    +7. Verify that the signature contains the address of the alias. 
    +If it is not included, it is a malicious foul. 
    +Otherwise, the verification is passed.
    +
  • ac_aliasTxValidate interface

    • Interface Description

      This interface is used for a single alias transaction.

    • Request example

      {
      +  "cmd": "ac_aliasTxValidate",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String alias transaction serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Whether the verification is successful

2.2.31 Alias transaction submit

  • Function Description

    Alias transaction submit, save alias

  • Process description

    1. deserialize txHex alias transaction data
    +2. save the alias alias to the database
    +3. set the alias to account and save to the database
    +4. Re-cache the modified account
    +5. return the alias save is successful
    +
  • ac_aliasTxCommit interface

    • Interface Description

      This interface is used to save aliases.

    • Request example

      {
      +  "cmd": "ac_aliasTxCommit",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String Alias transaction serialization data
      2 secondaryDataHex true String Block header serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex description

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the alias transaction saved successfully

2.2.32 Alias transaction rollback

  • Function Description

    Alias transaction rollback interface

  • Process description

    1. deserialize txHex alias transaction data
    +2. delete the alias object data from the database
    +3. take the corresponding account to clear the alias, re-sent the database
    +4. re-cache account
    +5. return the alias rollback is successful
    +
  • ac_aliasTxRollback interface

    • Interface Description

      This interface is used to roll back an alias.

    • Request example

      {
      +  "cmd": "ac_aliasTxRollback",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true Short Chain ID
      1 txHex true String Alias transaction serialization data
      2 secondaryDataHex true String Block header serialization data

      txHex description

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":10000,
      +            "nonce":"123",
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":1
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":"12345",
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex description

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • Return example

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • Return field description

      parameter type description
      code Integer Return result status
      msg String Failure message
      result jsonObj Data return object
      value boolean Is the alias transaction rollback successful

2.3 Module internal function

3、Event description

3.1 Published event

  • create Account

    event_topic : "evt_ac_createAccount"

    data:{
    +    address:''
    +    isEncrypted:true   //Is the password set
    +}
    +
  • remove account

    event_topic : "evt_ac_removeAccount"

    data:{
    +	address:''
    +}
    +
  • change password

    event_topic : "evt_ac_updatePassword"

    data:{
    +	address:''
    +}
    +

3.2 Subscribed event

no

4、protocol

4.1 Network communication protocol

  • no

4.2 Transaction agreement

  • Set alias

    • protocol

      Compared with the general transaction, only the type and txData are different, the specific difference is as follows

    type: n //Set the type of alias transaction
    +txData:{
    +    address:  //VarByte Set the address of alias
    +    alias:   //VarByte Array of bytes converted into an alias string, decoded with UTF-8
    +}
    +
    • Alias transaction parameters
    Len Fields Data Type Remark
    24 address byte[] Set the address of alias
    32 alias byte[] Array of bytes converted into an alias string, decoded with UTF-8
    • Validator
    1. alias format legality verification.
    +2. the address must be the satellite chain address, and an address can only be set to an alias.
    +3. burn a token unit.
    +4. Transaction fee.
    +5. signature: set address, input, signature verification.
    +
    • processor
    1. the asset processor.
    +2. store alias data.
    +3. Update local account information.
    +

5、Module configuration item

server.ip:0.0.0.0   //Native ip, used to provide services to other modules
+server.port:8080    //Service port
+

6、Java-specific design

  • Account Object design

    The key used when the table is stored:

    NULS system:chainId+type+hash160

    non-NULS system:chainId+length+address

Field name type Description
chainId short Chain ID
address String Account address(Base58(address)+Base58(chainId))
alias String Account alias
status Integer Account Status
pubKey byte[] Public key
priKey byte[] Private key - not encrypted
encryptedPriKey byte[] Encrypted private key
extend byte[] Extended data
remark String ramark
createTime long create time
  • Address object design (not persistent storage)
Field name type Description
chainId short Chain ID
addressType byte Address type
hash160 byte[] Public key hash
addressBytes byte[] Address byte array
  • Alias object design

    The key used when the table is stored:

    Address and alias are stored as keys respectively, and alias data is stored in two copies.

    Need to create different alias tables according to different chains.

Field name type Description
address byte[] Account address
alias String Account alias
  • MultiSigAccount object design
Field name type Description
address String Account address
pubKeyList List<byte[]> Public key list that needs to be signed
minSigns long Minimum number of signatures

7、to add on

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/blockModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/blockModuleDesign.html new file mode 100644 index 00000000..0e3ee9ce --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/blockModuleDesign.html @@ -0,0 +1,653 @@ + + + + + + Block management module design documents | NULS + + + + + + + +

Block management module design documents

[TOC]

Chapter 1. General description

1.1 The module overview

1.1.1 Why do you should have the block management module

All transaction data in the blockchain is stored in the block, so there is a module responsible for the saving and management of the block, so that other modules can obtain the block when verifying the data in the block and processing the business etc.

When the blockchain program is started for the first time, it is necessary to synchronize the full blocks from the network to the local. This process is generally time consuming, and the transaction cannot be initiated when the synchronization is not completed, so it is suitable for the work to be performed by a separate module.

In summary, it is necessary to provide a unified block data service for other modules, and it is also better to separate the management of the block from the specific service of the block. The modules who used the block do not have to care about the details of block's acquire.

1.1.2 Block management module's tasks

  1. When the system starts, it is judged whether the height of the local block reaches the latest height of most nodes on the network. If it is not reached, the block is downloaded from the network to the local, and then the block will be verified. If the verification is passed, the data is saved to the local database. This is called synchronization of blocks.

  2. After the block synchronization is completed, the system starts normal operation.Let's discuss separately below

  • If the self-node performs the packing block, the consensus module broadcasts the block information to the network before the packaged block is handed over to the block management module. The block management module verifies whether the block is legal, if legal then save it to the database, and respond to requests from other nodes on the network to get this block.

  • If other nodes on the network are packing blocks, the local node will receive the forwarding block message sent from the network. At this time, the block information is obtained from other nodes, verified and saved.

  1. In the abnormal case, the block's verification fails, and the new block cannot be connected to the last block on the main chain. The block is regarded as a forked block and placed in the forked chain set for maintenance. When it is found that one of the forked chains A is longer than the main chain B, the switching is performed, and the bifurcation chain A is the latest main chain, and the original main chain B enters the bifurcation chain assembly maintenance.

  2. Provide block header and block's query services for other modules or clients.

1.1.3 The position of block management module in the system

Block management is one of the underlying modules. The following sub-functions discuss module dependencies.

rely

  • Block synchronization - depends on the communication interface of the network module, relying on the serialization tool of the tool module
  • Block storage, rollback-dependent tool module database storage tool, consensus module, transaction management module
  • Block forwarding - dependent on the network module's broadcast message interface

Be dependent

  • The entire system can initiate transactions - block synchronization
  • Consensus module: block detailed verification, packing - block query, block saving, block broadcasting, block rollback

1.2 Architecture diagram

Chapter 2. Functional design

2.1 Functional architecture diagram

  1. Provide the API to block storage, query, rollback operations.
  2. Synchronous latest blocks from the Internet, a preliminary verification, validation, bifurcation without bifurcate, call consensus in a consensus based verification, the trading module dual authentication, all validation after saved to the local.
  3. Block synchronization, broadcasting, forwarding message process
  4. Fork blocks judgment and storage
  5. Fork chains maintenance and switch

2.2 The module service

2.2.1 Get the latest local block header

  • Interface specification
  1. Query the DB according to the chain ID and the latest block height in the cache to get the latest block header HASH.
  2. According to the HASH query DB to get the block header byte array
  3. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_bestBlockHeader",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block HASH
preHash String pre block HASH
merkleHash String block's MerkleHash
height Long block height
size Integer block size
time Long packing timestamp
txCount Integer count of transactions
packingAddress String packing address
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String block's signature

2.2.2 Get the latest local block

  • Interface specification:
  1. Get the latest local block header according to the the chain ID
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_bestBlock",
    +  "minVersion":"1.1",
    +  "params": [“888”]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +                "chainId": "888", //chain Id
    +                "height": "1", //block height
    +                "hash": "1", //transaction HASH
    +                "remark": "1", //transaction remark
    +                "size": "1", //transaction size
    +                "time": "1", //transaction timestamp
    +                "type": "1", //transaction type
    +                "transactionSignature": "1", //transaction sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”//Transaction sequence number and increasing
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “locktime”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //Special transaction data HEX
    +    	    },
    +    	    {...}
    +    	], //transaction list
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.3 get block header according to the height

  • Interface specification
  1. Query DB according to the chain ID and height, get the latest block header HASH
  2. Query DB according to the HASH to get the block header byte array
  3. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderByHeight",
    +  "minVersion":"1.1",
    +  "params": ["111","888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 height true Long block's height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.4 get block according to the height

  • Interface specification:
  1. Get the block header according to the chain ID and height
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_getBlockByHeight",
    +  "minVersion":"1.1",
    +  "params": [“111”,"888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 height true Long block's height
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +                "chainId": "888",//chain ID
    +                "height": "1", //block's height
    +                "hash": "1", //transaction's hash
    +                "remark": "1", //transaction's remark
    +                "size": "1", //transaction's size
    +                "time": "1", //transaction's timestamp
    +                "type": "1", //transaction's type
    +                "transactionSignature": "1", //transaction's sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”  
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //HEX
    +    	    },
    +    	    {...}
    +    	], 
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.5 get block header according to the hash

  • Interface specification
  1. According to the chain ID, HASH query DB to get the block header byte array
  2. Deserialize to block header object
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderByHash",
    +  "minVersion":"1.1",
    +  "params": ["888","aaa"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 hash true String block hash
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.6 get block according to the hash

  • Interface specification:
  1. Get the block header according to the chain ID and hash
  2. Query the DB according to the block head height to get the transaction HASH list.
  3. Obtain transaction data from the transaction management module according to the HASH list
  4. Assemble into a block object
  • Sample request

    {
    +  "cmd": "bl_getBlockByHash",
    +  "minVersion":"1.1",
    +  "params": ["888",“aaa”]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 hash true String block hash
  • response sample

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +    	    "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //block header
    +    	"transactions": [
    +    	    {
    +    	        "chainId": "888",
    +                "height": "1", //block's height
    +                "hash": "1", //transaction's hash
    +                "remark": "1", //transaction's remark
    +                "size": "1", //transaction's size
    +                "time": "1", //transaction's timestamp
    +                "type": "1", //transaction's type
    +                "transactionSignature": "1", //transaction's sign
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            “fromAssetsChainId”:“”  
    +                            “fromAssetsId”:“”
    +                            “fromAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            “toAssetsChainId”:“”  
    +                            “toAssetsId”:“”
    +                            “toAddress”:“”
    +                            “amount”:“”
    +                            “nonce”:“”
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //HEX
    +    	    },
    +    	    {...}
    +    	], 
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.7 get sync status

  • Interface specification

When the block synchronization on a ChainID is completed, the cached synchronization status identifier is updated. It is forbidden to initiate a transaction when the block synchronization is not completed.

  • Sample request

    {
    +  "cmd": "bl_getSynchronizeInfo",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"sync": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
sync String Block the synchronization to be achieved

2.2.8 get block header according to the height range

  • Interface specification
  1. Make queryHash = endHash
  2. Query DB according to queryHash to get block header byte array
  3. Deserialization for block header object blockHeader, added to the List as a return value
  4. If the blockHeader.Hash!= startHash, make queryHash = blockHeader.preHash, repeat step 2
  5. Return to the List
  • Sample request

    {
    +  "cmd": "bl_getBlockHeaderBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 startHeight true Long start Height
2 endHeight true Long end Height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        “list” : [
    +            {
    +           "chainId": "888",
    +           "hash": "xxxxxxx",
    +           "preHash": "xxxxxxx",
    +           "merkleHash": "1",
    +           "height": 1,
    +           "size": 1,
    +           "time": 1,
    +           "txCount": 1,
    +           "packingAddress": "1",
    +           "reward": 0,
    +           "fee": 0,
    +           "extend": xxxxxxx,HEX
    +           "scriptSig": "1"
    +           }
    +        ]
    +
    +    }
    +}
    +
  • Instructions of response parameters

parameter type description
chainId Long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height Long block's height
size Integer block's size
time Long block's packing timestamp
txCount Integer count of transactions
packingAddress String address of packing
reward Long Consensus reward
fee Long procedure fee
extend String Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String Signature of block

2.2.9 get block according to the height range

  • Interface specification
  1. make queryHash=endHash
  2. Query DB according to the chain ID, queryHash to get the block byte array
  3. Deserialize to block object block, add to List as return value
  4. If block.hash!=startHash, make queryHash=block.preHash, repeat step 2
  5. Return to List
  • Sample request

    {
    +  "cmd": "bl_getBlockBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • Instructions of request parameters

index parameter required type description
0 chainId true Long chain ID
1 startHeight true Long start Height
2 endHeight true Long end Height
  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        “list” : [
    +            {
    +                "blockHeader": {
    +                    "chainId": "888",
    +                    "hash": "xxxxxxx",
    +                    "preHash": "xxxxxxx",
    +                    "merkleHash": "1",
    +                    "height": 1,
    +                    "size": 1,
    +                    "time": 1,
    +                    "txCount": 1,
    +                    "packingAddress": "1",
    +                    "reward": 0,
    +                    "fee": 0,
    +                    "extend": xxxxxxx,HEX
    +                    "scriptSig": "1"
    +                }, //block header
    +                "transactions": [
    +                    {
    +                        "chainId": "888",
    +                        "height": "1", //block's height
    +                        "hash": "1", //transaction's hash
    +                        "remark": "1", //transaction's remark
    +                        "size": "1", //transaction's size
    +                        "time": "1", //transaction's timestamp
    +                        "type": "1", //transaction's type
    +                        "transactionSignature": "1", //transaction's sign
    +                        "coinData": {
    +                            "from" : [
    +                                {
    +                                    “fromAssetsChainId”:“”  
    +                                    “fromAssetsId”:“”
    +                                    “fromAddress”:“”
    +                                    “amount”:“”
    +                                    “nonce”:“”
    +                                },{...}
    +                            ]
    +                            "to" : [
    +                                {
    +                                    “toAssetsChainId”:“”  
    +                                    “toAssetsId”:“”
    +                                    “toAddress”:“”
    +                                    “amount”:“”
    +                                    “nonce”:“”
    +                                },{...}
    +                            ]
    +                        }
    +                        "txData": XXXX, //HEX
    +                    },
    +                    {...}
    +                ], 
    +           }
    +        ]
    +
    +    }
    +}
    +
  • Instructions of response parameters

    omit

2.2.10 Receive the latest packaging block

  • Interface specification

After the local node's consensus module paking a block, this interface is called to save the block data.

  • Sample request

    {
    +  "cmd": "bl_receivePackingBlock",
    +  "minVersion":"1.1",
    +  "params": [
    +  	blockhex
    +  ]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"sync": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
sync String wherther the Block's save is completed

2.2.11 run a chain

  • Interface specification

After the chain factory releases a chain, the core module calls the interface of the block management module, initializes the block and the forked chain database according to the chainID, starts a series of work threads corresponding to the chainID, and prepares for running the new chain.

  • Sample request

    {
    +  "cmd": "bl_startChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
result String whether the new chain started successfully

2.2.12 stop a chain

  • Interface specification

After stopping a chain in the chain factory, the core module will call the interface of the block management module, delete the cache block and the fork chain data of the chain, and stop a series of work threads corresponding to the chainID.

  • Sample request

    {
    +  "cmd": "bl_stopChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • Instructions of request parameters

    omit

  • response sample

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • Instructions of response parameters

parameter type description
result String whether the new chain started successfully

2.3 module's internal function

2.3.1 module's boot

  • Functional specifications:

    omit

  • process description

  1. Load block module configuration information
  2. Register block module's message handlers
  3. Register block module's service interfaces
  4. Register block module's events
  5. Start the synchronization thread, the block monitoring thread, branching chain processing thread.
  • Dependent service

    Tool module、kernel module

2.3.2 block's storage

  • Functional specifications:

Description storage table division

  • main chain's storage

A complete block consists of a block header and a transaction, and the block header is stored separately from the transaction. +Block header: (in the block management module) +Key(block's height)-value(block header hash) block-header-index +Key(block headerhash)-value(complete block header) block-header +Trading: (put in the transaction management module)

  • fork chain's storage +Cache each forked chain (starting height, starting hash, ending height, ending hash) in memory, and cache full forked chain data in the hard disk +         There are different tables for the bifurcation chain collection of different chains. The table name is added with the chainID suffix. Each bifurcation chain object is as follows: +             Key (start block height + start block hash) - value (complete chains) fork chains +         Private chain chain; +                 Private String id; +                 Private String preChainId; +                 Private BlockHeader startBlockHeader; +                 Private BlockHeader endBlockHeader; +                 Private List blockHeaderList; +                 Private List blockList;

  • process description

    omit

  • Dependent service

    Database storage tool of tool modules

2.3.2 block's Synchronization

  • Functional specifications:

    omit

  • process description

    • Block synchronization main flow

    • Get a list of available nodes on the network
        1. Traverse the node and count the two MAPs, assuming that each node (the latest HASH+ latest height) is the key
    +    2. A key with the key as the number of statistics
    +    3. A key is used to record the list of nodes holding the key.
    +    4. Finally, the most frequently occurring key is obtained, and the current trusted latest height and latest hash, as well as the list of trusted nodes are obtained.
    +    
    +    for example:
    +    Now connect to 10 nodes at the same time. The latest block's height of 4 nodes (A, B, C, D) is 100, the latest block hash is aaa, and the latest block's height of 6 nodes (E, F, G, H, I, J) is 101. The latest block hash is bbb.
    +    Finally return (101, bbb, [E, F, G, H, I, J]).
    +
    • Download block logic

            Before the official download of the block, it is necessary to determine whether the local and the network are forked, and whether it needs to be rolled back. In order to find the exact block download height.
    +        The following discussion is divided into:
    +        Take the result of the previous step (101, bbb, [E, F, G, H, I, J]), while LH(N) represents the hash of the local Nth block, and RH(N) represents the hash of the Nth block on the network. .
    +        1. Local height 100 < network height 101, LH (100) == RH (100), normal, behind the remote node, download block
    +        2. Local height 100 < network height 101, LH (100)! = RH (100), think local fork, roll back the local block, if LH (99) == RH (99)
    +        At the end of the rollback, download from 99 blocks. If LH(99)!=RH(99), continue to roll back and repeat the above logic. However, if you roll back 10 blocks at most, it will stop and wait for the next synchronization. This will avoid being attacked by malicious nodes and roll back normal blocks in large quantities.
    +        3. Local height 102> network height 101, LH (101) == RH (101), normal, leading than remote node, no need to download block
    +        4. Local height 102> network height 101, LH (101)! = RH (101), think local fork, first roll back to the height and remote consistency, repeat scene 2
    +        5. Local height 101 = network height 101, LH (101) == RH (101), normal, consistent with the remote node, no need to download the block
    +        6. Local height 101 = network height 101, LH (101)! = RH (101), think local fork, repeat scene 2
    +        
    +        In the scenario that needs to be rolled back, the number of available nodes (10) > configuration, the number of consistent available nodes (6) accounted for more than 80%, and avoiding too few nodes leads to frequent rollback. The above two conditions are not met, empty the connected nodes, and re-acquire the available nodes.
    + 
    +        When you actually download the block, give a chestnut:
    +        The current height is 100, the network height is 500, 12 nodes are available, 10 nodes are consistently available, and each node downloads 2 blocks at a time.
    +        Then calculate that you need to download 400 blocks, 400/(2*10)=20 rounds of downloading, and you can calculate the height range of each node download block per round.
    +        Pseudo code representation
    +            For (20 rounds){
    +                For (10 nodes) {
    +                    Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process
    +                }
    +            }
    +        Consider the case where the node is dropped during the download process. It is possible that 20 rounds cannot be downloaded, so the outer layer is added to the loop.
    +            While (not downloaded){
    +                Recalculate the round, download the block's height interval for each node
    +                For (20 rounds){
    +                    For (10 nodes) {
    +                        Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process
    +                    }
    +                }
    +            }
    +
    • Download blocks from a height interval from a node

  • Dependent service

    Database storage tool of tool modules、RPC tool

2.3.3 block's validation

  • Functional specifications:

    Verify the correctness of the block's own data, verify during the download process, verify that there is no problem with the block data itself, and discard the block if the verification fails.

  • process description

    • block's basic validation

    • block header's validation

    • Merkelhash validation

  • Dependent service

    Database storage tool of tool modules

2.3.4 fork block management

  • Functional specifications:

    Verify the correctness of the block context. After the download is complete, verify that the block is connected to the main chain. +The verification failure indicates that the block is bifurcated and enters the forked chain processing logic.

  • process description

    • Define a main chain (MasterChain), a fork chain set (forkChains) +    - Define the block to be verified as Block +    - Define the main chain height MG, to be verified block's heightBG +    - Define the latest block HASH of the main chain as MH, the HASH of the block to be verified is BH, and the PHHASH of the block to be verified is BPH +     +    - Discussion in six situations +    - 1.MG==BG, MH==BH, indicating that the latest main chain block is repeatedly received and discarded. +    - 2.MG==BG, MH!=BH, indicating network fork +        - Traverse the existing set of forked chains to determine if this block already exists +            - discard the block if it already exists +            - If it does not exist, create a new fork chain +              - Determine if you can connect to other fork chains (if you can connect, connect to other fork chains as a chain) +              - Recursive judgment +    - 3.MG==BG-1, MH==BPH, indicating that the block is continuous and saved to the main chain +    - 4.MG==BG-1, MH!=BPH, indicating network fork, processing the same as step 2 +    - 5.MG<BG-1, indicating network fork, processing the same as step 2 +    - 6.MG>BG, indicating network fork, processing the same as step 2 +     +    The height difference is less than 1000 cached to disk, the disk space is limited in size, and the height is discarded. +If the cache space is full, the forked chain is cleared in the order of adding cache time.
  • Dependent service

    Database storage tool of tool modules

2.3.5 fork chain management

  • Functional specifications:

    Determine if the fork chain and the main chain need to be switched

  • process description +​

    • Check if there is an orphan chain that links to the main chain or the forked chain, if any
    • Take the longest one of the fork chains and compare the length of the main chain to determine whether you need to switch the main chain +
      • If the length of the fork chain is longer than the length of the main chain by 3 (configured), you need to switch the main chain.
      • Find the bifurcation point of the main chain and the longest bifurcation chain
      • Verify the block in the forked chain if the verification continues by going down
      • Roll back the main chain block
      • Switch the fork chain as the main chain
  • Dependent service

    Database storage tool of tool modules

2.3.6 forward block

  • Functional specifications:

    omit

  • process description

  1. Use the blockHash to assemble the ForwardSmallBlockMessage and send it to the target node.
  2. After receiving the ForwardSmallBlockMessage, the target node takes out the hash to determine whether it is duplicated. If it does not repeat, use the hash assembly GetSmallBlockMessage to send to the source node.
  3. After the source node receives the GetSmallBlockMessage, it takes out the hash, queries the SmallBlock and assembles the SmallBlockMessage, and sends it to the target node.
  4. Subsequent interaction process reference broadcast block
  • Dependent service

    Database storage tool of tool modules

2.3.7 braodcast block

  • Functional specifications:

    omit

  • process description

  1. Get BlockHeader, TxList according to HASH, assemble into SmallBlock,
  2. Put a SmallBlock into the memory. If it is not deleted actively, it will be automatically cleared when the cache is full or exists for more than 1000 seconds.
  3. Local cache blockHash for filtering duplicate downloads
  4. Assem the SmallBlockMessage and call the RPC module to send a message to the target node.
  5. After receiving the message, the target node determines which transactions are not locally based on txHashList, and then assembles GetTxGroupRequest to the source node.
  6. After receiving the information, the source node assembles the TxGroupMessage according to the hashlist and returns it to the target node.
  7. All block data has been sent to the target node.
  • Dependent service

    Database storage tool of tool modules

2.3.8 Block monitoring

  • Functional specifications:

    omit

  • process description

    • Start monitoring scheduled tasks, once every minute
    • Take the local latest block header
    • Verify that the network module needs to be restarted (if the latest local block has not been updated for 3 minutes, the network module needs to be disconnected and reconnected randomly)
    • to be perfected
  • Dependent service

    Database storage tool of tool modules

Chapter 3. Events

3.1 published event

3.1.1 Synchronization completed

Description: The synchronization is completed. When the height of the area is the same as the height of the network, the event is released.

Event_topic : "bl_blockSyncComplete",

Data:{
+     chainId
+     Height
+     Hash
+}
+

3.1.2 save block event

Description:Each save a block, release the event

event_topic : "evt_bl_saveBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.1.3 rollback block event

Description:Each roll back a block, release the event

event_topic : "evt_bl_rollbackBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.2 Subscribed event

omit
+

Chapter 4. Network Message

4.1 Network communication protocol

omit
+

4.2 Message protocol

4.2.1 Forward block message-ForwardSmallBlockMessage

  • Message description:Used for the "forward block" function

  • Message type(cmd)

    ForwardSmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? hashLength VarInt array's length
? hash byte[] hash
  • Message validation

    omit

  • Message processing logic

  1. After receiving the message, the target node first determines whether the hash in the cache is duplicated according to the chainID.
  2. If it is repeated, it indicates that the SmallBlock forwarded by another node has been received, and the message is discarded.
  3. If there is no duplication, assemble GetSmallBlockMessage with hash and send it to the source node.

4.2.2 Get small block message-GetSmallBlockMessage

  • Message description:Used for the "forward block" function

  • Message type(cmd)

    GetSmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? hashLength VarInt array's length
? hash byte[] hash
  • Message validation

    omit

  • Message processing logic

  1. Get the SmallBlock object according to the hash
  2. Assem the SmallBlockMessage and send it to the source node

4.2.3 Block broadcast message-SmallBlockMessage

  • Message description:Used for "forwarding block" and "broadcast block" functions

  • Message type(cmd)

    SmallBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? preHashLength VarInt preHash array's length
? preHash byte[] preHash
1 digestAlgType byte digest algorithm identifier
? merkleHashLength VarInt merkleHash array's length
? merkleHash byte[] merkleHash
48 time Uint48 time
32 height Uint32 block's height
32 txCount Uint32 count of transactions
? extendLength VarInt extend array's length
? extend byte[] extend
32 publicKeyLength Uint32 public key array's length
? publicKey byte[] public key
1 signAlgType byte Signature algorithm type
? signBytesLength VarInt sign array's length
? signBytes byte[] sign bytes
? txHashListLength VarInt transaction's hash list array's length
1 digestAlgType byte digest algorithm identifier
? txHashLength VarInt transaction's hash array's length
? txHash byte[] transaction's hash
  • Message validation

    omit

  • Message processing logic

  1. Determine whether the block timestamp is greater than (current time +10s). If it is greater than this time, it is determined to be maliciously prematurely out of the block, ignoring the message.
  2. Determine whether the message is repeated according to the block hash. If it is repeated, ignore the message (requires maintenance of a set to store the received block hash)
  3. Query the DB according to the block hash to see if the block already exists in the local area. If it already exists, ignore the message.
  4. Verify the block header, if the verification fails, ignore the message
  5. Take txHashList, determine that tx is not local, assemble GetTxGroupMessage, and send it to the source node.

4.2.4 Get block message based on height-GetBlocksByHeightMessage

  • Message description:For the "sync block" function

  • Message type(cmd)

    GetBlocksByHeight

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
32 startHeight uint32 start Height
32 endHeight uint32 end Height
  • Message validation

    omit

  • Message processing logic

  1. Height parameter verification
  2. Return the response message ReactMessage
  3. Find the Block from endHeight, assemble the BlockMessage, and send it to the target node.
  4. Find the startHeight, assemble the CompleteMessage, and send it to the target node.

4.2.5 Get block message-GetBlockMessage

  • Message description:Used for "block synchronization"

  • Message type(cmd)

    GetBlock

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Return the response message ReactMessage
  2. Find the Block according to the hash, assemble the BlockMessage, and send it to the target node.
  3. Assemble the CompleteMessage and send it to the target node.

4.2.6 Complete block message-BlockMessage

  • Message description:Used for "block synchronization"

  • Message type(cmd)

    Block

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? preHashLength VarInt preHash array's length
? preHash byte[] preHash
1 digestAlgType byte digest algorithm identifier
? merkleHashLength VarInt merkleHash array's length
? merkleHash byte[] merkleHash
48 time Uint48 time
32 height Uint32 block's height
32 txCount Uint32 count of transactions
? extendLength VarInt extend array's length
? extend byte[] extend
32 publicKeyLength Uint32 public key array's length
? publicKey byte[] public key
1 signAlgType byte Signature algorithm type
? signBytesLength VarInt sign array's length
? signBytes byte[] Signature of block
16 type uint16 transaction's type
48 time uint48 transaction's timestamp
? remarkLength VarInt remark array's length
? remark byte[] remark bytes
32 fromCount Uint32 count of froms
32 fromAssetsChainId Uint32 chain id
32 fromAssetsId Uint32 asset id
? fromAddress VarChar from account address
48 amount Uint48 Transfer amount
32 nonce Uint32 Transaction sequence number, increment
32 toCount Uint32 count of tos
32 toAssetsChainId Uint32 chain id
32 toAssetsId Uint32 asset id
? toAddress VarChar to account address
48 amount Uint48 Transfer amount
32 lockTime Uint32 lock time
? txData T data of special transaction
? txSignLength VarInt transaction's sign array's length
? txSign byte[] transaction's sign
  • Message validation

    omit

  • Message processing logic

  1. Put into the cache queue
  2. Wait for other blocks to be synchronized

4.2.7 Data message not found-NotFoundMessage

  • Message description:A generic message for an asynchronous request that marks the target node not finding the corresponding information.

  • Message type(cmd)

    NotFound

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 msgType byte Data type not found
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, set the processing result flag to complete, and set the return result to null.

4.2.8 Response message-ReactMessage

  • Message description:A generic message, used for asynchronous requests, to flag that the target node receives the request and is processing it.

  • Message type(cmd)

    React

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to wait.

4.2.9 Request completion message-CompleteMessage

  • Message description:A generic message for asynchronous requests that marks the end of asynchronous request processing.

  • Message type(cmd)

    Complete

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
1 success byte flag
  • Message validation

    omit

  • Message processing logic

  1. Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to complete.

4.2.10 Get the message of the transaction list-GetTxGroupRequest

  • Message description:Used for "forwarding blocks"

  • Message type(cmd)

    GetTxGroup

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
? ArrayLength VarInt Hash list length
1 digestAlgType byte digest algorithm identifier
? HashLength VarInt Hash array's length
? Hash byte[] Hash
  • Message validation

    omit

  • Message processing logic

  1. After receiving the message, the target node takes out the hashList, traverses the hashList, obtains Tx according to txHash, assembles TxGroupMessage, and sends it to the source node.

4.2.11 Transaction list message-TxGroupMessage

  • Message description:Used for "forwarding blocks"

  • Message type(cmd)

    TxGroup

  • Message format(txData)

Length Fields Type Remark
32 chainID uint32 chain ID
1 digestAlgType byte digest algorithm identifier
? requestHashLength VarInt requestHash array's length
? requestHash byte[] requestHash
? txCount VarInt count of transactions
16 type uint16 transaction's type
48 time uint48 transaction's timestamp
? remarkLength VarInt remark array's length
? remark byte[] remark bytes
32 fromCount Uint32 count of froms
32 fromAssetsChainId Uint32 chain id
32 fromAssetsId Uint32 asset id
? fromAddress VarChar from account address
48 amount Uint48 Transfer amount
32 nonce Uint32 Transaction sequence number, increment
32 toCount Uint32 count of tos
32 toAssetsChainId Uint32 chain id
32 toAssetsId Uint32 asset id
? toAddress VarChar to account address
48 amount Uint48 Transfer amount
32 lockTime Uint32 lock time
? txData T data of special transaction
? txSignLength VarInt transaction's sign array's length
? txSign byte[] transaction's sign
  • Message validation

    omit

  • Message processing logic

    omit

Chapter 5. The module configuration

{
+    {
+        "name": "serverIp",
+        "remark": "service ip",
+        "changable": "true",
+        "default": "127.0.0.1"
+    },
+    {
+        "name": "serverPort",
+        "remark": "service port",
+        "changable": "true",
+        "default": ""
+    },
+    {
+        "name": "blockSize",
+        "remark": "block size",
+        "changable": "false",
+        "default": "3m"
+    },
+    {
+        "name": "resetTime",
+        "remark": "When the block height is not updated for a long time, the available nodes are reacquired",
+        "changable": "true",
+        "default": "180"
+    },
+    {
+        "name": "forkCount",
+        "remark": "When the fork chain is higher than the main chain, switch",
+        "changable": "false",
+        "default": "3"
+    },
+    {
+        "name": "cacheSize",
+        "remark": "forked chain cache size",
+        "changable": "true",
+        "default": "50m"
+    },
+    {
+        "name": "heightRange",
+        "remark": "Cache to the height range of the forked chain",
+        "changable": "false",
+        "default": "1000"
+    },
+    {
+        "name": "maxRollback",
+        "remark": "How many blocks are rolled back at most each time",
+        "changable": "true",
+        "default": "20"
+    },
+    {
+        "name": "consistencyNodePercent",
+        "remark": "The lowest percentage of consistent nodes available, below this number of unsynchronized blocks",
+        "changable": "false",
+        "default": "80"
+    },
+    {
+        "name": "minNodeAmount",
+        "remark": "The minimum number of available nodes, lower than this number of unsynchronized blocks",
+        "changable": "false",
+        "default": "10"
+    },
+    {
+        "name": "downloadNumber",
+        "remark": "How many blocks are downloaded from one node each time during synchronization",
+        "changable": "true",
+        "default": "20"
+    },
+    {
+        "name": "extendMaxSize",
+        "remark": "block header extension field maximum value",
+        "changable": "false",
+        "default": "1024"
+    }
+}
+

Chapter 6. Java's design

  • Block Object design
field name field type instruction
blockHeader BlockHeader block header
transactions List transaction's list
  • SmallBlock Object design
field name field type instruction
blockHeader BlockHeader block header
transactions List transaction's hash list
subTxList List Transactions that other nodes must not have (such as consensus reward transactions, red and yellow card transactions, etc.
  • BlockHeader Object design
field name field type instruction
chainId long chain ID
hash String block hash
preHash String pre block hash
merkleHash String block's MerkleHash
height int block's height
size short block's size
time long block's packing timestamp
txCount short count of transactions
packingAddress String address of packing
extend byte[] Extension field
blockSignature BlockSignature Signature of block
  • BlockSignature Object design
field name field type instruction
signData String Signature of block
publicKey byte[] public key

Chapter 7. additional content

Last Updated: 1/10/2019, 8:03:04 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/chainModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/chainModuleDesign.html new file mode 100644 index 00000000..06ff555d --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/chainModuleDesign.html @@ -0,0 +1,186 @@ + + + + + + Chain management module design document | NULS + + + + + + + +

Chain management module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why do you have a Chain Management module

In NULS 1.0, there is only one chain (NULS main network), so no chain management module is required.

In NULS 2.0, the NULS main network can register other friend information, including:

  • Chains in the NULS ecosystem: Derived from the same set of code as the NULS main network.
  • Other chains: Bitcoin, Ethereum, etc.

The Chain Management module is used to manage all the friends that join the NULS main network.

Glossary:

  • NULS main network: Unlike NULS 1.0, it is another chain that runs independently, also known as NULS 2.0."Chain Management" is one of the modules of the NULS main network.
  • Friends Chain: Other chains registered on the NULS main website.

Hypothesis 1: Friendship A, which owns asset A

Hypothesis 2: Friendship B, which owns asset B

  • Cross-chain trading: +
    • Friend chain A transfers asset A to friend chain B
    • Friendship B internal transfer of assets A
    • Friend Chain B turns asset A back to friend chain A
    • Friendship B transfers asset A to other friends (C, D, etc.)
  • Non-cross-chain trading: +
    • Friend Chain A Internal Transfer Asset A
    • Friendship B internal transfer of assets B

Remarks: Regardless of the assets in the chain or the assets outside the chain, as long as the assets are traded across the chain, the main network needs to be confirmed.

1.1.2 What does "Chain Management" do?

The Chain Management module is used to manage basic information about the chain that joins the NULS main network, including:

  • Sign up for a new friend chain
  • Destroy existing friendship chains
  • Query friend information
  • Increase the asset type for a specific friend chain
  • Destroy asset type for a specific friend chain
  • Cross-chain asset verification

1.1.3 The Positioning of "Chain Management" in the System

"chain management" dependent module:

  • Kernel module

  • Network module

  • Transaction management module

  • Account module

    "chain management" weakly dependent module:

  • Event bus module

1.2 Module internal architecture diagram

2、feature design

2.1 Functional architecture diagram

2.2 Module service

2.2.1 Sign up for a new friend chain

  • Function Description:

    he NULS main network will provide an entry (web page) through which you can register a new friend chain to the NULS main network.

  • Process description

步骤描述:

Step description:

1> The user registers the registration chain information with the terminal and the asset information initialized with the chain.
+
+2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.
+     During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.
+      And the seed node information of the cross-chain is obtained through the network module and returned to the user.
+
+3>The transaction module will perform a callback of the data check during the transaction process.
+
+4>The chain management module performs registration data submission through the transaction module callback interface of the “submission chain registration transaction”.
+
+5> The chain management module stores the data and sends the registration information to the network module.
+
+6> The registration chain requires 1000NULS, of which 20% is directly destroyed, 80% is used for mortgages, and is returned when assets are deleted.
+
  • Interface definition

    • Interface Description

    ​ Register friendchain information with the chain management module.

    ​ method : cm_chainReg

    • Request example
    {
    +        "chainId": 152,
    +        "chainName": "nuls chain",
    +        "addressType": "1",
    +        "magicNumber":454546,
    +        "supportInflowAsset":"1",
    +        "minAvailableNodeNum":5,
    +        "singleNodeMinConnectionNum":5,
    +        "txConfirmedBlockNum":30,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"NULS CHAIN",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    chainName true string Chain name
    addressType true int The address type of the account created on the chain: 1 within the ecological 2 non-ecological
    magicNumber true string Network magic parameter
    minAvailableNodeNum true int Minimum number of available nodes
    singleNodeConMinNodeNum true int Minimum number of single node connections
    txConfirmBlockNum true int Transaction confirmation block number
    symbol true string Asset symbol
    assetName true string Asset Name
    initNumber true string Initial value of assets
    decimalPlaces true int Minimum asset separable digits
    address true string Create the primary network address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"
      +}
      +
      +
    • Return field description

    parameter type description
    seeds String Seed node
  • Dependent service

    • Network management module
    • Transaction management module, send transaction
    • Account book module, get the book information

2.2.2 Log out of existing friends

  • Function Description:

    The NULS main network will provide an entry (web page) through which you can log out existing friends.

  • Process description

    1>The chain is created with the asset, so the logout chain must be checked for assets. Only the last asset will be deleted and the chain will be logged off.

    2>Conditions for determining whether to allow cancellation:

​ Assets and chains exist.

​ There is only one last asset with the chain.

​ Chain assets have n% of assets in their own main chain.

3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.

​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.

4>The transaction module will perform a callback of the data check during the transaction process.

5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.

6>The chain management module stores the data and sends the registration information to the network module.

7>Deleting the chain with the cancelled assets will return 80% of the mortgage deposit.

  • Interface definition

    • Interface Description

    ​ Unregister the chain information to the chain management module (the asset logout interface is called because the chain is logged off with the last asset)

    ​ method : cm_assetDisable

    • Request example
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    address true string Create the main network account address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Network management module
    • Transaction management module, send transaction
    • Ledger module, checkbook information

2.2.3 Increase asset information

  • Function Description:

    The NULS main network will provide an entry (web page) through which the selection chain and registered assets can be registered.

  • Process description

Step description: +​ 1>The user enters the asset information through the terminal selection chain and the chain: judge whether the assets overlap. +​ 2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module. +​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module. +​ 3> The transaction module will perform a callback of the data check during the transaction process. +​ 4> The chain management module performs registration data submission through the transaction module callback interface of “submit asset registration transaction”. +​ 5> Registered assets receive 1000NULS, of which 20% are directly destroyed, 80% are used for mortgage, and returned when assets are deleted.

  • Interface definition

    • Interface Description

    ​ Register asset information with the chain management module

    ​ method : cm_assetReg

    • Request example
    {
    +        "chainId": 152,
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"NULS",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +         "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int Chain identification
    symbol true string Asset symbol
    assetName true string Asset Name
    initNumber true string Initial value of assets
    decimalPlaces true int Minimum asset separable digits
    address true string Create the primary network address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +

      Success

      Unified RPC standard format
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, send transaction
    • Account book module, get the book information

2.2.4 Deleting an asset type for a specific friend chain

  • Function Description:

    The NULS main network will provide an entry (web page) through which the assets can be destroyed for the specified friend chain.

  • Process description

    Step description: +1> When there are multiple assets registered, the single asset is allowed to be written off. If there is only one asset, the asset is written off along with the chain. +2> Conditions for determining whether to allow cancellation: +​ There are multiple assets in the chain. +​ Chain assets have n% of assets in their own main chain. +3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module. +​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module. +4>The transaction module will perform a callback of the data check during the transaction process. +5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”. +6>The cancellation of the assets will be refunded 80% of the mortgage deposit.

  • Interface definition

    • Interface Description

    ​ Log out asset information to the chain management module

    ​ method : cm_assetDisable

    • Request example
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    address true string Create the main network account address of the chain
    password true string Password corresponding to the private key
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
    • Dependent service

      • Transaction management module, send transaction
      • Ledger module, checkbook information

2.2.5 Chain asset verification for cross-chain transactions

  • Function Description:

    When the transaction module generates a cross-chain transaction, the interface is called to perform cross-chain asset verification.

  • Process description

    1>Check chain and assets are registered normally in the cross-chain module

    2>Check if the amount of assets on the chain is overdrawn.

    3>Verify that the asset status is normal.

  • Interface definition

    • Interface Description

    ​ Submit verification to chain management when cross-chain assets are in circulation

    ​ method : cm_assetCirculateValidator

    • Request example
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • Request parameter description
    parameter required type description
    coinDatas true String Trading the HEX value of coindata
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, cross-chain transaction verification call

2.2.6 Chain asset submission for cross-chain trading

  • Function Description:

    When the transaction module generates a cross-chain transaction and verifies the pass, it calls the interface to submit the cross-chain asset.

  • Process description

    Used to change chain assets and manage them for chain assets

    Direct call cm_assetCirculateCommit

  • Interface definition

    • Interface Description

    ​ When the cross-chain asset is circulated, the transaction can be submitted to the chain management when the verification is passed and the confirmation is submitted.

    ​ method : cm_assetCirculateCommit

    • Request example
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • Request parameter description
    parameter required type description
    coinDatas true String Trading the HEX value of coindata
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      Unified RPC standard format
      +
      +
    • Return field description

    parameter type description
  • Dependent service

    • Transaction management module, cross-chain transaction call

2.2.7 Registration of chain management transaction processing functions

  • Function Description:

    When the module is started, registration of the transaction callback function is required, so that the transaction module performs callback processing when performing related type transaction processing.

    The registration function is divided into 4 categories: 1> transaction verification 2> transaction submission 3> transaction rollback 4> module batch transaction verification within a block

  • Process description

    1>Chain management module startup.

    2>Determine whether the transaction module RPC call status is accessible.

    3>Submit callback interface.

  • Interface definition

    See the "Registering a Transaction" section in the Transaction Module Design Document.

  • Dependent service

    • Transaction management module

2.2.8 Query chain information

  • Function Description:

    Query registration chain information

  • Process description

​ NA

  • Interface definition

    • Interface Description

    ​ Query registration friend information

    ​ method : cm_chain

    • Request example
    {
    +   "chainId":4545 
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "chainName": "nuls chain",
      +        "addressType": 1,
      +        "magicNumber":454546,
      +        "supportInflowAsset":"1",
      +        "minAvailableNodeNum":5,
      +        "singleNodeMinConnectionNum":5,
      +        "txConfirmedBlockNum":30,
      +        "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "regTxHash":"FFFFF", 
      +        "selfAssetKeyList":["1232_32","528_8"],
      +        "totalAssetKeyList":["1232_32","528_8"],
      +        "createTime":1212131
      +}
      +
    • Return field description

    parameter type description
    chainId int Chain identification
    chainName string Chain name
    addressType int The address type of the account created on the chain: 1 within the ecological 2 non-ecological
    magicNumber string Network magic parameter
    minAvailableNodeNum int Minimum number of available nodes
    singleNodeConMinNodeNum int Minimum number of single node connections
    txConfirmBlockNum int Transaction confirmation block number
    regTxHash string Transaction hash
    regAddress string Create the primary network address of the chain
    selfAssetKeyList list List of assets registered under the chain, asset key value combined by chainId_assetId
    totalAssetKeyList list List of assets circulating under the chain, asset key value combined by chainId_assetId
    createTime long Creation time
  • Dependent service

    NA

2.2.9 Query chain asset information

  • Function Description:

    Query a chain asset information

  • Process description

​ NA

  • Interface definition

    • Interface Description

    ​ Query the asset management module for an asset information.

    ​ method : cm_asset

    • Request example
    {
    +   "chainId":4545, 
    +   "assetId":45
    +}
    +
    • Request parameter description
    parameter required type description
    chainId true int Chain identification
    assetId true int Asset id
    • Return example

      Failed

      Unified RPC standard format
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "assetId":85,
      +        "symbol":"NULS",
      +        "assetName":"NULS ASSET",
      +        "initNumber":"1000000000",
      +        "decimalPlaces":8,
      +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "txHash":"xxxxxxxxxxxxx",
      +        "createTime":125848
      +        }
      +
    • Return field description

    parameter type description
    chainId int Chain identification
    symbol string Asset symbol
    assetName string Asset Name
    initNumber string Initial value of assets
    decimalPlaces int Minimum asset separable digits
    address string Create the primary network address of the chain
    txHash string Transaction hash
    createTime long Creation time
  • Dependent service

    NA

3、Event description

  • Chain registration event
  • Chain logout event
  • New asset event
  • Logout asset event

4、protocol

4.1 Network communication protocol

4.1.1 Asking the friend chain for the total amount of assets issued

  • Message description: Periodic chain management initiates the issue of total asset data request message to the friend chain
  • cmd:requestAssetAmount
Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
4 randomCode uint32 random number

4.1.1 Receive the total amount of assets returned by the friend chain

  • Message Description: Received a reply from the friend chain to the asset.
  • cmd:responseAssetAmount
Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
48 biginteger Total assets amount
4 randomCode uint32 random number

4.2 Transaction agreement

4.2.1 Sign up for a new friend chain

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10101

txData definition

Length Fields Type Remark
2 chainId uint16 Chain ID
name byte[] Chain Name
1 addressType uint8 address type
4 magicNumber uint32 Magic parameter
1 supportInflowAsset uint8 Whether to spend asset inflows
2 minAvailableNodeNum uint16 Minimum number of available nodes
2 singleNodeMinConnectionNum uint16 Single node minimum connection number
address byte[] Account address
2 assetId uint16 Asset id
symbol byte[] symbol
assetName byte[] Asset name
2 depositNuls uint16 Mortgage NULS quantity
48 initNumber Biginteger Initial quantity of assets
1 decimalPlaces uint8 Minimum number of assets
4.2.2 Log out of existing friends

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10102

txData definition:Same as 4.2.1 chain registration transaction

4.2.3 New friend chain assets

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10103

txData definition:

Length Fields Type Remark
2 chainId uint16 Chain Id
2 assetId uint16 Asset id
symbol byte[] symbol
assetName byte[] Asset name
2 depositNuls uint16 Mortgage NULS quantity
48 initNumber Biginteger Initial quantity of assets
1 decimalPlaces uint8 Minimum number of assets
address byte[] Account address
4.2.2 Log out of existing assets

Compared with the general transaction, only the type and txData are different, the specific difference is as follows

Transaction type definition:10104

txData definition:New transactions with 4.2.3 assets

5、Module configuration

[system]
+language = en
+encoding = UTF-8
+
+[db]
+rocksdb.datapath = ../data
+
+[param]
+asset_symbol_max = 5
+asset_name_max = 20
+asset_depositNuls = 200000
+asset_depositNuls_destroy_rate = 0.2
+asset_depositNuls_lock_rate = 0.8
+asset_initNumber_min = 10000
+asset_initNumber_max = 100000000
+asset_decimalPlaces_min = 4
+asset_decimalPlaces_max = 8
+asset_recovery_rate = 0.9
+
+[defaultAsset]
+nuls_chain_id = 8964
+nuls_chain_name = nuls chain
+nuls_asset_id = 1
+nuls_asset_initNumber_max = 100000000
+nuls_asset_symbol = NULS
+

6、Java-specific design

NA

7、to add on

NA

Last Updated: 1/10/2019, 8:03:04 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/consensusModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/consensusModuleDesign.html new file mode 100644 index 00000000..88fe8c9c --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/consensusModuleDesign.html @@ -0,0 +1,1134 @@ + + + + + + Consensus module design document | NULS + + + + + + + +

Consensus module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why do you have a consensus module

​ As we all know, the core of the blockchain is the consensus mechanism. Unlike the traditional Internet's clipet-server architecture, the agents of the blockchain are peer-to-peer, without the center, and everyone has the same rights; so in order to make the data consistent, let a network without a center maintain a set of books that everyone agrees with. This is the role of the consensus mechanism.

​ Broadly speaking, the consensus mechanism is the rule or algorithm that each agent of the blockchain adheres to, and is the basis for mutual trust. In this way, it can achieve decentralized unsupervised and maintain the normal operation of the entire platform.

​ In a narrow sense, the consensus mechanism determines the mechanism by which each agent verifies and validates transactions on the blockchain.

1.1.2 What does the consensus module do

​ Each transaction in the blockchain must be approved by each agent, and the transaction is completed only after the entire network has reached a consensus. It is like in a democratic election, the voting method or rules must be recognized by the whole people, based on which the election can be completed. In the blockchain, the main performance of the consensus mechanism is the incentive system, which is the reward for the miners. Under the guarantee of the consensus mechanism, every miner can be rewarded, and the entire blockchain can operate in an orderly manner, providing a fair, transparent and trusting environment. Therefore, the consensus module needs to provide a specific algorithm to maintain, that is, the consensus algorithm.

​ There are many public chain consensus mechanisms, and the mainstream is POW, POS, and DPOS. The NULS main network adopts the self-originated POC (Proof Of Credit) consensus mechanism, which inherits the security and high efficiency of the Dpos consensus mechanism. At the same time, it has made great improvements in collaboration, which can be regarded as an upgraded version. Dpos.

​ POC Consensus module responsibility:

  • Legality verification after block synchronization

  • Create consensus agents, delegate participation consensus, cancel delegation, and cancel consensus agents ★

  • Consensus agent packs out blocks

  • Disbursement of network maintenance incentives

  • Bad agent punishment ★

    PS:Different consensus mechanisms have different consensus algorithms. The above marked ★ is unique to POC consensus.

1.1.3 《Consensus module》Positioning in the system

​ The consensus module is a relatively core piece in the system. It is mainly responsible for packing transactions, verifying block headers, managing consensus agent information in the management system, entrusting information, and penalizing information.

1.2 Architecture diagram

Description:

  • Services: +
    • tx service : Additions, deletions and changes to transactions
    • consensus service : Consensus activities and state management, functional design
  • Validator +
    • tx Validator: Validator for consensus-related transactions for verifying consensus-related transactions
  • Processor +
    • Tx Processor:Consensus module related transaction processor for submitting rollback detection transactions
  • Task/Thread: +
    • consensus Task: Consensus packaging
    • Reward Task : Data statistics
  • Storage:Store consensus module related transaction data

2.0 Functional architecture diagram

2.1Consensus module functional requirements analysis

2.1.1 Support multi-chain parallelism

​ The NULS 2.0 design concept is to provide modular services, and each module should support multiple chains of data running at the same time, so the consensus module needs to implement algorithms with different consensus mechanisms. When the consensus module is started, it can simultaneously support multiple chains to run at the same time.

2.1.2 POC consensus mechanism

​ The main network of NULS adopts the independent POC consensus mechanism. To realize POC, you first need to know the design concept and business rules of POC. The following content is taken from the introduction part of the NULS white paper POC consensus. If you are familiar, you can skip it directly.

Consensus mechanism——POC
+	The NULS main chain defaults to the credit consensus mechanism POC (Proof-Of-Credit). In the case where the agent credit is up to standard, a certain margin can be locked to join the consensus. After the consensus agent is reordered, each round will flow out of the block, and the margin will be unlocked when the consensus is exited.
+	
+1、Consensus entry and exit mechanism
+	Anyone can join the NULS consensus at any time, as long as they meet the conditions and follow the rules, that is, they can continue to receive NULS token rewards. The addition of POC is divided into hard indicators and soft indicators. The hard indicator means that the credit score must reach a certain standard line, and exclude some agents that have been evil. The soft index refers to the need to freeze a certain amount of NULS tokens as a margin, in order to prevent the proliferation of agents and make the whole system more fair. The number of margins can be freely selected by anyone except the minimum value. The amount of the deposit will be tied to the final reward.
+	
+1.1 Yellow card penalty
+	Due to the hardware configuration of the agent or the network, the disconnection, crash, etc. during the consensus period cannot be blocked. It is not a violation, but it will affect the whole system. Therefore, the system has a mild warning mechanism for such cases. : lower the agent credit value.
+	
+1.2 Red card penalty
+	For some double-split, repeated block-outs, attempts to fork the system, and malicious human-induced damage that does not comply with system rules, the NULS system is firmly resisted, and all agents can detect this kind of situation; once a malicious agent tries to challenge the system, Then the corresponding margin will be locked for 2 months, and the credit rating will never reach the consensus threshold.
+	
+2、Credit Rating
+	In the NULS system, credit is the credit factor of the account in the system, and the credit of all accounts is automatically calculated by the credit rating algorithm formula in the interval [-1, 1].
+	
+	Credit evaluation formula: credit base = capacity coefficient + responsibility coefficient
+	Capacity factor: calculated based on the number of historical blocks
+	Responsibility factor: Calculated according to violations and correctness of the block
+	
+3、Consensus reward
+	For the balance and fairness of the entire NULS system, the consensus reward is calculated based on the margin and consensus agent credits submitted by all consensus agents. Consensus reward calculation formula: see (Figure p1)
+	
+4、Subchain consensus mechanism
+	There are two types of sub-chains that access NULS. The first one is accessed through the standard interface protocol of the NULS system, and the second is deployed through the NULS program.
+	
+	NULS is a common blockchain underlying infrastructure that does not run any application services on its main chain, and all application services are run by sub-chains. Through the NULS system, NULS-based sub-chains can be quickly deployed, and various operational parameters of the sub-chain can be flexibly customized, including whether to support basic tokens, encryption algorithms, consensus mechanisms, and storage mechanisms.
+	
+	NULS defines a standard consensus module to provide interfaces that are compatible with different consensus mechanisms. The NULS community will develop consensus mechanisms such as POW, DPOS, POS, PBFT, and POOL verification pools for users to choose freely.
+
+

Figure p1: Consensus reward calculation formula:

In the POC system, there are four roles: agent, principal, packager, and rewarder
  • Agent - the consensus agent creator. The NULS holder initiates a transaction to create a consensus agent, which is recorded in the chain and tells everyone that I want to be a consensus agent. The basic condition for agent creation is that 20,000-200,000 NULS need to be locked, and there is no red card penalty record. The purpose of setting up this basic condition is to prove that you are really trying to maintain the basic network of NULS.
  • Packager- When creating a consensus agent, the agent can specify a packager. This packager can be his own other account, or a friend who knows technology. The most important thing is that the packager can not hold any NULS. Even if the server participating in the consensus is hacked, the user will not have a huge loss, and the loss will only be affected by the earnings after the attack. It should be noted that the packager is a real out-of-the-box account. Each time you package a block, you need to sign the block. Therefore, you must not set a password for the packaged account.
  • Rewarding people- When creating a consensus agent, an agent can not only specify a packager, but also designate a beneficiary to specify who can get the reward generated by the consensus.
  • The principal-NULS holder can entrust the NULS he holds to the agent according to the agent's credit value and the influence of the agent, etc., and enjoy the corresponding consensus. Revenue, if the agent agent quality or integrity is found to decrease, the principal may withdraw its entrustment and change to others at any time.
In the POC system, there are four business logics: creating a proxy (creating a consensus agent), stopping a proxy agent (exiting consensus), delegating a consensus, and canceling a delegation.
  • Create proxy (create consensus agent): Lock 20,000-200,000 NULS and initiate a registration proxy transaction. After packaging, the whole network can be seen. Others can lock the NULS delegation to the proxy agent.
  • Stop the agent agent (exit consensus): The agent can stop its agent qualification at any time, initiate a transaction to delete the agent agent, and after the transaction is packaged and confirmed, it will quickly withdraw from the consensus and no longer participate in the production of the new block. The 20,000 NULS locked during the registration of the agent will be unlocked after 72 hours, and the rest of the NULS delegated to the agent will be unlocked immediately.
  • Delegate consensus: Users with NULS of 2000 or above can choose a proxy agent to commission and obtain the corresponding block revenue. Before exiting, the corresponding delegated NULS will be locked out of use. A proxy agent can accept up to 500,000 NULS delegates.
  • Cancellation of the delegation: The user can cancel the previous entrustment. After the revocation, the locked NULS will immediately explain and no longer enjoy the corresponding consensus revenue.
Two punishment mechanisms for POC systems
  • Yellow card penalty: When the block agent is disconnected from the network, card machine and other uncertain reasons, the block will not be out of the block, or the block is not used, then the yellow card will be punished in the next round. The yellow card penalty will affect the agent's income; when 100 consecutive yellow card penalties are awarded, a red card will be imposed.
  • Red card penalty: When the block agent makes malicious fork, double flower and other behaviors that seriously endanger the stability of the network, or when it receives 100 yellow card penalties continuously, the system will give a red card penalty. The agent that receives the red card penalty will be forced to stop the consensus. The deposit when the agent is created is frozen for 3 months, and the agent can never be created again; the corresponding agent of the agent that received the red card penalty is immediately unlocked.
Hidden functional requirements of POC internal systems
  • Maintain a consensus agent information table and update based on the above four transactions received in real time.
  • Maintain a round of information table, so that each round of agents who meet the conditions of the outbound block are randomly queued out.
  • The proxy agent that meets the condition of the outbound condition verifies and packages the transaction of the memory pool, assembles it into a new block and broadcasts it to the whole network.

The above is a functional analysis of the implementation of the consensus module POC consensus mechanism. The details of each function implementation are described in the next section.

2.2 Module service

​ The consensus module is the core module of the blockchain. Due to the different consensus mechanisms, the services provided by the outside are not the same. The module service will describe in detail the services shared by the consensus module and the services specific to the POC mechanism.

2.2.1 Create agent

  • Function Description:

    	Create an address that specifies the packaged block (the fast address when the consensus agent satisfies the packageable condition), the commission ratio (the commission ratio of other accounts participating in the agent consensus), and the consensus reward settlement address (the reward for the consensus agent) The consensus agent of the home address, waiting for other agents to delegate consensus, when the commissioned consensus amount reaches the standard amount, the agent can package the block to earn the reward.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	By creating a agent interface, the NULS user can initiate the creation of a agent transaction, and after the transaction is confirmed and packaged, the consensus agent can be successfully created.
      +
    • Request example

      {
      +    "method":"cs_createAgent",
      +    "version:"1.0",
      +    "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 agentAddress true String Request to create a agent account address
      1 packingAddress true String Packing block address
      2 rewardAddress false String Reward settlement address (default is the same as the agent address)
      3 commissionRate true double Commission rate
      4 deposit true long Create a agent's margin
      5 password false String password
      6 chainId true String chain ID
    • Return example

      success

      {
      + 	"version": 1.0,
      +    "code":0,
      +    "msg" :"Success message",
      +    "result":{
      +        "value":"tx.getHash().getDigestHex()" //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +	"version": 1.0,
      +   	 "code":1,
      +   	 "msg" :"Error message",
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the generated transaction hash value

2.2.2 Create agent transaction verification

  • Function Description:

    Create a validator for agent transactions
    +
  • Process description

    - Verify that the transaction contains agent information
    +- Verify that the trade creator is correct
    +- agent address and package address cannot be verified
    +- agent reward address and package address cannot be verified
    +- Commission proportional validity verification
    +- Create a agent's margin validity verification
    +- Signature correctness verification
    +- CoinData verification (lock time verification)
    +
  • Interface definition

    • Interface Description

      	This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.
      +
    • Request example

      {
      +    "method":"cs_createAgentValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                           //Prompt message                          
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                                //error code
      +   	 "msg" :"错误Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      无
      +

2.2.3 Create a agent transaction submission

  • Function Description:

    Save the created consensus node information
    +
  • Process description

    - Save node information to the database
    +
  • Interface definition

    • Interface Description

      Save consensus node information to the database
      +
    • Request example

      {
      +    "method":"cs_createAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.4 Create agent transaction rollback

  • Function Description:

    Delete consensus agent information
    +
  • Process description

    - Delete consensus agent information
    +
  • Interface definition

    • Interface Description

      Remove consensus agent information from the data
      +
    • Request example

      {
      +    "method":"cs_createAgentRollBack",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set 
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.5 Logout consensus agent

  • Function Description:

    	Log out a consensus agent created by yourself, and the consensus amount and consensus bonus of the agents participating in the consensus after unregistering the agent will be thawed after a certain time.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	By deregistering the agent interface, the NULS user can initiate a transaction to cancel the agent created by himself. After the transaction is confirmed to be packaged, the consensus agent can be successfully logged out.
      +
    • Request example

      {
      +    "method":"cs_stopAgent",
      +    "version:"1.0",
      +    "params":["address","password",chainId]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Create the address of the logout agent trading account
      1 password false String password
      2 chainId true String chian ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message        
      +    "result": {                                 //Returned business data set 
      +  		"value":"tx.getHash().getDigestHex()"   //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the generated transaction hash value

2.2.6 Logout agent transaction verification

  • Function Description:

    Verify the correctness of the logout agent transaction验证注销节点交易的正确性
    +
  • Process description

    - Verify that the deleted consensus agent exists and that the consensus agent has       been logged out
    +- Verify that the trade creator is correct
    +- CoinData verification (output address must exist)
    +- Query all consensus information participating in the consensus agent and the total   consensus amount of the agent
    +- Check whether the total amount of UTXO spent in the logout agent transaction is     equal to the consensus agent entrusted amount in the database query. If not,         verify the fail.
    +- Verify that each UTXO unlocked in the logout agent transaction is correct
    +
  • Interface definition

    • Interface Description

      Verify that the logout agent transaction is correct.
      +
    • Request example

      {
      +    "method":"cs_stopAgentValid",
      +    "version:"1.0",
      +    "params":["tx",chainId]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Logout serialized data for agent transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.7 Logout agent transaction submission

  • Function Description:

    Submit logout agent data transaction
    +
  • Process description

    - Set all delegate data under the consensus agent to deleted
    +- Set the consensus agent data to deleted
    +
  • Interface definition

    • Interface Description

      	Log out the consensus agent and set all the delegate data and consensus agents under the consensus agent to the deleted state.
      +
    • Request example

      {
      +    "method":"cs_stopAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Create serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.8 Logout agent transaction rollback

  • Function Description:

    Logout agent transaction data rollback
    +
  • Process description

    - Set all delegate data under the consensus agent to not deleted
    +- Set the consensus agent data to not deleted
    +
  • Interface definition

    • Interface Description

      Rollback logout agent transaction data
      +
    • Request example

      {
      +    "method":"cs_stopAgentRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Logout serialized data for agent transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chian ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.9 Apply to join the consensus

  • Function Description:

    	Entrust the specified amount to the consensus agent to participate in the consensus to earn consensus rewards. The entrusted amount and consensus reward will be frozen during the consensus period.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	Through this interface, users can entrust the specified agent address to join the consensus and earn bonuses.
      +
    • Request example

      {
      +    "method":"cs_depositToAgent",
      +    "version:"1.0",
      +    "params":["address","agentHash",20000,"password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Apply for a consensus account address
      1 agentHash true String Consensus agent id
      2 deposit true long Amount of participation in the consensus
      3 password false String Apply for a password for participating in the consensus account
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		"value":"tx.getHash().getDigestHex()"     //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the transaction hash value

2.2.10 Commissioned consensus transaction verification

  • Function Description:

    Entrusted consensus transaction correctness verification委托共识交易正确性验证
    +
  • Process description

    - Verify that the consensus agent to apply for is valid
    +- Verify that the consensus agent that applied to join has reached the maximum         number allowed to join the consensus
    +- Verify that the entrusted amount is valid
    +- Verify that the transaction was created by the account that requested the           application.
    +- Verify that the commission amount is equal to the output UTXO amount, and that     the output UTXO lock time is correct.
    +
  • Interface definition

    • Interface Description

      	Verify the validity of the entrusted agent in the entrusted transaction, verify the correctness of the entrusted amount, verify whether the entrusted transaction creator is correct, and whether the UTXO output by the entrusted transaction is correct. Verify that the logout agent transaction is correct.
      +
    • Request example

      {
      +    "method":"cs_depositValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for commissioned consensus transactions
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.11 Entrusted consensus transaction submission

  • Function Description:

    Entrusted transaction submission
    +
  • Process description

    - Save commissioned transaction information
    +
  • Interface definition

    • Interface Description

      Save commissioned transaction data
      +
    • Request example

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for transactions
      1 height true long The height of the block where the commissioned transaction is packaged
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.12 Delegate consensus transaction rollback

  • Function Description:

    Delegate consensus transaction rollback, delete delegate consensus transaction data
    +
  • Process description

    - Delete delegate consensus transaction information
    +
  • Interface definition

    • Interface Description

      	When the commissioned consensus transaction commits an error, this interface needs to be dropped to delete the delegate consensus transaction data.
      +
    • Request example

      {
      +    "method":"cs_depositRollback",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for commissioned consensus transactions
      1 height true long The height of the consigned consensus transaction is packaged
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.13 Revoke commission

  • Function Description:

    	Apply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.
    +
  • Process description

    - Verify parameter correctness
    +- Create a transaction
    +- Determine if the account balance is sufficient
    +- Verify the transaction
    +- Save the transaction
    +- Broadcasting transactions
    +
  • Interface definition

    • Interface Description

      	Apply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.
      +
    • Request example

      {
      +    "method":"cs_withdraw",
      +    "version:"1.0",
      +    "params":["address","txHash","password","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Apply to withdraw from the consensus account address
      1 txHash true String Transaction hash when joining consensus
      2 password false String password
      3 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		"value":"tx.getHash().getDigestHex()"   //Generated transaction hash value
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      value String The hex string of the transaction hash value

2.2.14 Exit consensus transaction verification

  • Function Description:

    Verify that the exit consensus transaction is correct
    +
  • Process description

    - Verify that the consensus to exit has been delegated before and has not exited
    +- Verify that the account that created the transaction is correct
    +
  • Interface definition

    • Interface Description

      	Before exiting, verify that the account has participated in the delegate and is still in the delegate. Also verify that the transaction creator is the principal.
      +
    • Request example

      {
      +    "method":"cs_withdrawValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Exit serialized data for a trusted transaction
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message  
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.15 Exit consensus transaction submission

  • Function Description:

    	Exit the consensus transaction submission, save the data related to the exit consensus transaction
    +
  • Process description

    - Save exit consensus transaction related data
    +
  • Interface definition

    • Interface Description

      	Save the transaction-related data by calling the interface after exiting the consensus transaction verification success
      +
    • Request example

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Serialized data for transactions
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0", 
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message 
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.16 Exit consensus transaction rollback

  • Function Description:

    Exit consensus transaction data rollback
    +
  • Process description

    - Rollback exit consensus transaction data
    +
  • Interface definition

    • Interface Description

      	When exiting the consensus transaction submission error, you need to call this interface to roll back the data to ensure the correctness of the data.
      +
    • Request example

      {
      +    "method":"cs_withdrawRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 tx true String Exit serialized data for a trusted transaction
      1 blockHeader true String Block header hex string
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //error code
      +    "msg": "Prompt message",                    //Prompt message
      +    "result": {                                 //Returned business data set  
      +  		
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      nothing
      +

2.2.17 Query consensus agent list

  • Function Description:

    	Obtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of consensus agents on the local primary chain
    +- Filter the list of consensus agents to get a list of consensus agents that meet the   criteria
    +- Consensus agent list sorting
    +- Pagination
    +- Return to the list of consensus agents
    +
  • Interface definition

    • Interface Description

      	Obtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query
      +
    • Request example

      {
      +    "method":"cs_getAgentList",
      +    "version:"1.0",
      +    "params":[1,10,"address","keyword","sortType","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 pageNumber true int page number
      1 pageSize true int Amount of data per page
      2 keyword false String Keyword (agent address, packed address, agent alias, agent ID)
      3 sortType false String The sort type (deposit creates the lock amount of the consensus agent, the commissionRate commission ratio, the creditVal reward amount, the total amount of the total deposit consensus, the comprehensive sort of comprehensive)
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "agentHash":"",                  //agent hash
      +                "agentAddress";"",            //Create the address of the agent
      +                "packingAddress";"",            //Packed address
      +                "rewardAddress";"",             //Reward address
      +                "deposit";,                     //Margin
      +                "commissionRate";,              //Commission rate
      +                "agentName";"",                 //agent name
      +                "agentId";"",                   //agent ID
      +                "introduction";"",              //Introduction
      +                "time";,                        //Creation time
      +                "blockHeight";,                 //Block height
      +                "delHeight":,                   //Block height at which the consensus agent is deleted
      +                "status":,                      //status                    
      +                "creditVal":,                   //Reputation value
      +                "totalDeposit":,                //Total amount of participation in the consensus
      +                "txHash":"",                    //Transaction hash
      +                "memberCount":,                 //Number of people joining the agent consensus
      +                "version":                       //version
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int Total data volume
      pages int total pages
      data List Consensus agent list

      Agent:

      parameter type description
      agentHash String agnet hash
      agentAddress String Create the address of the agent
      packingAddress String Packed address
      rewardAddress String Reward address
      deposit long Margin
      commissionRate double Commission rate
      agentName String agent name
      agentId String agent ID
      introduction String Introduction
      time long Creation time
      blockHeight long Create the height of the block where the agent is trading
      delHeight long Write off the height of the block where the transaction is located
      status int status
      creditVal double Reputation value
      totalDeposit long Total commission amount
      txHash String Transaction hash
      memberCount int Number of orders
      version String Protocol version

2.2.18 Query agent details (basic information, credit value, agent status)

  • Function Description:

    	Query detailed information of the specified consensus agent, including the creation time of the consensus agent, margin, commission ratio, agent address, package address, consensus status, credit value, commission amount, consensus number, etc.
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of consensus agents on the local primary chain
    +- Find the corresponding agent information from the list
    +
  • Interface definition

    • Interface Description

      Query the details of the agent through the agent hash
      +
    • Request example

      {
      +    "method":"cs_getAgent",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 agentHash true String Consensus agent id
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +                "agentHash":"",                  
      +                "agentAddress";"",              
      +                "packingAddress";"",          
      +                "rewardAddress";"",             
      +                "deposit";,                     
      +                "commissionRate";,              
      +                "agentName";"",                 
      +                "agentId";"",                   
      +                "introduction";"",              
      +                "time";,                       
      +                "blockHeight";,                 
      +                "delHeight":,                   
      +                "status":,                                      
      +                "creditVal":,                   
      +                "totalDeposit":,               
      +                "txHash":"",                  
      +                "memberCount":,                 
      +                "version":       
      +         }
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      agentHash String agent hash
      agentAddress String Create the address of the agent
      packingAddress String Packed address
      rewardAddress String Reward address
      deposit long Margin
      commissionRate double Commission rate
      agentName String agent name
      agentId String agent ID
      introduction String Introduction
      time long Creation time
      blockHeight long Create the height of the block where the agent is trading
      delHeight long Write off the height of the block where the transaction is located
      status int status
      creditVal double Reputation value
      totalDeposit long Total commission amount
      txHash String tx hash
      memberCount int Number of orders
      version String Protocol version

2.2.19 Query agent penalty list (all, red, yellow)

  • Function Description:

    	Obtain the penalty record (red card and yellow card penalty) obtained by the consensus agent. The user can customize the query for all penalty records or only the red card or yellow card penalty information.
    +
  • Process description

    - Verify parameter correctness
    +- Get the penalty based on the type of query
    +
  • Interface definition

    • Interface Description

      Query the penalty record specifying the block address
      +
    • Request example

      {
      +    "method":"cs_getPunishList",
      +    "version:"1.0",
      +    "params":["address",0,"chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 address true String Block address
      1 type true int Penalty type 1 yellow card, 2 red card, 0 all
      2 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "type",,                        
      +                "address","",                   
      +                "time","",                      
      +                "height",,                     
      +                "roundIndex",,                              
      +                "reasonCode",""                 
      +            },{
      +               ......
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int Total data
      pages int total pages
      data List Penalty list data

      Punish:

      parameter type description
      type byte Type of punishment
      address String address
      time String punishment time
      height long Punish the height of the block
      roundIndex long round
      reasonCode String Reason for punishment

2.2.20 Query the list of delegates (according to the principal, according to the agent)

  • Function Description:

    1. Query the list of all delegation information participating in the specified 	      address
    +2. Query the delegation information of the specified consensus agent participating      in the specified account
    +3. Query the specified consensus agent trust list information
    +
  • Process description

    - Verify parameter correctness
    +- Get a list of participating consensus information on the local primary chain
    +- Filter the consensus list to get the consensus list of the specified account       participation or the consensus list information of the specified agent
    +
  • Interface definition

    • Interface Description

      	Obtain the consensus list information accepted by the specified account or specified by the consensus agent. When querying all the consensus lists of the specified account, the agentHash field is passed "". When all the delegated lists of the specified agent need to be queried, the address field is passed "".
      +
    • Request example

      {
      +    "method":"cs_getDepositList",
      +    "version:"1.0",
      +    "params":[1,10,"address","agentHash","chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 pageNumber true int page number
      1 pageSize true int Amount of data per page
      2 address false String The account address of the participating delegation (the entrusted information of the query agent is the designated pass "")
      3 agentHash false String Specify the proxy agent ID (this field is passed "" when querying all account delegation information)
      4 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"pageNumber":1,                         //page number         
      +    	"pageSize":10,                          //Amount of data per page
      +    	"total":100,                            //Total data volume
      +    	"pages",10,                             //total pages
      +    	"data":[
      +            {
      +                "agentHash":"",                  
      +                "address";"",                   
      +                "deposit";,                     
      +                "time";,                        
      +                "blockHeight";,                 
      +                "delHeight":,                         
      +                "txHash":"",                    
      +                "status":,                       
      +                "agentName":"",                  
      +                "agentAddress":""  
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      data:

      parameter type description
      pageNumber int page number
      pageSize int Amount of data per page
      total int otal data
      pages int page number
      data List Json string of consensus data list

      Deposit:

      parameter type description
      agentHash String agent hash
      address String Apply to join the consensus account address
      deposit long Commission amount
      time long Commission time
      blockHeight long The height of the block where the transaction is located
      delHeight long Exit the height of the commissioned exchange
      txHash String tx hash
      status int Consensus agent status (to be agreed, consensus)
      agentName String agent name
      agentAddress String agent address

2.2.21 Query the consensus status of the entire network

  • Function Description:

    	Query the overall information of the network consensus, including the number of agents, total mortgage, total number of participating consensus accounts, etc.
    +
  • Process description

    - Get a list of network-wide consensus agents
    +- Filter the list of consensus agents and wait until the list of valid consensus       agents
    +- Get current package round information
    +- According to the current package round information, the total amount of accounts   and the total amount of entrusted funds that the current network participates in   the consensus
    +
  • Interface definition

    • Interface Description

      	Query the number of agents in the whole network, the total commission amount, the accounts participating in the consensus, and the number of consensus agents that meet the packaging conditions.
      +
    • Request example

      {
      +    "method":"cs_getWholeInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "agentCount":,                     
      +            "totalDeposit":,                    
      +            "rewardOfDay":,                   
      +            "consensusAccountNumber":,          
      +            "packingAgentCount":     
      +    	}
      +    }
      +}
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
    • Return parameter description

      parameter type description
      agentCount int Number of agents
      totalDeposit long Total amount of entrusted amount
      rewardOfDay long Reward amount within 24 hours
      consensusAccountNumber int Number of accounts participating in the consensus
      packingAgentCount int Current rounded number of consensus agents

2.2.22 Query individual account consensus status

  • Function Description:

    Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.
    +
  • Process description

     - Get a list of network-wide consensus nodes
    +

- Check if there is a consensus node created by the account in the consensus node list +   - Get the current network delegate list +   - Get the list of delegates participating in the account from the delegate list +   - Obtain commission information for the account from the delegate list of the account


+- Interface definition
+
+- Interface Description
+
+
Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.
+```
+
  • Request example

    {
    +    "method":"cs_getInfo",
    +    "version:"1.0",
    +    "params":["address","chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 address true String Account address
    1 chainId true String chain ID
  • Return example

    success

    {
    +    "code": 0,                                  //error code
    +    "msg": "success",                           //Prompt message
    +    "version":"1.0",                            
    +    "result": {                                 //Returned business data set  
    +    	"data":{
    +            "agentCount":,                      
    +            "totalDeposit":,                    
    +            "joinAgentCount":,                 
    +            "usableBalance":,                   
    +            "reward":,                          
    +            "rewardOfDay":,                     
    +            "agentHash":""                    
    +    	}
    +    }
    +}
    +

    fail

    {
    +     "version": 1.0,
    +   	 "code":1,                         //error code
    +   	 "msg" :"错误Prompt message",             //Prompt message
    +     "result":{
    +        
    +  	  }
    +}
    +
  • Return parameter description

    parameter type description
    data Object Consensus information
    agentCount int The number of agents created by this account
    totalDeposit long The total commission amount of the account
    joinAgentCount int The number of consensus agents participating in the account
    usableBalance long Available Balance
    reward long All rewards for account participation consensus
    rewardOfDay long Consensus rewards obtained within 24 hours of the account
    agentHash String The hash of the agent created by the account

2.2.23 Verify block correctness

  • Function Description:

    Verify the block round information, package the person, the transaction information in the block, whether the CoinBase is correct, and verify whether there is red and yellow card transaction generation.
    +
  • Process description

     - Verify fork (call block management module interface), generate red card trade with fork
    +

- Verify double flower (call transaction module interface), generate double card transaction with double flower and return to verify fail directly +   - Generate red card trades and place red card trades in the trading pool to be packaged +   - Verify block rotation information and packager correct +   - Verify transaction correctness in the block (call transaction module interface) +   - Verify CoinBase transactions


+- Interface definition
+
+- Interface Description
+
+
This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.
+```
+
  • Request example

    {
    +    "method":"cs_validSmallBlock",
    +    "version:"1.0",
    +    "params":["SmallBlock","chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 smallBlock true String SmallBlock serialization data
    1 chainId true String chain ID
  • Return example

    success

    {
    +    "version":"1.0",  
    +    "code": 0,                                  //error code
    +    "msg": "Prompt message",                    //Prompt message                          
    +    "result": {                                 //Returned business data set  
    +  		
    +    }
    +}
    +
    +

    fail

    {
    +     "version": 1.0,
    +   	 "code":1,                            //error code
    +   	 "msg" :"Prompt message",             //Prompt message
    +     "result":{
    +        
    +  	  }
    +}
    +
  • Return parameter description

    nothing
    +

2.2.24 Consensus module batch verification

  • Function Description:

    Consensus module transaction batch verification, verify the correctness of each transaction, verify transaction conflict
    +
  • Process description

     - Cycle to verify that each transaction is correct
    +

- Verify that there is a conflicting transaction in the transaction list


+- Interface definition
+
+- Interface Description
+
+
Loop to verify that each transaction in the incoming transaction list is correct and verify that there is a conflicting transaction in the transaction list
+```
+
  • Request example

    {
    +    "method":"cs_batchValid",
    +    "version:"1.0",
    +    "params":[["tx1","tx2","tx3"],"chainId"]
    +}
    +
  • Request parameter description

    index parameter required type description
    0 tx1,tx2,tx3...... true String Serialized data for transactions
    1 chainId true String chain id
  • Return example

    {
    +    "version":"1.0",  
    +    "code": 0,                                  //error code
    +    "msg": "Prompt message",                    //Prompt message                          
    +    "result": {                                 //Returned business data set  
    +  		"data":[							 
    +  				"tx1_hash",
    +  				"tx2_hash",
    +  				"tx3_hash"
    +  			  ]
    +    }
    +}
    +
  • Return parameter description

    parameter type description
    data String Verify the list of transactions that failed
    tx1_hash,tx2_hash,tx3_hash..... String Verify the hash of the transaction that failed

2.2.25 Get current round information

  • Function Description:

    Query the package round information of the current network consensus node, including the consensus node of the current network in the packed state, the start end time of the current round of packaging, and the basic information of all the packed nodes in the current round.
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Query the current network consensus node packaging round information
      +
    • Request example

      {
      +    "method":"cs_getRoundInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "totalWeight":,                      
      +            "index":,                    
      +            "startTime":,                     
      +            "endTime":,          
      +            "memberCount":,
      +            "memberList":[
      +                {
      +                    "agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"Weight":
      +                },{
      +                    
      +                }
      +            ],
      +            "myMember":{
      +                	"agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"weight":
      +            }
      +    	}
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                         //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      data

      parameter type description
      totalWeight double Total weight (used to calculate consensus rewards)
      index long Current round subscript
      startTime long Current round start packing time
      endTime long Current end of packaging time
      memberCount int Current number of packaged packages
      memberList List Current round packed agent packing information
      myMember MeetingMember Current agent packing information

      MeetingMember

      parameter type description
      agentAddress String agent address
      packingAddress String Packed address
      agentHash String agent ID
      packingIndexOfRound int The consensus agent packs the subscript in the current round
      creditVal double Credit value
      packStartTime long Consensus agent packaging start time
      packEndTime long Consensus agent packaging end time
      weight double Current consensus agent weight (total commission amount * credit value)

2.2.26 Specify consensus agent status query

  • Function Description:

    Query the current status of the specified consensus agent (consensus, packaged)
    +
  • Process description

    - Query whether the agent exists
    +- Query agent status
    +
  • Interface definition

    • Interface Description

      Query the current status of the specified consensus agent
      +
    • Request example

      {
      +    "method":"cs_getAgentStatus",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 agentHash true String agnet ID
      1 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	"data":{
      +            "status":1                            
      +    	}
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      parameter type description
      status int agent status (0 consensus, 1 package)

2.2.27 Modify agent packing status

  • Function Description:

    	When the local agent starts, notify the consensus module to package after the block management module synchronizes the block.
    +
  • Process description

    - Modify agent packing status
    +
  • Interface definition

    • Interface Description

      Modify agent packing status
      +
    • Request example

      {
      +    "method":"cs_updatePackStatus",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      nothing
      +

2.2.28 Stop chain

  • Function Description:

    Pause a running chain
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Pause a running chain
      +
    • Request example

      {
      +    "method":"cs_stopChain",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • Request parameter description

      index parameter required type description
      0 chainId true String chain ID
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • Return parameter description

      nothing
      +

2.2.29 Run a new chain

  • Function Description:

    Run a new subchain locally 
    +
  • Process description

    nothing
    +
  • Interface definition

    • Interface Description

      Run a new subchain locally
      +
    • Request example

      {
      +    "method":"cs_runChain",
      +    "version:"1.0",
      +    "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]
      +}
      +
      +
    • Request parameter description(待完善)

      index parameter required type description
      0 chainId true String chain ID
      1 packing_interval true long Packing interval (unit: s)
      2 packing_amount true long Minimum amount of the block
      3 coinbase_lockHeight true long Bonus lock block number
      4 redPublish_lockTime true long Get red card margin lock time (unit: s)
      5 stopAgent_lockTime true long Logout agent margin lock time (unit: s)
      6 commissionRate_min true double Commission ratio minimum
      7 commissionRate_max true double Commission ratio maximum
      8 deposit_min true int Create a agent margin minimum amount
      9 deposit_max true int Create a agent margin maximum amount
      10 commission_min true int Commissioned consensus minimum amount
      11 Commission_max true int Maximum amount of commissioned consensus
    • Return example

      success

      {
      +    "code": 0,                                  //error code
      +    "msg": "success",                           //Prompt message
      +    "version":"1.0",                            
      +    "result": {                                 //Returned business data set  
      +    	
      +    }
      +}
      +
      +
      +

      fail

      {
      +     "version": 1.0,
      +   	 "code":1,                            //error code
      +   	 "msg" :"Prompt message",             //Prompt message
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
      +
    • Return parameter description

2.3 Module internal function

​ The POC consensus mechanism is to take the agent round out of the block that participates in the consensus, reach a consensus, and jointly maintain a set of books. However, due to network reasons or some consensus agents do evil (send different packing blocks to different agents), there will be bifurcation. For this malicious agent system, different penalties will be given according to the severity, when it is a turn When the agent fails to issue the block at the specified time, the system will give the agent a yellow card penalty. The penalty will lower the credit value of the agent. When the agent credit value drops to -1, the agent will be punished with a red card; The agent will be directly punished with a red card. The agent that receives the red card penalty will stop packing and the agent will never be able to create a consensus agent again, and the margin will be frozen for a certain period of time. The other commissioned amount of the agent will be returned to the client; When a normal block is issued, the agent will receive a block reward, and the account entrusted to the agent will also receive a corresponding proportion of the bonus according to the amount of the commission.

​ In addition to providing packaged blocks, the consensus module will also do the statistical work of bonuses, statistics on the total amount of rewards issued within 24 hours, the amount of rewards accumulated in local accounts within 24 hours, and the details of rewards within 24 hours.

  • Consensus module startup process

    initialization:

    • Load consensus module configuration information (out of block interval, bonus lock block number)
    • Register Consensus Module Transaction, Transaction Verifier, Transaction Processor (registered with Transaction Module)
    • Register Consensus Module Service Interface (registered with the core module)
    • Register consensus module event (register with event bus module)

    start up:

    • Get the latest round of block information in the database and calculate the round information
    • Get current protocol version information and cache
    • Start each relevant thread
  • Package out process

    • Determine if the agent meets the requirements for becoming a packed agent
    • Calculate packaging round information
    • Waiting for packing out
    • Receive the latest block. If you wait for 5 seconds and have not received the latest block, the default last block agent does not have a block, and the current agent continues to perform the packing operation.
    • Verify the transactions that need to be packaged, and eliminate the new package after the duplicate package transaction
    • Verify the packaged new block and save the relevant data to the database
    • Broadcast block

  • Consensus reward statistics

    • Get a list of local accounts
    • Get a list of blocks within 24 hours
    • Traverse block list to get CoinBase transactions
    • According to the CoinBase transaction, update the total reward amount within 24 hours, the accumulated bonus amount of the local account within 24 hours, and the reward details within 24 hours.

4、Event description

4.1 Published event

4.1.1 Block packaging success event

Description: This event is released when a new zone is successfully packaged successfully.
+
 event_topic : "evt_cs_packing"
+
data:{
+    "chainId":88,
+    "smallBlock":"Serialize a smallBlock object into a hex string"
+}
+

4.1.2 Create agent

Description: Issue the event after the create agent transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_createAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //List of consensus agents created in the packaging block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.3 Logout agent

Description: Issue the event after the logout agent transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_stopAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //List of consensus agents that are logged out in the packaging block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.4 Consensus agent state change (in the consensus, out of the block)

Description: Issue the event when the consensus agent status changes
+
 event_topic : "evt_cs_agentStatusChage"
+
data:{
+    "chainId":88,
+    "agentList":{    //The list of consensus agents for the table in the state of the packed block
+        "agent1",    //Serialization of the Agent object to a hex string
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.5Commission consensus

Description: Issue the event after the delegate consensus transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_deposit"
+
data:{
+    "chainId":88,
+    "depositList":{     //Delegate list in the packaging block
+        "deposit1",     /Deposit object serialized to a hex string
+        "deposit2"
+    }
+}
+

4.1.6 Exit consensus

Description: Issue the event after the exit consensus transaction is confirmed and packaged into the block
+
 event_topic : "evt_cs_withdraw"
+
data:{
+    "chainId":88,
+    "depositList":{     //Exit the delegation list in the packaging block
+        "deposit1",     //The deposit object is serialized as a hex string
+        "deposit2"
+    }
+}
+

4.1.7 Yellow card penalty

Description: When there is a consensus agent to get a yellow card penalty is to issue the event
+
 event_topic : "evt_cs_yellowPublish"
+
data:{
+    "chainId":88,
+    "yellowPublishList":{    //Yellow card list in the packing block
+        "yellowPublish1",    //YellowPublish object serialized to a hex string
+        "yellowPublish2"
+    }
+}
+

4.1.8 Red card penalty

Description: Obtain the event when there is a consensus agent to get a red card transaction
+
 event_topic : "evt_cs_redPublish"
+
data:{
+    "chainId":88,
+    "redPublishList":{    //Red card list in the package block
+        "redPublish1",    //Serializing a RedPublish object to a hex string
+        "redPublish2"
+    }
+}
+

4.2 Subscribed event

nothing
+

五、protocol

5.1 Network communication protocol

broadBlock

  • Send a new block (SmallBlock)
  • Get blocks based on hash
  • Send a full block
  • Get multiple blocks based on height
  • Get a list of transactions based on the trade hash list
  • Send a list of transactions
  • Get SmallBlock based on hash
  • Get block hash list based on height interval
  • Get the SmallBlock list based on the height interval

New area for broadcast packaging

Length Fields Type Remark
4 chainId int chain ID
?? smallBlock String SmallBlock object serialized hex string

六、Module configuration

{
+    {
+        "name": "packing_interval",
+        "remark": “packaging interval”,
+        "changable": "true",
+        "default": "10秒"
+    },
+    {
+    	"name": "packing_amount",
+        "remark": “minimum amount of the block”,
+        "changable": "true",
+        "default": "200000"
+    },
+    {
+    	"name": "coinbase_unlock_height",
+        "remark": “Number of bonus lock blocks”,
+        "changable": "true",
+        "default": "100"
+    },
+    {
+    	"name": "redPublish_lockTime",
+        "remark": “Get red card margin lock time”,
+        "changable": "true",
+        "default": "3 months"
+    },
+    {
+    	"name": "stopAgent_lockTime",
+        "remark": “Logout agent margin lock time”,
+        "changable": "true",
+        "default": "3 days"
+    },
+    {
+    	"name": "commissionRate_min",
+        "remark": “minimum and minimum commission ratio”,
+        "changable": "true",
+        "default": "10"
+    },
+    {
+    	"name": "commissionRate_max",
+        "remark": “Maximum commission ratio”,
+        "changable": "true",
+        "default": "80"
+    },
+    {
+    	"name": "deposit_min",
+        "remark": “Create the minimum margin for the agent”,
+        "changable": "true",
+        "default": "20000"
+    },
+    {
+    	"name": "deposit_max",
+        "remark": “Create the maximum margin for the agent”,
+        "changable": "true",
+        "default": "700000"
+    },
+    {
+    	"name": "commission_min",
+        "remark": “trust the maximum amount”,
+        "changable": "true",
+        "default": "2000"
+    },
+    {
+    	"name": "commission_max",
+        "remark": “delegate the minimum amount”,
+        "changable": "true",
+        "default": "680000"
+    }
+}
+

七、Java-specific design

八、to add on

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/eventBusModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/eventBusModuleDesign.html new file mode 100644 index 00000000..44ef3946 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/eventBusModuleDesign.html @@ -0,0 +1,119 @@ + + + + + + Event bus module design document | NULS + + + + + + + +

Event bus module design document

[TOC]

1. Overall description

1.1 Module Overview

1.1.1 Why should I have the Event Bus module?

The Event Bus Module is a functional module designed to receive and notify processing module events, managing all module events.

1.1.2 What is the "Event Bus"?

Provide event subscription, receiving, sending and other functions, which is an event transfer station between modules

1.1.3 Positioning of Event Bus in the System

The event module is an edge system that provides some major asynchronous messaging, which means that even without an event bus, the system can operate normally, is lightweight, and does not depend on other module systems.

1.2 Architecture

event-bus-module

  • The event bus module mainly contains 2 parts of interactive logic: +  - Microservice registration and service information acquisition with the system core module. +  - Event message creation, subscription, and forwarding management with other base modules.

2. functional design

2.1 Functional Architecture

event-bus-content

2.2 Module Service

event-bus-model

This module provides event subscriptions, event forwarding

2.2.1 Modifying system operating parameters

Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,

2.3 Module internal function

event-bus-function

Module internal work mainly includes, subscription manager, event manager, and forwarding manager.

  • Microservice interface information synchronization management +  - for synchronizing the service interface with the kernel service management module
  • Event Storage Management (eventBus) +  - Used to create event information, subscribe to other storage, and initialize the information when the module is restarted.
  • Event subscription management (subscribe) +  - Maintain a "configuration table" for subscription events: including important parameters for all individual module subscriptions
  • Event forwarding management (dispatcher) +  - The open interface is used for event reception, the receiving event is forwarded by subscription, and the forwarding call interface is obtained through the service information management interface.
  • Function Interface Management (rpc) +  - Open query interface for external query

2.4 Event Bus Process

  • Event processing timing

event-bus-seq-flow

  • Event processing basic process

event-bus-main-flow

2.5 Business Logic

Exception logic processing in case of event forwarding failure (such as network reason), according to the following two logics:

    1. Retaining event calls Repeat calls by queue until the forwarding is successful.
    1. Discard it directly after trying many times. (Tentatively 5 times) Retry every 10 seconds.

3. Interface Design

3.1 Module Interface

3.1.1 Event Theme Subscription

cmd: subscribe

Parameter Description (Request body)
{
+  "cmd": "subscribe",
+  "min_version": 1.0,
+  "params":[
+    "app.nuls.network.bandwidth",//topic event topic
+    "moduleId" //moduleId subscriber module id
+  ]
+}
+
Return value description (Response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+    "app_secret": "xxxxxxxxxxxx" // app_secret, temporarily not needed, may need to be verified later if it is not required to be called locally
+  }
+}
+

3.1.2 Event Unsubscribe

cmd: unsubscribe

Parameter Description (request body)
{
+  "cmd": "unsubscribe",
+  "min_version": 1.0,
+  "params":[
+    "app.nuls.network.bandwidth", //topic event topic
+    "moduleId" //moduleId subscriber module id
+  ]
+}
+
Return value description: (response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.1.3 Event Sending [Automatically Create Topic]

Do you keep a certain amount of time when no one is subscribed?

cmd: send

Parameter description (request body)
{
+ "cmd": "send",
+ "min_version": 1.0,
+ "params":[
+   "app.nuls.network.bandwidth",//topic event topic
+   "moduleId", //moduleId subscriber module id
+   {"key" : "data value"} // event to be sent, jsonObj
+ ]
+}
+
return value description (response content)
{
+  "version": 1.2,
+  "code": 0,
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.1.4 Event broadcast (push push or dispatcher)

I need each interface to provide an interface when subscribing to events. I can call it when I broadcast. I am using multithreading to remove your interface. You need to return the correct code, otherwise there will be a retry mechanism.

Parameter description (request body)
{
+ "cmd": "dispatcher",
+ "min_version": 1.0,
+ "params":[
+   {} //data event to be sent, payload
+ ]
+}
+
return value description (response content)
{
+  "version": 1.2,
+  "code": 0, // ​​must return correctly, do not need to tell you whether the business logic is wrong, as long as you receive it, tell me that you have successfully received it.
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+  }
+}
+

3.2 Function Interface

The functional interface is the interface provided to the interface and command line tools

Get event topic information

cmd: topics

Parameter description (request body)
{
+ "cmd": "topics",
+ "min_version": 1.0,
+ "params":[]
+}
+
Response Body (response content)
{
+  "version": 1.2,
+  "code": 0, // ​​must return correctly, do not need to tell you whether the business logic is wrong, as long as you receive it, tell me that you have successfully received it.
+  "msg": "reponse message.", // ​​information on failure
+  "result": {
+    "topics":[{
+        "topic": "", //topic id
+        "createTime":"", //Create time
+        "moduleId":"", // theme creator (module) Id
+        "subscribes":[//subscriber information
+            {
+                "moduleId":"", //subscriber
+                "subscribeTime":"" //Subscription time
+            }
+        ]}
+    ]
+  }
+}
+

Get event topic information (including all event information on this topic?) Every event I don't care about.

cmd : get_topic

4. Description of the event

does not depend on any events

5. agreement

5.1 Network Communication Protocol

no

5.2 Trading Agreement

6. Module Configuration

6.1 Configuration Instructions

General support configuration, port, number of retries, retry time, thread pool size of default executor, network call timeout configuration, etc.

Server:
+  Ip: 127.0.0.1 // local ip, used to provide services to other modules, you can not fill, the default is automatically obtained
+  Port: 8080 //The port that provides the service, you can leave it blank, the default is automatically obtained.
+

6.2 Module Dependencies

  • Kernel module +  - Module registration +  - Module logout +  - Module status escalation (heartbeat) +  - Service interface data acquisition and timing update

7. Java-specific design

Core object class definition, storing data structures, ...

8. supplementary content

Required content not covered above

Last Updated: 1/11/2019, 1:47:19 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/generalProtocol.html b/docs/.vuepress/dist/NULSInfrastructure/generalProtocol.html new file mode 100644 index 00000000..76296aa6 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/generalProtocol.html @@ -0,0 +1,66 @@ + + + + + + Protocol design | NULS + + + + + + + +

Protocol design

[TOC]

Common standards

Hashes

Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time SHA-256 hashes are used, however RIPEMD-160 is also used when a shorter hash is desirable (for example when creating a NULS address).

Example of double-SHA-256 encoding of string "nuls":

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)
+7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)
+
+

For NULS addresses (RIPEMD-160) this would give:

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)
+f8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)
+

Merkle Trees

Merkle trees are binary trees of hashes. Merkle trees in NULS use a double SHA-256, the SHA-256 hash of the SHA-256 hash of something.

If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.

First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.

Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.

This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the Merkle root of the tree.

For example, imagine a block with three transactions a, b and c. The Merkle tree is:

d1 = dhash(a)
+d2 = dhash(b)
+d3 = dhash(c)
+d4 = dhash(c)            # a, b, c are 3. that's an odd number, so we take the c twice
+
+d5 = dhash(d1 concat d2)
+d6 = dhash(d3 concat d4)
+
+d7 = dhash(d5 concat d6)
+
+

where

dhash(a) = sha256(sha256(a))
+
+

d7 is the Merkle root of the 3 transactions in this block.

Addresses

A NULS address is in fact the hash of a ECDSA public key, computed this way:

ChainId = 2 byte,The ID of the chain in which the account belongs.
+addressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……
+pkh = 20 byte , RIPEMD-160(SHA-256(public key))
+xor = 1 byte, XOR(chainId+addressType+pkh)
+address = Base58Encode(chainId+addressType+pkh+xor)
+

非nuls体系的地址格式如下:

例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定

address = Base58Encode(chainId+原始地址长度+原始地址+xor)
+

Message Structre

Satellite-chain uses custom messaging for communication over the TCP protocol.

  • Digital binary stream using little endian。
  • Floating point numbers convert to integers and transfer by little endian

Message

The message consists of a 24-byte header and payload.

*---------------------------------------------------------------*
+|       Header(24 Byte)         |            Payload            |
+*---------------------------------------------------------------*
+

message header

The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.

Len Fields Data Type Remark
4 MagicNumber uint32 Packet valid flag
12 command char[12] ASCII string identifying the packet content, NULL padded
4 PayloadLength uint32 Length of payload in number of bytes
4 checksum uint32 First 4 bytes of sha256(sha256(payload))

[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.

Common Structre

VarInt

Variable-length integers that can be encoded based on the values expressed to save space.

Value Len Structure
< 0xfd 1 uint8
<= 0xffff 3 0xfd + uint16
<= 0xffffffff 5 0xfe + uint32
> 0xffffffff 9 0xff + uint64

VarString

A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.

Len Fields Data Type Remark
? length VarInt Length of the string
length value uint8[length] The string itself

VarByte

Variable-length buffer, consistent with the VarString implementation.

Len Fields Data Type Remark
? length VarInt Length of payload in number of bytes
length data byte[length] payload

Int48

6-byte number.

Network address

When a network address is needed somewhere, this structure is used.

Len Fields Data type Remark
16 IPv6/4 char[16] IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte
2 port1 uint16 port number, network byte order
2 port2 uint16 port number,for cross-chain module

Block_headers

Len Fields Data Type Remark
4 version uint32 version bumber
32 preHash byte[32]
32 merkleRoot byte[32]
stateRoot VarByte
4 time uint32 second
2 txCount uint16
extends VarByte 本字段内容不同的链可设置不同的约束
? signature Varbyte

Transactions

Len Fields Data Type Remark
2 type uint16 交易类型
4 time uint32 时间,精确到秒
txData VarByte 业务数据
coinData VarByte 资产数据
remark VarString 备注
sig VarByte 只包含签名,不包含pubkey

交易特性

多账户转出
+多账户转入
+多资产转账
+

coinData结构

froms://List<CoinForm>格式,
+tos://List<CoinTo>格式
+

CoinForm结构[40]

address:  //byte[24] 账户地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount:  //uint128,转出数量
+nonce  : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节
+locked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定
+

CoinTo结构[44]

address:  //byte[24],目标地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount :  //uint128,转账金额
+lockTime://uint32,解锁高度或解锁时间,-1为永久锁定
+

手续费

forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)
+

Message Types

参考各个模块

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/howToUseNulsBuildChain.html b/docs/.vuepress/dist/NULSInfrastructure/howToUseNulsBuildChain.html new file mode 100644 index 00000000..0f817772 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/howToUseNulsBuildChain.html @@ -0,0 +1,96 @@ + + + + + + [Alpha]如何使用NULS搭建区块链 | NULS + + + + + + + +

[Alpha]如何使用NULS搭建区块链

NULS2.0 开发环境搭建

NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。

1 环境准备

  • 安装JDK
  • 安装Maven
  • 安装IntelliJ IDEA开发工具
  • 安装git

2 clone源代码

git clone git@github.com:nuls-io/nuls_2.0.git

3 IDEA导入nuls_2.0中所有maven项目

4 建立自己的maven项目

5 运行所有需要启动的模块

使用NULS2.0核心模块搭建基础链

NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。

NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。

1 理解NULS 2.0的微服务架构

img

NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。

因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。

理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。

2 修改基础配置信息

一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。

NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf

modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:

section param name remark
common chain.id 本链id Uint16,NULS主网为1,测试网为2
common address.prefix 地址前缀 大小字母+数字,2-5个字符
common data.root.dir 数据存储路径 为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径
common encoding 编码方式 默认UTF-8,不建议修改
common asset.id 本来主资产编码 NULS为1
common log.root.dir 日志根目录 用于存放各个模块的日志文件
common log.level 日志级别 日志打印级别debug/info/warn/error.
block data.folder data子文件夹 用于存储block模块数据,该文件夹放在#{data.root.dir}下
block block.max.size 区块最大size 区块大小限制,避免太大区块太高参与门槛
block block.interval 出块间隔
block max.rollback 最大回滚数量 当超过这个数量后,系统将停止回滚,避免出现重大问题
block header.extend.max.size 扩展最大size 区块头中的扩展字段的大小限制
block genesis.block.json.path 创世块描述文件 创世块的描述文件
consensus data.folder data子文件夹 用于存储共识模块数据,该文件夹放在#{data.root.dir}下
consensus packing.interval 出块间隔
consensus inflation.token.count 每年增发数量 增发数量用于通过coinbase交易奖励给节点
consensus block.max.size 区块最大size
consensus seed.addresses 共识种子地址 多个地址用","分隔
consensus packing.address.pwd 地址密码 用于打包的地址的密码
consensus agent.deposit.min 创建节点时最小保证金数量
consensus agent.deposit.max 创建节点时最大保证金数量
consensus commission.rate.max 佣金比例最大值,不能大于100
consensus commission.rate.min 佣金比例最小值
consensus deposit.min 单笔委托最小金额
consensus agent.total.deposit.max 节点接受委托的最大金额
consensus packing.token.min 当节点的委托达到该值则开始出块
consensus red.punish.lock.time 红牌锁定时间
consensus agent.stop.lock.time 停止节点锁定时间
network data.folder data子文件夹
network seeds 种子节点,多个之间用","隔开
network magic.number 魔法数字,用于隔离其他网络
network port 端口
network nuls.seed 需要进行跨链时,配置NULS2.0种子节点
network cross.listener.port
network nuls.magic.number
contract nrc20.file.path NRC20协议描述json文件路径
tx data.folder data子文件夹
Ledger data.folder data子文件夹
api mongodb.ip mongodb地址
api mongodb.port mongodb端口
api rpc.listener.ips rpc监听ip 可以配置多个
api rpc.port rpc监听端口
api req.allow.per.s 并发限制

表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。

3 打包和启动

链的配置项修改完成后,则可直接参考本文档的第4部分:打包和启动

搭建包含业务模块的区块链

在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。

1 业务模块说明

1.1 何为业务模块

基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。

业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。

1.2 如何扩展协议

NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:

  • 通过转账交易的remark字段进行扩展

将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。

  • 通过制定的业务扩展交易进行扩展

NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。

示例:

假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。

1 功能设计

1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;
+
+2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;
+
+3. 解密查看:从数据库中获取记录,解密,展示解密结果
+
+4. 删除记事:app本地删除,不删除区块链中数据
+

2 区块链交互

以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。

  • 第一个功能的实现思路如下:
首先设计数据格式,如下
+
+{
+
+  address:"",//记事所属人
+
+  time:"",//记事时间点
+
+  content:""//加密后的记事内容
+
+}
+
+根据数据格式,组装上链数据:address+time+content;
+
+确定应用的魔法数字,假设为12345678.
+
+则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。
+
  • 第二个功能的实现思路如下:
监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,
+如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)
+如果成功解析了数据,则将数据存储到本地数据库中
+

3 其他业务实现

所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。

使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。

2 需求分析

在动手开发模块之前,首先要确定几个问题:

  • 自己需要的是什么样的功能?
  • 是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?
  • 用哪种方式实现这个模块? +
    • 扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。
    • 增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要
    • 修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。

3 模块设计

在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。

那么如何设计自己的业务?举例说明:

3.1 扩展基础协议的方式:

第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。
+比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。
+
+第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。
+一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。
+

3.2 新增协议的方式

如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。
+这里我们就用nuls的poc共识机制来举例
+功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。
+nuls的poc共识机制的业务功能有:
+1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。
+2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。
+3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。
+4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。
+
+协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。
+poc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易
+交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。
+例如创建共识节点:
+	1)创建节点的账户不能重复多次创建共识节点;
+	2)保证金在2-20万nuls之间;
+	3)账户是否有过红牌记录;
+存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。
+例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等
+
+接口设计:需要对外提供的RPC接口
+例如:查询共识节点信息,查询共识委托信息等
+
+其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里
+

3.3 修改基础链的方式

本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。
+修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。
+

4 模块实现

首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。

1、nuls-service-base-lib(baselib):

通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。

2、module-self:

模块本身,在一下几方面需要做出自己的实现:

  • 模块管理

    1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。

    2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。

    3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理

  • 协议相关

    当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。

  • 网络消息

    当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。

  • 数据存储

    NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。

  • 功能实现

    如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。

  • 功能接口

    根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。

  • 日志记录

    NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。

总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。

5 定义自己的协议

  • 设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。

  • 网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。

  • 交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。

6 调试

完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。

1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;
+
+2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;
+
+3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;
+
+4、检查交易验证逻辑是否严谨,不要出现安全漏洞;
+
+5、测试自身模块的业务是否正确、完整。
+

全部测试都完成后,便可进入打包和启动阶段了

打包和启动

1 打包

NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试

cd /home/nuls2/nuls_2.0
+./package.sh -m
+

确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。

2 启动

  • 编译成功 会生成如下路径文件
/home/nuls2/nuls_2.0/RELEASE/bin
+
  • 执行如下命令,即可一键批量启动所有模块
cd /home/nuls2/nuls_2.0/RELEASE/bin
+./start.sh -c ./moudle.json(指定moudle.json配置文件启动)
+
  • linux指令 jps 查看所有模块进程:
 ./start.sh  --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws
+
  • 查看模块启动状态
./checkstatus.sh  
+
  • 停止 工程模块:
kill  进程号(进程号对应jps显示出来的 mykernel 模块的进程)
+
Last Updated: 3/26/2019, 6:13:19 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/interfaceStandard.html b/docs/.vuepress/dist/NULSInfrastructure/interfaceStandard.html new file mode 100644 index 00000000..704b3e57 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/interfaceStandard.html @@ -0,0 +1,35 @@ + + + + + + JSON-RPC Interface interaction format and specification | NULS + + + + + + + +

JSON-RPC Interface interaction format and specification

Request Body

{
+  "cmd": "nuls_accounts",
+  "params": ["param1", "param2"],
+  "min_version": 1.0,
+}
+
  • parameters
parameter required type description
cmd true string The command to call
params true array parameters
min_version false float The minimum version of the interface to call

Response Body

  • success
{
+  "code":0,
+  "msg": "Success",
+  "result": {}
+}
+
  • returns
parameter required type description
code ture int The result status of the request, 0 means success. Otherwise return an error code
msg true string User-friendly request execution result description
result true object Method return value

Error Code

JSON RPC Standard errors

Code Possible Return message Description
0 Success Operation success
1 Parse error Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
2 Invalid Request The JSON sent is not a valid Request object.
3 Method not found The method does not exist / is not available.
4 Invalid params Invalid method parameter(s).
5 Internal error Internal JSON-RPC error.
6 Unauthorized Should be used when some action is not authorized, e.g. sending from a locked account.
7 Action not allowed Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).
8 Timeout Should be used when an action timedout.
9 Conflict Should be used when an action conflicts with another (ongoing?) action.
10 Execution error Will contain a subset of custom errors in the data field. See below.
11 to 100 Server error Reserved for implementation-defined server-errors.

Custom error fields

Custom error 10 can contain custom error(s) to further explain what went wrong.

{
+    code: 10,
+    msg: 'Execution error',
+}
+
Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/ledgerModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/ledgerModuleDesign.html new file mode 100644 index 00000000..9814a792 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/ledgerModuleDesign.html @@ -0,0 +1,123 @@ + + + + + + Account Ledger module design document | NULS + + + + + + + +

Account Ledger module design document

[TOC]

1. Overall description

1.1 Module Overview

1.1.1 Why do you have a "Ledger module"?

The ledger module is the data hub of the blockchain. The balances and transactions of all accounts are saved in the ledger module. +  A network-wide account ledger is saved on each network node to ensure complete, open and transparent data, while ensuring that data cannot be tampered and traceable.

1.1.2 What should be done in the Ledger Module?

Provide data support for assembly transactions, mainly accounting and auditing, verify the legality of the transaction, such as: whether there is sufficient balance, whether to repeat payment (double flower)

1.1.3 Positioning of the "Ledger module" in the system

The ledger module is the data hub, which stores the result data of all existing transactions in the system. It does not depend on any business modules, and other modules depend on it as needed.

1.1.4 Explanation of terms in "Ledger module"

  • The random number of the transaction (nonce, a 32-bit hash value) +
    • nonce: A scalar value equal to the number of transactions sent at this address, which will be included in every transaction initiated by the user.
    • Each transaction in the account needs to save the nonce (hash) of the previous transaction
    • Strictly speaking, a nonce is an attribute of the originating address (it only makes sense in the context of the sending address). However, the nonce is not explicitly stored in the blockchain as part of the account status.
    • The nonce value is also used to prevent incorrect calculation of account balances. For example, suppose an account has 10 NULS balances and signs two transactions, all of which cost 6 NULS with nonce 1 and nonce 2, respectively. Which of the two transactions is valid? In a blockchain distributed system, nodes may receive transactions out of order. Nonce forces transactions of any address to be processed in order, regardless of the interval, regardless of the order in which the nodes receive. This way, all nodes will calculate the same balance. The transaction paying 6 Ethereum will be successfully processed and the account balance will be reduced to 4 ether. Whenever it is received, all nodes believe that the transaction with nonce 2 is invalid. If a node receives a nonce 2 transaction first, it will hold it, but will not verify it until it receives and processes the nonce 1 transaction.
    • Use nonce to ensure that all nodes calculate the same balance and correctly sort the transactions, which is equivalent to the mechanism used in Bitcoin to prevent "double payment". However, because Ethereum tracks account balances and does not track individual coins separately (called UTXO in Bitcoin), "double payments" occur only when the account balance is incorrectly calculated. The nonce mechanism prevents this from happening.

1.2 Architecture

The core of the Ledger is assets management and ledger management.

ledger-arch.png

2. functional design

2.1 Functional Architecture

ledger-functions.png

2.2 Module Service

2.2.1 System Service of the Ledger Module

ledger-service.png

The RPC interface call provided by the ledger module. For detailed interface, please refer to the interface design section.

2.2.2 Modifying system operating parameters

Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,

2.3 Module internal function

2.3.1 Hot (online) transaction processing

Module internal work mainly includes asset management, obtaining account address balance and nonce, and verifying transaction coinData.

  • asset Management +
    • Total assets of the account
    • Available assets
    • Freeze assets. For locked assets, separate record and locked asset information, including chain ID, asset ID, asset amount, lock time, lock height, etc.
    • In the asset unlocking process, when the user's locked asset time or height reaches the unlock condition, the account will unlock the asset information, accumulate the available balance, and delete the asset lock record of the local data.
    • Multi-asset situation, need to join chainId.
  • Get account address balance and nonce +
    • Get account address balance
    • Get the account address nonce (the nonce is a hash value, meaning that the nonce of the first transaction is 0. Each transaction in the account will contain the nonce value of the previous transaction)
  • Verify the transaction +
    • Double flower verification (nonce mechanism prevents double payment)
    • Transaction creator verification, verifying that the issuer of the transaction has sufficient balance to verify that the nonce of the transaction creator is legal
    • Continuous transaction verification
  • Function Interface Management (rpc) +
    • rpc interface for use by other modules

2.3.2 Cold (offline) transaction processing

A cold wallet is an unconnected wallet, also called an offline wallet. A hot wallet is a wallet that keeps online, that is, an online wallet. Cold wallets are not more secure than hot wallets.

Since the cold wallet only signs the transaction information, the signed hex string is transmitted to the server through the hot wallet, and then the server performs unified transaction processing, so the client needs to perform the offline signature function. +The offline transaction system maintains the storage information of the nonce. After using a nonce, the nonce is saved in the business system.

2.4 Ledger flowcharts

2.4.1 Transfer Transaction Process

  • User enters the address of the transfer and the transferred address and the transferred amount
  • The system signs the transfer information by the private key of the transferred address (used to prove that the transaction was actually initiated by me)
  • The system verifies the transaction information +
    • Balance verification
    • Fee verification
    • nonce continuity verification
    • Signature and input account verification
  • Put this transaction into the local TxPool (that is, the account unconfirmed trading pool)
  • Broadcast transaction information to other nodes
  • Packing blocks, verifying blocks
  • Confirm transaction +
    • Update the balance of all accounts related (transferred or transferred)
    • Update the nonce corresponding to the account asset

2.4.2 Ordinary transaction process (reference example)

eth-transaction-flow.png

2.4.3 Transaction verification process

trx-validate-flow.png

3.Interface design

3.1 Module core interaction interface

3.1.1 Get account balance

cmd: getBalance

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y int Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
Return value description (response)
{ 
+       "available": "10000000000",
+       "freeze": "200000000",
+       "total": "12000000000"
+}
+

remarks: 1NULS=10^8Na

Field type DESC
available BigInteger Available Balance
freeze BigInteger freeze
total BigInteger total = available+freeze

3.1.2 Get the current account nonce value

cmd: getNonce

Parameter Description(request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
Return value description(response)
{
+   "nonce":"xxxxxxxxxxx",
+   "nonceType":1
+}
+
Field Type Desc
nonce String Spending transaction hash
nonceType int 1The last transaction has been confirmed, 0 the transaction has not been confirmed

3.1.3 Get balance and nonce value

cmd: getBalanceNonce

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
address Y String The address to check the balance
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":"34",
+    "assetId":"5",
+}
+
Return value description:(response)
{
+    "available": "10000000000",
+    "nonce": "xxxxx"
+}
+
Field Type Desc
available BigInteger User available balance
nonce String A random value of the account that holds the hash of the user's last transaction.

3.1.4 Verify coinData

cmd: validateCoinData

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+    "chainId": 458,
+    "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "validateCode":1,
+    "validateDesc":"success" 
+}
+
Field Type Desc
validateCode int 1 check pass, 2 orphan trade 3 double flower 4 other abnormalities
validateDesc String Check return description

3.1.5 Submit unconfirmed transaction

cmd: commitUnconfirmedTx

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+    "chainId": 21,
+    "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
value int 1 submission passed, 0 submission failed

3.1.6 Batch verification notify

cmd: bathValidateBegin

Parameter Description (request)
Field Required or not Type desc
chainId Y int 接口调用链的链Id
{
+     "chainId": 21  
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1成功,0失败

3.1.7 Receive batch verification one by one

cmd: bathValidatePerTx

Parameter Description (request)
Field Required or not Type Desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "result":1
+}
+
Field Type Desc
result int 1 success, 0 failed

3.1.8 Submit confirmation transactions one by one

cmd: commitConfirmTx

Parameter Description (request)
Field Required or not Type Desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1Success,0 failed

3.1.9 Rollback transaction

cmd: rollBackConfirmTx

Parameter Description (request)
Field Required or not Type desc
chainId Y int Chain id of the interface call chain
txHex Y String Transaction hex stream
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx"
+}
+
Return value description:(response)
{
+    "value":1
+}
+
Field Type Desc
result int 1Success,0 failed

3.2 Other interface

3.2.1 Obtain asset information based on asset id

cmd: getAsset

Parameter Description (request)
Field Required or not type desc
chainId Y int Chain id of the interface call chain
assetChainId Y String Asset-initiated chain ID
assetId Y int Asset ID
{
+  "chainId": 5,
+  "assetChainId": 12,
+  "assetId": 41
+}
+
Return value description (response)
{
+    "chainId": 5,
+    "assetChainId": 12,
+    "assetId": 41,
+    "balance" : {
+      "available": "10000000000",
+      "freeze": "200000000",
+      "total": "12000000000"
+    }
+}
+
Field Type Desc
chainId int The chain ID of the initiating call
assetChainId int Asset-initiated chain id
assetId int Asset ID
balance.available BigInteger Available Balance
balance.freeze BigInteger Freeze balance
balance.total BigInteger total = available+freeze

4. Description of the event

does not depend on any events

5. agreement

5.1 Network Communication Protocol

NA

5.2 Trading Agreement

6. Module Configuration

6.1 Configuration Instructions

6.2 Module Dependencies

  • Kernel module +
    • Module registration
    • Module logout
    • Module status escalation (heartbeat)
    • Service interface data acquisition and timing update

7. Java-specific design

Core object class definition, storing data structures, ...

8. supplementary content

References Literature


+
Last Updated: 1/11/2019, 1:47:19 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/linuxTutorial.html b/docs/.vuepress/dist/NULSInfrastructure/linuxTutorial.html new file mode 100644 index 00000000..bbe45944 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/linuxTutorial.html @@ -0,0 +1,673 @@ + + + + + + [Alpha]Linux CLI tutorial | NULS + + + + + + + +

[Alpha]Linux CLI tutorial

Introduction

This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.

Version update history

Versions Date Contents
V1.0.0 2018-03-18 alpha

Preparation

Server hardware configuration

The server for NULS node should be not lower than the following configuration:

CPU Memory Disk space Bandwidth
4-Core 3.0 GHz 16GB 128GB 20Mbps uplink

Recommended configuration:

CPU Memory Disk space Bandwidth
8-core 3.0 GHz 32GB 256GB 100Mbps uplink

System and kernel version

Linux system

  • CentOS 6, 7

The Linux kernel version is recommended to use 2.6.32 and above

Get started

Download

  • Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release
  • After entering the interface of NULS official wallet download, select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.

To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:

  $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
+

Note: the download address may be different if there are subsequent versions.

Installation

  • Extract the downloaded file in Linux
  $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz
+

Run

  • Enter the extracted directory and run the boot script to start the full node wallet
  $ cd NULS-Wallet-linux64-2.0.0-alpha-1
+  $ ./start.sh
+

Use wallet

Quick start

  • After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.

Enter the cmdclient/1.0.0 directory and execute the following command:

  $ cd cmdclient/1.0.0
+  $ ./cmd.sh
+

At this point, you can see the input prompt nuls>>>, now you can directly type NULS wallet command to operate. +For example, to create an account you can do like this:

  nuls>>> create
+  Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+  Enter your password:*********
+  Please confirm new password:*********
+  [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
+  nuls>>>
+

Command create means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.

Convention

  • Password rules: password length varies from 8 to 20 and must contain both letters and digits.
  • Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.

Wallet command

Help command

Print all valid commands,

  • command: help [-a]|[group]|[command]
Parameter Description
-a format the printed command, optional
command view instructions for the specific command
group view all instructions for the commands in the specific command group

Return: help

getaccount <address> --get account information
+

Return: help-a

getaccount <address> --get account information
+    OPTIONS:
+    <address> the account address - Required
+

Example

nuls>>> help
+nuls>>> help -a
+nuls>>> help account
+nuls>>> help create
+

Create an account

Create an account and return the set of account addresses

  • command: create [number]
Parameter Description
[number] the number of accounts you want to create, optional

When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.

Return: accounts set

[ "5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r", "5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p" ]
+

Example

Create a single account

nuls>>> create 
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]
+

Create multiple accounts at once

nuls>>> create 3
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]
+

Back up account

To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account

  • command: backup <address> [path]
Parameter Description
<address> account address, required
[path] the directory where the generated backup file is included, current directory by default, optional

Return

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Example: backup an account with password

shell
+nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj
+Enter account password
+***************
+The path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+

Remove account

Enter the password to remove a local account based on the account address

  • command: remove <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+Enter your password for account**********
+Success
+

Modify account password

Set a new password according to the account address and password.

  • command:resetpwd <address>
Parameter Description
<address> account address, required

Return

Success
+

Example

nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N
+Enter your old password:**********
+Enter new password**********
+Please confirm new password:**********
+Success
+

Set alias

Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source

  • command: setalias <address> <alias>
Parameter Description
<address> account address, required
<alias> alias name, required

Return: transaction hash

txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Example

nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj
+Enter your account password**********
+txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582
+

Import account keystore

Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.

  • command: importkeystore <path>
Parameter Description
<path> path of the keystore file to be imported, required

Note: the original password is required to import the keystore file to generate the account

Return: address of the imported account

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+

Import account private key

Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.

  • command: import <privatekey>
Parameter Description
<privatekey> account's private key, required
"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+

Query account information

Query account information with the account address

  • ** command: getaccount <address>**
Parameter Description
<address> account address, required

Return

{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  // the encrypted private key
+  "alias" : "zlj",  // alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets 
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets 
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //public key
+}
+

Example

nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //encrypted private key 
+  "alias" : "zlj",  //alias
+  "baglance" : {  
+    "freeze" : 0,   // frozen assets
+    "total" : 997999999800000,     // total assets
+    "available" : 997999999800000  // usable assets
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  // account address
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key 
+}
+

Query account list

Query the account list with the paging parameters and return all accounts in descending order by creation time.

  • ** command: getaccounts <pageNumber> <pageSize>**
Parameter Description
<pageNumber> page number indicating the page to query, required
<pageSize> number of rows displayed per page, required

Return: accounts set

[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Example: get accounts list

nuls>>> getaccounts
+[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //address
+  "alias" : null,  //alias
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //encrypted public key
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //encrypted private key
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

Query account's private key

Query the account’s private key with the account address and password

  • command: getprikey <address>
Parameter Description
<address> account address, required

Return: the private key of the imported account (unencrypted)

00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+

Example

nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9
+Enter your account password**********
+7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678
+

Query account balance

Query account balance with the account address

  • command: getbalance <address>
Parameter Description
<address> account address, required

Return: the address of the imported account

{
+"total": "9999998.99",// balance
+"freeze": "0", // locked balance
+"available": "9999998.99"// usable balance
+}
+

Example

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "total" : "9999998.99",
+  "freeze" : "0",
+  "available" : "9999998.99"
+}
+

Transfer

Transfer NULS to the specific account with the account address

  • command:transfer <formAddress>|<formAlias> <toAddress>|<toAlias> <amount> [remark]
Parameter Description
<fromAddress> sender address(Select any item with the fromAlias)
<fromAlias> sender address alias(Select any item with the fromAddress)
<toAddress> receiver address(Select any item with the toAlias)
<toAlias> receiver address(Select any item with the toAddress)
<amount> transfer amount, required
[remark] remark, optional

Return: transfer transaction hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Example

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer
+Please enter the password.
+Enter your password: *********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Query transaction details

Query the transaction details with the transaction hash

  • ** command: gettx <hash>**
Parameter Description
<hash> transaction hash, optional

Return: transaction details

{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Example: query transfer transaction

nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f
+{
+  "type" : 2,  //transaction type (refer to the table below for Enumeration type description [Enumeration type])
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //block height
+  "status" : "CONFIRMED",  //confirmation state
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //fee
+  "multiSignTx" : false
+}
+

Enumeration type description

/** coinbase transaction*/
+    int TX_TYPE_COINBASE = 1;
+    /** transfer */
+    int TX_TYPE_TRANSFER = 2;
+    /** set alias */
+    int TX_TYPE_ALIAS = 3;
+    /** create consensus node */
+    int TX_TYPE_REGISTER_AGENT = 4;
+    /** agent (join consensus) */
+    int TX_TYPE_JOIN_CONSENSUS = 5;
+    /** cancel agent (cancel consensus)*/
+    int TX_TYPE_CANCEL_DEPOSIT = 6;
+    /** yellow punish */
+    int TX_TYPE_YELLOW_PUNISH = 7;
+    /** red punish */
+    int TX_TYPE_RED_PUNISH = 8;
+    /** stop node (stop consensus node)*/
+    int TX_TYPE_STOP_AGENT = 9;
+    /** cross-chain transfer */
+    int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;
+    /** register chain */
+    int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;
+    /** destroy chain*/
+    int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;
+    /** add asset to chain*/
+    int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;
+    /** remove asset from chain*/
+    int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;
+    /** create contract */
+    int TX_TYPE_CREATE_CONTRACT = 100;
+    /** call contract */
+    int TX_TYPE_CALL_CONTRACT = 101;
+    /** delete contract*/
+    int TX_TYPE_DELETE_CONTRACT = 102;
+

Transfer by alias

Transfer to an external address with an account alias

  • order: transfer <address> <toAddress> <amount> [remark]
Parameter Description
<address> sender address, required
<toAddress> receiver address, required
<amount> transfer amount, required
[remark] remark, optional

Return: transaction hash

00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Example: transfer 10,000 NULS to external address through alias "zlj"

nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000
+Enter your account password**********
+00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3
+

Create node

To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.

  • command: createagent <agentAddress> <packingAddress> <commissionRate> <deposit>
Parameter Description
<agentAddress> account address to create a node, required
<packingAddress> account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)
<commissionRate> agent commission ratio with a range from 10 to 100, required
<deposit> deposit to create a node, no less than 2000 NULS, required

Return: agent hash of the node

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password: **********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Join consensus (agent node)

Join consensus by account address and node agentHash, which requires at least 2,000NULS

  • command: deposit <address> <agentHash> <deposit>
Parameter Description
<address> account address, required
<agentHash> agentHash of the node, optional
<deposit> deposit required to join consensus, no less than 2000NULS, required

Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Example

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Cancel consensus (cancel agent)

Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.

  • command: withdraw <address> <txHash>
Parameter Description
<address> account address, required
<txHash> hash of the agent transaction, required

Return: transaction hash to cancel consensus

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Example

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Stop agent

Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.

  • command: stopagent <address>
Parameter Description
<address> account address, required

Return: transaction hash to stop a node

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Example

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Get the latest information of block header

Get the latest block header’s information

  • command: getbestblockheader

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash 
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block 
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block singnature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  // packing address
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example

nuls>>> getbestblockheader
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",
+  "time" : "2019-03-19 18:26:20.020",
+  "height" : 1479,
+  "txCount" : 0,
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",
+  "size" : 0,
+  "packingAddress" : null,
+  "roundIndex" : 155299118,
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1,
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Query block header information

Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.

  • command: getblock <hash> | <height>
Parameter Description
<hash> block hash
<height> block height

Return

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Example: get block with block height

nuls>>> getblock 28115
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //block hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //previous block hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //packing time 
+  "height" : 1479, //block height 
+  "txCount" : 1,   // number of transactions included in the block
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature 
+  "size" : 0, //block size 
+  "packingAddress" : null,  //packing address 
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

Create smart contracts

This interface is called to create a smart contract on the chain

  • command:createcontract <sender> <gaslimt> <price> <contractCode> [remark]
Parameter Description
<sender> Create the account address for the smart contract
<gaslimt> Consumes of the gas for creating the contract
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractCode> Hex code of the contract code
[remark] remark

Returns the transaction hash for which the contract was created and the address of the contract

{
+  "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f",  //transaction hash
+  "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address
+}
+

The example creates a contract (contractCode omits the middle)

nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo
+The arguments structure: 
+[ {
+  "type" : "String",
+  "name" : "name",
+  "required" : true
+}, {
+  "type" : "String",
+  "name" : "symbol",
+  "required" : true
+}, {
+  "type" : "BigInteger",
+  "name" : "initialAmount",
+  "required" : true
+}, {
+  "type" : "int",
+  "name" : "decimals",
+  "required" : true
+} ]
+Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'").
+Enter the arguments:"KQB","KQB",10000,2
+{
+  "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"
+}
+

Get contract basic information

Gets the description of the intelligent contract and the argument list of the constructor and the calling method

  • command:getcontractinfo <contract address>
Parameter Description
<contract address> contract address

Return

Skip
+

example


+nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+{
+  "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+  "createTime" : 1553563706022,
+  "blockHeight" : 46,
+  "isNrc20" : true,
+  "nrc20TokenName" : "QKB",
+  "nrc20TokenSymbol" : "QKB",
+  "decimals" : 2,
+  "totalSupply" : "200000000",
+  "status" : "normal",
+  "method" : [ {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },{
+    "name" : "transfer",
+    "desc" : "(Address to, BigInteger value) return boolean",
+    "args" : [ {
+      "type" : "Address",
+      "name" : "to",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "value",
+      "required" : true
+    } ],
+    "returnArg" : "boolean",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  }]
+}
+
+

Invoke smart contracts

Call the functions provided by the smart contract

  • command:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]
Parameter Description
<senderAddress> The account address of the invocation contract
<gasLimit> This contract is the largest consumption of Gas
<price> Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas
<contractAddress The contract address of the call
<methodName> The method name of the contract
<value> If transfer is to be made to the contract, the amount of transfer
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract
[-r remark] remark

Returns: transaction hash

"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash
+

The example calls the nrc20-token transfer function for a specified contract, Example tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L NRC20 contract address, number of input parameters for receiving address and account transfer

nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+Please Enter your account passwordzhoujun172
+**********
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2
+"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"
+

Delete smart contract

Stop an available smart contract

  • commmand:deletecontract <senderAddress> <contractAddress>
Parameter Description
<senderAddress> The account address of the invocation contract
<contractAddress> The contract address of the call

Returns: trading hash

"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash
+

example

nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+Please enter your account passwordzhoujun172
+**********
+"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"
+

Call the contract view method

Calling the contract view method immediately returns the result and no transaction is generated

  • commmand:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract
Parameter Description
<contractAddress> The contract address of the call
<methodName> Method called
[-d methodDesc] Use this method to describe the parameter list if there is a method with the same name in the contract

The return value

The return value varies depending on the function being called
+

The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address

nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+{
+  "result" : "20000000"
+}
+

Transfer money to the contract address

To the specified contract address into the main network currency

  • command:transfertocontract <senderAddress> <contractAddress> <amount> [remark]
Parameter Description
<senderAddress> Transfer out account address
<contractAddress transfer into the contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

Example passes two NULS to the specified contract

nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark
+Please enter your account password
+**********
+"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

token transfer

NRC20 token transfer

  • command:tokentransfer <formAddress> <toAddress> <contractAddress> <amount> [remark]
Parameter Description
<formAddress> sender address
<toAddress receiver address
<contractAddress> contract address
<amount> transfer amount
[remark] remark

Returns: trading hash

"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

example token transfer:

nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD  tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta  tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000
+Please enter your account password
+**********
+"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

Get contract transaction

Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results

  • command:getcontracttx <hash>
Parameter Description
<hash> transaction hash

return value

skip 
+

example

nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "type" : "100",
+  "time" : "2019-03-26 09:28:26",
+  "blockHeight" : 46,
+  "fee" : 0.0,
+  "value" : 0.0,
+  "remark" : null,
+  "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",
+  "status" : "confirm",
+  "confirmCount" : 0,
+  "size" : 6686,
+  "inputs" : [ {
+    "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "assetsChainId" : 2,
+    "assetsId" : 1,
+    "amount" : "5700000",
+    "nonce" : "ffffffff",
+    "locked" : 0,
+    "value" : 0.0
+  } ],
+  "outputs" : [ ],
+  "txData" : {
+    "data" : {
+      "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "value" : 0.0,
+      "hexCode" : "504b03040a0000080...........31600000000",
+      "gasLimit" : 200000,
+      "price" : "0.00000025",
+      "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]
+    }
+  },
+  "contractResult" : {
+    "success" : true,
+    "errorMessage" : null,
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "result" : null,
+    "gasLimit" : 200000,
+    "gasUsed" : 14029,
+    "price" : "0.00000025",
+    "totalFee" : 0.0,
+    "txSizeFee" : 0.0,
+    "actualContractFee" : 0.0,
+    "refundFee" : 0.0,
+    "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+    "value" : 0.0,
+    "stackTrace" : null,
+    "balance" : 0.0,
+    "transfers" : [ ],
+    "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+    "tokenTransfers" : [ {
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "from" : null,
+      "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "value" : "200000000",
+      "name" : "QKB",
+      "symbol" : "QKB",
+      "decimals" : 2
+    } ],
+    "remark" : "create"
+  }
+}
+
+
+

Get the contract execution result

Gets the execution result of a contract

  • command:getcontractresult <hash>
Parameter Description
<hash> transaction hash

return value

skip
+

example

nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "success" : true,
+  "errorMessage" : null,
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "result" : null,
+  "gasLimit" : 200000,
+  "gasUsed" : 14029,
+  "price" : "0.00000025",
+  "totalFee" : 0.0,
+  "txSizeFee" : 0.0,
+  "actualContractFee" : 0.0,
+  "refundFee" : 0.0,
+  "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+  "value" : 0.0,
+  "stackTrace" : null,
+  "balance" : 0.0,
+  "transfers" : [ ],
+  "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+  "tokenTransfers" : [ {
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "from" : null,
+    "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "value" : "200000000",
+    "name" : "QKB",
+    "symbol" : "QKB",
+    "decimals" : 2
+  } ],
+  "remark" : "create"
+}
+
+

Get the contract constructor

Gets the list of parameters that need to be passed in to create the specified contract

  • command:getcontractcontructor <contractCode>
Parameter Description
<contractCode> Hex code of the contract code

return value

skip
+

example

nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000
+{
+  "constructor" : {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },
+  "isNrc20" : true
+}
+
+

Gets the list of contracts created for the specified account

Gets the list of contracts created by the specified account address

  • command:getaccountcontracts <createAddress>
Parameter Description
<createAddress> account address

return value

{
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}
+

example

nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD
+[ {
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",
+  "createTime" : "2019-03-25 16:08:25.025",
+  "height" : 253,
+  "confirmCount" : 195,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",
+  "createTime" : "2019-03-25 15:33:54.054",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+} ]
+

Query network information

Query network basic information

  • command: network info

Return

{
+  "localBestHeight" : 35317,//latest block height locally 
+  "netBestHeight" : 35317,//latest block height of the network 
+  "timeOffset" : "0ms",//network time offset 
+  "inCount" : 0,//number of in-nodes 
+  "outCount" : 1//number of out-nodes 
+}
+

Example

nuls>>> network info
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

Query network node IP

Query the network node IP

  • command: network nodes

Return information

[" 192.168.1.223 "]
+

Example: get a block with the block height

nuls>>> network nodes
+[ "192.168.1.223" ]
+

Exit the wallet CLI

Exit the command line that operates the wallet, while it won’t stop the launched wallet node.

  • command: exit

Example

nuls>>> exit
+
Last Updated: 3/26/2019, 6:13:19 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/networkModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/networkModuleDesign.html new file mode 100644 index 00000000..7f66120b --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/networkModuleDesign.html @@ -0,0 +1,425 @@ + + + + + + Network module design document | NULS + + + + + + + +

Network module design document

[TOC]

1、General description

1.1 Module overview

1.1.1 Why have a Network Module

The network module guarantees the communication between the decentralized nodes and +provides the lowest level of network communication and node discovery services for one of the NULS basic modules. The network foundation of the blockchain is Peer to Peer, or P2P. All participants in the P2P network can be either a server or a client. Features of P2P networks: decentralization, scalability, robustness, cost-effectiveness, privacy protection, and load balancing.

1.1.2 What to do with Network Module

The network module is the basic module of the entire system, which is used to manage the connection between nodes, nodes and connections, and the transmission and reception of data. Network modules do not involve complex business logic.

  • The received network message is pushed in the corresponding processing module according to the instruction service mapping relationship in the kernel module.
  • The open interface is used to push the message encapsulation of other modules to the specified peer node and broadcast to the specified network group.

1.1.3 The positioning of "Network Module" in the system

  • The network module is the underlying application module. Any module that needs network communication must send and receive messages through the network module.
  • Network modules rely on kernelmodules for service interface governance。
  • The network module builds different networks by network id (magic parameter).
  • When the nodes of the network module in the satellite chain are configured for cross-chain networking, a chain management module is required to provide cross-chain configuration information.
  • The nodes of the network module in the sub-chain need to provide cross-chain configuration information when the cross-chain network is built.

1.2 Architecture diagram

2、function design

2.1 Functional architecture diagram

​ The network module has functions in the business: node management, node group management, p2p network connection management, and message transmission and management.

​ The internal infrastructure functions include: state management of the module (including startup and shutdown management), and management of external interfaces. Thread task management, data storage management, etc. 。

  • Peer Nodes Management

    Manage all connectable, connected node information, status, and provide node operation interfaces

    • Node discovery
    • Node storage
  • Node Groups Management

    Manage different network nodes, divide nodes into different collections, and manage each collection separately. The magic parameters of the nodes connected in each set are the same and are different from the magic parameters of other sets.

    Each NodeGroup is initialized according to the information registered in the chain or the network information configured by itself (magic parameters, number of nodes, etc.) .Every time a NodeGroup is initialized, the network service listens for more than one MagicNumber.

  • Connection Management

    • Initialize the connection +
      • Satellite chain node: random connection
      • Cross-chain nodes: fixed algorithm connections, the goal is to spread and cross-link nodes across the chain
    • Connection Management: Heartbeat Maintenance
    • Disconnect
  • Message Management

    • Message receiver

    Receiving the message sent by the network node, making a simple judgment on the message +(judging command), and sending the message to the module service of interest +according to the message cmd field.

    [^ps]: RPC API Service interface information (url) is periodically obtained and cached from the kernel module.

    • Message receiver

      • NodeGroup broadcast message
      • Send a message to a node

  • Module Management

    • Start, turn off logic processing
    • Maintenance and management of the status of its own module: management module operation status, internal function status, etc.
  • RPC Api Management

    • Register your own interface into the kernel module

    • Synchronize module information and status to the kernel module

    • Get the list of RPC services to the local module

    • Open external interface call

  • Thread task management

    • heartbeat thread

    • Node discovery/elimination mechanism thread

    • Interface information synchronization thread

2.2 Module service

2.2.1 Network message recieve

  • Function Description:

    Receiving the message sent by the (external) network node, making a simple judgment on +the message (determining the magic parameter), and sending the message to the module service of interest according to the command field contained in the message header.

  • Process description

  • Message verification :

​ payload validate :First 4 bytes of sha256(sha256(payload))

​ magicNumbe :Determine if the nodegroups collection contains the magicNumber

  • External module network message receiving interface constraint

    • method : *** //Same as the CMD instruction in the message header, constraining 12 bytes

      Interface description: The network module transparently forwards the message to the external module.

    • params

    0:chainId  
+    1:nodeId  
+    2:messageBody
+    ......
+

+
  • Dependent service

    Parsing the command parameter in the message header, relying on the remote service interface data provided by the kernel module when calling the remote interface processing.

2.2.2 Network messaging

Forwards messages encapsulated by other or own modules, including broadcast messages and designated nodes to send messages.

2.2.2.1、Broadcast network message

Function Description:

Forwarding messages encapsulated by other or its own modules, and providing interfaces for forwarding calls to external modules have the following two cases:

a> Broadcast a message to a NodeGroup (specify a network).

b> Broadcast messages to the NodeGroup (specify a network) and exclude certain nodes.

  • Process description

  • Interface definition

    • Interface Description

    ​ method : nw_broadcast

    ​ Other modules can broadcast messages through this interface

    • Request example

      {
      +    "method":"nw_broadcast",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        "10.13.25.36:5003,20.30.25.65:8009",
      +        "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",
      +        "getBlock"
      +       
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 excludeNodes true String Exclude nodes, comma separated
      2 message true String Object hexadecimal character
      3 command true String message command,12 byte
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
  • Dependent service

​ nothing

2.2.2.2、The specified node sends a network message

Function Description:

Forwarding messages encapsulated by other or its own modules, you can specify that +certain nodes (which can be 1 node) send messages.

  • Process description

  • Interface definition

    • Interface Description

      External modules can broadcast messages through this interface

      method : nw_sendPeersMsg

    • Request example

      {
      +    "method":"nw_sendPeersMsg",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        "10.13.25.36:5003,20.30.25.65:8009",
      +        "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",
      +        "getBlock"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 nodes true String Send node, comma split
      2 message true String Object hexadecimal character
      3 command true String message command,12 byte
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

​ nothing

2.2.3 Create a node group

In addition to its own satellite network, the satellite chain also has n cross-chain networks. In addition to its own network, there is also a cross-chain network.

Node groups are used to manage different network information. The network module isolates and maintains different networks through node groups.

Node group type: 1> own network 2> cross-chain network (satellite chain cross-chain network & friend chain cross-chain network)

The network module is a call to receive an external module to create a node group. The basic network configuration information of the cross-chain is mainly obtained through two ways:

1> The own configuration file is loaded to create its own network group.

2> Cross-chain network:

As a satellite chain node, after the registration is registered by the chain management module, the system generates a transaction verification confirmation and then calls to generate a cross-chain network group.

As a friend chain node, when started by the cross-chain protocol module, the cross-chain protocol module obtains cross-chain configuration information from the module configuration, and notifies the network module,The network module triggers a cross-chain connection.

  • Process description

    The actual creation of a NodeGroup also has two kinds of logic:

    1> Generate your own network group (or data load call) by loading the configuration file.

    2> Call by external module: Create a network group as confirmed by registering cross-chain transactions.

2.2.3.1 Create a node group with its own network
  • Function Description:

    ​ The own network corresponds to its own chainId, and a magic parameter, through the configuration initialization to create a node group.

  • Process description

    Create a node group by loading the configuration file

  • Interface definition

​ Created internally, no external interface。

  • Dependent service

​ none

2.2.3.2 Create a cross-chain node group
  • Function Description:

    The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.

  • Process description

1> The satellite chain is triggered by the chain management module to trigger the creation of a cross-link node group.

2> The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.

  • interface definition

    • Interface Description

      Receive a call to an external module to create a node group

      method : nw_createNodeGroup

    • Request example

      {
      +    "method":"nw_createNodeGroup",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        232342,
      +        10,
      +        100,
      +        20,
      +        "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",
      +        0
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 magicNumber true long magicNumber
      2 maxOut true int Maximum active connections
      3 maxIn true int Maximum number of passive connections
      4 minAvailableCount true int Minimum number of links in the friend chain
      5 seedIps true String Seed section group comma segmentation
      6 isMoonNode true int Whether satellite chain node, default 0
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

Relies on remote service interface data provided by the kernel module.

2.2.3.3 Friend chain activates cross-chain connection
  • Function Description:

    The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.

  • Process description

    The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.

  • Interface definition

    • Interface Description

      Receive calls from cross-chain modules, activate friend chain cross-chain

      method : nw_activeCross

    • Request example

      {
      +    "method":"nw_activeCross",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        10,
      +        100,
      +        "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int Chain identification
      1 maxOut true int Maximum active connections
      2 maxIn true int Maximum number of passive connections
      3 seedIps true String Seed node, comma segmentation
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service

​ Relies on remote service interface data provided by the kernel module.

2.2.4 delete node group

  • Function Description:

    Receive a call from an external module and unregister the cross-chain node group.

    As a satellite chain node, the chain management module performs deregistration, and the system generates a transaction verification confirmation and then calls it.

  • Process description

  • Interface definition

  • Interface Description

    Receive calls from external modules, delete node groups

    method : nw_delNodeGroup

  • Request example

    {
    +    "method":"nw_delNodeGroup",
    +    "minVersion":1.1,
    +    "params":[
    +        1234
    +    ]}
    +
  • Request parameter description

    index parameter required type description
    0 chainId true int chainId
  • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +       
    +    }
    +}
    +
  • Return field description

    parameter type description
  • Dependent service

    Relies on remote service interface data provided by the kernel module.

2.2.5 Cross-chain seed node provision

  • Function Description:

    The seed node is a node used to provide peer connection information when the network is initialized. When the chain management module performs chain registration, it needs to +obtain the seed node information on the satellite chain for initializing +the connection.

  • Process description

    no

  • Interface definition

    • Interface Description

      Obtain satellite chain seed node

      method : nw_getSeeds

    • Request example

      {
      +    "method":"nw_getSeeds",
      +    "minVersion":1.1,
      +    "params":[
      +        1234
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +      seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" 
      +    }
      +}
      +
    • Return field description

      parameter type description
      seedsIps
  • Dependent service

    Relies on remote service interface data provided by the kernel module.

2.2.6 Add a connection node

  • Function Description:

    Add a peer connection information to a network under the cmd command.

  • Process description

    The added node triggers the network connection process。

  • Interface definition

    • Interface Description

      Add network peer node

      method : nw_addNodes

    • Request example

      {
      +    "method":"nw_addNodes",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +        1,
      +       "10.20.23.02:5006,53.26.65.58:8003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 isCross true int 0 false 1 true
      2 nodes true String nodes
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter
  • Dependent service

    none

2.2.7 Delete connection node

  • Function Description:

    Under the cmd command, the peer connection information is deleted for a network.

  • Process description

    Deleting a node triggers the disconnection of the network node。

  • Interface definition

    • Interface Description

      Delete network peer nodes

      method : nw_delNodes

    • Request example

      {
      +    "method":"nw_addNodes",
      +    "minVersion":1.1,
      +    "params":[
      +        1234,
      +       "10.20.23.02:5006,53.26.65.58:8003"
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int chainId
      1 nodes true String peer nodes
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter
  • Dependent service

    none

2.2.8 Reconnect to the specified network

  • Function Description:

    Network reconnection of the specified nodeGroup under the cmd command

  • Process description

    After receiving the command, disconnect all the peers under the specified nodeGroup and reconnect to the network.

​ Refresh the peer connection under nodegroup and restart the network connection.

​ If the peer connection is owned by multiple network services, you only need to cancel the association. If only the service is used by itself, you can disconnect.

  • Interface definition

    • Interface Description

      Obtain satellite chain seed node

      method : nw_reconnect

    • Request example

      {
      +    "method":"nw_reconnect",
      +    "minVersion":1.1,
      +    "params":[
      +        1234
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 chainId true int 链标识
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • Return field description

      parameter type description
  • Dependent service +none

2.2.9 Get the list of nodeGroup

  • Function Description:

    Get a list of all networks managed by the node。

  • Process description

    none

  • Interface definition

    • Interface Description

      Get node group information

      method : nw_getGroups

    • Request example

      {
      +    "method":"nw_getGroups",
      +    "minVersion":1.1,
      +    "params":[
      +        1,
      +        10
      +    ]}
      +
    • Request parameter description

      index parameter required type description
      0 startPage true int page of starts
      1 pageSize true int Number of records per page
    • Return example

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +        list:[{
      +            chainId:1212, 
      +            magicNumber:324234, 
      +            totalCount:2323,  
      +            inCount:22,    
      +            outCount:33,   
      +            isActive:1, 
      +            isCrossChain:1  
      +            },{}
      +            ]
      +    }
      +}
      +
    • Return field description

      parameter type description
      chainId int chainId
      magicNumber int magicNumber
      totalCount int Total number of connections
      inCount int Passive connection number
      outCount int ctive connections
      isActive int 0 is not activated, 1 is activated
      isCrossChain int 0 is not a cross-chain network, 1 cross-chain network
  • Dependent service

    none

2.2.10 Get the connection under the nodeGroup

  • Function Description:

    Get information about all nodes under the specified network id

  • Process description

    none

  • Interface definition

    • Interface Description

    ​ Get node information

    ​ method : nw_getNodes

    • Request example

      {
      +    "method":"nw_reconnect",
      +    "minVersion":1.1,
      +    "params":[
      +        1598,
      +        0,
      +        1,
      +        50
      +    ]
      +}
      +
      +
    • Request parameter description

    index parameter required type description
    0 chainId true int chainId
    1 state true int 0 all connected, 1 working connected
    2 startPage true int page of starts
    3 pageSize true int Number of records per page
    • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +
    +
    +

    Success

     {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +       list:[{
    +                chainId:122,
    +                nodeId:"20.20.30.10:9902"
    +                magicNumber:134124,
    +                version:2,
    +                blockHeight:6000,   //区块高度
    +                blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
    +                     ea1a960f207778150ffb9f2c173ff",  //区块Hash值
    +                ip:"200.25.36.41",
    +                port:54, 
    +                state:"已连接",
    +                isOut:"1", 
    +                time:"6449878789", 
    +	     },{}
    +	     ]
    +    }
    +}
    +
    +
    • Return field description
    parameter type description
    chainId int chainId
    nodeId String nodeId
    magicNumber int magicNumber
    version int protocol version
    blockHeight long latest block height
    blockHash String latest block hash
    ip String peer Ip address
    port int Server port
    state String connect state
    isOut int 0 passive connection, 1 active connection
    time long Recent connection time
  • Dependent service

    none

2.2.11 Get the specified chain network profile information

  • Function Description:

    Gets the network information of the specified chainId.

  • Process description

    none

  • Interface definition

    • Interface Description

    ​ Gets the network information of the specified chainId.

    ​ method : nw_getNodes

    • Request example

      {
      +    "method":"nw_getGroupByChainId",
      +    "minVersion":1.1,
      +    "params":[
      +        103
      +    ]}
      +
      • Request parameter description
    index parameter required type description
    0 chainId true int chainId
    • Return example

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +

    Success

    {
    + "version": 1.2,
    +    "code":0,
    +    "result":{
    +     
    +            chainId:1212, 
    +            magicNumber:324234,
    +            totalCount:2323, 
    +            inCount:22,  
    +            outCount:33, 
    +            blockHeight:6000,   
    +            blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
    +                     ea1a960f207778150ffb9f2c173ff", 
    +            isActive:1,
    +            isCrossActive:1,
    +            isMoonNet:0
    +    }
    +}
    +
    +
    • Return field description
    parameter type description
    chainId int chainId
    magicNumber int magicNumber
    totalCount int total connect
    blockHeight long latest block height
    blockHash String latest block hash
    isActive int 0 is not activated, 1 is activated
    isCrossActive int 0 is not a cross-chain network, 1 cross-chain network
    outCount int active connection count
    inCount int passive connection count
    isMoonNet int 0 not moon node,1 moon node
  • Dependent service

    none

2.2.12 Update the information of the peer connection node

  • Function Description:

    The network connection has the height and hash value of the peer node when the +handshake connection is made, and the height and hash value of the subsequent peer connection node are called and updated by the external module (block management module).

  • Process description

    1> Wait for the block management interface after the node starts Initialization, and then call the block management interface to get the latest block height and hash value.

    2> When the handshake is performed, the node related information is placed in the Verion information and sent to the peer.

    3> After the connection is established, the block management module will call the interface to update the latest block height and hash value.

  • Interface definition

    • Interface Description

    ​ The block management module calls to update the height of the node and the hash value.

    ​ method : nw_updateNodeInfo

    • Request example

      {
      +    "method":"nw_updateNodeInfo",
      +    "minVersion":1.1,
      +    "params":[
      +       1598,
      +        "10.20.30.20:8856",
      +        10,
      +        "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"
      +    ]
      +}
      +
    • Request parameter description

    index parameter required type description
    0 chainId true int 网络id
    1 nodeId true String 网络节点id
    2 blockHeight true long 区块高度
    3 blockHash true Sting 区块最新hash

    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +
      +

      Success

      {
      + "version": 1.2,
      + "code":0,
      + "msg" :"xxxxxxxxxxxxxxxxxx",
      + "result":{
      +   
      +    }
      +}
      +
      +
      +
    • 返回字段说明

    parameter type description
  • Dependent service

    none

2.3 Module internal function

2.3.1Module start

  • Function Description:

    When the module is started, the configuration information is initialized, the +registration service is initialized, and the initialization of each internal function management database information is performed.

  • Process description

1> load local configuration data, database node group and node information data loading.

2 > When the status of the listening block management module is initialized and the interface is callable, the call obtains the block height and Hash value of the latest local node.

3> initialization completes and enters peer node connection.

4 > The network module notifies the block management module of the maximum block height and hash value after the connection is stable. The block management module provides interfaces for network module calls.

The criteria for the stability of network module start-up connection are: no new handshake connection occurs in X seconds, and no height increase in X seconds. X=10

5 > After network stabilization, the network is in a working state, and the business state of each chain is released to other modules in an event manner.

  • Dependent service

    none

2.3.2 Module off

  • Function Description:

    When the module is closed, the connection is closed, the thread management is +closed, the resources are released, and the status is notified to the core interface.。

  • Process description

  • Dependent service

    none

2.3.3 Peer node discovery

  • Function Description:

    After the network module is started, the peer node is managed.

    The ways for node acquisition are:

    1> Connect to the seed node and request address acquisition.

    2> Receive the broadcasted node message.

    2> The connection of a cross-chain network, for example, as a connection between a node and a sub-chain on a satellite chain, or a connection between a node on a sub-chain and a satellite chain.

  • Process description

  • Dependent service

​ none

2.3.4 connection

  • Function Description:

    A node acts as the client, actively connecting to a known peer node, and is also a server, waiting for the peer node to connect.

    A connection can work normally, and it needs to send a version protocol message to each other through a handshake protocol. For the specific definition of the protocol, see the following.

    "Protocol - Network Communication Protocol Part".

  • Process description

​ After the TCP connection is complete with the server, the client needs to handshake through the rervice version protocol. Only the connection with successful handshake can forward the service. The state in the connection cannot be transitioned to connected after X minutes, and the connection is actively disconnected.

PS: In order to meet the requirements of one process carrying multiple-chain services at the same time, after a node peer connection is established, multiple NodeGroup services should be satisfied.

That is, the node peer connection and the nodeGroup object are many-to-many, n:n relationships.

  • Dependent service

    none

2.3.5Heartbeat detection

  • Function Description:

    Check if the connection is still connected. Maintain the keep-alive by ping-pong message from client and server. Refer to the "Protocol - Network Communication Protocol" section for the definition of the ping-pong protocol involved.

  • Process description

  • Dependent service

​ none

2.3.6 Connection quantity verification

  • Function Description:

    When a node connection is established, the number of connections is made, and +if the maximum is reached, the connection is actively disconnected.。

  • Process description

    • Dependent service

​ none

2.3.7 Node external network IP storage

  • Function Description:

​ A node may have multiple network cards, or it may be in a local area network. Therefore, when establishing a connection, it does not know its own external network IP address.

The node needs to know its own external network IP address to broadcast its own address for the external network peers to connect. In our design, the external network of the node is carried by the version protocol message.

  • Process description

    When the client receives the version message, it can know its own IP address information.

  • Dependent service

​ none

2.3.8 Node external network connection detection

  • Function Description:

​ When a node establishes a connection, it can broadcast its own external network IP+port to other nodes. However, if a node is in a local area network, the IP address of the external network cannot be directly connected. Therefore,in order to detect whether the external network IP of the node is +available, you can connect to your own server through your own client. If the connection is successful, the IP can be used for broadcasting. If it is unsuccessful, the external network IP of the node cannot be +broadcast to other nodes.

  • Process description

    Self-connection +may succeed or fail. If it is successful, the external network IP is reachable, and it can be broadcasted to other nodes in the network when the connection is established. If it is unreachable, the connection +cannot be established.。

  • Dependent service

    none

2.3.9 Peer node broadcast

  • Function Description:

    Broadcast +its own nodes to other nodes in the network. In the design, we will +broadcast through the self-connection established above。

  • Process description

    Constraint: The address broadcast is not carried out between peers in the cross-chain +network, that is, the nodes in the satellite chain are not broadcast to the sub-chain, and the nodes in the same sub-chain are found not to be broadcast to the satellite chain. The satellite chain and the sub-chain need to establish a connection. The initial peer node can send a getAdrr message to request the connection address.

  • Dependent service

none

2.3.10 Request/reply getaddr protocol message

  • Function Description:

    Request an address protocol message for more network connections

  • Process description

    Request getaddr:

    1> When a connection in a nodeGroup does not reach the network service required threshold minAvailableCount, the address list is requested from the seed node.

    2> The cross-chain nodeGroup in the satellite chain node can directly request the obtained address from the connected peer node.

    Reply getaddr:

    1>peer cross-link connection, node reply address list (IP+cross-chain port)

    2>peer own network connection, the node will reply to the address list (IP+ own chain port)

  • Dependent service

2.3.11 send/receive address logic

  • Function Description:

    Send & Receive network protocol addr protocol message processing logic

  • Process description

    Send addr:

​ 1> When a new node is accessed, an addr message is broadcast to other peers of the same nodegroup.

​ 2> When the getaddr message is requested, the addr message will be replied.

​ Receive addr:

​ 1> Determine whether the address is already owned locally. If you do not forward it, get the new addr.

​ 2>PEER is not cross-chain network forwarding

​ 3> Own network, add addr>0, store and broadcast forwarding (except receiving peer)

  • Dependent service

    none

3、Event description

3.1 Published event

[^remark]: Here is the topic of the event, the format protocol of the event (accurate to byte), and the occurrence of the event.

3.1.1 NodeGroup reaches the lower limit of the number of nodes

Description: The NodeGroup reaches the lower limit of the number of nodes and the event is advertised.

 event_topic : "evt_nw_inNodeLimit",
+
  data:{
+      chainId
+      magicNumber
+      nodeCount
+      nodeLimit
+      time
+  }
+  
+
+

3.1.2 NodeGroup is less than the minimum number of nodes

Description: The NodeGroup is less than the lower limit of the number of nodes. The event is advertised.

 event_topic : "evt_nw_lessNodeLimit",
+
  data:{
+      chainId
+      magicNumber
+      nodeCount
+      nodeLimit
+      time
+  }
+  
+
+

3.1.3 Node handshake succeeded

Description: The node handshake is successful and the event is advertised.

 event_topic : "evt_nw_connectSuccess",
+
  data:{
+      chainId
+      magicNumber
+      nodeId
+      time
+      version
+  }
+  
+
+

3.1.4 Node disconnected

Description: The node is disconnected and the event is published

 event_topic : "evt_nw_nodeDisconnect",
+
  data:{
+      chainId
+      magicNumber
+      nodeId
+      time
+      version
+  }
+  
+
+

3.2 Subscribed event

​     none
+

4、protocol

4.1 Network communication protocol

version

Used to establish a connection (handshake)

Length Fields Type Remark
4 version uint32 Protocol version identifier used by the node
20 addr_you byte[20] The peer network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [10.32.12.25 8003 9003] 16byte+2byte+2byte
20 addr_me byte[20] The self network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [20.32.12.25 8003 9003] 16byte+2byte+2byte
4 block_height uint32 node latest block height
block_hash varInt node latest block hash
6 network_time uint48 Network time
?? extend VarByte extended field, no more than 10 bytes

verack

Used to answer version

Length Fields Type Remark
1 ack_code uint8 Return code, 1 means normal, 2 means the connection is full

ping

Used to maintain the connection. After receiving a message for a certain node for a 
+

period of time, the message is sent. If the pong message is received, the node remains connected. Otherwise, the connection is closed and the node is deleted.

Length Fields Type Remark
4 randomCode uint32 random number

pong

reply for ping
+
Length Fields Type Remark
4 randomCode uint32random number

getaddr

Used to obtain connection information of available nodes in the network, no message body

addr

Used to reply getaddr, or announce the existence of itself to the network. After receiving the message, the node determines whether the node is known. If it is an unknown node, it propagates the message to the network.

Length Fields Type Remark
?? addr_list network address 18 bytes per node (16 bytes IP + 2 bytes port)

Bye

Used for peer connection to disconnect actively, rejecting service message connection

Length Fields Type Remark
1 byeCode uint8 预留字段

4.2 Transaction agreement

​        none
+

5、Module configuration

  [network]
+  network.self.server.port=8003
+  network.self.chainId=9861
+  network.self.magic=68866996
+  network.self.max.in=100
+  network.self.max.out=10
+  network.self.seed.ip=127.0.0.1:8003
+  #Satellite chain configuration information
+  network.moon.node=true
+  network.moon.server.port=8004
+  network.moon.max.in=100
+  network.moon.max.out=10
+  network.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003
+  
+
+

6、Java-specific design

[^remark]: Core object class definition, storing data structures,......

7、 to add on

[^remark]: Required content not covered above

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/randomRPC.html b/docs/.vuepress/dist/NULSInfrastructure/randomRPC.html new file mode 100644 index 00000000..518983ab --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/randomRPC.html @@ -0,0 +1,193 @@ + + + + + + Wallet adds a random seed | NULS + + + + + + + +

Wallet adds a random seed

一、Wallet adds a random seed RPC interface

The random seed you get is a big number, and notice, it could be a negative number

Get a random seed list based on the height interval

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cutoff height, cannot exceed startHeight+1000

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

Get random seed list according to height interval

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cut-off height,endHeight-startHeight<=1000
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

二、Smart contracts support random Numbers in the underlying chain

Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code. +Take one of these methods as an exampleUtils.getRandomSeed(long endHeight, int seedCount, String algorithm) Shows how to generate random Numbers using random number seeds.

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @param algorithm Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]According to the height range, a specific algorithm is used to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   Number of original seeds
+ * @param algorithm   Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]Get the set of original seeds according to the height range
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) A dice example shaking at the same time N

2.1) Calculation method 1

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • The original seed is multiplied by the number of tosses, resulting in an array of bytes
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) Calculation method 2

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 2/19/2019, 2:26:14 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/rpcToolWebsocketDesign.html b/docs/.vuepress/dist/NULSInfrastructure/rpcToolWebsocketDesign.html new file mode 100644 index 00000000..be8e0c94 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/rpcToolWebsocketDesign.html @@ -0,0 +1,283 @@ + + + + + + RPC-TOOL design document | NULS + + + + + + + +

RPC-TOOL design document

[TOC]

1. Overall description

1.1 summary

1.1.1 position of RPC-TOOL

  • NULS 2 according to function partition module, all modules are isolated and can run independently.
  • Interaction between modules through RPC call interface
  • As long as the module implements the required interface, it can be implemented in any language
  • Each module will use RPC, so it will be encapsulated into the same jar file

1.1.2 what will RPC-TOOL did

Data interaction between modules is done through RPC-TOOL

  • RPC Server start
  • Register all CMD commands of the current module
  • Parsing the received CMD command
  • Returns the result by calling the corresponding method based on CMD
  • RPC Client start
  • Interacting with kernel

1.1.3 position

RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.

2. functional design

3. interface design

3.1 interface

status

  • Interface description +Kernel will periodically push the status of the current system to each module, which is used for receiving

  • Request example

    {
    +    "cmd":"status",
    +    "minVersion":1,
    +    "params":[
    +        {
    +            "service":[
    +                "a",
    +                "b",
    +                "c"
    +            ],
    +            "available":true,
    +            "modules":{                
    +                "moduleABC":{
    +                    "name":"moduleABC",
    +                    "status":"READY",
    +                    "available":false,
    +                    "addr":"127.0.0.1",
    +                    "port":19722,
    +                    "rpcList":[
    +                        {
    +                            "cmd":"shutdown",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"cmd1",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"conf_reset",
    +                            "version":1
    +                        },
    +                        {
    +                            "cmd":"terminate",
    +                            "version":1
    +                        }
    +                    ],
    +                    "dependsModule":[
    +                        "m2",
    +                        "m3"
    +                    ]
    +                }
    +            }
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    index parameter required type description
    0 modules_information true map All module information

    modules_information

    parameter required type description
    service true string[] The dependent modules
    available true boolean can start service?
    modules true map<name, module> All module information

    module

    parameter required type description
    name true string name
    status true string status
    available true boolean can start service?
    addr true string ip address/host name
    port true int port
    rpcList true list cmd list
    dependsModule true string[] The dependent modules
  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    +"version": 1.2,
    +  "code":0,
    +  "result":{}
    +} 
    +
  • Response field specification +N/A

shutdown

  • Interface description +Kernel calls the interface to close the module (waiting for all the processing of the current business to complete)

  • Request example

    {
    +    "cmd":"shutdown",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

terminate

  • Interface description +Kernel calls the interface to close the module (immediately terminates).

  • Request example

    {
    +    "cmd":"terminate",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confGet

  • Interface description +Kernel gets module configuration items

  • Request example

    {
    +    "cmd":"confGet",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{
    +        "key1": "value1",
    +        "key2": "value2"
    +    }
    +} 
    +
  • Response field specification +N/A

confSet

  • Interface description +Kernel sets module configuration items

  • Request example

    {
    +    "cmd":"confSet",
    +    "minVersion":1,
    +    "params":[
    +        {
    +        "key1":"value1",
    +        "key2":"value2"
    +        }
    +    ]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

confReset

  • Interface description +Kernel restore template is configured as initial value.

  • Request example

    {
    +    "cmd":"confReset",
    +    "minVersion":1,
    +    "params":[]
    +}
    +
  • Request parameter specification

    N/A

  • Response example +Failed

    {
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +

    Success

    {
    + 	"version": 1.2,
    +    "code":0,
    +    "result":{}
    +} 
    +
  • Response field specification +N/A

4. Event description

5. Protocol

6. Configuration

7. Java unique design

Server

  • Start server

    // Port is not necessary. If no port is specified, the system is allocated randomly
    +BaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);
    +
    +// Scan the package in which the CMD command is located
    +server.scanPackage("io.nuls.rpc.mycmd");
    +
    +// Initialization
    +server.init("moduleName", "dependsModule, type is List<String>");
    +
    +// start
    +server.start();
    +
  • Custom CMD

    // extends BaseCmd
    +public class SomeCmd extends BaseCmd
    +
    +//  Custom method to add annotation CmdInfo 
    +@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)
    +public Object methodName(List params) {
    +    System.out.println("I'm version 1");
    +    return success();
    +}
    +
    +Note: rpc-tool automatically transfers the Object[] transferred from client to List<Object>. 
    +
  • There must be and only one CMD class to implement the KernelCmd interface.

    //  Implement interface 
    +public class SomeCmd extends BaseCmd implements KernelCmd 
    +
    +/**
    + *  Receive all module information from kernel 
    + */
    +public Object status(List params);
    +
    +/**
    + * Shut down service: after the existing business is completed
    + */
    +public Object shutdown(List params);
    +
    +/**
    + * Shut down service: close immediately, whether or not the business is completed.
    + */
    +public Object terminate(List params);
    +
    +/**
    + *  Provide local configuration information 
    + */
    +public Object confGet(List params);
    +
    +/**
    + *  Update local configuration information 
    + */
    +public Object confSet(List params);
    +
    +/**
    + *  Reset local configuration information 
    + */
    +public Object confReset(List params);
    +

Client

  • Provide module information to kernel

    RpcClient.versionToKernel();
    +
  • call rpc

    //  CMD corresponds to one interface. 
    +String jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);
    +
    +//  CMD corresponds to multiple interfaces. 
    +String jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);
    +
    +note:
    +params is instance of Object[]     
    +

Data exchange

  • Request

    {
    +  "cmd": "shutdown",
    +  "minVersion": 1.0,  //根据自己需要传最低版本号
    +  "params": [],
    +}
    +
  • Response(success and failure are the same)

    {
    +  "code":0,
    +  "msg": " This property is only available when failed",
    +  "version": "Actually called version",
    +  "result": {}
    +}    
    +

Other

  1. BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:

    @Override
    +@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)
    +public Object status(List params){
    +    return super.status(params);
    +}
    +
  2. There are ways to return to success and failure in BaseCmd.
    +success:

    protected Object success(double version) {
    +    return success(version, null);
    +}
    +
    +protected Object success(double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", 0);
    +    map.put("msg", SUCCESS);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

    fail:

    protected Object fail(String code, String msg, double version, Object result) {
    +    Map<String, Object> map = new HashMap<>(16);
    +    map.put("code", code);
    +    map.put("msg", msg);
    +    map.put("version", version);
    +    map.put("result", result);
    +    return map;
    +}
    +

8. supplementary content

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/NULSInfrastructure/transactionModuleDesign.html b/docs/.vuepress/dist/NULSInfrastructure/transactionModuleDesign.html new file mode 100644 index 00000000..883aec98 --- /dev/null +++ b/docs/.vuepress/dist/NULSInfrastructure/transactionModuleDesign.html @@ -0,0 +1,430 @@ + + + + + + Transaction Management Module Design | NULS + + + + + + + +

Transaction Management Module Design

[TOC]

一、Overview

1.1 Transaction Module

1.1.1 Why need "Transaction Management"

​ In the NULS 2.0 ecosystem, transactions are traded within the blockchain or between chains and chains. The nodes of each chain not only deal with transactions within the chain, but also deal with cross-chain transactions. So each node needs to process more and more transactions, and more complex, so we need a single but separate module to handle various transactions. And from the architectural design of NULS 2.0, we need a separate module to collecting transactions, verification, storage and forwarding of transactions. For all transactions, these functions are shared and unified,so we designed the transaction management as a separate module.

1.1.2 "Transaction Management" What can do

The core work of transaction management has the following two points:

一、Handling of ordinary transactions

  • Collecting transactions
  • Local verification
  • Extract packageable transactions
  • Submit, rollback transaction
  • Save unconfirmed, packageable, and confirmed transactions
  • Provide data query for transactions

二、Processing cross-chain transactions

The transaction management module needs to perform cross-chain verification on cross-chain transactions, while cross-chain verification involves interaction between different nodes in different chains. There are mainly three types of cross-chain transactions that need to be processed.

  1. Friend chain sends a transaction to NULS mainnet

The friend chain node initiates a new cross-chain transaction, which is confirmed inside the friend chain. When the friend chain reaches a certain number of confirmation blocks, the friend chain node will send the cross-chain transaction to the NULS mainnet nodes. For example, the friend chain node A sends the cross-chain transaction to the NULS mainnet node S, and the node S sends the transaction to the node other than the node A in the friend chain for verification. The NULS mainnet node S will receive the verification result of multiple friend chain nodes, and then calculate the node S's own cross-chain verification result, and then broadcast it to other nodes of the NULS mainnet, so each node of the NULS mainnet will The verification result of all other nodes is received, and finally the final verification result of the NULS mainnet is calculated.

  • The transaction management module will receive new cross-chain transactions from the friend chain
  • Verify cross-chain transactions with other nodes in the friend chain
  • Count the verification results of each node
  1. NULS mainnet sends a transaction to the friend chain

The NULS main-net node initiates a new cross-chain transaction. When a certain number of confirmation blocks is reached in the NULS mainnet, the transaction management module will take out the cross-chain transaction and send it to the target chain. For example, the NULS mainnet node S sends the transaction to the target chain node A, and the target chain node A will send the transaction to the NULS mainnet except the node S for verification. After the A node obtains the results of multiple NULS mainnet nodes, it calculates the final cross-chain verification result of the A node and broadcasts it to the target chain. The nodes of the target chain will receive the results of all other nodes, and then calculate the final verification result of the target chain.

  • Send cross-chain transactions to the target chain
  • Receiving the verification request of the target chain node, extracting the corresponding transaction and sending it back
  1. Send a transaction between the friend chain and another friend chain

Since the transaction protocol between the friends chain may be incompatible, the transaction between them needs to be transferred by the NULS mainnet. The process of sending a friend chain to another friend chain is actually to complete the transaction of the friend chain to the NULS mainnet, and the NULS mainnet sends the transaction to the friend chain. The transaction management module plays the same role.

1.1.3 Positioning

Transaction management controls the verification and circulation of all transactions throughout the system.

The following modules need to be used during normal operation.

  • Kernel Module
  • Network Module
  • Chain Manager Module
  • Ledger Module

1.2 Architecture diagram

The module is divided into three parts: interface, implementation layer, local storage

The implementation layer contains 4 parts:

  • Functional implementation logic of the interface
  • Validator manager, call transaction validator as needed
  • Queue for transaction reception, asynchronous verification processing, and push consensus
  • Cache, maintain node group, chain data and other basic data

二、Feature Design

2.1 Functional Architecture Diagram

2.2 The Core Processes

2.2.1 Transaction management caches data from other modules

The basic data of other modules needs to be obtained when the module starts

  • Maintain the basic data of all chains in the chain management module

    The way to get the data is:

    1. After the chain management is started, the chain management module interface is called
    2. When a new chain completes registration, it is acquired periodically, event notification
  • Maintain a collection correspondence between transaction and its validator, processor submission interface, and rollback interface with the transaction type as the key.

    The way to get the data is:

    After each module starts, it calls the transaction management module registration transaction interface to register itself.

2.2.2 Collect new transactions

  • Collect new transactions created by each module of this node

    Newly created transactions for each module (including cross-chain transactions), collected via the interface newTx provided by the transaction management module, When a new transaction is received, basic verification is performed first, then placed in the local transaction queue to be verified, waiting for the verification process.

    Note: There are also cross-chain transactions in the pending local trading queue, which is the local verification process for all transactions.

  • Collect cross-chain transactions broadcast by other nodes

    Cross-chain transactions broadcast by other nodes (provided that the cross-chain transaction has been packaged to confirm a certain height in the chain in which the transaction was created), will be sent by means of network messages, first sent the transaction hash, transaction management module Once received, send a message requesting a full transaction before receiving a full cross-chain transaction. After receiving, the basic verification will also be carried out, and then placed in the cross-chain transaction queue to be verified, waiting for the verification process.

2.2.3 Cross-chain transaction detailed process

For example: initiate a transaction atx from the a address of the A chain, and transfer aCoin to the B chain b address (A --> NULS mainnet --> B)

  • The a address in the A chain is the address of the NULS system format, Start with the A chainId
  • The b address in the B chain is the address of the NULS system format, Start with the B chainId
  • When the asset is transferred to the b address, the b address is not allowed to initiate a transaction in the A chain.

That is: other chain addresses cannot initiate transactions in this chain.

(1) Local process of cross-chain Transaction in the A chain

  1. The ledger module create the transfer transaction atx . If the cross-chain transaction is generated, the cross-chain module needs to be called to create the atx_trans of the NULS mainnet protocol and sign.

    • According to the NULS mainnet protocol, the type, time, remark, and txData are extracted from the atx into the newly generated atx_trans.

    • Extract the CoinData data. If it is a UTXO model, calculate the actual payment amount based on the assets, input, output, and fee, and generate the NULS mainnet protocol (account balance model) "from"

      from_total = input_utxo_total - output_utxo(not change) - fee

      Recalculate the "to" of the NULS mainnet protocol

      to = output_utxo(not change)

      Note: Consider multi-address transfer. Calculate "from" to the owner of UTXO in input. If it is utxo of multiple addresses, calculate the multiple inputs and the output as the utxo owner.

      For example: input has 3 addresses of utxo, transferred to 2 different addresses (not change),and the "from" of the three account balance models is calculated

      from_1 = input_utxo1

      from_2 = input_utxo2

      from_3 = from_total - input_utxo1 - input_utxo2

      to_1 = output(not change)_addr_1

      to_2 = output(not change)_addr_2

      The end result must be:from_total <= input_utxo_total、to_total = output_utxo(total except for change)。

    • If it is the account balance model, extract the corresponding "from" and "to", and generate CoinData of the NULS mainnet protocol.

    • The txData of the atx_trans transaction contains the hash of the atx transaction.

    • Finally, sign the atx_trans transaction and set up scriptSig

  2. The atx_trans cross-chain transaction is sent to the transaction management module via the interface newCrossTx for broadcast. After the atx transfer transaction is generated in the A chain, it is sent to the transaction management module, and the basic format and legality of the transaction data are basically verified by the newTx interface, and then stored in the local transaction queue to be verified.

    • Receive transaction to deserialize data

    • Verify the basic format, legality, and integrity of Transaction data

    • Check the basic format, legality, and integrity of the chain and asset in coinData

  3. The task that validates the transaction will take the transaction from the queue. First, the coinData is verified by the ledger module. After the verification, the corresponding transaction validator is found from the cache with the transaction type, and then the verification interface is called to verify. The verified transaction is broadcasted to other nodes in the chain through newHash, and the transaction atx_trans of the mainnet protocol is broadcasted through newCrossHash, and will be placed in the transaction management module to be packaged in the transaction memory pool, waiting for the consensus package.

    • Check out the pending transaction at regular intervals

    • CoinData is verified by calling the account module interface

    • Verify the transaction by calling the validator interface of the transaction

    • Verify that the passed transaction is placed in the transaction memory pool to be packaged

  4. When the consensus needs to be packaged, the tx_packableTxs interface is called to obtain the packageable transaction set according to the chain id, the specified end packing time, and the maximum capacity value of the transaction data. At this time, the transaction management module obtains the transaction from the transaction memory pool to be packaged, and then performs the transaction. verification.

    • First, take a transaction from the transaction memory pool to be packaged, and then perform a separate verification process (which is basically the same as step 2), and then put the corresponding collection by module.

    • This process is repeated until the specified end packing time or transaction maximum capacity value is reached.

  5. According to the unified verifier of the ledger module, the CoinData of all transactions is verified at one time, the unverified transaction is obtained, and the unverified transaction is filtered out. and the transaction set of each module is verified according to each module unified transaction validator, and the unverified verification is obtained. The transaction then summarizes the results and then returns a packageable transaction set to the consensus module.

  6. After the packaged block is verified, the block management module will call the tx_commit submission interface corresponding to the transaction, call the account module interface to update the balance and other book data, and finally call the save transaction interface tx_save, which means that the transaction is blocked. Chain confirmation.

    PS: If a transaction is a non-cross-chain transaction, the normal transaction process is completed by this step.

(2) Cross-chain transactions enter the cross-chain process

  1. The transaction management module of the A-chain node will always scan the cross-chain transactions in the blockchain. When the atx transaction is confirmed by the blockchain to confirm n heights, the A-chain node transaction management module sends a message to send the atx_trans transaction to the connected NULS mainnet nodes

    Send cross-chain transaction process

    1. The A-chain node Anode1 broadcasts the hash of the atx_trans transaction to the connected NULS mainnet node through the message interfacenewCrossHash.
    2. After the transaction management module obtains the transaction hash, it sends a message to acquire the complete cross-chain transaction to the A-chain node Anode1 through askCrossTx.
    3. The A-chain node Anode1 receives the request, and then sends the complete atx_trans cross-chain transaction to the main network node Mn through newMnTx, and the main network node transaction management module parses and processes the atx_trans transaction.
  2. The NULS mainnet node transaction management module deserializes the atx_trans transaction and then performs a check.

    • Verify the basic format, legality, and integrity of the transaction data
    • Check the basic format, legality, and integrity of the chain and assets in coinData.
  3. For cross-chain verification, the NULS primary network node Mn will send atx_hash (transaction hash before protocol conversion) and atx_trans_hash (complete transaction hash after protocol conversion received by NULS mainnet) through the message interface verifyFc to the node except the Anode1 in the node connected to the A chain to verify the atx_trans transaction.

    Verification logic of node Anode2 performing verification in A chain

    1. After receiving the message, the network module sends the message to the transaction management through the interface verifyFc. The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.
    2. The atx transaction is protocol converted to generate a new Anode2_atx_trans, and then the received atx_trans_hash is consistent with Anode2_atx_trans_hash.

    After the above two verifications, the node Anode2 will send the atx_trans_hash and the acknowledgement height to the NULS mainnet node Mn through verifyResult.

    Note : When the NULS mainnet node sends the cross-chain verification message verifyFc to the A-chain node group through the network module, the transaction management will cache the node information of successful transmission and failure. If the number of nodes successfully sent is less than S (the connection between Mn and A-chain) 51% of the number of nodes is resent to the failed node until S is not less than 51%.

  4. The NULS mainnet node Mn (consensus node) receives the message that the A chain node Anode2 verifies the transaction atx_trans, and sends it to the transaction management through the transaction management verifyResult interface. The transaction management will store the verification result with the successfully sent node. After Mn receives all the verification results sent by the self, it calculates the percentage of the verification pass. If more than 51% of the nodes of all the link nodes pass the verification, the node Mn determines that the verification of the transaction atx_trans is passed, The node that failed to send is considered as failed to pass the verification.

    Summary: The number of verification results received by the node Mn cannot be less than S. If it is less than S, the verifyFc is resent to the node that has not responded to the result. The ordinary node of the NULS mainnet queries any node of the A chain, and the mainnet consensus node queries all nodes of the A chain. The normal node is deemed to have passed the transaction and forwarded the transaction if it is confirmed by any three nodes.

  5. The consensus node Mn signs the cross-chain transaction atx_trans_hash and broadcasts the hash and signature data to the NULS mainnet through the crossNodeRs.

  6. The NULS mainnet consensus nodes receive messages sent by all other consensus nodes, and are collected and summarized by the transaction management module interface crossNodeRs. When the signer of a transaction exceeds 80% of the total number of consensus nodes, it is determined that the cross-chain transaction passed the verification of the mainnet, put in the transaction memory pool to be packaged, and wait for the package confirmation.

  7. When the NULS mainnet node consensus module is to be packaged, the transaction module first takes the transaction (similar to step 4) and verifies the number of signatures of the cross-chain transaction atx_trans again (PS: Since the extracted transaction set contains transactions created by the NULS mainnet, such transactions do not have the step of verifying the number of signatures). CoinData is then verified by the ledger module, and if the transaction meets the requirements, the consensus module is sent into the block.

(3) Cross-chain transactions into the process of the B chain

  1. The transaction management module of the NULS mainnet node will always scan the cross-chain transactions in the blockchain. When the atx_trans transaction is found to be n heights by the blockchain, the atx_trans transaction is sent out to the connected B-chain nodes

    Send a cross-chain transaction process (similar to step 7)

    1. The NULS primary network node Mn first broadcasts the hash of the atx_trans transaction to the connected B-chain node via the message newCrossHash.
    2. The transaction hash obtained by the transaction management module is sent through the askCrossTx to obtain the message of the complete cross-chain transaction to the NULS mainnet node Mn.
    3. After receiving the message, the Mn network module sends the complete atx_trans cross-chain transaction to Bnode1 via newMnTx. After receiving the message, Bnode1 needs to use the cross-chain module to process the atx_trans transaction.
  2. The B-node node Bnode1 transaction management module sends the atx_trans transaction hash (which has been obtained in step 14-2) through verifyMn to the node other than Mn in the node connected to the NULS mainnet to verify the atx_trans transaction.

    Verification logic of node Mn2 performing verification in NULS mainnet

    1. After receiving the message, the network module sends the message to the transaction management through the interface verifyMn. The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.

    After verification, node Mn2 will send the atx_trans_hash and the acknowledgement height to the B-chain node Bnode1 via verifyResult.

  3. When the B-chain node sends the cross-chain verification message verifyMn to the NULS mainnet node group through the network module, the transaction management will cache the node information of the successful transmission and the failure. If the number of successfully sent nodes is smaller than S (S is 51% of the number of nodes connected to the NULS mainnet by Node Bnode1), the information is resent to the failed node. Until S is not less than 51%.

  4. (Similar to step 10) The B-chain node Bnode1 receives the message that the mainnet node Mn verifies the transaction atx_trans, and sends it to the transaction management through the transaction management verifyResult interface, Transaction management caches the verification results against the successful nodes that were sent. After receiving all the verification results sent by the self, Bnode1 calculates the percentage of the verification pass. If more than 51% of the nodes pass the verification, the node Bnode1 determines that the verification of the transaction atx_trans is passed (The node that failed to send is considered as not passing).

  5. After the verification is passed, the transaction management module calls the cross-chain module to convert the atx_trans transaction through the protocol to generate the B-chain protocol transaction btx and broadcast it to the B-chain network through the crossNodeRs. If the Bnode1 node is the B-chain nearest x-block outperger (POW needs Adaptation), the transaction needs to be signed and broadcast to the B-chain network via the crossNodeRs.

  6. The B-chain node receives the messages sent by other nodes, collects and summarizes the transaction management module interface crossNodeRs, and counts the signature of the transaction. When the signer reaches 80% of the latest 20 blockers, the transaction is verified and placed. Enter the packaged transaction memory pool and wait for the package confirmation (The packager also confirms the transaction and the packaged transaction contains all signatures).

  7. (Similar to step 13)When the B-chain node consensus module is packaged, the transaction module first takes out the transaction consistently, verifies the signature number of the transaction btx again, and then verifies the CoinData through the account book module. If the requirements are met, the transaction transmission consensus module is packaged into the block.

  8. When the new block verification is finalized, the entire cross-chain transaction process is completed.

2.3 Module Service

2.3.1 Registration transaction

  • Function description

    The transaction type of each module, the corresponding transaction validator and the processor interface are cached.

  • Process description

    When the NULS mainnet is started, each module needs to register its transaction type, validator and other information with the transaction management module. The transaction management module will cache each transaction and the corresponding validator and processor interface. When a new transaction needs to be verified by the validator, the transaction management module will take out the corresponding validator interface name and call the validator interface for verification.

  • Interface definition

    • method: tx_register

      Interface description:The registration transaction needs to pass the transaction type, the verifier name, and the processor name to return whether the registration is successful.

    • Request

      {
      +    "cmd": "tx_register",
      +    "minVersion": "1.0",
      +    "params":[
      +        "moduleCode", 
      +        "moduleValidateCmd",
      +        [
      +            [
      +                "txType",
      +                "validateCmd",
      +                "commitCmd",
      +                "rollbackCmd",
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ],
      +             [
      +                "txType",
      +                "validateCmd",
      +                "commitCmd",
      +                "rollbackCmd",
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ]
      +         ]
      +    ]
      +}
      +
    • Request parameter

      index type description
      0 String Module code
      1 String Module unified verifier interface name
      2 Array Module transaction registration information list
    • Object of the module transaction registration information list

      index type description
      0 int Transaction Type
      1 String Single transaction validator interface name
      2 String Transaction processor submit interface name
      3 String Transaction processor rollback interface name
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true	
      +  	}
      +}
      +
    • Return

      parameter type description
      value boolean Success
2.3.1.1 Transaction validator, processor interface specification
  • Module unified transaction verifier interface specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chianId", ["txHex","txHex","txHex"]]
      +}
      +
    • Request parameter

      index type description
      0 chianId Chian Id
      1 array Transaction serialization data array
    • Response

      • result:Verify the failed transaction list
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "list":["txHex", "txHex", "txHex"]
      +	}
      +}
      +
      parameter type description
      list jsonArray Verify the failed transaction serialization data array
  • Transaction validator interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex"]
      +}
      +
    • Request parameter

      index type description
      0 int chainId
      1 String Transaction serialization data
    • Response

      • result:Verify the failed transaction list
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Verification passed return true
  • Transaction processor commit interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex","secondaryDataHex"]
      +}
      +
    • Request parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      • result:Commit successfully returns true, failure returns error message
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Commit successfully returns true
  • Transaction processor rollback interface uniform specification

    • Request

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["txHex","secondaryDataHex"]
      +}
      +
    • Request parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      • result:Rollback successfully returns true, failure returns error message
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean Rollback successfully returns true

2.3.2 Receive local new transactions

  • Function description:

    Collect newly created transactions from other modules of this node

  • Process description

    When other modules in a node have new transactions, you need to call this interface for unified collection and processing. The transaction management module will place the new transaction in the unconfirmed queue and wait for the transaction thread to process it.

    1. Basic verification of transactions, removal of duplicate transactions, illegally discarding

    2. Put in pending verification local transation queue

  • Interface definition

    • method: newTx

      Interface description:Receive a new transaction serialization data

    • Requset

      {
      +    "cmd": "newTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.3 Get packageable transaction list

  • Function description:

    Extract a packaged transaction list based on the packaging end time and transactions total size

  • Process description

    When the node needs to be packaged, the packaged transaction is obtained according to the chain id, the specified end packing time and transactions total size. The transaction management module will take out the corresponding transaction set from the transaction memory pool to be packaged, and then verify the coinData of all transactions in the collection from the account module at one time, filter out the unverified transaction, obtain the verified collection, and then unify through each module. The transaction validator verifies the transaction set of the respective module and then summarizes the results back to the packageable transaction list.

  • Interface definition

    • method: tx_packableTxs

      Interface description:Return a packaged transaction list

    • Requset

      {
      +    "cmd": "tx_packableTxs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "endtimestamp", "maxTxDataSize"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 long End packaging timestamp
      2 int Transactions total size
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"list":[]
      +  	}
      +}
      +
    • Result

      parameter type description
      list Transaction Transaction list

2.3.4 Transaction commit

  • Function description:

    Execute the transaction processor commit

  • Process description

    The transaction commit interface is invoked when the transaction is packaged into a block and the block validation passes

  • Interface definition

    • method: tx_commit

      Interface description:Call the transaction handler commit interface

    • Requset

      {
      +    "cmd": "tx_commit",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
      2 String Block header hash, height, time serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.5 Transaction rollback

  • Function description:

    Execute transaction processor rollback

  • Process description

    The transaction rollback interface is invoked when the transaction is packaged into a block and the block verification fails, or the block is rolled back and the transaction is not a cross-chain transaction.

  • Interface definition

    • method: tx_rollback

      Interface description:Call the transaction handler rollback interface

    • Requset

      {
      +    "cmd": "tx_rollback",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data array
      2 String Block header hash, height, time serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.6 Save transaction

  • Function description:

    Save the transaction in the new block that was verified to the database

  • Process description

    When the block management saves the block, the transaction is sent to the transaction management module for saving.

  • Interface definition

    • method: tx_save

    • Requset

      {
      +    "cmd": "tx_save",
      +    "minVersion": "1.0",
      +    "params": ["chainId", ["txHex", "txHex"]]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 array Transaction serialization data array
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.7 Get transaction

  • Function description:

    Get the transaction that have been packaged into the block from the database

  • Interface definition

    • method: tx_getTx

      Interface description:return transaction serialization data

    • Requset

      {
      +    "cmd": "tx_getTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"tx":"txHex"
      +  	}
      +}
      +
    • Result

      parameter type description
      tx String Transaction serialization data

2.3.8 Delete saved transaction

  • Function description:

    Delete transactions that have been packaged into blocks from the database, block rollback, etc.

  • Interface definition

    • method:tx_delete

      Interface description:return execution result

    • Requset

      {
      +    "cmd": "tx_delete",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.9 Verify transaction

  • Function description:

    Local validation of transactions (including cross-chain transactions), including calling the validator, verifying the coinData. Cross-chain verification of cross-chain transactions is not included.

  • Interface definition

    • method:tx_verify

      Interface description:return execution result

    • Requset

      {
      +    "cmd": "tx_verify",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.10 Receive new transaction hash

  • Function description:

    Receive a message of a new transaction hash broadcast by other nodes in the chain

  • Interface definition

    • method:newHash Receive new transaction hash message

      Interface description:Receive transaction hash serialization data

    • Requset

      {
      +    "cmd": "newHash",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHashHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.11 Receive new cross-chain transaction hash

  • Function description:

    Receive messages for new cross-chain transaction hashes sent by other chains

  • Process description

    When a cross-chain transaction has been confirmed to a certain height within the chain, it will be sent by the transaction module to the target chain (NULS mainnet or the friend chain), and the target chain will receive the transaction for verification. The hash of the transaction is sent first before the transaction is sent, and the interface will receive the hash.

  • Interface definition

    • method: newCrossHash Receive new cross transaction hash

      Interface description:Receive a new transaction hash hex

    • Requset

      {
      +    "cmd": "newCrossHash", 
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHashhex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      	"value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.12 Receive a new cross-chain transaction for the friend chain (Deprecated)

  • Function description:

    Processing message for new cross-chain transactions sent from other chains to the NULS mainnet

  • Process description

    When the NULS mainnet node receives the cross-chain transaction hash of other chain broadcasts, it will request the complete transaction from the sent hash node. At this time, the node will send the complete transaction and the original hash to the NULS mainnet node.

  • Interface definition

    • method: newFcTx Receive new cross transaction

      Interface description:Receive a new full cross-chain transaction, and the original hash of the transaction (The hash value of the transaction before the conversion of the friend chain agreement).

    • Requset

      {
      +    "cmd": "newFcTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Original transaction hash,and transaction serialization data of NULS mainnet protocol after protocol conversion
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.13 Receive a new complete cross-chain transaction on the mainnet

  • Function description:

    Processing message for new cross-chain transactions sent from the NULS mainnet to the friend chain

  • Process description

    When the friend chain node receives the cross-chain transaction hash broadcast by the NULS mainnet, it will request a complete transaction from the sent hash node, and the node will send the complete transaction partner chain node.

  • Interface definition

    • method: newMnTx Receive new mainnet cross transaction

      Interface description:Transaction serialization data hex

    • Requset

      {
      +    "cmd": "newMnTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.14 Ask for a complete cross-chain transaction

  • Function description:

    Take a complete cross-chain transaction with a certain height confirmed according to the transaction hash, and then send it back by message.

  • Process description

    NULS mainnet has new cross-chain transactions sent to the target chain (or the ordinary chain has a cross-chain transaction sent to the NULS mainnet), the hash is sent to the target chain first, and the target chain node requests a complete transaction from the NULS mainnet according to the hash, and the interface processes the message.

  • Interface definition

    • method: askCrossTx send cross transaction

      Interface description:Receiving the transaction hash sent by the network node

    • Requset

      {
      +    "cmd": "askCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.15 Verify to the friend chain whether the transaction is confirmed

  • Function description:

    The friend chain node receives the message of the cross-chain verification request of the NULS mainnet node

  • Process description

    The NULS mainnet node newly receives the cross-chain transaction, and will verify the transaction to the friend chain (nodes other than the sender) that sent the transaction, and the message to be sent will be processed by the interface.

  • Interface definition

    • method: verifyFc

    • Interface description:Receive cross-chain transaction hash and original hash of the transaction, return confirmation result through network message

    • Requset

      {
      +    "cmd": "verifyFc",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHashHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String [txOriginalHash] Raw transaction hash (before protocol conversion) , [txCrossHash] Cross-chain transaction hash (after protocol conversion)
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.16 Verify to the mainnet whether the transaction is confirmed

  • Function description:

    The NULS mainnet node receives the message of the cross-chain verification request of the friend chain node

  • Process description

    The friend chain node newly receives the cross-chain transaction, and will verify the transaction to the NULS mainnet node (node other than the sender) that sent the transaction, and the message to be sent during the verification is processed by the interface.

  • Interface definition

    • method: verifyMn

    • Interface description:receive cross-chain transaction hash, return confirmation result via network message

    • Requset

      {
      +    "cmd": "verifyMn",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash hex data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.17 Receive cross-chain verification results

  • Function description:

    Process messages that receive cross - chain transaction validation result

  • Process description

    The NULS mainnet verifies cross - chain transactions to other chain nodes, which send verification results

  • Interface definition

    • method: verifyResult cross result

    • Interface description:receive cross-chain transaction verification results

    • Requset

      {
      +    "cmd": "verifyResult",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "rsHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Transaction hash and confirmation of highly serialized data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.18 Receive in-chain node verification results for cross-chain transactions

  • Function description:

    Receive in-chain node verification results for cross-chain transactions and statistics.

  • Process description

    The node performs cross-chain verification on a cross-chain transaction, and obtains the cross-chain verification result of the node for the transaction. The node broadcasts the result to other nodes of the chain, and the other node will invoke the interface after receiving the message.

  • Interface definition

    • method: crossNodeRs cross tx node result

    • Interface description:receive sender's signature, cross-chain transaction hash, node verification result

    • Requset

      {
      +    "cmd": "crossNodeRs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "nodeRsHex"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
      1 int Node Id
      2 String Sender's signature, cross-chain transaction hash, node verification result Serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.19 View transaction pool information

  • Function description:

    View data in the transaction memory pool

  • Interface definition

    • method: tx_getTxsInfo

    • Interface description:Statistics transaction memory pool data

    • Requset

      {
      +    "cmd": "tx_getTxsInfo",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 Int Chain Id
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "localTxCount":111,	
      +      "crossChainTxCount":111,
      +      "pushingCount":111
      +  }
      +}
      +
    • Result

      parameter type description
      localTxCount int Number of local transactions
      crossChainTxCount int Number of cross-chain transactions
      pushingCount int Number of transactions to be packaged

2.3.20 Get transaction registration information

  • Function description:

    Returns the relationship list of the transaction and its corresponding commit processor and rollback processor

  • Interface definition

    • method: tx_getTxProcessors

    • Interface description:return Map<List<String>> jsonObject

    • Requset

      {
      +    "cmd": "tx_getTxProcessors",
      +    "minVersion": "1.0",
      +    "params": ["txType"]
      +}
      +
    • Requset parameter

      index type description
      0 int Transaction type (Fill in NULL to return all types)
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "2":["commitCmd","rollbackCmd"],
      +      "3":["commitCmd","rollbackCmd"],
      +      "4":["commitCmd","rollbackCmd"]
      +  }
      +}
      +
    • Result

      parameter type description
      0 String Commit interface name
      1 String Rollback interface name

2.3.21 Query transaction records

  • Function description:

    Query the transaction list based on conditions such as account, chain, asset, and paging information.

  • Interface definition

    • method: tx_getTxs

    • Interface description:return Page<Transaction>

    • Requset

      {
      +    "cmd": "tx_getTxs",
      +    "minVersion": "1.0",
      +    "params": [
      +    	"ChainId",
      +    	"assetId",
      +    	"type",
      +    	"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",
      +    	"pageSize",
      +    	"pageNumber"
      +    ]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 int AssetId
      2 int Transaction type (Fill in NULL to return all types)
      3 String Address
      4 int Page size
      5 int Page number
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +     "pageNumber": 1,
      +     "pageSize": 10,
      +     "total": 31,
      +     "pages": 4,
      +     "list": []
      +  }
      +}
      +
    • Result

      parameter type description
      pageNumber int Page number
      pageSize int Page size
      total int Total number of records
      pages int Total page number
      list Page Records

2.3.22 Receive cross-chain transactions for local new primary network protocols

  • Function description:

    Collect a complete transaction for the new NULS mainnet protocol for broadcast

  • Interface definition

    • method: newCrossTx

    • Requset

      {
      +    "cmd": "newCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
      1 String Transaction serialization data
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  	value:true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.23 Run chain

  • Function description:

    Run a new subchain locally

  • Interface definition

    • method: tx_runChain

    • Interface description:run a new subchain locally

    • Requset

      {
      +    "cmd": "tx_runChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 Int chainId
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  	"value":true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

2.3.24 Stop chain

  • Function description:

    Stop a running subchain locally

  • Interface definition

    • method: tx_stopChain

    • Interface description:Stop a running subchain locally

    • Requset

      {
      +    "cmd": "tx_stopChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • Requset parameter

      index type description
      0 int Chain Id
    • Response

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  }
      +}
      +
    • Result

      parameter type description
      value boolean Success

四、Event description

4.1 Published event

​ nothing

4.2 Subscribed event

  • Chain registration event

    Chain information interface for sending verification tx coinData

  • Chain logout event

    Confirmation for terminating the chain transaction

五、Network message body protocol

5.1 BroadcastCrossTxHashMessage

  • Broadcast new cross-chain trading hash

  • Message description:Messages sent when a cross-chain transaction needs to be broadcast to nodes of other nodes or other chains after the chain is confirmed

  • cmd:newCrossHash

Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Hash array
  • Message processing

    • Upon receipt of this message, newCrossHash will send askCrossTxMessage to get the complete cross-chain transaction.

5.2 ReceiveCrossTxMessage

  • Message description:Requesting a complete cross-chain transaction message, for example, the NULS mainnet receives a new cross-chain transaction hash of the friend chain, and the mainnet node will obtain a complete transaction from the friend chain node.
  • cmd:askCrossTx
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
  • Message processing +
    • The message is processed by askCrossTx and will send a SendcrossTxMessage/SendHashcrossTxMessage message to deliver the complete transaction.

5.3 SendHashCrossTxMessage (Deprecated)

  • Message description:The friend chain sends the complete cross-chain transaction converted by the protocol to the NULS mainnet, and the original transaction hash
  • cmd:newFcTx
Length Fields Type Remark
2 chainId uint16 Chain Id
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
1 originalHashDigestAlgType byte Abstract algorithm identifier
? originalHashLength VarInt Hash array length
? originalHash byte[] originalHash友链原始交易hash
  • Message processing +
    • newFcTx will process the transaction after receiving the message, and then cross-chain verification through the message

5.4 VerifyCrossWithFCMessage

  • Message description:Transmit the transaction hash before the protocol conversion, the transaction hash after the protocol conversion, and verify the cross-chain transaction to the friend chain node.
  • cmd:verifyFc
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Transaction hash after converting NULS mainnet protocol
1 originalHashDigestAlgType byte Abstract algorithm identifier
? originalHashLength VarInt Original hash array length
? originalHash byte[] Friends chain original transaction hash
  • Message processing +
    • verifyFc processes the message, validates the result and sends it back via VerifyCrossResultMessage

5.5 VerifyCrossResultMessage

  • Message description:After the node receives the cross-chain verification request, it sends the verification result back.
  • cmd:verifyResult
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
32 hight uint32 Confirm height
  • Message processing +
    • verifyResult calculates the result of its own node after receiving the cross-chain verification result

5.6 SendCrossTxMessage

  • Message description:Send a message for a complete cross-chain transaction
  • cmd:newMnTx
Length Fields Data Type Remark
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
  • Message processing +
    • newMnTx will perform a series of verifications after receiving the transaction. If the node that is not the transaction origin chain receives the transaction, it will perform cross-chain verification.

5.7 VerifyCrossWithMainMessage

  • Message description:The friend chain node sends the cross-chain transaction hash after the protocol conversion, and verifies the cross-chain transaction to the mainnet node.
  • cmd:verifyMn
Length Fields Type Remark
32 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Converted cross-chain transaction hash
  • Message processing +
    • verifyMn processes the message to verify that the transaction is confirmed in the NULS mainnet and sends the result back via the VerifyCrossResultMessage message.

5.8 BroadcastCrossNodeRsMessage

  • Message description:Broadcast the verification result of this node for a cross-chain transaction to other nodes in the chain
  • cmd:crossNodeRs
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] hash
Signature VarByte The verified node's signature on the transaction
2 result boolean Validation result
  • Message processing +
    • The crossNodeRs receives the message, counts the results of all other nodes, and finally calculates the verification result of the transaction for the transaction.

5.9 BroadcastTxMessage

  • Message description:The transaction created by this node broadcasts the hash to other nodes after the local authentication is completed.
  • cmd:newHash
Length Fields Type Remark
2 chainId uint16 Chain Id
1 digestAlgType byte Abstract algorithm identifier
? hashLength VarInt Hash array length
? hash byte[] Hash array
  • Message processing +
    • The newHash interface processes the message and sends the full transaction back.

5.10 SendTxMessage

  • Message description:Send the transaction to other nodes in the chain
  • cmd:newTx
Length Fields Data Type Remark
2 type uint16 Transaction type
4 time uint32 Transaction date
txData VarByte Transaction txData
coinData VarByte Transaction coinData
remark VarString Remark
scriptSig VarByte Digital script or transaction signature
  • Message processing +
    • Enter a new transaction process

六、Module configuration item

[tx-manager]
+bootstrap=io.module.TxManagerModuleBootstrap
+
Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/assets/css/0.styles.3751d6d5.css b/docs/.vuepress/dist/assets/css/0.styles.3751d6d5.css new file mode 100644 index 00000000..af2bba95 --- /dev/null +++ b/docs/.vuepress/dist/assets/css/0.styles.3751d6d5.css @@ -0,0 +1 @@ +.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto}.home .hero{text-align:center}.home .hero img{max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;transition:background-color .1s ease;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}li[data-v-69667123],ul[data-v-69667123]{list-style:none}.title[data-v-69667123]{padding:20px 0 0}.title p[data-v-69667123]{border-bottom:1px solid #eaecef;font-size:18px;font-weight:700;line-height:50px;padding:0;margin:0}.title ul[data-v-69667123]{padding:0;margin:0}.li[data-v-69667123]{width:25%;float:left;color:#2c815b;border-bottom:1px solid #eaecef;line-height:70px;height:70px}.li a[data-v-69667123]{text-decoration:none}.cb[data-v-69667123]{clear:both}.search-box{display:inline-block;position:relative;margin-right:1rem}.search-box input{cursor:text;width:10rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all .2s ease;background:#fff url(/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:#3eaf7c}.search-box .suggestions{background:#fff;width:20rem;position:absolute;top:1.5rem;border:1px solid #cfd4db;border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestions.align-right{right:0}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion a{white-space:normal;color:#5d82a6}.search-box .suggestion a .page-title{font-weight:600}.search-box .suggestion a .header{font-size:.9em;margin-left:.25em}.search-box .suggestion.focused{background-color:#f3f4f5}.search-box .suggestion.focused a{color:#3eaf7c}@media (max-width:959px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (max-width:959px) and (min-width:719px){.search-box .suggestions{left:0}}@media (max-width:719px){.search-box{margin-right:0}.search-box input{left:1rem}.search-box .suggestions{right:0}}@media (max-width:419px){.search-box .suggestions{width:calc(100vw - 4rem)}.search-box input:focus{width:8rem}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title{display:block}.dropdown-wrapper .dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:.45rem 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .nav-dropdown{transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper .dropdown-title .arrow{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid #ccc;border-bottom:0}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid #ddd;border-bottom-color:#ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem;position:relative}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:flex}.navbar .links .search-box{flex:0 0 auto;vertical-align:top}.navbar .links .nav-links{flex:1}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}}.page-edit,.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit,.page-nav{padding:2rem}}@media (max-width:419px){.page-edit,.page-nav{padding:1.5rem}}.page{padding-bottom:2rem}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#aaa}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar-button{display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem 0}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar .sidebar-links{padding:1.5rem 0}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar .sidebar-links{padding:1rem 0}}.sw-update-popup{position:fixed;right:1em;bottom:1em;padding:1em;border:1px solid #3eaf7c;border-radius:3px;background:#fff;box-shadow:0 4px 16px rgba(0,0,0,.5);text-align:center}.sw-update-popup button{margin-top:.5em;padding:.25em 2em}.sw-update-popup-enter-active,.sw-update-popup-leave-active{transition:opacity .3s,transform .3s}.sw-update-popup-enter,.sw-update-popup-leave-to{opacity:0;transform:translateY(50%) scale(.5)}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:2px solid transparent;border-top-color:#3eaf7c;border-left-color:#3eaf7c;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.content pre,.content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.content pre[class*=language-] code,.content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number,div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.content:not(.custom){padding:2rem}}@media (max-width:419px){.content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:15px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.content:not(.custom)>:first-child{margin-top:3.6rem}.content:not(.custom) a:hover{text-decoration:underline}.content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.content:not(.custom) img{max-width:100%}.content.custom{padding:0;margin:0}.content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1.2rem;color:#999;border-left:.25rem solid #dfe2e5;margin-left:0;padding-left:1rem}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.content:not(.custom)>h1,.content:not(.custom)>h2,.content:not(.custom)>h3,.content:not(.custom)>h4,.content:not(.custom)>h5,.content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.content:not(.custom)>h1:first-child,.content:not(.custom)>h2:first-child,.content:not(.custom)>h3:first-child,.content:not(.custom)>h4:first-child,.content:not(.custom)>h5:first-child,.content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.content:not(.custom)>h1:first-child+.custom-block,.content:not(.custom)>h1:first-child+p,.content:not(.custom)>h1:first-child+pre,.content:not(.custom)>h2:first-child+.custom-block,.content:not(.custom)>h2:first-child+p,.content:not(.custom)>h2:first-child+pre,.content:not(.custom)>h3:first-child+.custom-block,.content:not(.custom)>h3:first-child+p,.content:not(.custom)>h3:first-child+pre,.content:not(.custom)>h4:first-child+.custom-block,.content:not(.custom)>h4:first-child+p,.content:not(.custom)>h4:first-child+pre,.content:not(.custom)>h5:first-child+.custom-block,.content:not(.custom)>h5:first-child+p,.content:not(.custom)>h5:first-child+pre,.content:not(.custom)>h6:first-child+.custom-block,.content:not(.custom)>h6:first-child+p,.content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:hover .header-anchor,h2:hover .header-anchor,h3:hover .header-anchor,h4:hover .header-anchor,h5:hover .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.custom-layout{padding-top:3.6rem}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}.theme-container.no-navbar .custom-layout{padding-top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.icon.outbound{color:#aaa;display:inline-block}.badge[data-v-099ab69c]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff;margin-right:5px;background-color:#42b983}.badge.middle[data-v-099ab69c]{vertical-align:middle}.badge.top[data-v-099ab69c]{vertical-align:top}.badge.green[data-v-099ab69c],.badge.tip[data-v-099ab69c]{background-color:#42b983}.badge.error[data-v-099ab69c]{background-color:#da5961}.badge.warn[data-v-099ab69c],.badge.warning[data-v-099ab69c],.badge.yellow[data-v-099ab69c]{background-color:#e7c000}li[data-v-29630791],ul[data-v-29630791]{list-style:none}.title[data-v-29630791]{padding:20px 0 0}.title p[data-v-29630791]{border-bottom:1px solid #eaecef;font-size:18px;font-weight:700;line-height:50px;padding:0;margin:0}.title ul[data-v-29630791]{padding:0;margin:0}.li[data-v-29630791]{width:25%;float:left;color:#2c815b;border-bottom:1px solid #eaecef;line-height:70px;height:70px}.li a[data-v-29630791]{text-decoration:none}.cb[data-v-29630791]{clear:both}.sidebar-group:not(.first){margin-top:1em}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading{cursor:auto;color:inherit}.sidebar-heading{color:#999;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:0 1.5rem;margin-top:0;margin-bottom:.5rem}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading:.open .arrow{top:-.18em}.sidebar-group-items{transition:height .1s ease-out;overflow:hidden} \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/img/1.6f2046a8.png b/docs/.vuepress/dist/assets/img/1.6f2046a8.png new file mode 100644 index 00000000..8e65e2f8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1.6f2046a8.png differ diff --git a/docs/.vuepress/dist/assets/img/10.a44ca8c2.png b/docs/.vuepress/dist/assets/img/10.a44ca8c2.png new file mode 100644 index 00000000..310e04af Binary files /dev/null and b/docs/.vuepress/dist/assets/img/10.a44ca8c2.png differ diff --git a/docs/.vuepress/dist/assets/img/11.144a1b5d.png b/docs/.vuepress/dist/assets/img/11.144a1b5d.png new file mode 100644 index 00000000..830865d8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/11.144a1b5d.png differ diff --git a/docs/.vuepress/dist/assets/img/12.2924df38.png b/docs/.vuepress/dist/assets/img/12.2924df38.png new file mode 100644 index 00000000..1caae09f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/12.2924df38.png differ diff --git a/source/contract/communityImagesCN/1542526165310.png b/docs/.vuepress/dist/assets/img/1542526165310.ba6a717d.png similarity index 100% rename from source/contract/communityImagesCN/1542526165310.png rename to docs/.vuepress/dist/assets/img/1542526165310.ba6a717d.png diff --git a/source/contract/communityImagesCN/1542526178695.png b/docs/.vuepress/dist/assets/img/1542526178695.471936da.png similarity index 100% rename from source/contract/communityImagesCN/1542526178695.png rename to docs/.vuepress/dist/assets/img/1542526178695.471936da.png diff --git a/source/contract/communityImagesCN/1542526190286.png b/docs/.vuepress/dist/assets/img/1542526190286.0403f20e.png similarity index 100% rename from source/contract/communityImagesCN/1542526190286.png rename to docs/.vuepress/dist/assets/img/1542526190286.0403f20e.png diff --git a/source/contract/communityImagesCN/1542526202833.png b/docs/.vuepress/dist/assets/img/1542526202833.89727e78.png similarity index 100% rename from source/contract/communityImagesCN/1542526202833.png rename to docs/.vuepress/dist/assets/img/1542526202833.89727e78.png diff --git a/source/contract/communityImagesCN/1542526213174.png b/docs/.vuepress/dist/assets/img/1542526213174.38f2b59f.png similarity index 100% rename from source/contract/communityImagesCN/1542526213174.png rename to docs/.vuepress/dist/assets/img/1542526213174.38f2b59f.png diff --git a/source/contract/communityImagesCN/1542526223816.png b/docs/.vuepress/dist/assets/img/1542526223816.fa5a14f2.png similarity index 100% rename from source/contract/communityImagesCN/1542526223816.png rename to docs/.vuepress/dist/assets/img/1542526223816.fa5a14f2.png diff --git a/docs/.vuepress/dist/assets/img/1546518367717.3884ae76.png b/docs/.vuepress/dist/assets/img/1546518367717.3884ae76.png new file mode 100644 index 00000000..52ffebcd Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546518367717.3884ae76.png differ diff --git a/docs/.vuepress/dist/assets/img/1546518556230.b3d05831.png b/docs/.vuepress/dist/assets/img/1546518556230.b3d05831.png new file mode 100644 index 00000000..3efe6603 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546518556230.b3d05831.png differ diff --git a/docs/.vuepress/dist/assets/img/1546518956812.2aa8e3b0.png b/docs/.vuepress/dist/assets/img/1546518956812.2aa8e3b0.png new file mode 100644 index 00000000..f750592e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546518956812.2aa8e3b0.png differ diff --git a/docs/.vuepress/dist/assets/img/1546519370742.c4239db8.png b/docs/.vuepress/dist/assets/img/1546519370742.c4239db8.png new file mode 100644 index 00000000..fb1f2b6c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546519370742.c4239db8.png differ diff --git a/docs/.vuepress/dist/assets/img/1546519548787.20972169.png b/docs/.vuepress/dist/assets/img/1546519548787.20972169.png new file mode 100644 index 00000000..99653773 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546519548787.20972169.png differ diff --git a/docs/.vuepress/dist/assets/img/1546520020388.3442ad67.png b/docs/.vuepress/dist/assets/img/1546520020388.3442ad67.png new file mode 100644 index 00000000..753bfa6c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546520020388.3442ad67.png differ diff --git a/docs/.vuepress/dist/assets/img/1546586728639.68220b93.png b/docs/.vuepress/dist/assets/img/1546586728639.68220b93.png new file mode 100644 index 00000000..92909f3a Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1546586728639.68220b93.png differ diff --git a/docs/.vuepress/dist/assets/img/1547434994872.92dbbc1e.png b/docs/.vuepress/dist/assets/img/1547434994872.92dbbc1e.png new file mode 100644 index 00000000..4f3d45f8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547434994872.92dbbc1e.png differ diff --git a/docs/.vuepress/dist/assets/img/1547436510741.06607801.png b/docs/.vuepress/dist/assets/img/1547436510741.06607801.png new file mode 100644 index 00000000..bea8562b Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547436510741.06607801.png differ diff --git a/docs/.vuepress/dist/assets/img/1547436748834.fe0f9423.png b/docs/.vuepress/dist/assets/img/1547436748834.fe0f9423.png new file mode 100644 index 00000000..da026135 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547436748834.fe0f9423.png differ diff --git a/docs/.vuepress/dist/assets/img/1547436768246.f101c590.png b/docs/.vuepress/dist/assets/img/1547436768246.f101c590.png new file mode 100644 index 00000000..98eb650f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547436768246.f101c590.png differ diff --git a/docs/.vuepress/dist/assets/img/1547437357998.b682db26.png b/docs/.vuepress/dist/assets/img/1547437357998.b682db26.png new file mode 100644 index 00000000..0759e9f8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547437357998.b682db26.png differ diff --git a/docs/.vuepress/dist/assets/img/1547437427946.7b123720.png b/docs/.vuepress/dist/assets/img/1547437427946.7b123720.png new file mode 100644 index 00000000..39b0ad28 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547437427946.7b123720.png differ diff --git a/docs/.vuepress/dist/assets/img/1547437842317.019395e0.png b/docs/.vuepress/dist/assets/img/1547437842317.019395e0.png new file mode 100644 index 00000000..8f0f5e33 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547437842317.019395e0.png differ diff --git a/docs/.vuepress/dist/assets/img/1547437878443.667d71a0.png b/docs/.vuepress/dist/assets/img/1547437878443.667d71a0.png new file mode 100644 index 00000000..f3b31d05 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547437878443.667d71a0.png differ diff --git a/docs/.vuepress/dist/assets/img/1547445221113.c3f48bb9.png b/docs/.vuepress/dist/assets/img/1547445221113.c3f48bb9.png new file mode 100644 index 00000000..ce0556da Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547445221113.c3f48bb9.png differ diff --git a/docs/.vuepress/dist/assets/img/1547445305902.570917cf.png b/docs/.vuepress/dist/assets/img/1547445305902.570917cf.png new file mode 100644 index 00000000..1a61d124 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547445305902.570917cf.png differ diff --git a/docs/.vuepress/dist/assets/img/1547458467571.a14a4e0b.png b/docs/.vuepress/dist/assets/img/1547458467571.a14a4e0b.png new file mode 100644 index 00000000..b70de5be Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547458467571.a14a4e0b.png differ diff --git a/docs/.vuepress/dist/assets/img/1547458489793.f9af2155.png b/docs/.vuepress/dist/assets/img/1547458489793.f9af2155.png new file mode 100644 index 00000000..0d0f6751 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547458489793.f9af2155.png differ diff --git a/docs/.vuepress/dist/assets/img/1547458691614.21c0d621.png b/docs/.vuepress/dist/assets/img/1547458691614.21c0d621.png new file mode 100644 index 00000000..cfdea2db Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547458691614.21c0d621.png differ diff --git a/docs/.vuepress/dist/assets/img/1547458844211.915e83ae.png b/docs/.vuepress/dist/assets/img/1547458844211.915e83ae.png new file mode 100644 index 00000000..7e97a3fc Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547458844211.915e83ae.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459086013.698b1bc6.png b/docs/.vuepress/dist/assets/img/1547459086013.698b1bc6.png new file mode 100644 index 00000000..f58c6b4a Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459086013.698b1bc6.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459110975.8cb3878e.png b/docs/.vuepress/dist/assets/img/1547459110975.8cb3878e.png new file mode 100644 index 00000000..21a69dc7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459110975.8cb3878e.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459677163.2aac5dcb.png b/docs/.vuepress/dist/assets/img/1547459677163.2aac5dcb.png new file mode 100644 index 00000000..d64ba1b9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459677163.2aac5dcb.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459708942.564adc16.png b/docs/.vuepress/dist/assets/img/1547459708942.564adc16.png new file mode 100644 index 00000000..9fe25f6a Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459708942.564adc16.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459737912.24ee8a80.png b/docs/.vuepress/dist/assets/img/1547459737912.24ee8a80.png new file mode 100644 index 00000000..4a5aeb26 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459737912.24ee8a80.png differ diff --git a/docs/.vuepress/dist/assets/img/1547459824098.05b8ba9b.png b/docs/.vuepress/dist/assets/img/1547459824098.05b8ba9b.png new file mode 100644 index 00000000..8984ed52 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547459824098.05b8ba9b.png differ diff --git a/docs/.vuepress/dist/assets/img/1547460181242.914f1175.png b/docs/.vuepress/dist/assets/img/1547460181242.914f1175.png new file mode 100644 index 00000000..00f43d7b Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547460181242.914f1175.png differ diff --git a/docs/.vuepress/dist/assets/img/1547460237710.d8e664ca.png b/docs/.vuepress/dist/assets/img/1547460237710.d8e664ca.png new file mode 100644 index 00000000..30502ba1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547460237710.d8e664ca.png differ diff --git a/docs/.vuepress/dist/assets/img/1547460590047.38d13fda.png b/docs/.vuepress/dist/assets/img/1547460590047.38d13fda.png new file mode 100644 index 00000000..156e6f19 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547460590047.38d13fda.png differ diff --git a/docs/.vuepress/dist/assets/img/1547460865338.ace153bf.png b/docs/.vuepress/dist/assets/img/1547460865338.ace153bf.png new file mode 100644 index 00000000..7249898d Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547460865338.ace153bf.png differ diff --git a/docs/.vuepress/dist/assets/img/1547461252921.f60612aa.png b/docs/.vuepress/dist/assets/img/1547461252921.f60612aa.png new file mode 100644 index 00000000..4c2176c0 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547461252921.f60612aa.png differ diff --git a/docs/.vuepress/dist/assets/img/1547461277501.70b4b430.png b/docs/.vuepress/dist/assets/img/1547461277501.70b4b430.png new file mode 100644 index 00000000..f76adc14 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547461277501.70b4b430.png differ diff --git a/docs/.vuepress/dist/assets/img/1547461383782.e376e971.png b/docs/.vuepress/dist/assets/img/1547461383782.e376e971.png new file mode 100644 index 00000000..e4751450 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547461383782.e376e971.png differ diff --git a/docs/.vuepress/dist/assets/img/1547627744781.d29f4151.png b/docs/.vuepress/dist/assets/img/1547627744781.d29f4151.png new file mode 100644 index 00000000..bd27d5cb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547627744781.d29f4151.png differ diff --git a/docs/.vuepress/dist/assets/img/1547628433529.82f02f3c.png b/docs/.vuepress/dist/assets/img/1547628433529.82f02f3c.png new file mode 100644 index 00000000..bfceb4f4 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547628433529.82f02f3c.png differ diff --git a/docs/.vuepress/dist/assets/img/1547629113708.a978d574.png b/docs/.vuepress/dist/assets/img/1547629113708.a978d574.png new file mode 100644 index 00000000..43a0c2c7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547629113708.a978d574.png differ diff --git a/docs/.vuepress/dist/assets/img/1547629614931.c21668db.png b/docs/.vuepress/dist/assets/img/1547629614931.c21668db.png new file mode 100644 index 00000000..b5c8e379 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547629614931.c21668db.png differ diff --git a/docs/.vuepress/dist/assets/img/1547630048933.09832fac.png b/docs/.vuepress/dist/assets/img/1547630048933.09832fac.png new file mode 100644 index 00000000..090ad76a Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547630048933.09832fac.png differ diff --git a/docs/.vuepress/dist/assets/img/1547630351497.bb1c264a.png b/docs/.vuepress/dist/assets/img/1547630351497.bb1c264a.png new file mode 100644 index 00000000..61966d34 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547630351497.bb1c264a.png differ diff --git a/docs/.vuepress/dist/assets/img/1547630438203.46cfbc93.png b/docs/.vuepress/dist/assets/img/1547630438203.46cfbc93.png new file mode 100644 index 00000000..1f45008c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547630438203.46cfbc93.png differ diff --git a/docs/.vuepress/dist/assets/img/1547630589355.f9869b27.png b/docs/.vuepress/dist/assets/img/1547630589355.f9869b27.png new file mode 100644 index 00000000..897368db Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547630589355.f9869b27.png differ diff --git a/docs/.vuepress/dist/assets/img/1547631195826.4604d1ee.png b/docs/.vuepress/dist/assets/img/1547631195826.4604d1ee.png new file mode 100644 index 00000000..397e8948 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547631195826.4604d1ee.png differ diff --git a/docs/.vuepress/dist/assets/img/1547780793.d1901165.png b/docs/.vuepress/dist/assets/img/1547780793.d1901165.png new file mode 100644 index 00000000..dc4ea67d Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1547780793.d1901165.png differ diff --git a/docs/.vuepress/dist/assets/img/1552373134638.64de5bfc.png b/docs/.vuepress/dist/assets/img/1552373134638.64de5bfc.png new file mode 100644 index 00000000..1910130b Binary files /dev/null and b/docs/.vuepress/dist/assets/img/1552373134638.64de5bfc.png differ diff --git a/docs/.vuepress/dist/assets/img/2.e042a947.png b/docs/.vuepress/dist/assets/img/2.e042a947.png new file mode 100644 index 00000000..f9526d9c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/2.e042a947.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115102249.d551ecec.png b/docs/.vuepress/dist/assets/img/20190115102249.d551ecec.png new file mode 100644 index 00000000..3b5efab6 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115102249.d551ecec.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115103504.342076cb.png b/docs/.vuepress/dist/assets/img/20190115103504.342076cb.png new file mode 100644 index 00000000..91f74f6b Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115103504.342076cb.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115104427.1df39c02.png b/docs/.vuepress/dist/assets/img/20190115104427.1df39c02.png new file mode 100644 index 00000000..9d51ef03 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115104427.1df39c02.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115104911.71222bc1.png b/docs/.vuepress/dist/assets/img/20190115104911.71222bc1.png new file mode 100644 index 00000000..b945d149 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115104911.71222bc1.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115110413.617e8ffb.png b/docs/.vuepress/dist/assets/img/20190115110413.617e8ffb.png new file mode 100644 index 00000000..0e8536eb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115110413.617e8ffb.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115110806.ad21b29f.png b/docs/.vuepress/dist/assets/img/20190115110806.ad21b29f.png new file mode 100644 index 00000000..acc240d5 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115110806.ad21b29f.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115111229.1227e59a.png b/docs/.vuepress/dist/assets/img/20190115111229.1227e59a.png new file mode 100644 index 00000000..458a8b9b Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115111229.1227e59a.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115111447.ddf1ea31.png b/docs/.vuepress/dist/assets/img/20190115111447.ddf1ea31.png new file mode 100644 index 00000000..8ee2af6e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115111447.ddf1ea31.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115111721.cb32c823.png b/docs/.vuepress/dist/assets/img/20190115111721.cb32c823.png new file mode 100644 index 00000000..77340c63 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115111721.cb32c823.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115112121.0f04e108.png b/docs/.vuepress/dist/assets/img/20190115112121.0f04e108.png new file mode 100644 index 00000000..3ac2b58e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115112121.0f04e108.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115112217.f8239e8a.png b/docs/.vuepress/dist/assets/img/20190115112217.f8239e8a.png new file mode 100644 index 00000000..93962f48 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115112217.f8239e8a.png differ diff --git a/docs/.vuepress/dist/assets/img/20190115112741.272fc0b7.png b/docs/.vuepress/dist/assets/img/20190115112741.272fc0b7.png new file mode 100644 index 00000000..e09b34a0 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190115112741.272fc0b7.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312145034.0a656cae.png b/docs/.vuepress/dist/assets/img/20190312145034.0a656cae.png new file mode 100644 index 00000000..1407deea Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312145034.0a656cae.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312145056.3f134cfe.png b/docs/.vuepress/dist/assets/img/20190312145056.3f134cfe.png new file mode 100644 index 00000000..79b8a3b4 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312145056.3f134cfe.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312150047.df608632.png b/docs/.vuepress/dist/assets/img/20190312150047.df608632.png new file mode 100644 index 00000000..cee00f05 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312150047.df608632.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312150103.4981632b.png b/docs/.vuepress/dist/assets/img/20190312150103.4981632b.png new file mode 100644 index 00000000..929027f1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312150103.4981632b.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312151157.e0d24572.png b/docs/.vuepress/dist/assets/img/20190312151157.e0d24572.png new file mode 100644 index 00000000..853c0840 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312151157.e0d24572.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312151528.1be54755.png b/docs/.vuepress/dist/assets/img/20190312151528.1be54755.png new file mode 100644 index 00000000..d72ae1cc Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312151528.1be54755.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312152642.636c3486.png b/docs/.vuepress/dist/assets/img/20190312152642.636c3486.png new file mode 100644 index 00000000..faf5c420 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312152642.636c3486.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312153112.e10d3148.png b/docs/.vuepress/dist/assets/img/20190312153112.e10d3148.png new file mode 100644 index 00000000..95cc8b48 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312153112.e10d3148.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312153758.2decc7c9.png b/docs/.vuepress/dist/assets/img/20190312153758.2decc7c9.png new file mode 100644 index 00000000..1dc120d2 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312153758.2decc7c9.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312154059.a051284c.png b/docs/.vuepress/dist/assets/img/20190312154059.a051284c.png new file mode 100644 index 00000000..310e2c89 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312154059.a051284c.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312154512.6da50cbb.png b/docs/.vuepress/dist/assets/img/20190312154512.6da50cbb.png new file mode 100644 index 00000000..0615d586 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312154512.6da50cbb.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312154925.f127eb93.png b/docs/.vuepress/dist/assets/img/20190312154925.f127eb93.png new file mode 100644 index 00000000..2bcba622 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312154925.f127eb93.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312155458.c35956eb.png b/docs/.vuepress/dist/assets/img/20190312155458.c35956eb.png new file mode 100644 index 00000000..0a80bdab Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312155458.c35956eb.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312155710.3b00c0ae.png b/docs/.vuepress/dist/assets/img/20190312155710.3b00c0ae.png new file mode 100644 index 00000000..39e8714c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312155710.3b00c0ae.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312160126.44144b2b.png b/docs/.vuepress/dist/assets/img/20190312160126.44144b2b.png new file mode 100644 index 00000000..cdfd1a89 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312160126.44144b2b.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312160629.4f000d32.png b/docs/.vuepress/dist/assets/img/20190312160629.4f000d32.png new file mode 100644 index 00000000..f6a569bf Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312160629.4f000d32.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312160828.c04ec122.png b/docs/.vuepress/dist/assets/img/20190312160828.c04ec122.png new file mode 100644 index 00000000..ce9177c8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312160828.c04ec122.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312161634.406c6ace.png b/docs/.vuepress/dist/assets/img/20190312161634.406c6ace.png new file mode 100644 index 00000000..729dc6b1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312161634.406c6ace.png differ diff --git a/docs/.vuepress/dist/assets/img/20190312162211.93951a94.png b/docs/.vuepress/dist/assets/img/20190312162211.93951a94.png new file mode 100644 index 00000000..b061b8c5 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190312162211.93951a94.png differ diff --git a/docs/.vuepress/dist/assets/img/20190327142342.5789d3b1.png b/docs/.vuepress/dist/assets/img/20190327142342.5789d3b1.png new file mode 100644 index 00000000..6c0a5468 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190327142342.5789d3b1.png differ diff --git a/docs/.vuepress/dist/assets/img/20190327143435.6f71ae15.png b/docs/.vuepress/dist/assets/img/20190327143435.6f71ae15.png new file mode 100644 index 00000000..7320666c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190327143435.6f71ae15.png differ diff --git a/docs/.vuepress/dist/assets/img/20190327144549.1cbb469e.png b/docs/.vuepress/dist/assets/img/20190327144549.1cbb469e.png new file mode 100644 index 00000000..0b609bce Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190327144549.1cbb469e.png differ diff --git a/docs/.vuepress/dist/assets/img/20190327150757.e698a658.png b/docs/.vuepress/dist/assets/img/20190327150757.e698a658.png new file mode 100644 index 00000000..dcce3d3d Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190327150757.e698a658.png differ diff --git a/docs/.vuepress/dist/assets/img/20190327223858.aec0a9b8.png b/docs/.vuepress/dist/assets/img/20190327223858.aec0a9b8.png new file mode 100644 index 00000000..49babe23 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/20190327223858.aec0a9b8.png differ diff --git a/docs/.vuepress/dist/assets/img/3.2a598d4a.png b/docs/.vuepress/dist/assets/img/3.2a598d4a.png new file mode 100644 index 00000000..7651329f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/3.2a598d4a.png differ diff --git a/docs/.vuepress/dist/assets/img/4.ab76dd1b.png b/docs/.vuepress/dist/assets/img/4.ab76dd1b.png new file mode 100644 index 00000000..0e7ec9be Binary files /dev/null and b/docs/.vuepress/dist/assets/img/4.ab76dd1b.png differ diff --git a/docs/.vuepress/dist/assets/img/6.b4a2a10c.png b/docs/.vuepress/dist/assets/img/6.b4a2a10c.png new file mode 100644 index 00000000..0373a053 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/6.b4a2a10c.png differ diff --git a/docs/.vuepress/dist/assets/img/7.71c33714.png b/docs/.vuepress/dist/assets/img/7.71c33714.png new file mode 100644 index 00000000..58fb580f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/7.71c33714.png differ diff --git a/docs/.vuepress/dist/assets/img/8.33bf5b49.png b/docs/.vuepress/dist/assets/img/8.33bf5b49.png new file mode 100644 index 00000000..909b2d41 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/8.33bf5b49.png differ diff --git a/docs/.vuepress/dist/assets/img/9.ae82c2b9.png b/docs/.vuepress/dist/assets/img/9.ae82c2b9.png new file mode 100644 index 00000000..e732c9a1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/9.ae82c2b9.png differ diff --git a/source/contract/pluginImages/Add.jpg b/docs/.vuepress/dist/assets/img/Add.e1d751e6.jpg similarity index 100% rename from source/contract/pluginImages/Add.jpg rename to docs/.vuepress/dist/assets/img/Add.e1d751e6.jpg diff --git a/source/contract/pluginImages/Add3.jpg b/docs/.vuepress/dist/assets/img/Add3.fbd88d0f.jpg similarity index 100% rename from source/contract/pluginImages/Add3.jpg rename to docs/.vuepress/dist/assets/img/Add3.fbd88d0f.jpg diff --git a/source/contract/pluginImages/Add5.jpg b/docs/.vuepress/dist/assets/img/Add5.dfc1a6d7.jpg similarity index 100% rename from source/contract/pluginImages/Add5.jpg rename to docs/.vuepress/dist/assets/img/Add5.dfc1a6d7.jpg diff --git a/source/contract/pluginImages/Deploy.jpg b/docs/.vuepress/dist/assets/img/Deploy.0f2d2d88.jpg similarity index 100% rename from source/contract/pluginImages/Deploy.jpg rename to docs/.vuepress/dist/assets/img/Deploy.0f2d2d88.jpg diff --git a/source/contract/pluginImages/Deploy2.jpg b/docs/.vuepress/dist/assets/img/Deploy2.ccca3cbd.jpg similarity index 100% rename from source/contract/pluginImages/Deploy2.jpg rename to docs/.vuepress/dist/assets/img/Deploy2.ccca3cbd.jpg diff --git a/source/contract/pluginImages/Deploy3.jpg b/docs/.vuepress/dist/assets/img/Deploy3.131a59dc.jpg similarity index 100% rename from source/contract/pluginImages/Deploy3.jpg rename to docs/.vuepress/dist/assets/img/Deploy3.131a59dc.jpg diff --git a/source/contract/pluginImages/Deploy4.jpg b/docs/.vuepress/dist/assets/img/Deploy4.ebcdade6.jpg similarity index 100% rename from source/contract/pluginImages/Deploy4.jpg rename to docs/.vuepress/dist/assets/img/Deploy4.ebcdade6.jpg diff --git a/source/contract/pluginImages/Deploy5.jpg b/docs/.vuepress/dist/assets/img/Deploy5.37a2c168.jpg similarity index 100% rename from source/contract/pluginImages/Deploy5.jpg rename to docs/.vuepress/dist/assets/img/Deploy5.37a2c168.jpg diff --git a/source/contract/pluginImages/Deploy6.jpg b/docs/.vuepress/dist/assets/img/Deploy6.f4b26eb1.jpg similarity index 100% rename from source/contract/pluginImages/Deploy6.jpg rename to docs/.vuepress/dist/assets/img/Deploy6.f4b26eb1.jpg diff --git a/source/contract/pluginImages/Deploy7.jpg b/docs/.vuepress/dist/assets/img/Deploy7.e33e7d01.jpg similarity index 100% rename from source/contract/pluginImages/Deploy7.jpg rename to docs/.vuepress/dist/assets/img/Deploy7.e33e7d01.jpg diff --git a/source/contract/pluginImages/Install.jpg b/docs/.vuepress/dist/assets/img/Install.33ff9464.jpg similarity index 100% rename from source/contract/pluginImages/Install.jpg rename to docs/.vuepress/dist/assets/img/Install.33ff9464.jpg diff --git a/source/contract/pluginImages/Install2.jpg b/docs/.vuepress/dist/assets/img/Install2.23136d69.jpg similarity index 100% rename from source/contract/pluginImages/Install2.jpg rename to docs/.vuepress/dist/assets/img/Install2.23136d69.jpg diff --git a/source/contract/pluginImages/Install3.jpg b/docs/.vuepress/dist/assets/img/Install3.145b9c4e.jpg similarity index 100% rename from source/contract/pluginImages/Install3.jpg rename to docs/.vuepress/dist/assets/img/Install3.145b9c4e.jpg diff --git a/source/contract/smartContractImages/access1.jpg b/docs/.vuepress/dist/assets/img/access1.e55b0e87.jpg similarity index 100% rename from source/contract/smartContractImages/access1.jpg rename to docs/.vuepress/dist/assets/img/access1.e55b0e87.jpg diff --git a/source/contract/smartContractImages/access2.jpg b/docs/.vuepress/dist/assets/img/access2.142e5288.jpg similarity index 100% rename from source/contract/smartContractImages/access2.jpg rename to docs/.vuepress/dist/assets/img/access2.142e5288.jpg diff --git a/source/contract/smartContractImages/access3.jpg b/docs/.vuepress/dist/assets/img/access3.473cdd05.jpg similarity index 100% rename from source/contract/smartContractImages/access3.jpg rename to docs/.vuepress/dist/assets/img/access3.473cdd05.jpg diff --git a/source/contract/smartContractImages/access4.jpg b/docs/.vuepress/dist/assets/img/access4.ec334fa4.jpg similarity index 100% rename from source/contract/smartContractImages/access4.jpg rename to docs/.vuepress/dist/assets/img/access4.ec334fa4.jpg diff --git a/source/contract/smartContractImages/access5.jpg b/docs/.vuepress/dist/assets/img/access5.2eda257e.jpg similarity index 100% rename from source/contract/smartContractImages/access5.jpg rename to docs/.vuepress/dist/assets/img/access5.2eda257e.jpg diff --git a/source/contract/smartContractImages/access6.jpg b/docs/.vuepress/dist/assets/img/access6.f24bf883.jpg similarity index 100% rename from source/contract/smartContractImages/access6.jpg rename to docs/.vuepress/dist/assets/img/access6.f24bf883.jpg diff --git a/source/contract/smartContractImages/access7.jpg b/docs/.vuepress/dist/assets/img/access7.d4ad0113.jpg similarity index 100% rename from source/contract/smartContractImages/access7.jpg rename to docs/.vuepress/dist/assets/img/access7.d4ad0113.jpg diff --git a/docs/.vuepress/dist/assets/img/account-context.aaa5f026.png b/docs/.vuepress/dist/assets/img/account-context.aaa5f026.png new file mode 100644 index 00000000..b084438c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-context.aaa5f026.png differ diff --git a/docs/.vuepress/dist/assets/img/account-create-address.23098bf5.png b/docs/.vuepress/dist/assets/img/account-create-address.23098bf5.png new file mode 100644 index 00000000..7e50869f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-create-address.23098bf5.png differ diff --git a/docs/.vuepress/dist/assets/img/account-create-offline.71a206b9.png b/docs/.vuepress/dist/assets/img/account-create-offline.71a206b9.png new file mode 100644 index 00000000..d4c178be Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-create-offline.71a206b9.png differ diff --git a/docs/.vuepress/dist/assets/img/account-export-keystore.a0ab3ab5.png b/docs/.vuepress/dist/assets/img/account-export-keystore.a0ab3ab5.png new file mode 100644 index 00000000..67ebbec3 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-export-keystore.a0ab3ab5.png differ diff --git a/docs/.vuepress/dist/assets/img/account-export-prikey.49b3d4d1.png b/docs/.vuepress/dist/assets/img/account-export-prikey.49b3d4d1.png new file mode 100644 index 00000000..532c06ef Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-export-prikey.49b3d4d1.png differ diff --git a/docs/.vuepress/dist/assets/img/account-import-keystore.5886df1e.png b/docs/.vuepress/dist/assets/img/account-import-keystore.5886df1e.png new file mode 100644 index 00000000..4871cf7d Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-import-keystore.5886df1e.png differ diff --git a/docs/.vuepress/dist/assets/img/account-import-prikey.e1a987ac.png b/docs/.vuepress/dist/assets/img/account-import-prikey.e1a987ac.png new file mode 100644 index 00000000..b631b421 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-import-prikey.e1a987ac.png differ diff --git a/docs/.vuepress/dist/assets/img/account-module.ab4c1b38.png b/docs/.vuepress/dist/assets/img/account-module.ab4c1b38.png new file mode 100644 index 00000000..39b3fb20 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-module.ab4c1b38.png differ diff --git a/docs/.vuepress/dist/assets/img/account-remove-address.e8b7a30d.png b/docs/.vuepress/dist/assets/img/account-remove-address.e8b7a30d.png new file mode 100644 index 00000000..b0f59aa1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/account-remove-address.e8b7a30d.png differ diff --git a/docs/.vuepress/dist/assets/img/architecture.784f3b18.png b/docs/.vuepress/dist/assets/img/architecture.784f3b18.png new file mode 100644 index 00000000..02e2a508 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/architecture.784f3b18.png differ diff --git a/docs/.vuepress/dist/assets/img/assetDestroy.62602f22.png b/docs/.vuepress/dist/assets/img/assetDestroy.62602f22.png new file mode 100644 index 00000000..c3fa81f9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/assetDestroy.62602f22.png differ diff --git a/docs/.vuepress/dist/assets/img/assetRegister.b72c7a79.png b/docs/.vuepress/dist/assets/img/assetRegister.b72c7a79.png new file mode 100644 index 00000000..18a33fbe Binary files /dev/null and b/docs/.vuepress/dist/assets/img/assetRegister.b72c7a79.png differ diff --git a/source/contract/smartContractImages/assets1.jpg b/docs/.vuepress/dist/assets/img/assets1.abc7fc62.jpg similarity index 100% rename from source/contract/smartContractImages/assets1.jpg rename to docs/.vuepress/dist/assets/img/assets1.abc7fc62.jpg diff --git a/source/contract/smartContractImages/assets2.jpg b/docs/.vuepress/dist/assets/img/assets2.a43e834e.jpg similarity index 100% rename from source/contract/smartContractImages/assets2.jpg rename to docs/.vuepress/dist/assets/img/assets2.a43e834e.jpg diff --git a/source/contract/smartContractImages/assets3.jpg b/docs/.vuepress/dist/assets/img/assets3.68229e16.jpg similarity index 100% rename from source/contract/smartContractImages/assets3.jpg rename to docs/.vuepress/dist/assets/img/assets3.68229e16.jpg diff --git a/source/contract/smartContractImages/assets4.jpg b/docs/.vuepress/dist/assets/img/assets4.1e09a147.jpg similarity index 100% rename from source/contract/smartContractImages/assets4.jpg rename to docs/.vuepress/dist/assets/img/assets4.1e09a147.jpg diff --git a/docs/.vuepress/dist/assets/img/block-basic-validation.07557d70.png b/docs/.vuepress/dist/assets/img/block-basic-validation.07557d70.png new file mode 100644 index 00000000..2f07385c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-basic-validation.07557d70.png differ diff --git a/docs/.vuepress/dist/assets/img/block-basic-validation1.cf392d66.png b/docs/.vuepress/dist/assets/img/block-basic-validation1.cf392d66.png new file mode 100644 index 00000000..98b0f55c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-basic-validation1.cf392d66.png differ diff --git a/docs/.vuepress/dist/assets/img/block-basic-validation2.ed057a96.png b/docs/.vuepress/dist/assets/img/block-basic-validation2.ed057a96.png new file mode 100644 index 00000000..04b3eaeb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-basic-validation2.ed057a96.png differ diff --git a/docs/.vuepress/dist/assets/img/block-fork-chain.ceeb7bdd.png b/docs/.vuepress/dist/assets/img/block-fork-chain.ceeb7bdd.png new file mode 100644 index 00000000..6eaf2d28 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-fork-chain.ceeb7bdd.png differ diff --git a/docs/.vuepress/dist/assets/img/block-fork.a3b65fd6.png b/docs/.vuepress/dist/assets/img/block-fork.a3b65fd6.png new file mode 100644 index 00000000..498d28a0 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-fork.a3b65fd6.png differ diff --git a/docs/.vuepress/dist/assets/img/block-module-boot.4686b7bf.png b/docs/.vuepress/dist/assets/img/block-module-boot.4686b7bf.png new file mode 100644 index 00000000..e684d7a8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-module-boot.4686b7bf.png differ diff --git a/docs/.vuepress/dist/assets/img/block-module.ffc57f74.png b/docs/.vuepress/dist/assets/img/block-module.ffc57f74.png new file mode 100644 index 00000000..103b533f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-module.ffc57f74.png differ diff --git a/docs/.vuepress/dist/assets/img/block-synchronization.3b5f0ded.png b/docs/.vuepress/dist/assets/img/block-synchronization.3b5f0ded.png new file mode 100644 index 00000000..f020b1a3 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-synchronization.3b5f0ded.png differ diff --git a/docs/.vuepress/dist/assets/img/block-synchronization2.1bde323a.png b/docs/.vuepress/dist/assets/img/block-synchronization2.1bde323a.png new file mode 100644 index 00000000..06a8ac7e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-synchronization2.1bde323a.png differ diff --git a/docs/.vuepress/dist/assets/img/block-synchronization3.99496017.png b/docs/.vuepress/dist/assets/img/block-synchronization3.99496017.png new file mode 100644 index 00000000..4c65b9f0 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/block-synchronization3.99496017.png differ diff --git a/docs/.vuepress/dist/assets/img/chainDestroy.013520b1.png b/docs/.vuepress/dist/assets/img/chainDestroy.013520b1.png new file mode 100644 index 00000000..53fd4382 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/chainDestroy.013520b1.png differ diff --git a/docs/.vuepress/dist/assets/img/chainRegister.9111e337.png b/docs/.vuepress/dist/assets/img/chainRegister.9111e337.png new file mode 100644 index 00000000..36d852a4 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/chainRegister.9111e337.png differ diff --git a/docs/.vuepress/dist/assets/img/clip_image002.425eb96f.jpg b/docs/.vuepress/dist/assets/img/clip_image002.425eb96f.jpg new file mode 100644 index 00000000..04a251a1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/clip_image002.425eb96f.jpg differ diff --git a/source/contract/pluginImages/code.jpg b/docs/.vuepress/dist/assets/img/code.785ccdb5.jpg similarity index 100% rename from source/contract/pluginImages/code.jpg rename to docs/.vuepress/dist/assets/img/code.785ccdb5.jpg diff --git a/docs/.vuepress/dist/assets/img/coinbase.afeaf0dd.png b/docs/.vuepress/dist/assets/img/coinbase.afeaf0dd.png new file mode 100644 index 00000000..1dc629b7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/coinbase.afeaf0dd.png differ diff --git a/docs/.vuepress/dist/assets/img/connectSelf-recieve.7af46eff.png b/docs/.vuepress/dist/assets/img/connectSelf-recieve.7af46eff.png new file mode 100644 index 00000000..798680b5 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connectSelf-recieve.7af46eff.png differ diff --git a/docs/.vuepress/dist/assets/img/connectSelf-recieve.b38cf567.png b/docs/.vuepress/dist/assets/img/connectSelf-recieve.b38cf567.png new file mode 100644 index 00000000..012caa6c Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connectSelf-recieve.b38cf567.png differ diff --git a/docs/.vuepress/dist/assets/img/connectSelf.201d795a.png b/docs/.vuepress/dist/assets/img/connectSelf.201d795a.png new file mode 100644 index 00000000..896e2df5 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connectSelf.201d795a.png differ diff --git a/docs/.vuepress/dist/assets/img/connectSelf.f95af1ba.png b/docs/.vuepress/dist/assets/img/connectSelf.f95af1ba.png new file mode 100644 index 00000000..04d555a2 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connectSelf.f95af1ba.png differ diff --git a/docs/.vuepress/dist/assets/img/connection.18465077.png b/docs/.vuepress/dist/assets/img/connection.18465077.png new file mode 100644 index 00000000..84cffa27 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connection.18465077.png differ diff --git a/docs/.vuepress/dist/assets/img/connection.6ef3c5f5.png b/docs/.vuepress/dist/assets/img/connection.6ef3c5f5.png new file mode 100644 index 00000000..c190e7ef Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connection.6ef3c5f5.png differ diff --git a/docs/.vuepress/dist/assets/img/connet-validate.01cd9ec6.png b/docs/.vuepress/dist/assets/img/connet-validate.01cd9ec6.png new file mode 100644 index 00000000..fcc892f7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connet-validate.01cd9ec6.png differ diff --git a/docs/.vuepress/dist/assets/img/connet-validate.a03bf001.png b/docs/.vuepress/dist/assets/img/connet-validate.a03bf001.png new file mode 100644 index 00000000..dfdf11f7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/connet-validate.a03bf001.png differ diff --git a/docs/.vuepress/dist/assets/img/consensus-constants.5d3198f1.jpg b/docs/.vuepress/dist/assets/img/consensus-constants.5d3198f1.jpg new file mode 100644 index 00000000..318bc5bf Binary files /dev/null and b/docs/.vuepress/dist/assets/img/consensus-constants.5d3198f1.jpg differ diff --git a/docs/.vuepress/dist/assets/img/consensus-flow-5.e1e96c82.png b/docs/.vuepress/dist/assets/img/consensus-flow-5.e1e96c82.png new file mode 100644 index 00000000..060bf880 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/consensus-flow-5.e1e96c82.png differ diff --git a/docs/.vuepress/dist/assets/img/consensus-staticsReward.0738cb87.jpg b/docs/.vuepress/dist/assets/img/consensus-staticsReward.0738cb87.jpg new file mode 100644 index 00000000..7189b4a7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/consensus-staticsReward.0738cb87.jpg differ diff --git a/docs/.vuepress/dist/assets/img/createNodeGroup.02a8f18e.png b/docs/.vuepress/dist/assets/img/createNodeGroup.02a8f18e.png new file mode 100644 index 00000000..61e5bd1f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/createNodeGroup.02a8f18e.png differ diff --git a/docs/.vuepress/dist/assets/img/createNodeGroup.dcac4eab.png b/docs/.vuepress/dist/assets/img/createNodeGroup.dcac4eab.png new file mode 100644 index 00000000..d6793395 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/createNodeGroup.dcac4eab.png differ diff --git a/source/contract/pluginImages/createProject.jpg b/docs/.vuepress/dist/assets/img/createProject.e78abf06.jpg similarity index 100% rename from source/contract/pluginImages/createProject.jpg rename to docs/.vuepress/dist/assets/img/createProject.e78abf06.jpg diff --git a/source/contract/pluginImages/createProject2.jpg b/docs/.vuepress/dist/assets/img/createProject2.b7246453.jpg similarity index 100% rename from source/contract/pluginImages/createProject2.jpg rename to docs/.vuepress/dist/assets/img/createProject2.b7246453.jpg diff --git a/docs/.vuepress/dist/assets/img/crossPortDeliver.60021595.png b/docs/.vuepress/dist/assets/img/crossPortDeliver.60021595.png new file mode 100644 index 00000000..9190ef56 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/crossPortDeliver.60021595.png differ diff --git a/docs/.vuepress/dist/assets/img/deleteNodeGroup.1bb694b1.png b/docs/.vuepress/dist/assets/img/deleteNodeGroup.1bb694b1.png new file mode 100644 index 00000000..63bea3ed Binary files /dev/null and b/docs/.vuepress/dist/assets/img/deleteNodeGroup.1bb694b1.png differ diff --git a/docs/.vuepress/dist/assets/img/deleteNodeGroup2.a41d2684.png b/docs/.vuepress/dist/assets/img/deleteNodeGroup2.a41d2684.png new file mode 100644 index 00000000..8649b4ce Binary files /dev/null and b/docs/.vuepress/dist/assets/img/deleteNodeGroup2.a41d2684.png differ diff --git a/source/contract/smartContractImages/deploy1.jpg b/docs/.vuepress/dist/assets/img/deploy1.0620b80d.jpg similarity index 100% rename from source/contract/smartContractImages/deploy1.jpg rename to docs/.vuepress/dist/assets/img/deploy1.0620b80d.jpg diff --git a/source/contract/smartContractImages/deploy2.jpg b/docs/.vuepress/dist/assets/img/deploy2.c581a6ad.jpg similarity index 100% rename from source/contract/smartContractImages/deploy2.jpg rename to docs/.vuepress/dist/assets/img/deploy2.c581a6ad.jpg diff --git a/source/contract/smartContractImages/deploy3.jpg b/docs/.vuepress/dist/assets/img/deploy3.f8cde6aa.jpg similarity index 100% rename from source/contract/smartContractImages/deploy3.jpg rename to docs/.vuepress/dist/assets/img/deploy3.f8cde6aa.jpg diff --git a/source/contract/smartContractImages/deploy4.jpg b/docs/.vuepress/dist/assets/img/deploy4.e0509949.jpg similarity index 100% rename from source/contract/smartContractImages/deploy4.jpg rename to docs/.vuepress/dist/assets/img/deploy4.e0509949.jpg diff --git a/source/contract/smartContractImages/deploy6.jpg b/docs/.vuepress/dist/assets/img/deploy6.d41305b3.jpg similarity index 100% rename from source/contract/smartContractImages/deploy6.jpg rename to docs/.vuepress/dist/assets/img/deploy6.d41305b3.jpg diff --git a/docs/.vuepress/dist/assets/img/discoverPeer.3e4de810.png b/docs/.vuepress/dist/assets/img/discoverPeer.3e4de810.png new file mode 100644 index 00000000..5ce58e78 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/discoverPeer.3e4de810.png differ diff --git a/docs/.vuepress/dist/assets/img/discoverPeer.bc23a3c9.png b/docs/.vuepress/dist/assets/img/discoverPeer.bc23a3c9.png new file mode 100644 index 00000000..9997b722 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/discoverPeer.bc23a3c9.png differ diff --git a/docs/.vuepress/dist/assets/img/eth-transaction-flow.6f3dd253.png b/docs/.vuepress/dist/assets/img/eth-transaction-flow.6f3dd253.png new file mode 100644 index 00000000..a8e8c033 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/eth-transaction-flow.6f3dd253.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-content.23c1f972.png b/docs/.vuepress/dist/assets/img/event-bus-content.23c1f972.png new file mode 100644 index 00000000..1d14e3d6 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-content.23c1f972.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-function.8044546e.png b/docs/.vuepress/dist/assets/img/event-bus-function.8044546e.png new file mode 100644 index 00000000..60db2b70 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-function.8044546e.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-main-flow.c97c465a.png b/docs/.vuepress/dist/assets/img/event-bus-main-flow.c97c465a.png new file mode 100644 index 00000000..6bca6665 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-main-flow.c97c465a.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-model.a7412672.png b/docs/.vuepress/dist/assets/img/event-bus-model.a7412672.png new file mode 100644 index 00000000..b611d9bb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-model.a7412672.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-module.18c5a6f0.png b/docs/.vuepress/dist/assets/img/event-bus-module.18c5a6f0.png new file mode 100644 index 00000000..2c0563ae Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-module.18c5a6f0.png differ diff --git a/docs/.vuepress/dist/assets/img/event-bus-seq-flow.2de08cda.png b/docs/.vuepress/dist/assets/img/event-bus-seq-flow.2de08cda.png new file mode 100644 index 00000000..f4444063 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/event-bus-seq-flow.2de08cda.png differ diff --git a/docs/.vuepress/dist/assets/img/image-20190103193901967.35788ccc.png b/docs/.vuepress/dist/assets/img/image-20190103193901967.35788ccc.png new file mode 100644 index 00000000..5333535f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/image-20190103193901967.35788ccc.png differ diff --git a/docs/.vuepress/dist/assets/img/intro1.3e938c21.jpg b/docs/.vuepress/dist/assets/img/intro1.3e938c21.jpg new file mode 100644 index 00000000..104f1fa9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/intro1.3e938c21.jpg differ diff --git a/docs/.vuepress/dist/assets/img/intro2.d161b583.jpg b/docs/.vuepress/dist/assets/img/intro2.d161b583.jpg new file mode 100644 index 00000000..27c80a81 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/intro2.d161b583.jpg differ diff --git a/docs/.vuepress/dist/assets/img/introduction-1.3e938c21.jpg b/docs/.vuepress/dist/assets/img/introduction-1.3e938c21.jpg new file mode 100644 index 00000000..104f1fa9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/introduction-1.3e938c21.jpg differ diff --git a/docs/.vuepress/dist/assets/img/introduction-2.d161b583.jpg b/docs/.vuepress/dist/assets/img/introduction-2.d161b583.jpg new file mode 100644 index 00000000..27c80a81 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/introduction-2.d161b583.jpg differ diff --git a/docs/.vuepress/dist/assets/img/ledger-arch.865ff93a.png b/docs/.vuepress/dist/assets/img/ledger-arch.865ff93a.png new file mode 100644 index 00000000..b444b87e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/ledger-arch.865ff93a.png differ diff --git a/docs/.vuepress/dist/assets/img/ledger-functions.e4039436.png b/docs/.vuepress/dist/assets/img/ledger-functions.e4039436.png new file mode 100644 index 00000000..c6a145eb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/ledger-functions.e4039436.png differ diff --git a/docs/.vuepress/dist/assets/img/ledger-service.219cab8a.png b/docs/.vuepress/dist/assets/img/ledger-service.219cab8a.png new file mode 100644 index 00000000..edf61aa2 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/ledger-service.219cab8a.png differ diff --git a/docs/.vuepress/dist/assets/img/ledger.d4383200.png b/docs/.vuepress/dist/assets/img/ledger.d4383200.png new file mode 100644 index 00000000..c6361857 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/ledger.d4383200.png differ diff --git a/docs/.vuepress/dist/assets/img/ledgerstart.e024f199.png b/docs/.vuepress/dist/assets/img/ledgerstart.e024f199.png new file mode 100644 index 00000000..2e2d9ed4 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/ledgerstart.e024f199.png differ diff --git a/docs/.vuepress/dist/assets/img/module.84e040d4.png b/docs/.vuepress/dist/assets/img/module.84e040d4.png new file mode 100644 index 00000000..9c40bcc2 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/module.84e040d4.png differ diff --git a/docs/.vuepress/dist/assets/img/modules.5667d6c6.png b/docs/.vuepress/dist/assets/img/modules.5667d6c6.png new file mode 100644 index 00000000..32a9bac7 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/modules.5667d6c6.png differ diff --git a/source/contract/smartContractImages/myContract1.jpg b/docs/.vuepress/dist/assets/img/myContract1.9dd9d99f.jpg similarity index 100% rename from source/contract/smartContractImages/myContract1.jpg rename to docs/.vuepress/dist/assets/img/myContract1.9dd9d99f.jpg diff --git a/source/contract/smartContractImages/myContract2.jpg b/docs/.vuepress/dist/assets/img/myContract2.01d9687b.jpg similarity index 100% rename from source/contract/smartContractImages/myContract2.jpg rename to docs/.vuepress/dist/assets/img/myContract2.01d9687b.jpg diff --git a/source/contract/smartContractImages/myContract3.jpg b/docs/.vuepress/dist/assets/img/myContract3.31870321.jpg similarity index 100% rename from source/contract/smartContractImages/myContract3.jpg rename to docs/.vuepress/dist/assets/img/myContract3.31870321.jpg diff --git a/source/contract/smartContractImages/myContract4.jpg b/docs/.vuepress/dist/assets/img/myContract4.07a83092.jpg similarity index 100% rename from source/contract/smartContractImages/myContract4.jpg rename to docs/.vuepress/dist/assets/img/myContract4.07a83092.jpg diff --git a/source/contract/smartContractImages/myContract5.jpg b/docs/.vuepress/dist/assets/img/myContract5.912b5882.jpg similarity index 100% rename from source/contract/smartContractImages/myContract5.jpg rename to docs/.vuepress/dist/assets/img/myContract5.912b5882.jpg diff --git a/source/contract/smartContractImages/myContract6.jpg b/docs/.vuepress/dist/assets/img/myContract6.405104a8.jpg similarity index 100% rename from source/contract/smartContractImages/myContract6.jpg rename to docs/.vuepress/dist/assets/img/myContract6.405104a8.jpg diff --git a/docs/.vuepress/dist/assets/img/mykernelstarted.cfb5fce2.png b/docs/.vuepress/dist/assets/img/mykernelstarted.cfb5fce2.png new file mode 100644 index 00000000..2aef3ab5 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/mykernelstarted.cfb5fce2.png differ diff --git a/docs/.vuepress/dist/assets/img/network-context.8f5dc235.png b/docs/.vuepress/dist/assets/img/network-context.8f5dc235.png new file mode 100644 index 00000000..49bc9c79 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/network-context.8f5dc235.png differ diff --git a/docs/.vuepress/dist/assets/img/network-functions.51710572.png b/docs/.vuepress/dist/assets/img/network-functions.51710572.png new file mode 100644 index 00000000..d3a4b620 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/network-functions.51710572.png differ diff --git a/docs/.vuepress/dist/assets/img/network-functions.811c83fd.png b/docs/.vuepress/dist/assets/img/network-functions.811c83fd.png new file mode 100644 index 00000000..f4c9c8be Binary files /dev/null and b/docs/.vuepress/dist/assets/img/network-functions.811c83fd.png differ diff --git a/docs/.vuepress/dist/assets/img/package.06d61e5f.png b/docs/.vuepress/dist/assets/img/package.06d61e5f.png new file mode 100644 index 00000000..b4622303 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/package.06d61e5f.png differ diff --git a/source/contract/pluginImages/package.jpg b/docs/.vuepress/dist/assets/img/package.6fff1f40.jpg similarity index 100% rename from source/contract/pluginImages/package.jpg rename to docs/.vuepress/dist/assets/img/package.6fff1f40.jpg diff --git a/source/contract/pluginImages/package1.jpg b/docs/.vuepress/dist/assets/img/package1.e07eba9a.jpg similarity index 100% rename from source/contract/pluginImages/package1.jpg rename to docs/.vuepress/dist/assets/img/package1.e07eba9a.jpg diff --git a/source/contract/pluginImages/package2.jpg b/docs/.vuepress/dist/assets/img/package2.698a4145.jpg similarity index 100% rename from source/contract/pluginImages/package2.jpg rename to docs/.vuepress/dist/assets/img/package2.698a4145.jpg diff --git a/source/contract/pluginImages/package3.jpg b/docs/.vuepress/dist/assets/img/package3.e7db1454.jpg similarity index 100% rename from source/contract/pluginImages/package3.jpg rename to docs/.vuepress/dist/assets/img/package3.e7db1454.jpg diff --git a/source/contract/pluginImages/package4.jpg b/docs/.vuepress/dist/assets/img/package4.a9a579bf.jpg similarity index 100% rename from source/contract/pluginImages/package4.jpg rename to docs/.vuepress/dist/assets/img/package4.a9a579bf.jpg diff --git a/docs/.vuepress/dist/assets/img/pingpong.19416293.png b/docs/.vuepress/dist/assets/img/pingpong.19416293.png new file mode 100644 index 00000000..d751ec58 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/pingpong.19416293.png differ diff --git a/docs/.vuepress/dist/assets/img/pingpong.4acdca1b.png b/docs/.vuepress/dist/assets/img/pingpong.4acdca1b.png new file mode 100644 index 00000000..b8bc3845 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/pingpong.4acdca1b.png differ diff --git a/docs/.vuepress/dist/assets/img/recMessage2.74b8d584.png b/docs/.vuepress/dist/assets/img/recMessage2.74b8d584.png new file mode 100644 index 00000000..be0082ba Binary files /dev/null and b/docs/.vuepress/dist/assets/img/recMessage2.74b8d584.png differ diff --git a/docs/.vuepress/dist/assets/img/recMessage2.ccf47917.png b/docs/.vuepress/dist/assets/img/recMessage2.ccf47917.png new file mode 100644 index 00000000..294b5b0e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/recMessage2.ccf47917.png differ diff --git a/docs/.vuepress/dist/assets/img/saveNodeIp.3650e4e2.png b/docs/.vuepress/dist/assets/img/saveNodeIp.3650e4e2.png new file mode 100644 index 00000000..ce87bdc1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/saveNodeIp.3650e4e2.png differ diff --git a/docs/.vuepress/dist/assets/img/saveNodeIp.bc667171.png b/docs/.vuepress/dist/assets/img/saveNodeIp.bc667171.png new file mode 100644 index 00000000..f56553d8 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/saveNodeIp.bc667171.png differ diff --git a/docs/.vuepress/dist/assets/img/search.83621669.svg b/docs/.vuepress/dist/assets/img/search.83621669.svg new file mode 100644 index 00000000..03d83913 --- /dev/null +++ b/docs/.vuepress/dist/assets/img/search.83621669.svg @@ -0,0 +1 @@ + diff --git a/docs/.vuepress/dist/assets/img/sendMsg1.02c2c1dd.png b/docs/.vuepress/dist/assets/img/sendMsg1.02c2c1dd.png new file mode 100644 index 00000000..4d48f1f3 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/sendMsg1.02c2c1dd.png differ diff --git a/docs/.vuepress/dist/assets/img/sendMsg1.46198729.png b/docs/.vuepress/dist/assets/img/sendMsg1.46198729.png new file mode 100644 index 00000000..91f40939 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/sendMsg1.46198729.png differ diff --git a/docs/.vuepress/dist/assets/img/sendMsg2.de353050.png b/docs/.vuepress/dist/assets/img/sendMsg2.de353050.png new file mode 100644 index 00000000..379fff27 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/sendMsg2.de353050.png differ diff --git a/docs/.vuepress/dist/assets/img/sendMsg2.e2d2bd96.png b/docs/.vuepress/dist/assets/img/sendMsg2.e2d2bd96.png new file mode 100644 index 00000000..300f1f2e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/sendMsg2.e2d2bd96.png differ diff --git a/docs/.vuepress/dist/assets/img/shutdown.9b647f72.png b/docs/.vuepress/dist/assets/img/shutdown.9b647f72.png new file mode 100644 index 00000000..6686e9a0 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/shutdown.9b647f72.png differ diff --git a/docs/.vuepress/dist/assets/img/shutdown.c5afd6a1.png b/docs/.vuepress/dist/assets/img/shutdown.c5afd6a1.png new file mode 100644 index 00000000..b24c32d1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/shutdown.c5afd6a1.png differ diff --git a/docs/.vuepress/dist/assets/img/start.1e9dac99.png b/docs/.vuepress/dist/assets/img/start.1e9dac99.png new file mode 100644 index 00000000..44a2879d Binary files /dev/null and b/docs/.vuepress/dist/assets/img/start.1e9dac99.png differ diff --git a/docs/.vuepress/dist/assets/img/start.b7d30232.png b/docs/.vuepress/dist/assets/img/start.b7d30232.png new file mode 100644 index 00000000..f302eb60 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/start.b7d30232.png differ diff --git a/docs/.vuepress/dist/assets/img/statics_en.4c53a0d1.png b/docs/.vuepress/dist/assets/img/statics_en.4c53a0d1.png new file mode 100644 index 00000000..3bf93c55 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/statics_en.4c53a0d1.png differ diff --git a/docs/.vuepress/dist/assets/img/structure.2a58a4c4.png b/docs/.vuepress/dist/assets/img/structure.2a58a4c4.png new file mode 100644 index 00000000..4cb62f4f Binary files /dev/null and b/docs/.vuepress/dist/assets/img/structure.2a58a4c4.png differ diff --git a/docs/.vuepress/dist/assets/img/trx-validate-flow.fd3d46e4.png b/docs/.vuepress/dist/assets/img/trx-validate-flow.fd3d46e4.png new file mode 100644 index 00000000..66dae2d9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/trx-validate-flow.fd3d46e4.png differ diff --git a/docs/.vuepress/dist/assets/img/tx-manager-architecture.a6fa2f65.png b/docs/.vuepress/dist/assets/img/tx-manager-architecture.a6fa2f65.png new file mode 100644 index 00000000..504d6652 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/tx-manager-architecture.a6fa2f65.png differ diff --git a/docs/.vuepress/dist/assets/img/tx-manager-context.9c43a7b6.png b/docs/.vuepress/dist/assets/img/tx-manager-context.9c43a7b6.png new file mode 100644 index 00000000..2aeb75e1 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/tx-manager-context.9c43a7b6.png differ diff --git a/docs/.vuepress/dist/assets/img/tx-manager-ctosatellite.b4831c18.png b/docs/.vuepress/dist/assets/img/tx-manager-ctosatellite.b4831c18.png new file mode 100644 index 00000000..500b047e Binary files /dev/null and b/docs/.vuepress/dist/assets/img/tx-manager-ctosatellite.b4831c18.png differ diff --git a/docs/.vuepress/dist/assets/img/tx-manager-functional-architecture.10e83f9b.png b/docs/.vuepress/dist/assets/img/tx-manager-functional-architecture.10e83f9b.png new file mode 100644 index 00000000..1d6ec6a9 Binary files /dev/null and b/docs/.vuepress/dist/assets/img/tx-manager-functional-architecture.10e83f9b.png differ diff --git a/docs/.vuepress/dist/assets/img/tx-manager-satellitetoc.361d3fe7.png b/docs/.vuepress/dist/assets/img/tx-manager-satellitetoc.361d3fe7.png new file mode 100644 index 00000000..529021fb Binary files /dev/null and b/docs/.vuepress/dist/assets/img/tx-manager-satellitetoc.361d3fe7.png differ diff --git a/source/zh-cn/contract/communityImages/wps55B5.tmp.jpg b/docs/.vuepress/dist/assets/img/wps55B5.tmp.31dcd6a9.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wps55B5.tmp.jpg rename to docs/.vuepress/dist/assets/img/wps55B5.tmp.31dcd6a9.jpg diff --git a/source/zh-cn/contract/communityImages/wps96E5.tmp.jpg b/docs/.vuepress/dist/assets/img/wps96E5.tmp.56607bda.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wps96E5.tmp.jpg rename to docs/.vuepress/dist/assets/img/wps96E5.tmp.56607bda.jpg diff --git a/source/zh-cn/contract/communityImages/wpsA8AA.tmp.jpg b/docs/.vuepress/dist/assets/img/wpsA8AA.tmp.bc7dd59c.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wpsA8AA.tmp.jpg rename to docs/.vuepress/dist/assets/img/wpsA8AA.tmp.bc7dd59c.jpg diff --git a/source/zh-cn/contract/communityImages/wpsBF9.tmp.jpg b/docs/.vuepress/dist/assets/img/wpsBF9.tmp.94fa7ea2.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wpsBF9.tmp.jpg rename to docs/.vuepress/dist/assets/img/wpsBF9.tmp.94fa7ea2.jpg diff --git a/source/zh-cn/contract/communityImages/wpsD101.tmp.jpg b/docs/.vuepress/dist/assets/img/wpsD101.tmp.21509964.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wpsD101.tmp.jpg rename to docs/.vuepress/dist/assets/img/wpsD101.tmp.21509964.jpg diff --git a/source/zh-cn/contract/communityImages/wpsFCF4.tmp.jpg b/docs/.vuepress/dist/assets/img/wpsFCF4.tmp.a32293ed.jpg similarity index 100% rename from source/zh-cn/contract/communityImages/wpsFCF4.tmp.jpg rename to docs/.vuepress/dist/assets/img/wpsFCF4.tmp.a32293ed.jpg diff --git a/docs/.vuepress/dist/assets/js/10.2cc8f5c2.js b/docs/.vuepress/dist/assets/js/10.2cc8f5c2.js new file mode 100644 index 00000000..9b83777e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/10.2cc8f5c2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{420:function(t,e,a){t.exports=a.p+"assets/img/Install.33ff9464.jpg"},421:function(t,e,a){t.exports=a.p+"assets/img/Install2.23136d69.jpg"},422:function(t,e,a){t.exports=a.p+"assets/img/Install3.145b9c4e.jpg"},423:function(t,e,a){t.exports=a.p+"assets/img/createProject.e78abf06.jpg"},424:function(t,e,a){t.exports=a.p+"assets/img/createProject2.b7246453.jpg"},425:function(t,e,a){t.exports=a.p+"assets/img/code.785ccdb5.jpg"},426:function(t,e,a){t.exports=a.p+"assets/img/Deploy.0f2d2d88.jpg"},427:function(t,e,a){t.exports=a.p+"assets/img/Add.e1d751e6.jpg"},428:function(t,e,a){t.exports=a.p+"assets/img/Add3.fbd88d0f.jpg"},429:function(t,e,a){t.exports=a.p+"assets/img/Add5.dfc1a6d7.jpg"},430:function(t,e,a){t.exports=a.p+"assets/img/package.6fff1f40.jpg"},431:function(t,e,a){t.exports=a.p+"assets/img/package1.e07eba9a.jpg"},432:function(t,e,a){t.exports=a.p+"assets/img/package3.e7db1454.jpg"},433:function(t,e,a){t.exports=a.p+"assets/img/package2.698a4145.jpg"},434:function(t,e,a){t.exports=a.p+"assets/img/package4.a9a579bf.jpg"},435:function(t,e,a){t.exports=a.p+"assets/img/Deploy2.ccca3cbd.jpg"},436:function(t,e,a){t.exports=a.p+"assets/img/Deploy3.131a59dc.jpg"},437:function(t,e,a){t.exports=a.p+"assets/img/Deploy4.ebcdade6.jpg"},438:function(t,e,a){t.exports=a.p+"assets/img/Deploy5.37a2c168.jpg"},439:function(t,e,a){t.exports=a.p+"assets/img/Deploy6.f4b26eb1.jpg"},440:function(t,e,a){t.exports=a.p+"assets/img/Deploy7.e33e7d01.jpg"},993:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls-idea-plugin-user-manual"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls-idea-plugin-user-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS IDEA Plugin User Manual")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-install-nuls-plugin-on-idea"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-install-nuls-plugin-on-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 Install NULS Plugin on IDEA")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(420),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Select the said ZIP, and click OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(421),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Tick NULS plugin, and click Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(422),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-create-a-nuls-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-a-nuls-project","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 Create a NULS project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(423),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(424),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-compile-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-compile-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 Compile smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(425),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-set-and-deploy-the-node-and-account-for-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-set-and-deploy-the-node-and-account-for-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 Set and deploy the node and account for contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click NULS plugin on the right, and call NULS plugin interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(426),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract.\nRecommendation: Start the local wallet, and add the wallet address as the node address.")]),t._v(" "),s("p",[t._v("Click + on the top left corner of panel, and select Add Node.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(427),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Input Node address and clock OK")]),t._v(" "),s("p",[s("img",{attrs:{src:a(428),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(429),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-package-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-package-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 Package contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code")]),t._v(" "),s("p",[s("img",{attrs:{src:a(430),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).")]),t._v(" "),s("p",[s("img",{attrs:{src:a(431),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(432),alt:"code"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(433),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-deploy-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 Deploy contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(434),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Parameters following JarFilePath are the parameters of the contract construction function.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(435),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(436),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(437),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(438),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Review the deployed contract on the top of panel")]),t._v(" "),s("p",[s("img",{attrs:{src:a(439),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the deployed contract to review all method of this contract")]),t._v(" "),s("p",[s("img",{attrs:{src:a(440),alt:"code"}})])])])}],c=a(0),n=Object(c.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Get NULS plugin"),a("OutboundLink")],1),t._v(" ZIP, and save in disk\nClick File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Input Project name, click finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),a("p",[t._v("Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},s,!1,null,null,null);n.options.__file="smartContractIDEAPlugin.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/100.d3a152d6.js b/docs/.vuepress/dist/assets/js/100.d3a152d6.js new file mode 100644 index 00000000..84f48e29 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/100.d3a152d6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[100],{969:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"rpc-tool-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rpc-tool-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" RPC-TOOL design document")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"_1-overall-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Overall description")]),t._v(" "),a("h3",{attrs:{id:"_1-1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-summary","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 summary")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-position-of-rpc-tool"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-position-of-rpc-tool","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 position of RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("NULS 2 according to function partition module, all modules are isolated and can run independently.")]),t._v(" "),a("li",[t._v("Interaction between modules through RPC call interface")]),t._v(" "),a("li",[t._v("As long as the module implements the required interface, it can be implemented in any language")]),t._v(" "),a("li",[t._v("Each module will use RPC, so it will be encapsulated into the same jar file")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-what-will-rpc-tool-did"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-will-rpc-tool-did","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 what will RPC-TOOL did")]),t._v(" "),a("p",[t._v("Data interaction between modules is done through RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("RPC Server start")]),t._v(" "),a("li",[t._v("Register all CMD commands of the current module")]),t._v(" "),a("li",[t._v("Parsing the received CMD command")]),t._v(" "),a("li",[t._v("Returns the result by calling the corresponding method based on CMD")]),t._v(" "),a("li",[t._v("RPC Client start")]),t._v(" "),a("li",[t._v("Interacting with kernel")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-position"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-position","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 position")]),t._v(" "),a("p",[t._v("RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.")]),t._v(" "),a("h2",{attrs:{id:"_2-functional-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2. functional design")]),t._v(" "),a("h2",{attrs:{id:"_3-interface-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 3. interface design")]),t._v(" "),a("h3",{attrs:{id:"_3-1-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 interface")]),t._v(" "),a("h4",{attrs:{id:"status"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#status","aria-hidden":"true"}},[t._v("#")]),t._v(" status")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel will periodically push the status of the current system to each module, which is used for receiving")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"service"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"modules"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"READY"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"addr"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19722")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rpcList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cmd1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conf_reset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependsModule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("modules_information")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("modules_information")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("service")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("modules")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("module")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("name")])]),t._v(" "),a("tr",[a("td",[t._v("status")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("status")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("addr")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("ip address/host name")])]),t._v(" "),a("tr",[a("td",[t._v("port")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("port")])]),t._v(" "),a("tr",[a("td",[t._v("rpcList")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("list")]),t._v(" "),a("td",[t._v("cmd list")])]),t._v(" "),a("tr",[a("td",[t._v("dependsModule")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"shutdown"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#shutdown","aria-hidden":"true"}},[t._v("#")]),t._v(" shutdown")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (waiting for all the processing of the current business to complete)")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"terminate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#terminate","aria-hidden":"true"}},[t._v("#")]),t._v(" terminate")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (immediately terminates).")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confget"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confget","aria-hidden":"true"}},[t._v("#")]),t._v(" confGet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel gets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confGet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confset","aria-hidden":"true"}},[t._v("#")]),t._v(" confSet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel sets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confSet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confreset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confreset","aria-hidden":"true"}},[t._v("#")]),t._v(" confReset")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel restore template is configured as initial value.")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confReset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h2",{attrs:{id:"_4-event-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 4. Event description")]),t._v(" "),a("h2",{attrs:{id:"_5-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 5. Protocol")]),t._v(" "),a("h2",{attrs:{id:"_6-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 6. Configuration")]),t._v(" "),a("h2",{attrs:{id:"_7-java-unique-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-unique-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 7. Java unique design")]),t._v(" "),a("h3",{attrs:{id:"server"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#server","aria-hidden":"true"}},[t._v("#")]),t._v(" Server")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Start server")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// Port is not necessary. If no port is specified, the system is allocated randomly\nBaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);\n\n// Scan the package in which the CMD command is located\nserver.scanPackage("io.nuls.rpc.mycmd");\n\n// Initialization\nserver.init("moduleName", "dependsModule, type is List");\n\n// start\nserver.start();\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Custom CMD")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// extends BaseCmd\npublic class SomeCmd extends BaseCmd\n\n// Custom method to add annotation CmdInfo \n@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)\npublic Object methodName(List params) {\n System.out.println("I\'m version 1");\n return success();\n}\n\nNote: rpc-tool automatically transfers the Object[] transferred from client to List. \n')])])])]),t._v(" "),a("li",[a("p",[t._v("There must be and only one CMD class to implement the KernelCmd interface.")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("// Implement interface \npublic class SomeCmd extends BaseCmd implements KernelCmd \n\n/**\n * Receive all module information from kernel \n */\npublic Object status(List params);\n\n/**\n * Shut down service: after the existing business is completed\n */\npublic Object shutdown(List params);\n\n/**\n * Shut down service: close immediately, whether or not the business is completed.\n */\npublic Object terminate(List params);\n\n/**\n * Provide local configuration information \n */\npublic Object confGet(List params);\n\n/**\n * Update local configuration information \n */\npublic Object confSet(List params);\n\n/**\n * Reset local configuration information \n */\npublic Object confReset(List params);\n")])])])])]),t._v(" "),a("h3",{attrs:{id:"client"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#client","aria-hidden":"true"}},[t._v("#")]),t._v(" Client")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Provide module information to kernel")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("RpcClient.versionToKernel();\n")])])])]),t._v(" "),a("li",[a("p",[t._v("call rpc")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// CMD corresponds to one interface. \nString jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);\n\n// CMD corresponds to multiple interfaces. \nString jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);\n\nnote:\nparams is instance of Object[] \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"data-exchange"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-exchange","aria-hidden":"true"}},[t._v("#")]),t._v(" Data exchange")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "shutdown",\n "minVersion": 1.0, //根据自己需要传最低版本号\n "params": [],\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Response(success and failure are the same)")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "msg": " This property is only available when failed",\n "version": "Actually called version",\n "result": {}\n} \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"other"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#other","aria-hidden":"true"}},[t._v("#")]),t._v(" Other")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("@Override\n@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)\npublic Object status(List params){\n return super.status(params);\n}\n")])])])]),t._v(" "),a("li",[a("p",[t._v("There are ways to return to success and failure in BaseCmd."),a("br"),t._v("\nsuccess:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object success(double version) {\n return success(version, null);\n}\n\nprotected Object success(double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", 0);\n map.put("msg", SUCCESS);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])]),a("p",[t._v("fail:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object fail(String code, String msg, double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", code);\n map.put("msg", msg);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])])])]),t._v(" "),a("h2",{attrs:{id:"_8-supplementary-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 8. supplementary content")])])}],!1,null,null,null);n.options.__file="rpcToolWebsocketDesign.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/101.2a081cb7.js b/docs/.vuepress/dist/assets/js/101.2a081cb7.js new file mode 100644 index 00000000..d478f02d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/101.2a081cb7.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[101],{973:function(e,t,n){"use strict";n.r(t);var r=n(0),a=Object(r.a)({},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),n("p",[e._v("The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.")]),e._v(" "),e._m(2),e._v(" "),n("p",[e._v("Dear users:")]),e._v(" "),n("p",[e._v("It is a great honor to announce that the NULS2.0 Alpha version has been released at 10:30 am, Beijing time: 2019-03-28. We sincerely invite you to participate in the internal test.")]),e._v(" "),n("p",[e._v("The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture.")]),e._v(" "),n("p",[e._v("The Alpha version test mainly includes:")]),e._v(" "),n("ul",[n("li",[e._v("Full functionality of the Linux wallet, such as account creation, import, transfer, node creation, etc")]),e._v(" "),n("li",[e._v("Build blockchain based on NULS2.0 core modules")]),e._v(" "),n("li",[e._v("Build blockchain including "),n("router-link",{attrs:{to:"/NULS2.0/developModule.html"}},[e._v("business module")])],1)]),e._v(" "),e._m(3),e._v(" "),n("p",[e._v("1 "),n("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/pangu/NULS-Wallet-linux64-alpha1.tgz",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download linux client"),n("OutboundLink")],1)]),e._v(" "),n("p",[e._v("2 "),n("router-link",{attrs:{to:"/NULS2.0/linuxTutorial.html"}},[e._v("linux CLI Manual")])],1),e._v(" "),n("p",[e._v("3 "),n("a",{attrs:{href:"https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141",target:"_blank",rel:"noopener noreferrer"}},[e._v("Apply for test NULS"),n("OutboundLink")],1),e._v(" and reply: Alpha+address")]),e._v(" "),n("p",[e._v("4 Access blockchain explorer: "),n("a",{attrs:{href:"http://alpha.nulscan.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://alpha.nulscan.io/"),n("OutboundLink")],1)]),e._v(" "),n("p",[e._v("5 "),n("router-link",{attrs:{to:"/NULS2.0/howToUseNulsBuildChain.html"}},[e._v("Build Blockchain based on NULS2.0")])],1),e._v(" "),n("p",[e._v("6 Submit bug:"),n("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls_2.0/issues"),n("OutboundLink")],1)]),e._v(" "),e._m(4),e._v(" "),n("ul",[n("li",[e._v("Github:"),n("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls_2.0"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Community:"),n("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Tech community Telegram:"),n("a",{attrs:{href:"https://t.me/nulstest",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://t.me/nulstest"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Wechat:NULS中文社区")])]),e._v(" "),n("p",[e._v("To learn more about us, visit "),n("a",{attrs:{href:"https://nuls.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.io"),n("OutboundLink")],1),e._v(".")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"welcome-to-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#welcome-to-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" Welcome to NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("blockquote",[t("p",[this._v("NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nuls2-0-alpha-version-is-released"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha-version-is-released","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha Version is released")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"join-test:"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#join-test:","aria-hidden":"true"}},[this._v("#")]),this._v(" Join Test:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"related-link"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#related-link","aria-hidden":"true"}},[this._v("#")]),this._v(" Related Link")])}],!1,null,null,null);a.options.__file="README.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/102.a47ba456.js b/docs/.vuepress/dist/assets/js/102.a47ba456.js new file mode 100644 index 00000000..277567ac --- /dev/null +++ b/docs/.vuepress/dist/assets/js/102.a47ba456.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{977:function(e,t,o){"use strict";o.r(t);var a=o(0),s=Object(a.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(2),e._v(" "),o("p",[e._v("a. A candidate for the NULS ambassador is required to create a NULS node.")]),e._v(" "),o("p",[e._v("b. A candidate is required to agree with the values of NULS, understand the core knowledge of NULS, and respect members of the NULS community.")]),e._v(" "),o("p",[e._v("c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.")]),e._v(" "),o("p",[e._v("d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.")]),e._v(" "),o("p",[e._v("f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.")]),e._v(" "),o("p",[e._v("g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.")]),e._v(" "),o("p",[e._v("h. NULS ambassadors can apply for a budget from the NULS Foundation for major developments. The budget is open to all community members, and a budget vote will be initiated for it. The voting period is 15 days, and if the voting volume exceeds 10 million NULS tokens, and the supporting votes reach 70% or higher, the vote is considered passed and the NULS Foundation will execute.")]),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("a. Publish the work report for the previous month and the work plan for the next month:")]),e._v(" "),o("p",[e._v("Please post on the NULS forum: "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!")]),e._v(" "),o("p",[e._v("c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.")]),e._v(" "),o("p",[e._v("Final Tribute to your efforts:")]),e._v(" "),o("p",[e._v("• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.")]),e._v(" "),o("p",[e._v("• Start your work of community-building and outreach!")]),e._v(" "),o("p",[e._v("• Help NULS dock more DApps!")]),e._v(" "),o("p",[e._v("• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.")]),e._v(" "),o("p",[e._v("For all ambassador related discussions, please post on the NULS forum at "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("Welcome to the NULS community! Let’s work together to create a brighter future for NULS!")]),e._v(" "),o("p",[e._v("If you can deliver more, we have these expectations of you:")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),o("p",[e._v("Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),o("p",[e._v("NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.")]),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),o("ol",[o("li",[e._v("NULS Ambassador Board (["),o("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[e._v("Click to enter"),o("OutboundLink")],1),e._v("]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.")]),e._v(" "),o("li",[e._v("You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.")]),e._v(" "),o("li",[e._v("If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.")]),e._v(" "),o("li",[e._v("Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.")]),e._v(" "),o("li",[e._v("You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.")]),e._v(" "),o("li",[e._v("If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.")]),e._v(" "),o("li",[e._v("If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).")]),e._v(" "),o("li",[e._v("Any suggestions, questions and ideas, and all work progress can be posted on the community forum "),o("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),o("OutboundLink")],1),e._v(".")])]),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction-of-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction-of-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction of NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-duties-and-compensation-for-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-duties-and-compensation-for-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Duties and Compensation for NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-how-to-participate-in-the-election"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-how-to-participate-in-the-election","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. How to participate in the election")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("3. Share the story of NULS to the community;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("8. Help NULS with publicity and be committed to NULS press releases through your local media.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassador-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassador-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Ambassador Guide")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preface"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preface","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Preface")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Transparency")]),this._v(" "),t("li",[this._v("Freedom")]),this._v(" "),t("li",[this._v("Autonomy")]),this._v(" "),t("li",[this._v("Evolution")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"the-vision-of-the-nuls-project-is-based-on-the-following-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-vision-of-the-nuls-project-is-based-on-the-following-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" The vision of the NULS project is based on the following mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Making blockchain technology easy and simple")]),this._v(" "),t("li",[this._v("Breaking through the bottleneck of blockchain performance and adoption")]),this._v(" "),t("li",[this._v("Reducing the cost of using blockchain technology")]),this._v(" "),t("li",[this._v("Increasing security and reliability of data")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-you-will-obtain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-you-will-obtain","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, you will obtain")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.")]),this._v(" "),t("li",[this._v("Rewards produced by one node. Rewards are used to develop the local NULS community.")]),this._v(" "),t("li",[this._v("Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.")]),this._v(" "),t("li",[this._v("The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-your-mission-is"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-your-mission-is","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, Your Mission is")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A. Community Development")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Let others know about NULS via Internet or offline communications.")]),e._v(" "),o("li",[e._v("Organize some NULS fans or volunteers to promote the technology and concepts of NULS.")]),e._v(" "),o("li",[e._v("Share the development from other areas of the NULS community with your local community.")]),e._v(" "),o("li",[e._v("Continuously share the progress, planning, news, etc. of the NULS project to the local community.")]),e._v(" "),o("li",[e._v("Contact local media and forums to help NULS publicize presentations or news.")]),e._v(" "),o("li",[e._v("Share the story of NULS with the local community.")]),e._v(" "),o("li",[e._v("Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.")]),e._v(" "),o("li",[e._v("Share videos or other content produced by the team in the local language of the people in your country/region.")]),e._v(" "),o("li",[e._v("If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.")]),e._v(" "),o("li",[e._v("Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("B.")]),this._v(" "),t("strong",[this._v("Community Activities")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.")]),e._v(" "),o("li",[e._v("Participate in any possible cryptocurrency gatherings in your area and represent NULS.")]),e._v(" "),o("li",[e._v("Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.")]),e._v(" "),o("li",[e._v("Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.")]),e._v(" "),o("li",[e._v("Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"get-started-with-everything-you-need-here"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#get-started-with-everything-you-need-here","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Get Started With Everything You Need Here")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"recruit-volunteers-to-organize-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recruit-volunteers-to-organize-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Recruit Volunteers to Organize Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.")]),this._v(" "),t("li",[this._v("Organize some offline meet-ups.")]),this._v(" "),t("li",[this._v("Introduce more blockchain investors to NULS and guide them towards investing in NULS.")]),this._v(" "),t("li",[this._v("Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"develop-a-local-nuls-ecology"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#develop-a-local-nuls-ecology","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Develop a Local NULS Ecology")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.")]),this._v(" "),t("li",[this._v("Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.")]),this._v(" "),t("li",[this._v("If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"spread-the-concepts-and-features-of-nuls-technology-with-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#spread-the-concepts-and-features-of-nuls-technology-with-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Spread the Concepts and Features of NULS Technology with Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.")]),this._v(" "),t("li",[this._v("Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.")]),this._v(" "),t("li",[this._v("Use local mainstream media websites to spread the news and progress of NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nulstar-guidelines-and-duties"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nulstar-guidelines-and-duties","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("NULStar Guidelines And Duties")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Requirements for becoming a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.")]),this._v(" "),t("li",[this._v("Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.")]),this._v(" "),t("li",[this._v("Must live in a city with over 350k population.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Duties of a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.")]),this._v(" "),t("li",[this._v("Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Rewards for NULStars")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.")]),this._v(" "),t("li",[this._v("NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.")])])}],!1,null,null,null);s.options.__file="ambassadorRules.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/103.d5ac9751.js b/docs/.vuepress/dist/assets/js/103.d5ac9751.js new file mode 100644 index 00000000..866d42ce --- /dev/null +++ b/docs/.vuepress/dist/assets/js/103.d5ac9751.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[103],{979:function(e,t,i){"use strict";i.r(t);var o=i(0),n=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.")]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.")]),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),i("p",[e._v("20,000,000 NULS from the NULS and entrusted revenues from the contributors.")]),e._v(" "),e._m(7),e._v(" "),i("p",[e._v("The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.")]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),i("p",[e._v("As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.")]),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),i("p",[e._v("The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.")]),e._v(" "),e._m(21),e._v(" "),i("p",[e._v("We stick to the following philosophy in the technology community:")]),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),i("p",[e._v("The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).")]),e._v(" "),i("p",[e._v("The process of joining CCC is:")]),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),i("p",[e._v("Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at "),i("strong",[i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),i("OutboundLink")],1)]),e._v(".")]),e._v(" "),e._m(32),e._v(" "),i("p",[e._v("Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.")]),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),i("p",[e._v("Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.")]),e._v(" "),e._m(35),e._v(" "),i("p",[e._v("The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.")]),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),e._m(39),e._v(" "),e._m(40),e._v(" "),e._m(41),e._v(" "),i("p",[e._v("We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:")]),e._v(" "),i("p",[e._v("NULS community website: "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),i("OutboundLink")],1)]),e._v(" "),i("p",[e._v("Feedback post: "),i("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/132-we-need-your-suggestions"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-nuls-community-profile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-nuls-community-profile","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. NULS Community Profile")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.")]),this._v(" NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-objectives-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-objectives-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I)")]),this._v(" "),t("strong",[this._v("Objectives")]),this._v(" "),t("strong",[this._v("of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Code writing")]),this._v(" "),t("li",[this._v("Applications development")]),this._v(" "),t("li",[this._v("Operation and promotion")]),this._v(" "),t("li",[this._v("Other actions in favor of NULS community ecology development")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-source-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-source-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Source of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-management-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-management-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Management of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-appointment-of-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-appointment-of-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Appointment of Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers "),t("strong",[this._v("(developer council member)")]),this._v(" elected based on a ballot participated by all developers; and 7 members elected by ballot within the community "),t("strong",[this._v("(standing council member)")]),this._v(". The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.")]),this._v(" "),t("li",[this._v("Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.")]),this._v(" "),t("li",[this._v("Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.")]),this._v(" "),t("li",[this._v("Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-rights-and-responsibilities-of-council-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-rights-and-responsibilities-of-council-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Rights and responsibilities of Council member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:")]),this._v(" "),t("p",[this._v("(1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.")])]),e._v(" "),i("li",[i("p",[e._v("Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.")]),e._v(" "),i("p",[e._v("(2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of lower node agency commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of transfer commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of contract call commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of Council member proposal commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of adjustable system parameter in other systems.")]),e._v(" "),i("p",[e._v("(3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.")])]),e._v(" "),i("li",[i("p",[e._v("Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.")])]),e._v(" "),i("li",[i("p",[e._v("Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.")])]),e._v(" "),i("li",[i("p",[e._v("Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"2"}},[t("li",[this._v("Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.")]),this._v(" "),t("li",[this._v("Responsibilities of Council member.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Council member shall communicate with the community in good time.")])]),this._v(" "),t("li",[t("p",[this._v("Act in strict accordance with the community’s Constitution.")])]),this._v(" "),t("li",[t("p",[this._v("Share the same vision and purpose with NULS.")])]),this._v(" "),t("li",[t("p",[this._v("Take it as its own mission to protect community members’ interests.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note:")]),this._v(" "),t("strong",[this._v("All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-code-craft-council-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. CODE CRAFT COUNCIL (CCC)")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-philosophy-of-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-philosophy-of-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Philosophy of the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Equal: the technology community and core team are equal and work together for joint development.")])]),this._v(" "),t("li",[t("p",[this._v("Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.")])]),this._v(" "),t("li",[t("p",[this._v("Sharing:")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("The whole community shares the achievements of NULS technology.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares the development dividend of NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares NULS’s influence and reputation.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares the technical innovation brought by NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares NULS’s standard establishment to promote industry development.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[t("p",[this._v("Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.")])]),this._v(" "),t("li",[t("p",[this._v("Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-appointment-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-appointment-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Appointment of the CCC member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.")]),this._v(" "),t("li",[this._v("Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.")]),this._v(" "),t("li",[this._v("Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.")]),this._v(" "),t("li",[this._v("After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iv-rights-and-responsibilities-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-rights-and-responsibilities-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(IV) Rights and responsibilities of the CCC member")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ol",[i("li",[i("p",[e._v("NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.")])]),e._v(" "),i("li",[i("p",[e._v("The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.")])]),e._v(" "),i("li",[i("p",[e._v("After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.")])]),e._v(" "),i("li",[i("p",[e._v("Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.")])]),e._v(" "),i("li",[i("p",[e._v("The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-contributor-for-campaign"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-contributor-for-campaign","aria-hidden":"true"}},[this._v("#")]),this._v(" (I) Contributor for campaign")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-permanent-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-permanent-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" (II) Permanent contributor")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vi-project-budget"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vi-project-budget","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VI. Project Budget")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-with-respect-to-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-with-respect-to-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) With respect to contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-with-respect-to-other-transaction-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-with-respect-to-other-transaction-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) With respect to other transaction funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vii-other-votes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vii-other-votes","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VII. Other votes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-start-a-vote"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-start-a-vote","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Start a vote")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("The Council member shall start a vote and only the transaction fee is required.")])]),this._v(" "),t("li",[t("p",[this._v("Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-vote-by-proxy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-vote-by-proxy","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Vote by proxy")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.")])]),this._v(" "),t("li",[t("p",[this._v("Any NULS user can be an agent.")])]),this._v(" "),t("li",[t("p",[this._v("Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.")])]),this._v(" "),t("li",[t("p",[this._v("The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"viii-feedback"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viii-feedback","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VIII.")]),this._v(" Feedback")])}],!1,null,null,null);n.options.__file="communityConstitution.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/104.7595a7fc.js b/docs/.vuepress/dist/assets/js/104.7595a7fc.js new file mode 100644 index 00000000..9ff291ed --- /dev/null +++ b/docs/.vuepress/dist/assets/js/104.7595a7fc.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{981:function(e,t,a){"use strict";a.r(t);var n=a(0),o=Object(n.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),e._m(2),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),a("p",[e._v("Community Fund Account Address:")]),e._v(" "),a("p",[a("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[e._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.")]),e._v(" "),a("p",[e._v("The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.")]),e._v(" "),e._m(3),e._v(" "),a("p",[e._v("**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),a("p",[e._v("All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.")]),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),a("p",[e._v("The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.")]),e._v(" "),e._m(10),e._v(" "),a("p",[e._v("The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.")]),e._v(" "),e._m(11),e._v(" "),a("p",[e._v("Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.")]),e._v(" "),e._m(12),e._v(" "),a("p",[e._v("Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),a("p",[e._v("(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;")]),e._v(" "),a("p",[e._v("(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;")]),e._v(" "),a("p",[e._v("(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;")]),e._v(" "),a("p",[e._v("(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;")]),e._v(" "),a("p",[e._v("(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;")]),e._v(" "),a("p",[e._v("(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;")]),e._v(" "),e._m(15),e._v(" "),a("p",[e._v("(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;")]),e._v(" "),a("p",[e._v("(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;")]),e._v(" "),a("p",[e._v("(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;")]),e._v(" "),a("p",[e._v("(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.")]),e._v(" "),e._m(16),e._v(" "),a("p",[e._v("(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;")]),e._v(" "),a("p",[e._v("(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).")]),e._v(" "),e._m(17),e._v(" "),a("p",[e._v("All community discussion suggestions are made at "),a("a",{attrs:{href:"https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),a("OutboundLink")],1),e._v(" .")]),e._v(" "),a("p",[e._v("This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.")]),e._v(" "),a("p",[e._v("Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.")]),e._v(" "),a("p",[e._v("The specific node generates revenue with reference to the NULS POC consensus mechanism.")]),e._v(" "),e._m(18),e._v(" "),a("p",[e._v("Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),e._v(" "),a("p",[e._v("CCC Members")]),e._v(" "),a("p",[e._v("Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),e._v(" "),a("p",[e._v("Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),e._v(" "),a("p",[e._v("Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),e._v(" "),a("p",[e._v("Berzeck’s staking – Same as above")]),e._v(" "),a("p",[e._v("Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),e._v(" "),a("p",[e._v("Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),e._v(" "),a("p",[e._v("Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),e._v(" "),a("p",[e._v("Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),e._v(" "),a("p",[e._v("Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),e._v(" "),a("p",[e._v("Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),e._v(" "),a("p",[e._v("Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),e._v(" "),a("p",[e._v("Moshe’s staking – Same as above")]),e._v(" "),a("p",[e._v("Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),e._v(" "),a("p",[e._v("Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png",alt:"img"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-community-fund-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-community-fund-management","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. Community Fund Management")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-the-application-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-the-application-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. The Application Member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-ordinary-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-ordinary-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Ordinary Members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-contributor-role"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-contributor-role","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Contributor Role")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. "),t("strong",[this._v("The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.")]),this._v(" The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-the-type-of-application"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-the-type-of-application","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. The Type of Application")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-proposal-to-pay-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-proposal-to-pay-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Proposal to Pay Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-proposal-budget-item"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-proposal-budget-item","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Proposal Budget Item")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-the-proposal-to-create-a-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-the-proposal-to-create-a-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. The Proposal to Create a Node")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("4. Proposal Entrusted Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-the-application-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-the-application-process","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. The Application Process")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-the-plan-is-openly-and-thoroughly-discussed"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-the-plan-is-openly-and-thoroughly-discussed","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. The Plan is Openly and Thoroughly Discussed")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-council-member-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-council-member-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Council Member Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-foundation-implementation-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-foundation-implementation-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. Foundation Implementation Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-process-explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-process-explanation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Process Explanation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"attachment-current-contributor-role-delegation-and-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#attachment-current-contributor-role-delegation-and-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Attachment: Current Contributor Role Delegation and Node:")])])}],!1,null,null,null);o.options.__file="communityFund.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/105.828dda8f.js b/docs/.vuepress/dist/assets/js/105.828dda8f.js new file mode 100644 index 00000000..462ecee4 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/105.828dda8f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{983:function(e,t,o){"use strict";o.r(t);var n=o(0),i=Object(n.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),o("p",[e._v("NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology.")]),e._v(" "),o("p",[e._v("NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration.")]),e._v(" "),o("p",[e._v("In the community, we adhere to the following vision:")]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("NULS technical community is open for all developers.\nIf you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us:")]),e._v(" "),o("p",[e._v("Please join the NULS dev Telegram group:\n"),o("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ"),o("OutboundLink")],1)]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),o("p",[e._v("The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution.\nCurrently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool.\nNote: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well.")]),e._v(" "),e._m(6),e._v(" "),o("p",[e._v("Make it easy to build a blockchain!")]),e._v(" "),o("p",[e._v("First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life.\nThe NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository.")]),e._v(" "),o("p",[e._v("Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months.\nFor all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives.")]),e._v(" "),o("p",[e._v("Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more!")]),e._v(" "),e._m(7),e._v(" "),o("p",[e._v("A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently.\nB. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests.")]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),o("p",[e._v("We also strongly recommend you to learn more about NULS through these links below:")]),e._v(" "),o("ul",[o("li",[e._v("Official website: "),o("a",{attrs:{href:"https://nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.io/"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Code: "),o("a",{attrs:{href:"https://github.com/nuls-io/nuls",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Dev documents: "),o("a",{attrs:{href:"https://dev.nuls.io/docs/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://dev.nuls.io/docs/"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Community forum: "),o("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),o("OutboundLink")],1)])]),e._v(" "),e._m(10),e._v(" "),o("p",[o("a",{attrs:{href:"https://nuls.community/d/9-invitation-of-community-developers/4",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh"),o("OutboundLink")],1)]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),o("p",[o("a",{attrs:{href:"https://nuls.community/d/9-invitation-of-community-developers/4",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/9-invitation-of-community-developers/4"),o("OutboundLink")],1),e._v(" (Continuously updated)")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"invitation-of-community-developers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#invitation-of-community-developers","aria-hidden":"true"}},[this._v("#")]),this._v(" Invitation of community developers")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction")])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ul",[o("li",[o("strong",[e._v("Equal")]),e._v(": Members from both the technical community and the core dev team are equal and they shall work together.")]),e._v(" "),o("li",[o("strong",[e._v("Synergetic")]),e._v(": The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem.")]),e._v(" "),o("li",[o("strong",[e._v("Sharing")]),e._v(":\n"),o("ul",[o("li",[e._v("Technical achievements of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("Development bonuses of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("The influence and brand of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("Technical innovation of NULS is shared with the whole industry;")])])]),e._v(" "),o("li",[e._v("All the industrial standards set by NULS are shared with the whole industry.")]),e._v(" "),o("li",[o("strong",[e._v("Fair")]),e._v(": Reward for each developer is based on his/her contribution.")]),e._v(" "),o("li",[o("strong",[e._v("Innovative")]),e._v(": A strong technical community is the guarantee for the innovation in the blockchain field.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-are-you-the-one"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-are-you-the-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Are you the one?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Notice")]),this._v(": We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground!")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-what-are-we-offering"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-what-are-we-offering","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. What are we offering?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_4-our-plan"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-our-plan","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Our plan")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_5-current-situation-of-the-technical-community"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-current-situation-of-the-technical-community","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. Current situation of the technical community")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_6-how-to-join-us"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-how-to-join-us","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. How to join us")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group.")]),this._v(" "),t("li",[this._v("Talk to our community developer Moshe. Briefly introduce your experience, background, etc.\nCommunity developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"3"}},[t("li",[this._v("You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[this._v("In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_7-refer-to-task-list"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-refer-to-task-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Refer to task list")])}],!1,null,null,null);i.options.__file="joinCCC.md";t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/106.e754f194.js b/docs/.vuepress/dist/assets/js/106.e754f194.js new file mode 100644 index 00000000..f75d4fad --- /dev/null +++ b/docs/.vuepress/dist/assets/js/106.e754f194.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{987:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"api手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#api手册","aria-hidden":"true"}},[this._v("#")]),this._v(" API手册")])])}],!1,null,null,null);i.options.__file="APIManual.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/107.775c5175.js b/docs/.vuepress/dist/assets/js/107.775c5175.js new file mode 100644 index 00000000..3a2e1eb9 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/107.775c5175.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[107],{989:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("​\tThe User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("It is recommended to use core of version 2.6.32 or higher.")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("ul",[t._m(15),t._v(" "),t._m(16),t._v(" "),s("li",[s("p",[t._v("Enter "),s("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("wallet download on NULS website"),s("OutboundLink")],1),t._v(",and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users.")]),t._v(" "),s("p",[t._v("The following is for downloading wallet (v1.0.0) in Linux system:")]),t._v(" "),t._m(17),s("p",[t._v("Note: the downloading link for the subsequent versions is subject to change.")])])]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),s("p",[t._v("All commands for output and printing")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),s("p",[t._v("Return message help")]),t._v(" "),t._m(31),s("p",[t._v("Return message help -a")]),t._v(" "),t._m(32),s("p",[t._v("Example")]),t._v(" "),t._m(33),t._m(34),t._v(" "),s("p",[t._v("Create account and return to account addresses collection")]),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),s("p",[t._v("Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter;")]),t._v(" "),s("p",[t._v("Return accounts collection")]),t._v(" "),t._m(37),s("p",[t._v("Example, to create 2 accounts without password")]),t._v(" "),t._m(38),t._m(39),t._v(" "),s("p",[t._v("For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account")]),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),s("p",[t._v("Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe.")]),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(42),s("p",[t._v("Example: backup of an account with password")]),t._v(" "),t._m(43),t._m(44),t._v(" "),s("p",[t._v("Remove local account according to account address; if the account is encrypted, insert password.")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(47),s("p",[t._v("Example")]),t._v(" "),t._m(48),t._m(49),t._v(" "),s("p",[t._v("Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts.")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(52),s("p",[t._v("Example")]),t._v(" "),t._m(53),t._m(54),t._v(" "),s("p",[t._v("Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one.")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(57),s("p",[t._v("Example")]),t._v(" "),t._m(58),t._m(59),t._v(" "),s("p",[t._v("Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source.")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),s("p",[t._v("Return message, transaction hash")]),t._v(" "),t._m(62),s("p",[t._v("Example")]),t._v(" "),t._m(63),t._m(64),t._v(" "),s("p",[t._v("Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account.")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),s("p",[t._v("Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required.")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(67),s("p",[t._v("Example")]),t._v(" "),t._m(68),t._m(69),t._v(" "),s("p",[t._v("Import account’s private key and create a local account. Receive failure to import if there is an existing local account.")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),s("p",[t._v("注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(72),s("p",[t._v("Example")]),t._v(" "),t._m(73),t._m(74),t._v(" "),s("p",[t._v("Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account.")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),s("p",[t._v("Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.")]),t._v(" "),s("p",[t._v("Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import).")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(77),s("p",[t._v("Example")]),t._v(" "),t._m(78),t._m(79),t._v(" "),s("p",[t._v("Inquire account information based on account address")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(82),s("p",[t._v("Example")]),t._v(" "),t._m(83),t._m(84),t._v(" "),s("p",[t._v("Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),s("p",[t._v("Return message, output accounts collection")]),t._v(" "),t._m(87),s("p",[t._v("Example: to get list of accounts, showing page 1, 2 items per page")]),t._v(" "),t._m(88),t._m(89),t._v(" "),s("p",[t._v("Inquire account’s private key based on account address; if the account is encrypted, insert password.")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(92),s("p",[t._v("Example")]),t._v(" "),t._m(93),t._m(94),t._v(" "),s("p",[t._v("Inquire account balance based on account address")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(97),s("p",[t._v("Example")]),t._v(" "),t._m(98),t._m(99),t._v(" "),s("p",[t._v("Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly.")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),s("p",[t._v("Return message, transfer transaction hash")]),t._v(" "),t._m(102),s("p",[t._v("Example")]),t._v(" "),t._m(103),t._m(104),t._v(" "),s("p",[t._v("Inquire transaction details as per transaction hash")]),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),s("p",[t._v("Return message, transaction details")]),t._v(" "),t._m(107),s("p",[t._v("Example, to inquire transfer transaction")]),t._v(" "),t._m(108),t._m(109),t._v(" "),s("p",[t._v("Inquire list of transactions in this account based on account address")]),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),s("p",[t._v("Return message, transaction details")]),t._v(" "),t._m(112),s("p",[t._v("Example")]),t._v(" "),t._m(113),t._m(114),t._v(" "),s("p",[t._v("Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least.")]),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),s("p",[t._v("Return message, agent hash of return node")]),t._v(" "),t._m(117),s("p",[t._v("Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS")]),t._v(" "),t._m(118),t._m(119),t._v(" "),s("p",[t._v("Include consensus of 2000NULS at least based on account address and node agent hash")]),t._v(" "),t._m(120),t._v(" "),t._m(121),t._v(" "),s("p",[t._v("Return message, transaction hash for including consensus; to exit the consensus, require such hash.")]),t._v(" "),t._m(122),s("p",[t._v("Example")]),t._v(" "),t._m(123),t._m(124),t._v(" "),s("p",[t._v("Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent.")]),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),s("p",[t._v("Return message, transaction hash upon exiting the consensus")]),t._v(" "),t._m(127),s("p",[t._v("Example")]),t._v(" "),t._m(128),t._m(129),t._v(" "),s("p",[t._v("Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours.")]),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),s("p",[t._v("Return message, transaction hash of stop node")]),t._v(" "),t._m(132),s("p",[t._v("Example")]),t._v(" "),t._m(133),t._m(134),t._v(" "),s("p",[t._v("Get node details as per agent hash of node")]),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(137),s("p",[t._v("Example")]),t._v(" "),t._m(138),t._m(139),t._v(" "),s("p",[t._v("As per list of consensus nodes")]),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(142),s("p",[t._v("Example")]),t._v(" "),t._m(143),t._m(144),t._v(" "),s("p",[t._v("Inquire total information of network consensuses")]),t._v(" "),t._m(145),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(146),s("p",[t._v("Example")]),t._v(" "),t._m(147),t._m(148),t._v(" "),s("p",[t._v("Get the general of all agents (consensuses) information of the account based on account address")]),t._v(" "),t._m(149),t._v(" "),t._m(150),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(151),s("p",[t._v("Example")]),t._v(" "),t._m(152),t._m(153),t._v(" "),s("p",[t._v("Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash.")]),t._v(" "),t._m(154),t._v(" "),t._m(155),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(156),s("p",[t._v("Example")]),t._v(" "),t._m(157),t._m(158),t._v(" "),s("p",[t._v("Inquire list of agency nodes asper address (return list of node information)")]),t._v(" "),t._m(159),t._v(" "),t._m(160),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(161),s("p",[t._v("Example, to get page 1, display 2 items per page")]),t._v(" "),t._m(162),t._m(163),t._v(" "),s("p",[t._v("Get the latest block head information")]),t._v(" "),t._m(164),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(165),s("p",[t._v("Example")]),t._v(" "),t._m(166),t._m(167),t._v(" "),s("p",[t._v("Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.")]),t._v(" "),t._m(168),t._v(" "),t._m(169),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(170),s("p",[t._v("Example: to get block as per height")]),t._v(" "),t._m(171),t._m(172),t._v(" "),s("p",[t._v("Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.")]),t._v(" "),t._m(173),t._v(" "),t._m(174),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(175),s("p",[t._v("Example: to get block as per height")]),t._v(" "),t._m(176),t._m(177),t._v(" "),s("p",[t._v("Inquire network basic information")]),t._v(" "),t._m(178),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(179),s("p",[t._v("Example")]),t._v(" "),t._m(180),t._m(181),t._v(" "),s("p",[t._v("Inquire network node IP")]),t._v(" "),t._m(182),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(183),s("p",[t._v("Example: get block as per height")]),t._v(" "),t._m(184),t._m(185),t._v(" "),s("p",[t._v("Inquire current version number")]),t._v(" "),t._m(186),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(187),s("p",[t._v("Example")]),t._v(" "),t._m(188),t._m(189),t._v(" "),s("p",[t._v("Inquire current version number")]),t._v(" "),t._m(190),t._v(" "),s("p",[t._v("Example")]),t._v(" "),t._m(191),t._m(192),t._v(" "),s("p",[t._v("Exiting from wallet command line program does not mean exiting from wallet node started.")]),t._v(" "),t._m(193),t._v(" "),s("p",[t._v("Example")]),t._v(" "),t._m(194)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"cli-user-manual"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cli-user-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" CLI User Manual")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"version-update-records"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update-records","aria-hidden":"true"}},[this._v("#")]),this._v(" Version Update Records")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("Version")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Date updated")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Contents")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-12")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("All functions of official version")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"preparation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preparation","aria-hidden":"true"}},[this._v("#")]),this._v(" Preparation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"server-hardware"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardware","aria-hidden":"true"}},[this._v("#")]),this._v(" Server hardware")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Server for creating NULS nodes shall be with configurations not lower than the following")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Hard Disk")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Broadband")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("Quad-core 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("128G Hard Disk")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("20M Uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Recommendation")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Hard Disk")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Broadband")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("8-core 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("256G Hard Disk")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("100M Uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"version-of-system-and-core"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-of-system-and-core","aria-hidden":"true"}},[this._v("#")]),this._v(" Version of system and core")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux system")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS (recommended)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#start","aria-hidden":"true"}},[this._v("#")]),this._v(" Start")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"download"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#download","aria-hidden":"true"}},[this._v("#")]),this._v(" Download")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("GitHub:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"install"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install","aria-hidden":"true"}},[this._v("#")]),this._v(" Install")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Extract downloaded files in Linux system")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"operate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#operate","aria-hidden":"true"}},[this._v("#")]),this._v(" Operate")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Enter bin catalogue and run startup script to start full-node wallet")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ cd bin\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"use-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" Use wallet")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"quick-start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick-start")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Upon confirming the wallet is started, start the command line of wallet to run it.")]),t._v(" "),s("p",[t._v("Enter bin catalogue to execute the following commands:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ ./cmd.sh\n")])])]),s("p",[t._v("Display NULS naming prompt "),s("code",[t._v("nuls>>>")]),t._v(", and then directly input NULS wallet operation command to run it.")]),t._v(" "),s("p",[t._v("The following gives an example of account creating:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),s("p",[t._v("Command "),s("code",[t._v("create")]),t._v(" is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"conventions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#conventions","aria-hidden":"true"}},[this._v("#")]),this._v(" Conventions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("For password: it must be 8 to 20 digits, including letters and figures.")]),this._v(" "),e("li",[this._v('Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required.')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"wallet-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wallet-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Wallet command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"help-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#help-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Help command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: help [-a] **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("-a")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Formatting printing command, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n\tOPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"create-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Create account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: create [number] **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Quantity of accounts created, optional")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 2\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:\n[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"backup-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#backup-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Backup account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command: backup
[path]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("[path]")]),t._v(" "),s("td",[t._v("The target folder of backup files, defaults to be the current folder, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nThe path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"remove-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#remove-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Remove account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: remove
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"set-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Set account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: setpwd
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"change-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#change-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Change account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: resetpwd
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nEnter your old password:**********\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"set-nickname"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-nickname","aria-hidden":"true"}},[this._v("#")]),this._v(" Set nickname")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:setalias
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Nickname, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias\n"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account-keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account-keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: import keystore **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Address of keystore files to be imported, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account’s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account’s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account’s private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:import **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Account’s private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account’s-private-key-overwritten"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account’s-private-key-overwritten","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account’s private key (overwritten)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:import **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Account’s private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getaccount
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Nickname\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Public key\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key after encryption (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Creation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//Encrypted or not (set password or not"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\n{\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-list-of-accounts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-list-of-accounts","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire list of accounts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getaccounts ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Nickname\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Public key\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Private key after encryption (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Creation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//Encrypted or not (set password or not"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:02:23"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts 1 2\n[ {\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}, {\n "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",\n "alias" : null,\n "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",\n "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",\n "encryptedPriKey" : "",\n "extend" : null,\n "createTime" : "2018-07-13 11:02:23",\n "encrypted" : false\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account’s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account’s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account’s private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getprikey
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\n"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getbalance
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Locked balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//Available balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "balance" : "9999998.99",\n "locked" : "0",\n "usable" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: transfer
[remark] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("transferring address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("receiving address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("transferred amount, round to 8 decimals in total (in NULS), required")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("Remarks, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-transaction-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-transaction-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire transaction details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:gettx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Transaction hash, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type (transfer transaction as an example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of package transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction service charge\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//(Transfer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" transaction amount\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//remarks\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Signature\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status of transaction confirmation (confirmed or unconfirmed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("46")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("254")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Input of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979998.98"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Output of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"')]),t._v("// Target address of transaction output (means to transfer "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v(" to the target address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Target address of transaction output (means to give users changes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979898.979"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596\n{\n "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "type" : "transfer",\n "time" : "2018-07-16 11:21:46",\n "blockHeight" : 26269,\n "fee" : "0.001",\n "value" : "100",\n "remark" : "Transfer",\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",\n "status" : "confirm",\n "confirmCount" : 46,\n "size" : 254,\n "inputs" : [ {\n "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979998.98",\n "lockTime" : 0\n } ],\n "outputs" : [ {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 0,\n "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",\n "value" : "100",\n "lockTime" : 0,\n "status" : "usable"\n }, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979898.979",\n "lockTime" : 0,\n "status" : "usable"\n } ]\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-list-of-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-list-of-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire list of transactions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:gettxlist
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26473")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:55:43"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("//Message\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10\n[ {\n "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",\n "blockHeight" : 26473,\n "time" : "2018-07-16 11:55:43",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n}, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "blockHeight" : 26269,\n "time" : "2018-07-16 11:21:46",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"create-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Create node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:createagent **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Account address of nodes created, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node account package address, required (note: the account shall have no password, otherwise the node cannot package)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Agent commission proportion, with a range of 10~100, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node creating deposit of 2 at least, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"include-consensus-agency-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#include-consensus-agency-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Include consensus (agency node)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:deposit
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node agent hash, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Include consensus deposit, not less than 2000NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"exit-the-consensus-agency"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-the-consensus-agency","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit the consensus (agency)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: withdraw
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Transaction hash upon agency, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"stop-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stop-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Stop node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:stopagent
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-node-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-node-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Get node details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: getagent **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Node agent hash, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agency amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6\n{\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.05,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-nodes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-nodes","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of nodes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getagents **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agent amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getagents 1 2\n[ {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.18,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}, {\n "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",\n "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "deposit" : "20000",\n "commissionRate" : 10.0,\n "agentName" : null,\n "agentId" : "5CE291D8",\n "time" : "2018-07-16 16:31:12",\n "blockHeight" : 28126,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.16,\n "totalDeposit" : "208000",\n "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-total-information-of-network-consensuses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-total-information-of-network-consensuses","aria-hidden":"true"}},[this._v("#")]),this._v(" Get total information of network consensuses")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getconsensus **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1758000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Total quantity of agents\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusAccountNumber"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of consensus accounts\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAgentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v("//Quantity of package addresses\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getconsensus\n{\n "agentCount" : 6,\n "totalDeposit" : "1758000",\n "rewardOfDay" : "0",\n "consensusAccountNumber" : 6,\n "packingAgentCount" : 6\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-general-of-agents-in-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-general-of-agents-in-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get general of agents in single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositedinfo
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes created\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1600000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Quantity of total agents\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"joinAgentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes in agency\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usableBalance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8048998.869"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Available balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Total bonuses gained\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonuses gained a day\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"')]),t._v("//Node hash\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "agentCount" : 1,\n "totalDeposit" : "1600000",\n "joinAgentCount" : 6,\n "usableBalance" : "8048998.869",\n "reward" : "219.65910271",\n "rewardOfDay" : "219.65910271",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-agent-information-of-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-agent-information-of-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of agent information of single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositeds
[agentHash] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])]),t._v(" "),s("tr",[s("td",[t._v("[agentHash]")]),t._v(" "),s("td",[t._v("Node hash, optional")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agency amount\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Address of agent\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:38:25"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agency transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28148")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),t._v("//Node address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "deposit" : "2000",\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:25",\n "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",\n "blockHeight" : 28148,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "35024DE6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"\n}, {\n "deposit" : "2000",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:43",\n "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",\n "blockHeight" : 28149,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "E09EB7FD",\n "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-agency-nodes-of-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-agency-nodes-of-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of agency nodes of single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositedagents
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("40.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0198ACAF"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:32:52"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28136")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.91")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"204000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agent amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("// Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",\n "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "deposit" : "20000",\n "commissionRate" : 40.0,\n "agentName" : null,\n "agentId" : "0198ACAF",\n "time" : "2018-07-16 16:32:52",\n "blockHeight" : 28136,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.91,\n "totalDeposit" : "204000",\n "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "memberCount" : 3\n}, {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.91,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-the-latest-block-head-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-latest-block-head-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the latest block head information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getbestblockheader")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:40"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("33950")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("668413")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("204")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"')]),t._v("// Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",\n "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",\n "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",\n "time" : "2018-07-17 10:25:40",\n "height" : 33950,\n "txCount" : 1,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 668413,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-17 10:25:30",\n "packingIndexOfRound" : 1,\n "reward" : "0",\n "fee" : "0",\n "confirmCount" : 0,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-block-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-block-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire block information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getblock | **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block hash")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Height of block")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Transaction collection\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coinbase"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction service charge\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction input\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //Transaction output\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("29115")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6174,\n "size" : 507,\n "txList" : [ {\n "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",\n "type" : "coinbase",\n "time" : "2018-07-16 16:29:30",\n "blockHeight" : 28115,\n "fee" : "0",\n "value" : null,\n "remark" : null,\n "scriptSig" : null,\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 54,\n "inputs" : [ ],\n "outputs" : [ {\n "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "value" : 100000,\n "lockTime" : 29115\n } ]\n }, {\n "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",\n "type" : "transfer",\n "time" : "2018-07-16 16:29:27",\n "blockHeight" : 28115,\n "fee" : "0.001",\n "value" : null,\n "remark" : null,\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 249,\n "inputs" : [ {\n "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 972899896100000\n } ],\n "outputs" : [ {\n "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",\n "value" : 3000000000000,\n "lockTime" : 0\n }, {\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 969899896000000,\n "lockTime" : 0\n } ]\n } ],\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-block-head-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-block-head-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire block head information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getblockheader | **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block hash")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-network-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-network-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire network information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getnetinfo **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Height of local latest block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Height of latest block online\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Offset of network time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of passive connecting nodes\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//Quantity of active connecting nodes\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getnetinfo\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-network-node-ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-network-node-ip","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire network node IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: getnetnodes **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getnetnodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-current-version-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-current-version-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire current version information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:version **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> version\n{\n "myVersion" : "1.0.0",\n "newestVersion" : "0.9.11",\n "upgradable" : false,\n "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"version-update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update","aria-hidden":"true"}},[this._v("#")]),this._v(" Version update")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:upgrade **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> version 1.0.0\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"exit-wallet-command-program"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-wallet-command-program","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit wallet command program")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="clientCLI.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/108.8b1f0e7f.js b/docs/.vuepress/dist/assets/js/108.8b1f0e7f.js new file mode 100644 index 00000000..2f747117 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/108.8b1f0e7f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[108],{847:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("Import jar files by using build tool")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._m(10),t._v(" "),a("p",[t._v("First introduce SDK namespace")]),t._v(" "),t._m(11),a("p",[t._v("After importing, create a client instance using the following code")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._m(14),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),a("p",[t._v("--")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(21),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._m(24),t._v(" "),t._m(25),a("hr"),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),a("hr"),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),a("hr"),t._v(" "),t._m(42),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(43),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(47),t._v(" "),t._m(48),t._m(49),t._v(" "),t._m(50),a("hr"),t._v(" "),t._m(51),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(52),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._m(57),t._v(" "),t._m(58),a("hr"),t._v(" "),t._m(59),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),a("hr"),t._v(" "),t._m(67),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(68),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(71),t._v(" "),t._m(72),t._m(73),t._v(" "),t._m(74),a("hr"),t._v(" "),t._m(75),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(79),t._v(" "),t._m(80),t._m(81),t._v(" "),t._m(82),t._m(83),t._v(" "),t._m(84),t._m(85),t._v(" "),t._m(86),a("hr"),t._v(" "),t._m(87),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(88),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(91),t._v(" "),t._m(92),t._m(93),t._v(" "),t._m(94),a("hr"),t._v(" "),t._m(95),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("Instrucions")]),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._m(101),t._v(" "),t._m(102),a("hr"),t._v(" "),t._m(103),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(104),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._m(109),t._v(" "),t._m(110),a("hr"),t._v(" "),t._m(111),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(112),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(115),t._v(" "),t._m(116),t._m(117),t._v(" "),t._m(118),t._m(119),t._v(" "),t._m(120),t._m(121),t._v(" "),t._m(122),a("hr"),t._v(" "),t._m(123),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(124),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(127),t._v(" "),t._m(128),t._m(129),t._v(" "),t._m(130),t._m(131),t._v(" "),t._m(132),a("hr"),t._v(" "),t._m(133),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(134),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(137),t._v(" "),t._m(138),t._m(139),t._v(" "),t._m(140),t._m(141),t._v(" "),t._m(142),a("hr"),t._v(" "),t._m(143),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(147),t._v(" "),t._m(148),t._m(149),t._v(" "),t._m(150),t._m(151),t._v(" "),t._m(152),a("hr"),t._v(" "),t._m(153),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(155),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(156),t._v(" "),t._m(157),t._m(158),t._v(" "),t._m(159),t._m(160),t._v(" "),t._m(161),a("hr"),t._v(" "),t._m(162),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(164),t._v(" "),t._m(165),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(166),t._v(" "),t._m(167),t._m(168),t._v(" "),t._m(169),a("hr"),t._v(" "),t._m(170),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(171),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(174),t._v(" "),t._m(175),t._m(176),t._v(" "),t._m(177),a("hr"),t._v(" "),t._m(178),t._v(" "),t._m(179),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(180),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),a("hr"),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(186),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),t._m(189),t._v(" "),t._m(190),a("blockquote"),t._v(" "),a("hr"),t._v(" "),t._m(191),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(192),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(193),t._v(" "),t._m(194),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(195),t._v(" "),t._m(196),t._m(197),t._v(" "),t._m(198),a("hr"),t._v(" "),t._m(199),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(200),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(201),t._v(" "),t._m(202),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(203),t._v(" "),t._m(204),t._m(205),t._v(" "),t._m(206),a("hr"),t._v(" "),t._m(207),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(208),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(209),t._v(" "),t._m(210),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(211),t._v(" "),t._m(212),t._m(213),t._v(" "),t._m(214),a("hr"),t._v(" "),t._m(215),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(216),t._v(" "),a("p",[t._v("Instruction")]),t._v(" "),t._m(217),t._v(" "),t._m(218),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(219),t._v(" "),t._m(220),t._m(221),t._v(" "),t._m(222),a("hr"),t._v(" "),t._m(223),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(224),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(225),t._v(" "),t._m(226),t._v(" "),t._m(227),t._v(" "),t._m(228),a("hr"),t._v(" "),t._m(229),t._v(" "),t._m(230),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(231),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(232),t._v(" "),a("table",[t._m(233),t._v(" "),t._m(234),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privKeys")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" private key of the transaction")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("passwords")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password corresponding to the private key (passwords for multiple accounts must be the same)\n")])])]),t._v(" "),t._m(235),t._v(" "),t._m(236),a("blockquote"),t._v(" "),t._m(237),t._v(" "),t._m(238),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(239),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(240),t._v(" "),t._m(241),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(242),t._v(" "),t._m(243),t._m(244),t._v(" "),t._m(245),a("hr"),t._v(" "),t._m(246),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(247),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(248),t._v(" "),t._m(249),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(250),t._v(" "),t._m(251),t._m(252),t._v(" "),t._m(253),a("hr"),t._v(" "),t._m(254),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(255),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(256),t._v(" "),t._m(257),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(258),t._v(" "),t._m(259),t._m(260),t._v(" "),t._m(261),a("hr"),t._v(" "),t._m(262),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(263),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(264),t._v(" "),t._m(265),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(266),t._v(" "),t._m(267),t._m(268),t._v(" "),t._m(269),a("hr"),t._v(" "),t._m(270),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(271),t._v(" "),a("p",[t._v("Instrucntions")]),t._v(" "),t._m(272),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(273),t._v(" "),t._m(274),t._m(275),t._v(" "),t._m(276),a("hr"),t._v(" "),t._m(277),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(278),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(279),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(280),t._v(" "),t._m(281),t._m(282),t._v(" "),t._m(283),a("hr"),t._v(" "),t._m(284),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(285),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(286),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(287),t._v(" "),t._m(288),t._m(289),t._v(" "),t._m(290),a("hr"),t._v(" "),t._m(291),t._v(" "),t._m(292),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(293),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(294),t._v(" "),t._m(295),t._v(" "),t._m(296),t._v(" "),t._m(297),a("hr"),t._v(" "),t._m(298),t._v(" "),t._m(299),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(300),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(301),t._v(" "),t._m(302),t._v(" "),t._m(303),t._v(" "),t._m(304),a("hr"),t._v(" "),t._m(305),t._v(" "),t._m(306),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(307),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(308),t._v(" "),t._m(309),t._v(" "),t._m(310),t._v(" "),t._m(311),t._m(312),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(313),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(314),t._v(" "),t._m(315),t._v(" "),t._m(316),t._v(" "),t._m(317),t._m(318),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(319),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(320),t._v(" "),t._m(321),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(322),t._v(" "),t._m(323),t._m(324),t._v(" "),t._m(325),t._m(326),t._v(" "),t._m(327),t._v(" "),t._m(328),t._v(" "),t._m(329),t._v(" "),t._m(330),t._m(331),t._v(" "),t._m(332),t._m(333),t._v(" "),t._m(334),t._m(335),t._v(" "),t._m(336),t._m(337),t._v(" "),t._m(338),a("hr"),t._v(" "),t._m(339),t._v(" "),t._m(340),a("hr"),t._v(" "),t._m(341),t._v(" "),t._m(342),a("hr"),t._v(" "),t._m(343),t._v(" "),t._m(344),a("hr"),t._v(" "),t._m(345),t._v(" "),t._m(346),a("hr"),t._v(" "),t._m(347),t._v(" "),t._m(348),a("hr"),t._v(" "),t._m(349),t._v(" "),t._m(350),a("hr"),t._v(" "),t._m(351),t._v(" "),t._m(352)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"convention"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#convention","aria-hidden":"true"}},[this._v("#")]),this._v(" Convention")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article)")]),t._v(" "),a("li",[t._v("The return object described in each interface refers to the content of the data attribute in the Result")]),t._v(" "),a("li",[t._v("Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na")]),t._v(" "),a("li",[t._v("Before running the SDK, you need to confirm that the NULS service is started and running normally")]),t._v(" "),a("li",[t._v("JDK1.8+ is recommended")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"releases-history"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#releases-history","aria-hidden":"true"}},[this._v("#")]),this._v(" Releases History")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Version")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Release Date")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Release Notes")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-19")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Provide interfaces for docking basic functions of the NULS service")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-22")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.14")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-04")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.15")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-07")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add four consensus interfaces (4.1-4.4)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.16")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-11")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add interface 4.5")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.0.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-13")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add error code")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.1.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-09-28")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add multi-account transfer interface")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick Start")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-importing-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-importing-files","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Importing files")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Use maven")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-xml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-xml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("dependency")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("groupId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("io.nuls.sdk"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("artifactId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("sdk-all"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1.0.1"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-creating-sdk-instance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-creating-sdk-instance","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Creating SDK instance")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace of the SDK boot class ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace of the SDK calls tool ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Initiate SDK")]),this._v(" "),s("li",[this._v("If no parameters are passed in initialization method, the default PRC IP and Port respectively are "),s("code",[this._v("127.0.0.1")]),this._v(", 8001 "),s("code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//By default ")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Pass in the NULS service’s IP and Port")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.88"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Call interface methods using the tool class")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g a complete example of creating an account with password")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace for corresponding modules as required ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\tSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"accounts-accountservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#accounts-accountservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Accounts AccountService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-creating-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-creating-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Creating account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAccount(int count, String password);")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Creates one or more accounts with or without a password depending on the parameters passed in.\nThe information about the successfully created account will be persisted to the NULS service local database.")]),t._v(" "),a("p",[t._v("Returns a set of successfully created account addresses\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" required or not ")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account count to be created (default 1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" optional ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" // Return a set of the created account addresses\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//create an account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//create an account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three password-less accounts ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three accounts with passwords ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-2-creating-offline-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-creating-offline-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Creating offline account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createOfflineAccount(int count, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Directly create an offline account and return it completely, without underlying interaction with NULS and persistence\nCreates an encrypted off-line account (Not saved to the database)")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account count to be created (default 1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" optional ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiBQg72BCLmLqttRpPfp8ECRCBwbdD"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529314943624")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"')]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create an offline account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create an offline account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three password-less offline accounts")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three offline accounts with passwords")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-3-getting-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-getting-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.3 Getting account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccount(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets information about the account by account address")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("AccountInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if when a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-4-getting-the-fee-for-setting-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-getting-the-fee-for-setting-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.4 Getting the fee for setting alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAliasFee(String address, String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)>\nResult.data "),s("code",[this._v("double")]),this._v(", unit is "),s("code",[this._v("NULS")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("Note!")]),this._v(" The unit of the fee returned by this interface is "),s("code",[this._v("NULS")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" alias name to be set")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.01")]),t._v(" //( unit"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" NULS"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAliasFee")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-5-getting-account-list"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-getting-account-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.5 Getting account list")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccountList(int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a list of accounts based on the paging parameters")]),this._v(" "),s("p",[this._v("Result.data Page "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("page number, must be greater than 0 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" record size displayed per page, ranging from 1 to 100")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cid96JrTGA2XaNG6zXrRKh18kLUbLP"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529311250627")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t...\n\t\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-6-getting-account-address-by-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-getting-account-address-by-account-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.6 Getting account address by account alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAddressByAlias(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the account address by the account alias")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account alias")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[this._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAddressByAlias")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-7-getting-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-getting-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.7 Getting account private key")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getPrikey(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the private key of the account by account address and password, and returns the private key string")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the way of calling the account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the way of calling the password-less account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-8-verifying-the-availability-of-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-verifying-the-availability-of-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.8 Verifying the availability of alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isAliasUsable(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Verifies that the alias is available (if it is not used) by alias name")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("alias name")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the alias is available\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return the case where the alias is unavailable")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the alias is not available\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isAliasUsable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-9-account-backup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-account-backup","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.9 Account Backup")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result backupAccount(String address, String path, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing.")]),this._v(" "),s("p",[this._v("Result: the generated file address")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Backup an password-less account to the current directory")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Backup an account with password to the /backup directory")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-10-importing-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-importing-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.10 Importing account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByKeystore")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path/fileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String/FileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//import an account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//import a password-less account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-11-importing-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-importing-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.11 Importing account (private key)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByPriKey(String privateKey, String password, boolean overwrite)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Imports an account by private key")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr"),a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privateKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" private key of the account")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// set a password when importing account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no password is set when importing account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-12-verifying-account-is-encrypted"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-verifying-account-is-encrypted","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.12 Verifying account is encrypted")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isEncrypted(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Verifies the account is encrypted")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate encrypted\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return unencrypted")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isEncrypted")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-removing-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-removing-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 Removing account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result removeAccount(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Removes an account")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-setting-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-setting-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 Setting password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPassword(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Sets a password for an unencrypted account. Encrypted account cannot call this interface.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-14-modifying-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-modifying-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.14 Modifying password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPassword(String address, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Modifys the password for an encrypted account. Unencrypted account cannot call this interface.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the current password of the account")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-15-setting-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-setting-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.15 Setting alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setAlias(String address, String alias, String password)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Sets alias name for an account")]),t._v(" "),a("p",[t._v("Result: the hash of the transaction for setting the alias\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("alias name to be set ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted ")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"')]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example for error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT007"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The account already set an alias"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-16-setting-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-setting-offline-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.16 Setting offline-account password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPasswordOffline(String address, String priKey, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service")]),this._v(" "),s("p",[this._v("Result: the encrypted private key(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account’s private key")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-17-modifying-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-modifying-offline-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.17 Modifying offline-account password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Modifies the password of the offline account independently in SDK, without interaction with NULS service")]),this._v(" "),s("p",[this._v("Result: the encrypted private key generated by the new password (encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("encryptedPriKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("encrypted private key")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("original password ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"transactions-accountledgerservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transactions-accountledgerservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Transactions AccountLedgerService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-1-creating-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-creating-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Creating transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. "),a("strong",[t._v("The calculation of the fee will be explained in detail later")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(": serialized transaction string in hexadecimal\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output referred by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output newly generated by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction remarks")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the outputs for assembly transaction, the attribute of the output in the example is mandatory.")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:100000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-transaction-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-transaction-signatures","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Transaction Signatures")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signTransaction(String txHex, String priKey, String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Signs the transaction by private key")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": the signed transaction, serialized string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("serialized transaction data in hexadecimal ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("private key of the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the address corresponding to the private key, used to verify the validity of the private key. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the password of the private key, leave it blank if the private key is not encrypted ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString priKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS6352s!f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-querying-transaction-details-by-transaction-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-querying-transaction-details-by-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Querying transaction details by transaction hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getTxByHash(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Queries transaction details by transaction hash")]),this._v(" "),s("p",[this._v("Result.data: "),s("a",{attrs:{href:"#Transaction"}},[s("code",[this._v("Transaction")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction hash ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getTxByHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-4-transfers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-transfers","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Transfers")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result transfer(String address, String toAddress, String password, long amount, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Initiates a transfer transaction")]),this._v(" "),s("p",[this._v("Result: the transaction hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" address of the transferor account ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("toAddress")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" address of the transferee account ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password of the transferor account, leave it blank if the account is not encrypted. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("amount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("long")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transfer amount (unit: Na)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("remarks")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remarks 1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('" remarks 1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-5-querying-account-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-querying-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.5 Querying account balance")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBalance(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the account balance")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BalanceInfo"}},[s("code",[this._v("BalanceInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-6-broadcasting-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-6-broadcasting-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.6 Broadcasting transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result broadcastTransaction(String txHex);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Broadcasts a transaction")]),this._v(" "),s("p",[this._v("Result.data String: transaction hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("serialized transaction data in hexadecimal ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" service"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcastTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isSuccess")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n String txHash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-7-creating-multi-address-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-7-creating-multi-address-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.7 Creating multi-address transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. "),s("strong",[this._v("The calculation of the fee will be explained in detail later")])]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output referred by the transaction")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output newly generated by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("nInputAccount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input account number")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction remarks")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" nInputAccount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the outputs for assembly transaction, the attribute of the output in the example is mandatory.")]),t._v("\n Output output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createMultipleInputAddressTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("nInputAccount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:100000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-8-signing-multi-address-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-8-signing-multi-address-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.8 Signing multi-address transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Signs a transaction by private key")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": signed transaction, serialized string in hexadecimal")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("th",{attrs:{align:"center"}},[this._v("parameter")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("type")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("required or not")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("note")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",{attrs:{align:"center"}},[this._v("txHex")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("String")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("required")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("serialized transaction data in hexadecimal ")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" priKeys "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" passwords "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signMultiTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" passwords"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"blocks-blockservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocks-blockservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Blocks BlockService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-1-getting-block-header-by-block-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-getting-block-header-by-block-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 Getting block header by block height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block header by block height")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block height")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-2-getting-block-header-by-block-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-getting-block-header-by-block-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Getting block header by block hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block header by block hash")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block hash ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-3-getting-block-by-block-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-getting-block-by-block-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 Getting block by block height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block by block height")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block height")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following formats:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-4-getting-block-by-block-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-getting-block-by-block-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 Getting block by block hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block by block hash")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block hash")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("-Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-5-getting-the-latest-block-header"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-getting-the-latest-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 Getting the latest block header")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the latest block header")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-6-getting-the-latest-block’s-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-6-getting-the-latest-block’s-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.6 Getting the latest block’s height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHight()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the height of the latest block")]),this._v(" "),s("p",[this._v("Result.data: height (Long)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("-Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5210")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-7-getting-the-latest-block’s-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-7-getting-the-latest-block’s-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.7 Getting the latest block’s Hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the block Hash of the latest block")]),this._v(" "),s("p",[this._v("Result.data: Hash (String)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"consensus-consensusservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#consensus-consensusservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Consensus ConsensusService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-1-offline-assembling-transaction-for-creating-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-offline-assembling-transaction-for-creating-node","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Offline assembling transaction for creating node")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles transaction for creating node offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("agentInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the information about the node to be created")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input information")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction fee")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the information about the node to be created, the attribute of AgentInfo in the example is mandatory.")]),t._v("\nAgentInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AgentInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the agent address of the consensus node")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the address of the node actually packing block")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// deposit for creating a node, not less than 20000NULS and not more than 200000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setCommissionRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// commission ratio ranging from 1 to 100")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//fee for creating a node")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:1000000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(288 + 50 * inputs.length)/1024\n210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-2-offline-assembling-agent-consensus-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-offline-assembling-agent-consensus-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Offline assembling agent consensus transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles an agent consensus transaction offline.")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction data in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("depositInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the information about the node to be created")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input information")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction fee")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory.")]),t._v("\nDepositInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DepositInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//address of the agent consensus node")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the agent token number ranging from 2000NULS to 500000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the id of the transaction for creating consensus node")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//fee for creating a node")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of fee for creating an agent transaction**: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:1000000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(288 + 50 * inputs.length)/1024\n210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-3-offline-assembling-transaction-for-canceling-agent-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-offline-assembling-transaction-for-canceling-agent-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.3 Offline assembling transaction for canceling agent consensus")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createCancelDepositTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles a transaction for canceling agent consensus offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the output locked when participating in the consensus ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus.")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" use the output as a parameter to generate an transaction "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" canceling agent consensus\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCancelDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-4-offline-assembling-transaction-for-stopping-consensus-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-offline-assembling-transaction-for-stopping-consensus-node","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.4 Offline assembling transaction for stopping consensus node")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createStopAgentTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles a transaction for stopping consensus node offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the output locked when creating a node ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" use the output as a parameter to generate a transaction "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" canceling agent consensus \nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createStopAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-5-getting-list-of-agent-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-getting-list-of-agent-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.5 Getting list of agent consensus")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getDeposits(String address, int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a list of agent consensus by agent address")]),this._v(" "),s("p",[this._v("Result.data List: a list of agent consensus")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("agent address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" record size displayed per page ranging from 1 to 100< ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000010000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("98")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDeposits")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"appendix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#appendix","aria-hidden":"true"}},[this._v("#")]),this._v(" Appendix")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"example-of-result-returned-by-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-of-result-returned-by-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" Example of Result returned by interface")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"result"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#result","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface and the specific data returned by the business service.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// interface executes correctly\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" data\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface, and the business service returns true.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the normal access to the interface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" and the business service returns "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// interface executes correctly\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" // the result returned by interface business function\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface, and the business service returns false.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // interface executes correctly\n \t"),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" // the result returned by interface business function\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error, exception, etc.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("This is the full result of creating an offline account with password.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n //data为List\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529041525794")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\t \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Account"}},[this._v(" Account ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"input"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#input","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Input"}},[this._v(" Input ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in amount\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"output"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#output","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Output"}},[this._v(" Output ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" index\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(usable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(time lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(consensus lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(spent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Transaction"}},[this._v(" Transaction ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction type\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction initiation time \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction fee\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction amount\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remarks\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(to be confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address \n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in amount\n\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" index\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(usable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(time lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(consensus lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(spent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"balanceinfo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceinfo","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BalanceInfo"}},[this._v(" BalanceInfo ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(' available balance\n\t“locked"'),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" locked balance\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BlockHeader"}},[this._v(" BlockHeader")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" hash value of the previous block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" merkle hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block generation time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of transactions packaged by the block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of members participating in the consensus\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the start time of the current consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the packing index of the current round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus reward\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing fee obtained\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#block","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Block"}},[this._v(" Block")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" hash value of the previous block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" merkle hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block generation time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of transactions packaged by the block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of members participating in the consensus\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the start time of the current consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the packing index of the current round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus reward\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing fee obtained\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction type\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction initiation time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction fee\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction amount\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remarks\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(to be confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("inputs\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long transfer-in amount\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" outputs\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])}],!1,null,null,null);e.options.__file="sdk.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/109.2f3b3253.js b/docs/.vuepress/dist/assets/js/109.2f3b3253.js new file mode 100644 index 00000000..de3825f8 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/109.2f3b3253.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[109],{995:function(t,e,i){"use strict";i.r(e);var s=i(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"client-wallet-user-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#client-wallet-user-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" Client wallet user guide")]),this._v(" "),e("p",[this._v("Community members are writing...")])])}],!1,null,null,null);n.options.__file="GUIGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/11.b0ceb74e.js b/docs/.vuepress/dist/assets/js/11.b0ceb74e.js new file mode 100644 index 00000000..fa6b0a0e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/11.b0ceb74e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{469:function(t,e,a){t.exports=a.p+"assets/img/Install.33ff9464.jpg"},470:function(t,e,a){t.exports=a.p+"assets/img/Install2.23136d69.jpg"},471:function(t,e,a){t.exports=a.p+"assets/img/Install3.145b9c4e.jpg"},472:function(t,e,a){t.exports=a.p+"assets/img/createProject.e78abf06.jpg"},473:function(t,e,a){t.exports=a.p+"assets/img/createProject2.b7246453.jpg"},474:function(t,e,a){t.exports=a.p+"assets/img/code.785ccdb5.jpg"},475:function(t,e,a){t.exports=a.p+"assets/img/Deploy.0f2d2d88.jpg"},476:function(t,e,a){t.exports=a.p+"assets/img/Add.e1d751e6.jpg"},477:function(t,e,a){t.exports=a.p+"assets/img/Add3.fbd88d0f.jpg"},478:function(t,e,a){t.exports=a.p+"assets/img/Add5.dfc1a6d7.jpg"},479:function(t,e,a){t.exports=a.p+"assets/img/package.6fff1f40.jpg"},480:function(t,e,a){t.exports=a.p+"assets/img/package1.e07eba9a.jpg"},481:function(t,e,a){t.exports=a.p+"assets/img/package3.e7db1454.jpg"},482:function(t,e,a){t.exports=a.p+"assets/img/package2.698a4145.jpg"},483:function(t,e,a){t.exports=a.p+"assets/img/package4.a9a579bf.jpg"},484:function(t,e,a){t.exports=a.p+"assets/img/Deploy2.ccca3cbd.jpg"},485:function(t,e,a){t.exports=a.p+"assets/img/Deploy3.131a59dc.jpg"},486:function(t,e,a){t.exports=a.p+"assets/img/Deploy4.ebcdade6.jpg"},487:function(t,e,a){t.exports=a.p+"assets/img/Deploy5.37a2c168.jpg"},488:function(t,e,a){t.exports=a.p+"assets/img/Deploy6.f4b26eb1.jpg"},489:function(t,e,a){t.exports=a.p+"assets/img/Deploy7.e33e7d01.jpg"},930:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls-idea-plugin-user-manual"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls-idea-plugin-user-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS IDEA Plugin User Manual")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-install-nuls-plugin-on-idea"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-install-nuls-plugin-on-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 Install NULS Plugin on IDEA")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(469),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Select the said ZIP, and click OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(470),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Tick NULS plugin, and click Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(471),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-create-a-nuls-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-a-nuls-project","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 Create a NULS project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(472),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(473),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-compile-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-compile-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 Compile smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(474),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-set-and-deploy-the-node-and-account-for-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-set-and-deploy-the-node-and-account-for-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 Set and deploy the node and account for contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click NULS plugin on the right, and call NULS plugin interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(475),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract.\nRecommendation: Start the local wallet, and add the wallet address as the node address.")]),t._v(" "),s("p",[t._v("Click + on the top left corner of panel, and select Add Node.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(476),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Input Node address and clock OK")]),t._v(" "),s("p",[s("img",{attrs:{src:a(477),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(478),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-package-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-package-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 Package contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code")]),t._v(" "),s("p",[s("img",{attrs:{src:a(479),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).")]),t._v(" "),s("p",[s("img",{attrs:{src:a(480),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(481),alt:"code"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(482),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-deploy-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 Deploy contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(483),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Parameters following JarFilePath are the parameters of the contract construction function.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(484),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(485),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(486),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(487),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Review the deployed contract on the top of panel")]),t._v(" "),s("p",[s("img",{attrs:{src:a(488),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the deployed contract to review all method of this contract")]),t._v(" "),s("p",[s("img",{attrs:{src:a(489),alt:"code"}})])])])}],c=a(0),n=Object(c.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Get NULS plugin"),a("OutboundLink")],1),t._v(" ZIP, and save in disk\nClick File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Input Project name, click finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),a("p",[t._v("Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},s,!1,null,null,null);n.options.__file="ideaPlugin.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/110.aa04c678.js b/docs/.vuepress/dist/assets/js/110.aa04c678.js new file mode 100644 index 00000000..b71a208f --- /dev/null +++ b/docs/.vuepress/dist/assets/js/110.aa04c678.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[110],{996:function(e,t,r){"use strict";r.r(t);var a=r(0),n=Object(a.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432"),r("OutboundLink")],1)])]),e._v(" "),e._m(2),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/zh-cn/categories/115000056052"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/en-us/categories/115000056052"),r("OutboundLink")],1)])]),e._v(" "),e._m(3),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.okex.com/hc/zh-cn/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/zh-cn/categories/115000275231"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.okex.com/hc/en-us/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/en-us/categories/115000275231"),r("OutboundLink")],1)])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"trading-guide-for-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trading-guide-for-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" Trading guide for NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-huobi-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-huobi-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for Huobi platform")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-binance-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-binance-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for Binance platform")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-okex-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-okex-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for OKEX platform")])}],!1,null,null,null);n.options.__file="NULSTransaction.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/111.f62d78bb.js b/docs/.vuepress/dist/assets/js/111.f62d78bb.js new file mode 100644 index 00000000..efe92cbf --- /dev/null +++ b/docs/.vuepress/dist/assets/js/111.f62d78bb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[111],{994:function(t,e,i){"use strict";i.r(e);var s=i(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"light-wallet-user-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#light-wallet-user-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" Light wallet user guide")]),this._v(" "),e("p",[this._v("Community members are writing...")])])}],!1,null,null,null);n.options.__file="webGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/112.69acd927.js b/docs/.vuepress/dist/assets/js/112.69acd927.js new file mode 100644 index 00000000..e103dacb --- /dev/null +++ b/docs/.vuepress/dist/assets/js/112.69acd927.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[112],{992:function(t,e,i){"use strict";i.r(e);var s=i(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"client-wallet-user-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#client-wallet-user-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" Client wallet user guide")]),this._v(" "),e("p",[this._v("Community members are writing...")])])}],!1,null,null,null);n.options.__file="GUIGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/113.888160f3.js b/docs/.vuepress/dist/assets/js/113.888160f3.js new file mode 100644 index 00000000..ebf7a7a3 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/113.888160f3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[113],{990:function(e,t,s){"use strict";s.r(t);var i=s(0),a=Object(i.a)({},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),s("p",[e._v("NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.")]),e._v(" "),e._m(3),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),s("p",[e._v("There are six types of NIP:")]),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),s("p",[e._v("Vetting an idea publicly before going as far as writing a NIP is meant to save your time. Asking the community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions. It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where NULS is used. We recommend that comments can be collected in the community via voting, and the results will also help the NIP editors to make quicker decisions on whether to merge the NIP.")]),e._v(" "),s("p",[e._v("A successful NIP requires the following stages:")]),e._v(" "),e._m(10),s("p",[e._v("Each change to the NIP status should be submitted by the NIP author as a pull request (PR), and the NIP editors will review the NIP. It's a good idea to add a link to the discussion post when you submit a PR.")]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),s("p",[e._v("Other exceptional statuses are:")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),s("p",[e._v("Each NIP should have the following parts:")]),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),s("p",[e._v("NIP should be written in markdown format.")]),e._v(" "),e._m(17),e._v(" "),s("p",[e._v("Each NIP must use the RFC 822 style as the head of the document. The headers must be arranged in the following order. The headers marked with * are optional, others are required.")]),e._v(" "),e._m(18),e._m(19),e._v(" "),s("p",[e._v('NIPs may include auxiliary files such as diagrams. Auxiliary files must be named NIP-XXXX-Y.ext, where "XXXX" is the NIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png").')]),e._v(" "),e._m(20),e._v(" "),s("p",[e._v("It occasionally becomes necessary to transfer ownership of NIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred NIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the NIP process or has fallen off the face of the 'net' (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the NIP. We try to build consensus around a NIP, but if that's not possible, you can always submit a competing NIP.")]),e._v(" "),s("p",[e._v("If you are interested in assuming ownership of a NIP, send a message asking to take over, addressed to both the original author and the NIP editors. If the original author doesn't respond to email in a timely manner, the NIP editors will make a unilateral decision (it's not like such decisions can't be reversed).")]),e._v(" "),e._m(21),e._v(" "),s("p",[e._v("The current NIP editors are:")]),e._v(" "),e._m(22),e._m(23),e._v(" "),s("p",[e._v("For each new NIP that comes in an editor does the following:")]),e._v(" "),e._m(24),e._v(" "),s("p",[e._v("If the NIP isn't ready, an editor will send it back to the author for revision, with specific instructions. Once the NIP is ready for the repository, a NIP editor will:")]),e._v(" "),e._m(25),e._v(" "),s("p",[e._v("Many NIPs are written and maintained by developers with write access to the NULS codebase. The NIP editors monitor NIP changes, and correct any structure, grammar, spelling, or markup mistakes they see. NIP editors don't pass judgment on NIPs. They merely do the administrative and editorial part.")]),e._v(" "),e._m(26),e._v(" "),s("p",[e._v("This document was derived heavily from Bitcoin's "),s("a",{attrs:{href:"https://github.com/bitcoin/bips",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin's BIP-0001"),s("OutboundLink")],1),e._v(", written by Amir Taake, and the text he wrote was mainly from "),s("a",{attrs:{href:"https://www.python.org/dev/peps/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Python's PEP-0001"),s("OutboundLink")],1),e._v(". According to this situation, NIP makes some modifications based on their documents, such as adding the Council in the NIP process, modifying NIP types, etc. Please direct all comments to the NULS NIP editors.")]),e._v(" "),s("link",{attrs:{rel:"stylesheet",href:"https://use.fontawesome.com/releases/v5.0.13/css/all.css"}}),e._v(" "),s("p",[e._v("​")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-1-nip-purpose-and-guidelines"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-1-nip-purpose-and-guidelines","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-1 NIP Purpose and Guidelines")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("NIP: 1\nTitle: NIP Purpose and Guidelines\nStatus: Last call\nType: Process\nAuthor: Lin Yang \nCreated: 2018-12-27\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"what-is-a-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("What is a NIP?")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"reasons-for-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#reasons-for-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Reasons for NIP")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.")]),this._v(" "),t("li",[this._v("For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-types"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-types","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Types")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[e._v("A Core NIP describes improvements in the NULS core code, such as consensus mechanisms, network protocols, etc.")]),e._v(" "),s("li",[e._v("A Module NIP describes improvements in module submission and review requirements, such as the certain minimum criteria a NIP must meet to be accepted and merged into the module repository.")]),e._v(" "),s("li",[e._v("An Interface NIP describes improvements in the specifications and standards of the NULS client API/RPC, such as API name and method name.")]),e._v(" "),s("li",[e._v("An NRC Standards NIP describes improvements in application-level standards, such as contract standards, token standards, etc.")]),e._v(" "),s("li",[e._v("An Informational NIP describes a NULS design issue or provides general guidelines or information to the NULS community--but does not propose a new feature. Informational NIPs do not necessarily represent a NULS community consensus or recommendation, so users and implementers are free to ignore Informational NIPs or follow their advice.")]),e._v(" "),s("li",[e._v("A Process NIP describes improvements in all NULS-related operational processes, such as the ambassador election in the community. A Process NIP is not only a recommendation, but also a specification that community members need to follow to accomplish certain things, but it does not involve code-level specifications.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-work-flow"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-work-flow","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Work Flow")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("The parties involved in the workflow include some or all of the following roles:")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("p",[e._v("Most members of the community")]),e._v(" "),s("p",[e._v("The main responsibility is to participate in the discussion and voting of the NIPs, making constructive comments as well.")])]),e._v(" "),s("li",[s("p",[e._v("NIP Authors")]),e._v(" "),s("p",[e._v("Propose and improve NIPs and lead the community to discuss.")])]),e._v(" "),s("li",[s("p",[e._v("NIP Editors")]),e._v(" "),s("p",[e._v("Manage and edit NIPs.")])]),e._v(" "),s("li",[s("p",[e._v("NULS Council")]),e._v(" "),s("p",[e._v("The NIPs, about to “Final” or “Accepted”, can be rejected by the final decision of the Council via internal voting.")])]),e._v(" "),s("li",[s("p",[e._v("NULS Core Developers")]),e._v(" "),s("p",[e._v("They are responsible for the audit and code implementation of the Core, Module, NRC Standards and Interface NIPs.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" [ Draft ]->[ Last Call ]->[ Accepted ]->[ Final ]\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A complete NIP process is as follows:")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("p",[e._v("The NIP author writes the NIP using the mandated format and style and shepherds the discussions in the community. The NIP author should first attempt to ascertain whether the idea is NIP-able, and then submit the NIP as a PR to the NIP repository, including a link to the discussion post. The NIP editors will handle these requests based on actual situation.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Draft:")]),e._v(" Once approved, the NIP editors will assign the NIP a number and squash commit the pull request onto master. The NIP editors will not unreasonably deny a NIP.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Draft:")]),e._v(" Reasons for denying NIP status include being unfocused or too broad, duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the NULS philosophy.")])])]),e._v(" "),s("li",[s("p",[e._v("Updates to drafts may also be submitted by the author as pull requests before it can be considered mature enough and ready for the next status.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Last call")]),e._v(": Once approved, the NIP editors will change the NIP status from Draft to last call and set the end date for the last call, usually 15 days.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Last call")]),e._v(": Once the NIP has been published, it will be re-assigned to Draft status when necessary revisions are made on the NIP. We hope that a NIP will enter last call status only once to avoid unnecessary controversy in the community.")])])]),e._v(" "),s("li",[s("p",[e._v("The NIP in last call status will be pinned at https://nuls.community/")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Accepted (involved in Core, Module, NRC Standards and Interface NIPs only):")]),e._v(" If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Accepted” by the NIP editors.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Final (involved in Informational and Process NIPs only):")]),e._v(" If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Final” by the NIP editors.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Last call:")]),e._v(" The NIP will be re-assigned to Draft status if there are material changes or technical issues raised by the community cannot be solved during the last call period. In addition, if the Council has different views on the NIP, a vote can be initiated within the Council members. If more than 70% of the Council members reject the NIP (giving reasons), the NIP will be re-assigned to “Draft” status or directly “Rejected” according to actual reasons.")])])]),e._v(" "),s("li",[s("p",[e._v("Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the NULS core developers must implement the NIPs in the form of code before they can be considered “Final”.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Final (involved in Core, Module, NRC Standards and Interface NIPs only):")]),e._v(' After the NIP is implemented in the form of code, and is running on the main-net stably for certain amount of time or has become effectively verified, with changes recognized by the community as well, the status can be changed to "Final".')])])])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("strong",[e._v("Deferred:")]),e._v(" Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the developers do not complete the reference implementation as scheduled.")]),e._v(" "),s("li",[s("strong",[e._v("Rejected:")]),e._v(" A NIP can also be “Rejected”. Perhaps core developers reject to propose an implementation or the Council finds it unfeasible.")]),e._v(" "),s("li",[s("strong",[e._v("Superseded:")]),e._v(" A NIP used to “Final”, but it is no longer considered the most advanced. Another better NIP appears, referring to this NIP, and becomes the Final status.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"what-belongs-in-a-successful-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-belongs-in-a-successful-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" What belongs in a successful NIP?")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("strong",[e._v("Preamble:")]),e._v(" RFC 822 style headers containing meta-data about the NIP, including the NIP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. See NIP Header Preamble for details.")]),e._v(" "),s("li",[s("strong",[e._v("Summary:")]),e._v(" The NIP author needs to provide a simple and understandable summary of the NIP for the general public. If you can't explain it in a simple way, it means that you don't fully understand it.")]),e._v(" "),s("li",[s("strong",[e._v("Abstract:")]),e._v("  A short (~200 word) description of the technical issue being addressed.")]),e._v(" "),s("li",[s("strong",[e._v("Motivation:")]),e._v(" The motivation is critical for NIPs that want to change the NULS protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the NIP solves. NIP submissions without sufficient motivation may be rejected outright.")]),e._v(" "),s("li",[s("strong",[e._v("Specification:")]),e._v(" The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current NULS platforms (NULS client, explorer).")]),e._v(" "),s("li",[s("strong",[e._v("Rationale:")]),e._v(" The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion.")]),e._v(" "),s("li",[s("strong",[e._v("Backwards Compatibility:")]),e._v(" All NIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The NIP must explain how the author proposes to deal with these incompatibilities. NIP submissions without a sufficient backwards compatibility treatise may be rejected outright.")]),e._v(" "),s("li",[s("strong",[e._v("Test Cases:")]),e._v(" For NIPs that affect the consensus mechanism, test cases for their implementation must be provided.")]),e._v(" "),s("li",[s("strong",[e._v("Reference Implementation:")]),e._v(' The reference implementation must be completed before any NIP is given status "Final", but it need not be completed before the NIP is accepted.')]),e._v(" "),s("li",[s("strong",[e._v("History:")]),e._v(" History records show the whole process of the NIP from being proposed to the Final state, which can be displayed as additional links.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-formats-and-templates"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-formats-and-templates","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Formats and Templates")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-header-preamble"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-header-preamble","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Header Preamble")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" Title: < NIP title>\n Author: \n* Discussions-To: < links to official discussion channels>\n Status: \n Type: \n Created: \n* Replaces: < NIP number>\n* Superseded-By: < NIP number>\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"auxiliary-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#auxiliary-files","aria-hidden":"true"}},[this._v("#")]),this._v(" Auxiliary Files")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"transferring-nip-ownership"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#transferring-nip-ownership","aria-hidden":"true"}},[this._v("#")]),this._v(" Transferring NIP Ownership")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-editors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-editors","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Editors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("Niels \nPen \n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-editor-responsibilities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-editor-responsibilities","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Editor Responsibilities")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Read the NIP to check if it is ready: sound and complete. The ideas in the NIP must make technical sense, even if they don’t seem likely to be accepted.")]),this._v(" "),t("li",[this._v("The title should accurately describe the content.")]),this._v(" "),t("li",[this._v("Skim the NIP for obvious defects in language (spelling, grammar, sentence structure, etc.), markup (for Github style), and code style.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Assign a NIP number (usually a PR number)")]),this._v(" "),t("li",[this._v("Merge the pull request")]),this._v(" "),t("li",[this._v("Send email back to the NIP author with next steps")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#history","aria-hidden":"true"}},[this._v("#")]),this._v(" History")])}],!1,null,null,null);a.options.__file="NIP-1.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/114.29e41199.js b/docs/.vuepress/dist/assets/js/114.29e41199.js new file mode 100644 index 00000000..1f8ce1dd --- /dev/null +++ b/docs/.vuepress/dist/assets/js/114.29e41199.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[114],{988:function(e,t,i){"use strict";i.r(t);var o=i(0),n=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),i("p",[e._v("Due to the development requirement of NULS and to better facilitate the favorable operation of the NULS community and to make blockchain technology easier with NULS, the NULS community will constantly seek and implement NULS community autonomy for the realization of self-governance and self-evolution. This Constitution is hereby formulated based on the NULS community culture and philosophy.")]),e._v(" "),i("p",[e._v("NULS community culture: openness, freedom, autonomy, evolution")]),e._v(" "),i("p",[e._v("NULS community philosophy: share, inherit, grow, innovate")]),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("NULS Foundation")]),e._v(" "),i("p",[e._v("December 2018")]),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")]),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("In order to build a good community operation mechanism, promote community autonomy, and promote the NULS project to enable the community to evolve and drive independently.")]),e._v(" "),e._m(6),e._v(" "),i("p",[e._v("The following is a specification of the NULS Community Constitution.")]),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),i("p",[e._v("NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),i("p",[e._v("NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.")]),e._v(" "),e._m(11),e._v(" "),i("p",[e._v("Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:")]),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),i("p",[e._v("20,000,000 NULS from the NULS and entrusted revenues from the contributors.")]),e._v(" "),e._m(14),e._v(" "),i("p",[e._v("The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.")]),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),i("p",[e._v("As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.")]),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),i("p",[e._v("The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.")]),e._v(" "),e._m(28),e._v(" "),i("p",[e._v("We stick to the following philosophy in the technology community:")]),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),i("p",[e._v("The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).")]),e._v(" "),i("p",[e._v("The process of joining CCC is:")]),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),i("p",[e._v("Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at "),i("strong",[i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),i("OutboundLink")],1)]),e._v(".")]),e._v(" "),e._m(39),e._v(" "),i("p",[e._v("Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.")]),e._v(" "),e._m(40),e._v(" "),e._m(41),e._v(" "),i("p",[e._v("Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.")]),e._v(" "),e._m(42),e._v(" "),i("p",[e._v("The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.")]),e._v(" "),e._m(43),e._v(" "),e._m(44),e._v(" "),e._m(45),e._v(" "),e._m(46),e._v(" "),e._m(47),e._v(" "),e._m(48),e._v(" "),i("p",[e._v("We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:")]),e._v(" "),i("p",[e._v("NULS community website: "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),i("OutboundLink")],1)]),e._v(" "),i("p",[e._v("Feedback post: "),i("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/132-we-need-your-suggestions"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-2-nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-2-nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-2 NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 2\n Title: NULS Community Constitution\n Author: Reaper Ran \n Discussions-To: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207\n Status: Last call\n Type: Process\n Created: 2018-12-28\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preamble"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preamble","aria-hidden":"true"}},[this._v("#")]),this._v(" Preamble")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("The following rules will be based on the NULS development consensus governance module. The Council members and Ambassadors will be appointed by a vote within the NULS core team before consensus governance module is set in motion.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-nuls-community-profile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-nuls-community-profile","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. NULS Community Profile")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.")]),this._v(" NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-objectives-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-objectives-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I)")]),this._v(" "),t("strong",[this._v("Objectives")]),this._v(" "),t("strong",[this._v("of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Code writing")]),this._v(" "),t("li",[this._v("Applications development")]),this._v(" "),t("li",[this._v("Operation and promotion")]),this._v(" "),t("li",[this._v("Other actions in favor of NULS community ecology development")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-source-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-source-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Source of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-management-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-management-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Management of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-appointment-of-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-appointment-of-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Appointment of Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers "),t("strong",[this._v("(developer council member)")]),this._v(" elected based on a ballot participated by all developers; and 7 members elected by ballot within the community "),t("strong",[this._v("(standing council member)")]),this._v(". The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.")]),this._v(" "),t("li",[this._v("Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.")]),this._v(" "),t("li",[this._v("Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.")]),this._v(" "),t("li",[this._v("Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-rights-and-responsibilities-of-council-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-rights-and-responsibilities-of-council-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Rights and responsibilities of Council member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:")]),this._v(" "),t("p",[this._v("(1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.")])]),e._v(" "),i("li",[i("p",[e._v("Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.")]),e._v(" "),i("p",[e._v("(2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of lower node agency commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of transfer commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of contract call commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of Council member proposal commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of adjustable system parameter in other systems.")]),e._v(" "),i("p",[e._v("(3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.")])]),e._v(" "),i("li",[i("p",[e._v("Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.")])]),e._v(" "),i("li",[i("p",[e._v("Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.")])]),e._v(" "),i("li",[i("p",[e._v("Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"2"}},[t("li",[this._v("Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.")]),this._v(" "),t("li",[this._v("Responsibilities of Council member.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Council member shall communicate with the community in good time.")])]),this._v(" "),t("li",[t("p",[this._v("Act in strict accordance with the community’s Constitution.")])]),this._v(" "),t("li",[t("p",[this._v("Share the same vision and purpose with NULS.")])]),this._v(" "),t("li",[t("p",[this._v("Take it as its own mission to protect community members’ interests.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note:")]),this._v(" "),t("strong",[this._v("All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-code-craft-council-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. CODE CRAFT COUNCIL (CCC)")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-philosophy-of-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-philosophy-of-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Philosophy of the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Equal: the technology community and core team are equal and work together for joint development.")])]),this._v(" "),t("li",[t("p",[this._v("Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.")])]),this._v(" "),t("li",[t("p",[this._v("Sharing:")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("The whole community shares the achievements of NULS technology.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares the development dividend of NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares NULS’s influence and reputation.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares the technical innovation brought by NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares NULS’s standard establishment to promote industry development.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[t("p",[this._v("Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.")])]),this._v(" "),t("li",[t("p",[this._v("Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-appointment-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-appointment-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Appointment of the CCC member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.")]),this._v(" "),t("li",[this._v("Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.")]),this._v(" "),t("li",[this._v("Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.")]),this._v(" "),t("li",[this._v("After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iv-rights-and-responsibilities-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-rights-and-responsibilities-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(IV) Rights and responsibilities of the CCC member")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ol",[i("li",[i("p",[e._v("NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.")])]),e._v(" "),i("li",[i("p",[e._v("The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.")])]),e._v(" "),i("li",[i("p",[e._v("After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.")])]),e._v(" "),i("li",[i("p",[e._v("Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.")])]),e._v(" "),i("li",[i("p",[e._v("The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-contributor-for-campaign"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-contributor-for-campaign","aria-hidden":"true"}},[this._v("#")]),this._v(" (I) Contributor for campaign")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-permanent-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-permanent-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" (II) Permanent contributor")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vi-project-budget"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vi-project-budget","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VI. Project Budget")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-with-respect-to-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-with-respect-to-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) With respect to contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-with-respect-to-other-transaction-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-with-respect-to-other-transaction-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) With respect to other transaction funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vii-other-votes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vii-other-votes","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VII. Other votes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-start-a-vote"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-start-a-vote","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Start a vote")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("The Council member shall start a vote and only the transaction fee is required.")])]),this._v(" "),t("li",[t("p",[this._v("Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-vote-by-proxy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-vote-by-proxy","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Vote by proxy")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.")])]),this._v(" "),t("li",[t("p",[this._v("Any NULS user can be an agent.")])]),this._v(" "),t("li",[t("p",[this._v("Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.")])]),this._v(" "),t("li",[t("p",[this._v("The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"viii-feedback"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viii-feedback","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VIII.")]),this._v(" Feedback")])}],!1,null,null,null);n.options.__file="NIP-2.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/115.d2ee5369.js b/docs/.vuepress/dist/assets/js/115.d2ee5369.js new file mode 100644 index 00000000..0ef7be55 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/115.d2ee5369.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{986:function(e,t,a){"use strict";a.r(t);var n=a(0),o=Object(n.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),e._m(3),e._v(" "),a("p",[e._v("In order to enable the community to have more talents to join, community funds are opened to the community for joint management and use.")]),e._v(" "),e._m(4),e._v(" "),a("p",[e._v("The following is a specification of the Community Fund Management and Use of Process.")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),a("p",[e._v("Community Fund Account Address:")]),e._v(" "),a("p",[a("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[e._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.")]),e._v(" "),a("p",[e._v("The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.")]),e._v(" "),e._m(8),e._v(" "),a("p",[e._v("**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),a("p",[e._v("All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.")]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),a("p",[e._v("The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.")]),e._v(" "),e._m(15),e._v(" "),a("p",[e._v("The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.")]),e._v(" "),e._m(16),e._v(" "),a("p",[e._v("Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.")]),e._v(" "),e._m(17),e._v(" "),a("p",[e._v("Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),a("p",[e._v("(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;")]),e._v(" "),a("p",[e._v("(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;")]),e._v(" "),a("p",[e._v("(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;")]),e._v(" "),a("p",[e._v("(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;")]),e._v(" "),a("p",[e._v("(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;")]),e._v(" "),a("p",[e._v("(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;")]),e._v(" "),e._m(20),e._v(" "),a("p",[e._v("(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;")]),e._v(" "),a("p",[e._v("(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;")]),e._v(" "),a("p",[e._v("(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;")]),e._v(" "),a("p",[e._v("(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.")]),e._v(" "),e._m(21),e._v(" "),a("p",[e._v("(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;")]),e._v(" "),a("p",[e._v("(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).")]),e._v(" "),e._m(22),e._v(" "),a("p",[e._v("All community discussion suggestions are made at "),a("a",{attrs:{href:"https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),a("OutboundLink")],1),e._v(" .")]),e._v(" "),a("p",[e._v("This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.")]),e._v(" "),a("p",[e._v("Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.")]),e._v(" "),a("p",[e._v("The specific node generates revenue with reference to the NULS POC consensus mechanism.")]),e._v(" "),e._m(23),e._v(" "),a("p",[e._v("Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),e._v(" "),a("p",[e._v("CCC Members")]),e._v(" "),a("p",[e._v("Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),e._v(" "),a("p",[e._v("Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),e._v(" "),a("p",[e._v("Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),e._v(" "),a("p",[e._v("Berzeck’s staking – Same as above")]),e._v(" "),a("p",[e._v("Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),e._v(" "),a("p",[e._v("Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),e._v(" "),a("p",[e._v("Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),e._v(" "),a("p",[e._v("Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),e._v(" "),a("p",[e._v("Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),e._v(" "),a("p",[e._v("Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),e._v(" "),a("p",[e._v("Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),e._v(" "),a("p",[e._v("Moshe’s staking – Same as above")]),e._v(" "),a("p",[e._v("Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),e._v(" "),a("p",[e._v("Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),e._v(" "),e._m(24)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-3-community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-3-community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-3 Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 3\n Title: Community Fund Management and Use of Process\n Author: Reaper Ran \n Discussions-To: https://nuls.community/d/262-community-fund-management-and-use-of-process-discussion-draft-ngc20181221\n Status: Last call\n Type: Process\n Created: 2018-12-28\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png",alt:"img"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-community-fund-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-community-fund-management","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. Community Fund Management")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-the-application-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-the-application-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. The Application Member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-ordinary-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-ordinary-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Ordinary Members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-contributor-role"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-contributor-role","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Contributor Role")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. "),t("strong",[this._v("The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.")]),this._v(" The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-the-type-of-application"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-the-type-of-application","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. The Type of Application")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-proposal-to-pay-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-proposal-to-pay-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Proposal to Pay Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-proposal-budget-item"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-proposal-budget-item","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Proposal Budget Item")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-the-proposal-to-create-a-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-the-proposal-to-create-a-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. The Proposal to Create a Node")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("4. Proposal Entrusted Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-the-application-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-the-application-process","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. The Application Process")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-the-plan-is-openly-and-thoroughly-discussed"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-the-plan-is-openly-and-thoroughly-discussed","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. The Plan is Openly and Thoroughly Discussed")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-council-member-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-council-member-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Council Member Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-foundation-implementation-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-foundation-implementation-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. Foundation Implementation Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-process-explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-process-explanation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Process Explanation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"attachment-current-contributor-role-delegation-and-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#attachment-current-contributor-role-delegation-and-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Attachment: Current Contributor Role Delegation and Node:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);o.options.__file="NIP-3.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/116.51fc87d4.js b/docs/.vuepress/dist/assets/js/116.51fc87d4.js new file mode 100644 index 00000000..ff4a5df3 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/116.51fc87d4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{984:function(e,t,o){"use strict";o.r(t);var a=o(0),s=Object(a.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("During the period between September to November 2018, we have had 9 ambassadors who have actively worked within the NULS Community to attract more members and developers. Once smart contracts are launched on the NULS main-net, there will be a community voting tool. Appointments of the ambassadors should be decided by the community. During this time, community members have given many suggestions, so we have set up some new detailed campaigning rules for the ambassadors. This will be the first step toward community autonomy, which is an important goal for NULS. It requires many fundamental tools, as well as the support from everyone in the community.")]),e._v(" "),e._m(4),e._v(" "),o("p",[e._v("The following is a specification of the Ambassadors participate in the election rules.")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(7),e._v(" "),o("p",[e._v("a. A candidate for the NULS ambassador is required to create a NULS node.")]),e._v(" "),o("p",[e._v("b. Identify with the NULS concepts of values, understand the core knowledge of NULS and respect the members of the NULS community. The election cycle is quarterly and requires a full 3 month commitment. Consider this commitment before running for election. Ambassadors are expected to meet the full term of the quarterly commitment.")]),e._v(" "),o("p",[e._v("c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.")]),e._v(" "),o("p",[e._v("d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.")]),e._v(" "),o("p",[e._v("f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.")]),e._v(" "),o("p",[e._v("g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.")]),e._v(" "),o("p",[e._v("h. Half of all rewards of the ambassador's nodes are rewarded to ambassador(for he need to pay the node server cost and he shall get the rewards of 20,000 NULS he is staking on this nodes). And the other half must be used as development fund of ambassador for community development.")]),e._v(" "),o("p",[e._v("i.About the resignation of ambassador, if the ambassador is voluntarily resigned or subject to recall by the community, please ambassador return the remaining development fund of ambassador to the community fund.")]),e._v(" "),o("p",[e._v("j.The ambassador is a community contributor. If you need to initiate other community fund applications, please carry them out based on the community fund use and management process.")]),e._v(" "),e._m(8),e._v(" "),o("p",[e._v("a. Publish the work report for the previous month and the work plan for the next month:")]),e._v(" "),o("p",[e._v("Please post on the NULS forum: "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!")]),e._v(" "),o("p",[e._v("c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.")]),e._v(" "),o("p",[e._v("Final Tribute to your efforts:")]),e._v(" "),o("p",[e._v("• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.")]),e._v(" "),o("p",[e._v("• Start your work of community-building and outreach!")]),e._v(" "),o("p",[e._v("• Help NULS dock more DApps!")]),e._v(" "),o("p",[e._v("• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.")]),e._v(" "),o("p",[e._v("For all ambassador related discussions, please post on the NULS forum at "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("Welcome to the NULS community! Let’s work together to create a brighter future for NULS!")]),e._v(" "),o("p",[e._v("If you can deliver more, we have these expectations of you:")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),o("p",[e._v("Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),o("p",[e._v("NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.")]),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),o("ol",[o("li",[e._v("NULS Ambassador Board (["),o("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[e._v("Click to enter"),o("OutboundLink")],1),e._v("]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.")]),e._v(" "),o("li",[e._v("You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.")]),e._v(" "),o("li",[e._v("If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.")]),e._v(" "),o("li",[e._v("Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.")]),e._v(" "),o("li",[e._v("You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.")]),e._v(" "),o("li",[e._v("If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.")]),e._v(" "),o("li",[e._v("If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).")]),e._v(" "),o("li",[e._v("Any suggestions, questions and ideas, and all work progress can be posted on the community forum "),o("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),o("OutboundLink")],1),e._v(".")])]),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),e._m(39),e._v(" "),e._m(40),e._v(" "),e._m(41)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-4-ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-4-ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-4 Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 4\n Title: Ambassadors participate in the election rules\n Author: Reaper Ran Penny \n Discussions-To: https://nuls.community/d/206-ambassadors-participate-in-the-election-rules-ncg-20181114\n Status: Last call\n Type: Process\n Created: 2019-2-15\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction-of-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction-of-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction of NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-duties-and-compensation-for-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-duties-and-compensation-for-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Duties and Compensation for NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-how-to-participate-in-the-election"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-how-to-participate-in-the-election","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. How to participate in the election")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("3. Share the story of NULS to the community;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("8. Help NULS with publicity and be committed to NULS press releases through your local media.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassador-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassador-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Ambassador Guide")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preface"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preface","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Preface")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Transparency")]),this._v(" "),t("li",[this._v("Freedom")]),this._v(" "),t("li",[this._v("Autonomy")]),this._v(" "),t("li",[this._v("Evolution")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"the-vision-of-the-nuls-project-is-based-on-the-following-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-vision-of-the-nuls-project-is-based-on-the-following-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" The vision of the NULS project is based on the following mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Making blockchain technology easy and simple")]),this._v(" "),t("li",[this._v("Breaking through the bottleneck of blockchain performance and adoption")]),this._v(" "),t("li",[this._v("Reducing the cost of using blockchain technology")]),this._v(" "),t("li",[this._v("Increasing security and reliability of data")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-you-will-obtain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-you-will-obtain","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, you will obtain")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.")]),this._v(" "),t("li",[this._v("Rewards produced by one node. Rewards are used to develop the local NULS community.")]),this._v(" "),t("li",[this._v("Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.")]),this._v(" "),t("li",[this._v("The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-your-mission-is"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-your-mission-is","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, Your Mission is")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A. Community Development")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Let others know about NULS via Internet or offline communications.")]),e._v(" "),o("li",[e._v("Organize some NULS fans or volunteers to promote the technology and concepts of NULS.")]),e._v(" "),o("li",[e._v("Share the development from other areas of the NULS community with your local community.")]),e._v(" "),o("li",[e._v("Continuously share the progress, planning, news, etc. of the NULS project to the local community.")]),e._v(" "),o("li",[e._v("Contact local media and forums to help NULS publicize presentations or news.")]),e._v(" "),o("li",[e._v("Share the story of NULS with the local community.")]),e._v(" "),o("li",[e._v("Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.")]),e._v(" "),o("li",[e._v("Share videos or other content produced by the team in the local language of the people in your country/region.")]),e._v(" "),o("li",[e._v("If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.")]),e._v(" "),o("li",[e._v("Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("B.")]),this._v(" "),t("strong",[this._v("Community Activities")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.")]),e._v(" "),o("li",[e._v("Participate in any possible cryptocurrency gatherings in your area and represent NULS.")]),e._v(" "),o("li",[e._v("Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.")]),e._v(" "),o("li",[e._v("Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.")]),e._v(" "),o("li",[e._v("Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"get-started-with-everything-you-need-here"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#get-started-with-everything-you-need-here","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Get Started With Everything You Need Here")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"recruit-volunteers-to-organize-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recruit-volunteers-to-organize-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Recruit Volunteers to Organize Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.")]),this._v(" "),t("li",[this._v("Organize some offline meet-ups.")]),this._v(" "),t("li",[this._v("Introduce more blockchain investors to NULS and guide them towards investing in NULS.")]),this._v(" "),t("li",[this._v("Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"develop-a-local-nuls-ecology"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#develop-a-local-nuls-ecology","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Develop a Local NULS Ecology")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.")]),this._v(" "),t("li",[this._v("Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.")]),this._v(" "),t("li",[this._v("If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"spread-the-concepts-and-features-of-nuls-technology-with-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#spread-the-concepts-and-features-of-nuls-technology-with-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Spread the Concepts and Features of NULS Technology with Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.")]),this._v(" "),t("li",[this._v("Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.")]),this._v(" "),t("li",[this._v("Use local mainstream media websites to spread the news and progress of NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nulstar-guidelines-and-duties"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nulstar-guidelines-and-duties","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("NULStar Guidelines And Duties")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Requirements for becoming a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.")]),this._v(" "),t("li",[this._v("Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.")]),this._v(" "),t("li",[this._v("Must live in a city with over 350k population.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Duties of a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.")]),this._v(" "),t("li",[this._v("Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Rewards for NULStars")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.")]),this._v(" "),t("li",[this._v("NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.")])])}],!1,null,null,null);s.options.__file="NIP-4.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/117.4c9dc648.js b/docs/.vuepress/dist/assets/js/117.4c9dc648.js new file mode 100644 index 00000000..dbdaaf1e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/117.4c9dc648.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[117],{982:function(t,e,i){"use strict";i.r(e);var n=i(0),s=Object(n.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("p",[t._v("NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),i("p",[t._v("All NIP files are available through NULS's github:"),i("a",{attrs:{href:"https://github.com/nuls-io/NIPs",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/NIPs"),i("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"what-is-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" What is NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"reasons-for-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#reasons-for-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Reasons for NIP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.")])]),this._v(" "),e("li",[e("p",[this._v("For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"get-all-the-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-all-the-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Get all the NIP")])}],!1,null,null,null);s.options.__file="NIPIntroduction.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/118.83070636.js b/docs/.vuepress/dist/assets/js/118.83070636.js new file mode 100644 index 00000000..238bcf55 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/118.83070636.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[118],{980:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"content"},[this._m(0),this._v(" "),s("NavBars")],1)},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls-portal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls-portal","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Portal")])}],!1,null,null,null);n.options.__file="NULSNav.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/119.665c7995.js b/docs/.vuepress/dist/assets/js/119.665c7995.js new file mode 100644 index 00000000..797a3340 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/119.665c7995.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[119],{976:function(e,t,r){"use strict";r.r(t);var a=r(0),n=Object(a.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432"),r("OutboundLink")],1)])]),e._v(" "),e._m(2),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/zh-cn/categories/115000056052"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/en-us/categories/115000056052"),r("OutboundLink")],1)])]),e._v(" "),e._m(3),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.okex.com/hc/zh-cn/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/zh-cn/categories/115000275231"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.okex.com/hc/en-us/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/en-us/categories/115000275231"),r("OutboundLink")],1)])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"trading-guide-for-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trading-guide-for-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" Trading guide for NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-huobi-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-huobi-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for Huobi platform")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-binance-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-binance-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for Binance platform")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"trade-guide-for-okex-platform"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#trade-guide-for-okex-platform","aria-hidden":"true"}},[this._v("#")]),this._v(" Trade guide for OKEX platform")])}],!1,null,null,null);n.options.__file="NULSTransaction.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/12.02dfbd69.js b/docs/.vuepress/dist/assets/js/12.02dfbd69.js new file mode 100644 index 00000000..9b7b3371 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/12.02dfbd69.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{528:function(t,e,s){t.exports=s.p+"assets/img/Install.33ff9464.jpg"},529:function(t,e,s){t.exports=s.p+"assets/img/Install2.23136d69.jpg"},530:function(t,e,s){t.exports=s.p+"assets/img/Install3.145b9c4e.jpg"},531:function(t,e,s){t.exports=s.p+"assets/img/createProject.e78abf06.jpg"},532:function(t,e,s){t.exports=s.p+"assets/img/createProject2.b7246453.jpg"},533:function(t,e,s){t.exports=s.p+"assets/img/code.785ccdb5.jpg"},534:function(t,e,s){t.exports=s.p+"assets/img/Deploy.0f2d2d88.jpg"},535:function(t,e,s){t.exports=s.p+"assets/img/Add.e1d751e6.jpg"},536:function(t,e,s){t.exports=s.p+"assets/img/Add3.fbd88d0f.jpg"},537:function(t,e,s){t.exports=s.p+"assets/img/Add5.dfc1a6d7.jpg"},538:function(t,e,s){t.exports=s.p+"assets/img/package.6fff1f40.jpg"},539:function(t,e,s){t.exports=s.p+"assets/img/package1.e07eba9a.jpg"},540:function(t,e,s){t.exports=s.p+"assets/img/package3.e7db1454.jpg"},541:function(t,e,s){t.exports=s.p+"assets/img/package2.698a4145.jpg"},542:function(t,e,s){t.exports=s.p+"assets/img/package4.a9a579bf.jpg"},543:function(t,e,s){t.exports=s.p+"assets/img/Deploy2.ccca3cbd.jpg"},544:function(t,e,s){t.exports=s.p+"assets/img/Deploy3.131a59dc.jpg"},545:function(t,e,s){t.exports=s.p+"assets/img/Deploy4.ebcdade6.jpg"},546:function(t,e,s){t.exports=s.p+"assets/img/Deploy5.37a2c168.jpg"},547:function(t,e,s){t.exports=s.p+"assets/img/Deploy6.f4b26eb1.jpg"},548:function(t,e,s){t.exports=s.p+"assets/img/Deploy7.e33e7d01.jpg"},894:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"idea插件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#idea插件","aria-hidden":"true"}},[this._v("#")]),this._v(" IDEA插件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-在idea安装nuls插件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-在idea安装nuls插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 在IDEA安装NULS插件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(528),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("选择之前获取到的ZIP包,然后点击OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(529),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("勾选上NULS插件,点击Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(530),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-创建一个nuls项目"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-创建一个nuls项目","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 创建一个NULS项目")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(531),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(532),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-编写智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-编写智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 编写智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(533),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-设置部署合约的节点和账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-设置部署合约的节点和账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 设置部署合约的节点和账户")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("点击右方的NULS插件,调出NULS插件面板")]),t._v(" "),a("p",[a("img",{attrs:{src:s(534),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址")]),t._v(" "),a("p",[t._v("点击面板左上角的+号,选择Add Node")]),t._v(" "),a("p",[a("img",{attrs:{src:s(535),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("输入Node地址,点击OK")]),t._v(" "),a("p",[a("img",{attrs:{src:s(536),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK")]),t._v(" "),a("p",[a("img",{attrs:{src:s(537),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-打包合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-打包合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 打包合约")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码")]),t._v(" "),a("p",[a("img",{attrs:{src:s(538),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤)")]),t._v(" "),a("p",[a("img",{attrs:{src:s(539),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面")]),t._v(" "),a("p",[a("img",{attrs:{src:s(540),alt:"code"}})]),t._v(" "),a("p",[a("img",{attrs:{src:s(541),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-部署合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-部署合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 部署合约")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径")]),t._v(" "),a("p",[a("img",{attrs:{src:s(542),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("紧接JarFilePath的参数为该合约构造函数的参数")]),t._v(" "),a("p",[a("img",{attrs:{src:s(543),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败")]),t._v(" "),a("p",[a("img",{attrs:{src:s(544),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息")]),t._v(" "),a("p",[a("img",{attrs:{src:s(545),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功")]),t._v(" "),a("p",[a("img",{attrs:{src:s(546),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("可在面板上方查看已部署的合约")]),t._v(" "),a("p",[a("img",{attrs:{src:s(547),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击部署成功的合约,可查看该合约的所有方法")]),t._v(" "),a("p",[a("img",{attrs:{src:s(548),alt:"code"}})])])])}],r=s(0),i=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("获取NULS插件"),s("OutboundLink")],1),t._v("ZIP包,存放在磁盘\n点击File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("输入Project名,点击finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("智能合约代码编写可查看"),s("a",{attrs:{href:"http://dev.nuls.io/contract/",target:"_blank",rel:"noopener noreferrer"}},[t._v("开发者文档"),s("OutboundLink")],1)]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},a,!1,null,null,null);i.options.__file="ideaPlugin.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/120.214bbe7a.js b/docs/.vuepress/dist/assets/js/120.214bbe7a.js new file mode 100644 index 00000000..ae7076f6 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/120.214bbe7a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{974:function(e,t,s){"use strict";s.r(t);var a=s(0),r=Object(a.a)({},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),s("p",[e._v("The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.")]),e._v(" "),e._m(2),e._v(" "),s("p",[s("router-link",{attrs:{to:"/NULS2.0/"}},[e._v("Have a try")])],1)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"welcome-to-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#welcome-to-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" Welcome to NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("blockquote",[t("p",[this._v("NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nuls2-0-alpha-version-is-released"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha-version-is-released","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha Version is released")])}],!1,null,null,null);r.options.__file="README.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/121.bf9971ed.js b/docs/.vuepress/dist/assets/js/121.bf9971ed.js new file mode 100644 index 00000000..7978bd26 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/121.bf9971ed.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{972:function(e,t,o){"use strict";o.r(t);var a=o(0),s=Object(a.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(2),e._v(" "),o("p",[e._v("a. A candidate for the NULS ambassador is required to create a NULS node.")]),e._v(" "),o("p",[e._v("b. A candidate is required to agree with the values of NULS, understand the core knowledge of NULS, and respect members of the NULS community.")]),e._v(" "),o("p",[e._v("c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.")]),e._v(" "),o("p",[e._v("d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.")]),e._v(" "),o("p",[e._v("f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.")]),e._v(" "),o("p",[e._v("g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.")]),e._v(" "),o("p",[e._v("h. NULS ambassadors can apply for a budget from the NULS Foundation for major developments. The budget is open to all community members, and a budget vote will be initiated for it. The voting period is 15 days, and if the voting volume exceeds 10 million NULS tokens, and the supporting votes reach 70% or higher, the vote is considered passed and the NULS Foundation will execute.")]),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("a. Publish the work report for the previous month and the work plan for the next month:")]),e._v(" "),o("p",[e._v("Please post on the NULS forum: "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!")]),e._v(" "),o("p",[e._v("c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.")]),e._v(" "),o("p",[e._v("Final Tribute to your efforts:")]),e._v(" "),o("p",[e._v("• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.")]),e._v(" "),o("p",[e._v("• Start your work of community-building and outreach!")]),e._v(" "),o("p",[e._v("• Help NULS dock more DApps!")]),e._v(" "),o("p",[e._v("• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.")]),e._v(" "),o("p",[e._v("For all ambassador related discussions, please post on the NULS forum at "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("Welcome to the NULS community! Let’s work together to create a brighter future for NULS!")]),e._v(" "),o("p",[e._v("If you can deliver more, we have these expectations of you:")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),o("p",[e._v("Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),o("p",[e._v("NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.")]),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),o("ol",[o("li",[e._v("NULS Ambassador Board (["),o("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[e._v("Click to enter"),o("OutboundLink")],1),e._v("]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.")]),e._v(" "),o("li",[e._v("You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.")]),e._v(" "),o("li",[e._v("If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.")]),e._v(" "),o("li",[e._v("Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.")]),e._v(" "),o("li",[e._v("You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.")]),e._v(" "),o("li",[e._v("If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.")]),e._v(" "),o("li",[e._v("If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).")]),e._v(" "),o("li",[e._v("Any suggestions, questions and ideas, and all work progress can be posted on the community forum "),o("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),o("OutboundLink")],1),e._v(".")])]),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction-of-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction-of-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction of NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-duties-and-compensation-for-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-duties-and-compensation-for-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Duties and Compensation for NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-how-to-participate-in-the-election"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-how-to-participate-in-the-election","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. How to participate in the election")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("3. Share the story of NULS to the community;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("8. Help NULS with publicity and be committed to NULS press releases through your local media.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassador-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassador-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Ambassador Guide")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preface"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preface","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Preface")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Transparency")]),this._v(" "),t("li",[this._v("Freedom")]),this._v(" "),t("li",[this._v("Autonomy")]),this._v(" "),t("li",[this._v("Evolution")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"the-vision-of-the-nuls-project-is-based-on-the-following-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-vision-of-the-nuls-project-is-based-on-the-following-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" The vision of the NULS project is based on the following mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Making blockchain technology easy and simple")]),this._v(" "),t("li",[this._v("Breaking through the bottleneck of blockchain performance and adoption")]),this._v(" "),t("li",[this._v("Reducing the cost of using blockchain technology")]),this._v(" "),t("li",[this._v("Increasing security and reliability of data")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-you-will-obtain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-you-will-obtain","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, you will obtain")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.")]),this._v(" "),t("li",[this._v("Rewards produced by one node. Rewards are used to develop the local NULS community.")]),this._v(" "),t("li",[this._v("Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.")]),this._v(" "),t("li",[this._v("The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-your-mission-is"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-your-mission-is","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, Your Mission is")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A. Community Development")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Let others know about NULS via Internet or offline communications.")]),e._v(" "),o("li",[e._v("Organize some NULS fans or volunteers to promote the technology and concepts of NULS.")]),e._v(" "),o("li",[e._v("Share the development from other areas of the NULS community with your local community.")]),e._v(" "),o("li",[e._v("Continuously share the progress, planning, news, etc. of the NULS project to the local community.")]),e._v(" "),o("li",[e._v("Contact local media and forums to help NULS publicize presentations or news.")]),e._v(" "),o("li",[e._v("Share the story of NULS with the local community.")]),e._v(" "),o("li",[e._v("Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.")]),e._v(" "),o("li",[e._v("Share videos or other content produced by the team in the local language of the people in your country/region.")]),e._v(" "),o("li",[e._v("If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.")]),e._v(" "),o("li",[e._v("Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("B.")]),this._v(" "),t("strong",[this._v("Community Activities")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.")]),e._v(" "),o("li",[e._v("Participate in any possible cryptocurrency gatherings in your area and represent NULS.")]),e._v(" "),o("li",[e._v("Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.")]),e._v(" "),o("li",[e._v("Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.")]),e._v(" "),o("li",[e._v("Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"get-started-with-everything-you-need-here"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#get-started-with-everything-you-need-here","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Get Started With Everything You Need Here")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"recruit-volunteers-to-organize-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recruit-volunteers-to-organize-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Recruit Volunteers to Organize Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.")]),this._v(" "),t("li",[this._v("Organize some offline meet-ups.")]),this._v(" "),t("li",[this._v("Introduce more blockchain investors to NULS and guide them towards investing in NULS.")]),this._v(" "),t("li",[this._v("Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"develop-a-local-nuls-ecology"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#develop-a-local-nuls-ecology","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Develop a Local NULS Ecology")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.")]),this._v(" "),t("li",[this._v("Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.")]),this._v(" "),t("li",[this._v("If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"spread-the-concepts-and-features-of-nuls-technology-with-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#spread-the-concepts-and-features-of-nuls-technology-with-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Spread the Concepts and Features of NULS Technology with Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.")]),this._v(" "),t("li",[this._v("Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.")]),this._v(" "),t("li",[this._v("Use local mainstream media websites to spread the news and progress of NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nulstar-guidelines-and-duties"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nulstar-guidelines-and-duties","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("NULStar Guidelines And Duties")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Requirements for becoming a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.")]),this._v(" "),t("li",[this._v("Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.")]),this._v(" "),t("li",[this._v("Must live in a city with over 350k population.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Duties of a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.")]),this._v(" "),t("li",[this._v("Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Rewards for NULStars")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.")]),this._v(" "),t("li",[this._v("NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.")])])}],!1,null,null,null);s.options.__file="ambassadorRules.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/122.7560b52a.js b/docs/.vuepress/dist/assets/js/122.7560b52a.js new file mode 100644 index 00000000..29dcef23 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/122.7560b52a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[122],{970:function(e,t,i){"use strict";i.r(t);var o=i(0),n=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.")]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.")]),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),i("p",[e._v("20,000,000 NULS from the NULS and entrusted revenues from the contributors.")]),e._v(" "),e._m(7),e._v(" "),i("p",[e._v("The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.")]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),i("p",[e._v("As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.")]),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),i("p",[e._v("The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.")]),e._v(" "),e._m(21),e._v(" "),i("p",[e._v("We stick to the following philosophy in the technology community:")]),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),i("p",[e._v("The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).")]),e._v(" "),i("p",[e._v("The process of joining CCC is:")]),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),i("p",[e._v("Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at "),i("strong",[i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),i("OutboundLink")],1)]),e._v(".")]),e._v(" "),e._m(32),e._v(" "),i("p",[e._v("Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.")]),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),i("p",[e._v("Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.")]),e._v(" "),e._m(35),e._v(" "),i("p",[e._v("The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.")]),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),e._m(39),e._v(" "),e._m(40),e._v(" "),e._m(41),e._v(" "),i("p",[e._v("We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:")]),e._v(" "),i("p",[e._v("NULS community website: "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),i("OutboundLink")],1)]),e._v(" "),i("p",[e._v("Feedback post: "),i("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/132-we-need-your-suggestions"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-nuls-community-profile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-nuls-community-profile","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. NULS Community Profile")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.")]),this._v(" NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-objectives-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-objectives-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I)")]),this._v(" "),t("strong",[this._v("Objectives")]),this._v(" "),t("strong",[this._v("of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Code writing")]),this._v(" "),t("li",[this._v("Applications development")]),this._v(" "),t("li",[this._v("Operation and promotion")]),this._v(" "),t("li",[this._v("Other actions in favor of NULS community ecology development")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-source-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-source-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Source of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-management-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-management-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Management of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-appointment-of-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-appointment-of-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Appointment of Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers "),t("strong",[this._v("(developer council member)")]),this._v(" elected based on a ballot participated by all developers; and 7 members elected by ballot within the community "),t("strong",[this._v("(standing council member)")]),this._v(". The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.")]),this._v(" "),t("li",[this._v("Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.")]),this._v(" "),t("li",[this._v("Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.")]),this._v(" "),t("li",[this._v("Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-rights-and-responsibilities-of-council-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-rights-and-responsibilities-of-council-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Rights and responsibilities of Council member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:")]),this._v(" "),t("p",[this._v("(1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.")])]),e._v(" "),i("li",[i("p",[e._v("Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.")]),e._v(" "),i("p",[e._v("(2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of lower node agency commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of transfer commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of contract call commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of Council member proposal commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of adjustable system parameter in other systems.")]),e._v(" "),i("p",[e._v("(3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.")])]),e._v(" "),i("li",[i("p",[e._v("Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.")])]),e._v(" "),i("li",[i("p",[e._v("Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.")])]),e._v(" "),i("li",[i("p",[e._v("Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"2"}},[t("li",[this._v("Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.")]),this._v(" "),t("li",[this._v("Responsibilities of Council member.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Council member shall communicate with the community in good time.")])]),this._v(" "),t("li",[t("p",[this._v("Act in strict accordance with the community’s Constitution.")])]),this._v(" "),t("li",[t("p",[this._v("Share the same vision and purpose with NULS.")])]),this._v(" "),t("li",[t("p",[this._v("Take it as its own mission to protect community members’ interests.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note:")]),this._v(" "),t("strong",[this._v("All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-code-craft-council-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. CODE CRAFT COUNCIL (CCC)")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-philosophy-of-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-philosophy-of-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Philosophy of the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Equal: the technology community and core team are equal and work together for joint development.")])]),this._v(" "),t("li",[t("p",[this._v("Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.")])]),this._v(" "),t("li",[t("p",[this._v("Sharing:")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("The whole community shares the achievements of NULS technology.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares the development dividend of NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares NULS’s influence and reputation.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares the technical innovation brought by NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares NULS’s standard establishment to promote industry development.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[t("p",[this._v("Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.")])]),this._v(" "),t("li",[t("p",[this._v("Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-appointment-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-appointment-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Appointment of the CCC member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.")]),this._v(" "),t("li",[this._v("Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.")]),this._v(" "),t("li",[this._v("Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.")]),this._v(" "),t("li",[this._v("After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iv-rights-and-responsibilities-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-rights-and-responsibilities-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(IV) Rights and responsibilities of the CCC member")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ol",[i("li",[i("p",[e._v("NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.")])]),e._v(" "),i("li",[i("p",[e._v("The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.")])]),e._v(" "),i("li",[i("p",[e._v("After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.")])]),e._v(" "),i("li",[i("p",[e._v("Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.")])]),e._v(" "),i("li",[i("p",[e._v("The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-contributor-for-campaign"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-contributor-for-campaign","aria-hidden":"true"}},[this._v("#")]),this._v(" (I) Contributor for campaign")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-permanent-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-permanent-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" (II) Permanent contributor")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vi-project-budget"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vi-project-budget","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VI. Project Budget")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-with-respect-to-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-with-respect-to-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) With respect to contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-with-respect-to-other-transaction-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-with-respect-to-other-transaction-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) With respect to other transaction funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vii-other-votes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vii-other-votes","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VII. Other votes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-start-a-vote"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-start-a-vote","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Start a vote")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("The Council member shall start a vote and only the transaction fee is required.")])]),this._v(" "),t("li",[t("p",[this._v("Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-vote-by-proxy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-vote-by-proxy","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Vote by proxy")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.")])]),this._v(" "),t("li",[t("p",[this._v("Any NULS user can be an agent.")])]),this._v(" "),t("li",[t("p",[this._v("Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.")])]),this._v(" "),t("li",[t("p",[this._v("The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"viii-feedback"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viii-feedback","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VIII.")]),this._v(" Feedback")])}],!1,null,null,null);n.options.__file="communityConstitution.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/123.1d267c1f.js b/docs/.vuepress/dist/assets/js/123.1d267c1f.js new file mode 100644 index 00000000..920c988f --- /dev/null +++ b/docs/.vuepress/dist/assets/js/123.1d267c1f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[123],{968:function(e,t,a){"use strict";a.r(t);var n=a(0),o=Object(n.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),e._m(2),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),a("p",[e._v("Community Fund Account Address:")]),e._v(" "),a("p",[a("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[e._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.")]),e._v(" "),a("p",[e._v("The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.")]),e._v(" "),e._m(3),e._v(" "),a("p",[e._v("**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),a("p",[e._v("All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.")]),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),a("p",[e._v("The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.")]),e._v(" "),e._m(10),e._v(" "),a("p",[e._v("The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.")]),e._v(" "),e._m(11),e._v(" "),a("p",[e._v("Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.")]),e._v(" "),e._m(12),e._v(" "),a("p",[e._v("Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),a("p",[e._v("(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;")]),e._v(" "),a("p",[e._v("(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;")]),e._v(" "),a("p",[e._v("(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;")]),e._v(" "),a("p",[e._v("(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;")]),e._v(" "),a("p",[e._v("(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;")]),e._v(" "),a("p",[e._v("(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;")]),e._v(" "),e._m(15),e._v(" "),a("p",[e._v("(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;")]),e._v(" "),a("p",[e._v("(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;")]),e._v(" "),a("p",[e._v("(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;")]),e._v(" "),a("p",[e._v("(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.")]),e._v(" "),e._m(16),e._v(" "),a("p",[e._v("(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;")]),e._v(" "),a("p",[e._v("(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).")]),e._v(" "),e._m(17),e._v(" "),a("p",[e._v("All community discussion suggestions are made at "),a("a",{attrs:{href:"https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),a("OutboundLink")],1),e._v(" .")]),e._v(" "),a("p",[e._v("This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.")]),e._v(" "),a("p",[e._v("Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.")]),e._v(" "),a("p",[e._v("The specific node generates revenue with reference to the NULS POC consensus mechanism.")]),e._v(" "),e._m(18),e._v(" "),a("p",[e._v("Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),e._v(" "),a("p",[e._v("CCC Members")]),e._v(" "),a("p",[e._v("Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),e._v(" "),a("p",[e._v("Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),e._v(" "),a("p",[e._v("Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),e._v(" "),a("p",[e._v("Berzeck’s staking – Same as above")]),e._v(" "),a("p",[e._v("Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),e._v(" "),a("p",[e._v("Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),e._v(" "),a("p",[e._v("Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),e._v(" "),a("p",[e._v("Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),e._v(" "),a("p",[e._v("Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),e._v(" "),a("p",[e._v("Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),e._v(" "),a("p",[e._v("Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),e._v(" "),a("p",[e._v("Moshe’s staking – Same as above")]),e._v(" "),a("p",[e._v("Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),e._v(" "),a("p",[e._v("Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png",alt:"img"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-community-fund-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-community-fund-management","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. Community Fund Management")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-the-application-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-the-application-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. The Application Member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-ordinary-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-ordinary-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Ordinary Members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-contributor-role"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-contributor-role","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Contributor Role")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. "),t("strong",[this._v("The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.")]),this._v(" The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-the-type-of-application"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-the-type-of-application","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. The Type of Application")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-proposal-to-pay-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-proposal-to-pay-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Proposal to Pay Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-proposal-budget-item"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-proposal-budget-item","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Proposal Budget Item")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-the-proposal-to-create-a-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-the-proposal-to-create-a-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. The Proposal to Create a Node")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("4. Proposal Entrusted Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-the-application-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-the-application-process","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. The Application Process")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-the-plan-is-openly-and-thoroughly-discussed"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-the-plan-is-openly-and-thoroughly-discussed","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. The Plan is Openly and Thoroughly Discussed")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-council-member-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-council-member-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Council Member Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-foundation-implementation-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-foundation-implementation-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. Foundation Implementation Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-process-explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-process-explanation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Process Explanation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"attachment-current-contributor-role-delegation-and-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#attachment-current-contributor-role-delegation-and-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Attachment: Current Contributor Role Delegation and Node:")])])}],!1,null,null,null);o.options.__file="communityFund.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/124.f5bbb448.js b/docs/.vuepress/dist/assets/js/124.f5bbb448.js new file mode 100644 index 00000000..5c9e3cd8 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/124.f5bbb448.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[124],{966:function(t,e,i){"use strict";i.r(e);var n=i(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),i("p",[t._v("Although the main network is now in a stable state of operation, in order to cope with changes, the development of the main network is still in progress. We need the help of the community to solve the challenges in the development of the main network and improve the NULS blockchain infrastructure together. We urge developers in the community to join us and contribute, and your efforts will be rewarded.")]),t._v(" "),i("ul",[i("li",[t._v("How to join the tech community:"),i("a",{attrs:{href:"https://nuls.io/developer",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/developer"),i("OutboundLink")],1)]),t._v(" "),i("li",[t._v("NULS Github:"),i("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io"),i("OutboundLink")],1)])]),t._v(" "),t._m(3),t._v(" "),i("p",[t._v("In the software development process, although there are strict tests, we still can't avoid bugs in the program. So if you find bugs in the process of using our application or developing, please timely feedback to us, and we will actively deal with them. There are three ways to feed back bugs:")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Feedback through "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("community forum"),i("OutboundLink")],1)]),t._v(" "),t._m(4)]),t._v(" "),t._m(5),t._v(" "),t._m(6)]),t._v(" "),t._m(7),t._v(" "),i("p",[t._v("NULS formulated the document writing incentive plan, invited the community to write NULS related documents together, and gave corresponding rewards according to the efforts of community members.")]),t._v(" "),t._m(8),t._v(" "),i("p",[t._v("As a global open source blockchain project, NULS needs a lot of bilingual documents in Chinese and English. If you are a professional in this field, we really need your help.")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"how-to-contribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-contribute","aria-hidden":"true"}},[this._v("#")]),this._v(" How to contribute")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The development of NULS is inseparable from the community and requires the participation of community members. We provide different ways for community members to participate, and you can choose what you are good at to contribute to NULS. For each contributor, the name of the contributor is published with its consent (we also attach the node name if the node is owned)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"join-the-mainnet-development"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#join-the-mainnet-development","aria-hidden":"true"}},[this._v("#")]),this._v(" Join the Mainnet development")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"report-bugs"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#report-bugs","aria-hidden":"true"}},[this._v("#")]),this._v(" Report bugs")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Mainnet:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs")]),this._v(" "),e("li",[this._v("Testnet:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Send email to support@nuls.io")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Direct feedback to the community manager or operations staff")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"write-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#write-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Write document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"translate-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#translate-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Translate document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"list-of-contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#list-of-contributors","aria-hidden":"true"}},[this._v("#")]),this._v(" List of contributors")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The rankings are arranged alphabetically, in no particular order")])])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("Name")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("Email")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("Node Alias/ID")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Angang Tang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("tangangang@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Albert")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("albert@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Charlie Li")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lichao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Cody Lan")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lanjinsheng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Davi Yang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("davi@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yuanchen Jiang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("jiangyuanchen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yifeng Qin")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("qinyifeng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Niels")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pierre Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("luohao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pen Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("pen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Siwei")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("13809668344@139.com")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("siwei")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Vivi Zhou")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("zhouwei@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])])])])}],!1,null,null,null);a.options.__file="howToContribute.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/125.376b8644.js b/docs/.vuepress/dist/assets/js/125.376b8644.js new file mode 100644 index 00000000..eeafe664 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/125.376b8644.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[125],{964:function(e,t,i){"use strict";i.r(t);var r=i(0),a=Object(r.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("Following the principles of pluggability, modularization and parallel expansion, NULS provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and usage, and to promote the application of blockchain in the commercial field and the interaction among chains")]),e._v(" "),i("p",[e._v('Upholding the "chain" as the core in the NULS development philosophy, NULS is striving for building its core product: "Chain Factory". In the meantime, NULS will realize the value circulation among chains through cross-chain module and build the ecosystem of blockchains.')]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("The NULS whitepaper is an authoritative report that addresses what NULS’ goal is and how we plan to achieve it.")]),e._v(" "),i("p",[i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NulsWhitepaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more from whitepaper"),i("OutboundLink")],1)]),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("The NULS yellowpaper is the technical detailed version of the whitepaper, which drills down into the underlying aspects of NULS.")]),e._v(" "),i("p",[i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more from Yellowpaper"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"what-is-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" What is NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"nuls-is-a-blockchain-infrastructure-for-customizable-services-driven-by-our-global-open-source-community"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-is-a-blockchain-infrastructure-for-customizable-services-driven-by-our-global-open-source-community","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-our-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-our-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Our Mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Provide flexible blockchain technology that supports a wide variety of enterprise applications")]),this._v(" "),t("li",[this._v("Efficient, high performance technology to solve bottlenecks")]),this._v(" "),t("li",[this._v("Promote usage of blockchain technology by reducing the barrier of entry development cost")]),this._v(" "),t("li",[this._v("Provide the most powerful system of trust through a decentralized network")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-whitepaper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-whitepaper","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Whitepaper")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-yellowpaper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-yellowpaper","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. Yellowpaper")])}],!1,null,null,null);a.options.__file="introduction.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/126.f44dfff9.js b/docs/.vuepress/dist/assets/js/126.f44dfff9.js new file mode 100644 index 00000000..4e65ffef --- /dev/null +++ b/docs/.vuepress/dist/assets/js/126.f44dfff9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[126],{962:function(e,t,o){"use strict";o.r(t);var n=o(0),i=Object(n.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),o("p",[e._v("NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology.")]),e._v(" "),o("p",[e._v("NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration.")]),e._v(" "),o("p",[e._v("In the community, we adhere to the following vision:")]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("NULS technical community is open for all developers.\nIf you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us:")]),e._v(" "),o("p",[e._v("Please join the NULS dev Telegram group:\n"),o("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ"),o("OutboundLink")],1)]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),o("p",[e._v("The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution.\nCurrently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool.\nNote: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well.")]),e._v(" "),e._m(6),e._v(" "),o("p",[e._v("Make it easy to build a blockchain!")]),e._v(" "),o("p",[e._v("First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life.\nThe NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository.")]),e._v(" "),o("p",[e._v("Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months.\nFor all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives.")]),e._v(" "),o("p",[e._v("Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more!")]),e._v(" "),e._m(7),e._v(" "),o("p",[e._v("A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently.\nB. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests.")]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),o("p",[e._v("We also strongly recommend you to learn more about NULS through these links below:")]),e._v(" "),o("ul",[o("li",[e._v("Official website: "),o("a",{attrs:{href:"https://nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.io/"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Code: "),o("a",{attrs:{href:"https://github.com/nuls-io/nuls",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Dev documents: "),o("a",{attrs:{href:"https://dev.nuls.io/docs/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://dev.nuls.io/docs/"),o("OutboundLink")],1)]),e._v(" "),o("li",[e._v("Community forum: "),o("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),o("OutboundLink")],1)])]),e._v(" "),e._m(10),e._v(" "),o("p",[o("a",{attrs:{href:"https://nuls.community/d/9-invitation-of-community-developers/4",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh"),o("OutboundLink")],1)]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),o("p",[o("a",{attrs:{href:"https://nuls.community/d/9-invitation-of-community-developers/4",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/9-invitation-of-community-developers/4"),o("OutboundLink")],1),e._v(" (Continuously updated)")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"invitation-of-community-developers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#invitation-of-community-developers","aria-hidden":"true"}},[this._v("#")]),this._v(" Invitation of community developers")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction")])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ul",[o("li",[o("strong",[e._v("Equal")]),e._v(": Members from both the technical community and the core dev team are equal and they shall work together.")]),e._v(" "),o("li",[o("strong",[e._v("Synergetic")]),e._v(": The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem.")]),e._v(" "),o("li",[o("strong",[e._v("Sharing")]),e._v(":\n"),o("ul",[o("li",[e._v("Technical achievements of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("Development bonuses of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("The influence and brand of NULS are shared with the community;")]),e._v(" "),o("li",[e._v("Technical innovation of NULS is shared with the whole industry;")])])]),e._v(" "),o("li",[e._v("All the industrial standards set by NULS are shared with the whole industry.")]),e._v(" "),o("li",[o("strong",[e._v("Fair")]),e._v(": Reward for each developer is based on his/her contribution.")]),e._v(" "),o("li",[o("strong",[e._v("Innovative")]),e._v(": A strong technical community is the guarantee for the innovation in the blockchain field.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-are-you-the-one"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-are-you-the-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Are you the one?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Notice")]),this._v(": We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground!")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-what-are-we-offering"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-what-are-we-offering","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. What are we offering?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_4-our-plan"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-our-plan","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Our plan")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_5-current-situation-of-the-technical-community"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-current-situation-of-the-technical-community","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. Current situation of the technical community")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_6-how-to-join-us"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-how-to-join-us","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. How to join us")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group.")]),this._v(" "),t("li",[this._v("Talk to our community developer Moshe. Briefly introduce your experience, background, etc.\nCommunity developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"3"}},[t("li",[this._v("You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[this._v("In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_7-refer-to-task-list"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-refer-to-task-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Refer to task list")])}],!1,null,null,null);i.options.__file="joinCCC.md";t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/127.4bfabc7b.js b/docs/.vuepress/dist/assets/js/127.4bfabc7b.js new file mode 100644 index 00000000..59712d42 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/127.4bfabc7b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[127],{960:function(t,e,o){"use strict";o.r(e);var n=o(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/overview/introduction.html"}},[t._v("Overview")])],1)]),t._v(" "),o("p",[t._v("This section can help readers unfamiliar with NULS understand what NULS is and what can be done")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/guide/GUIGuide.html"}},[t._v("Users guide")])],1)]),t._v(" "),o("p",[t._v("If you are a beginner, here is what you need.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/community/toolsGuide.html"}},[t._v("NULS community")])],1)]),t._v(" "),o("p",[t._v("Blockchain projects are always community-based, and here you can learn about all aspects of the NULS community")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/startNULS/sourceCodeStartNULS.html"}},[t._v("Launching NULS")])],1)]),t._v(" "),o("p",[t._v("Launch NULS to see what NULS can do, what different experiences NULS can bring to you")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/buildChain/buildPrivateChain.html"}},[t._v("Quickly building a chain")])],1)]),t._v(" "),o("p",[t._v("If you want to build a private chain, this section should help you")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/NULSInfrastructure/NULS2.0Introduction.html"}},[t._v("NULS2.0")])],1)]),t._v(" "),o("p",[t._v("What is the modular design? What is NULS2.0? This section will answer these questions one by one. It elaborates on the design concept of NULS and the design details of each module")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/smartContract/startSmartContract.html"}},[t._v("Smart contracts")])],1)]),t._v(" "),o("p",[t._v("Do you want to develop DAPPs or do other cool things based on smart contracts? This section is what you want. It includes developer documents, NRC standards, plug-ins, and some interesting contract examples.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/developerTools/sdk.html"}},[t._v("Developer tools")])],1)]),t._v(" "),o("p",[t._v("NULS has always been developer-friendly, and we continue to provide tools for developers. Developers can come here to see what they are.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/nips/NIPIntroduction.html"}},[t._v("NIPs")])],1)]),t._v(" "),o("p",[t._v("All related proposals of NULS are here, where you can learn more about NULS's protocals, regulations ,standards and etc.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"./nulsNav/NULSNav.html"}},[t._v("NULS portal")])],1)]),t._v(" "),o("p",[t._v("The NULS documentation portal is only a part of NULS. For more information and products about NULS Blockchain, you can find the access here.")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"documentation-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#documentation-structure","aria-hidden":"true"}},[this._v("#")]),this._v(" Documentation structure")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"this-documentation-consists-of-eight-sections"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#this-documentation-consists-of-eight-sections","aria-hidden":"true"}},[this._v("#")]),this._v(" This documentation consists of eight sections.")])}],!1,null,null,null);a.options.__file="structure.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/128.f1386192.js b/docs/.vuepress/dist/assets/js/128.f1386192.js new file mode 100644 index 00000000..ca61ff75 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/128.f1386192.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[128],{956:function(t,e,i){"use strict";i.r(e);var s=i(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"light-wallet-user-guide"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#light-wallet-user-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" Light wallet user guide")]),this._v(" "),e("p",[this._v("Community members are writing...")])])}],!1,null,null,null);n.options.__file="webGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/129.bc8e43b2.js b/docs/.vuepress/dist/assets/js/129.bc8e43b2.js new file mode 100644 index 00000000..89fdcf26 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/129.bc8e43b2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[129],{954:function(e,t,s){"use strict";s.r(t);var i=s(0),a=Object(i.a)({},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),s("p",[e._v("NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.")]),e._v(" "),e._m(3),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),s("p",[e._v("There are six types of NIP:")]),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),s("p",[e._v("Vetting an idea publicly before going as far as writing a NIP is meant to save your time. Asking the community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions. It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where NULS is used. We recommend that comments can be collected in the community via voting, and the results will also help the NIP editors to make quicker decisions on whether to merge the NIP.")]),e._v(" "),s("p",[e._v("A successful NIP requires the following stages:")]),e._v(" "),e._m(10),s("p",[e._v("Each change to the NIP status should be submitted by the NIP author as a pull request (PR), and the NIP editors will review the NIP. It's a good idea to add a link to the discussion post when you submit a PR.")]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),s("p",[e._v("Other exceptional statuses are:")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),s("p",[e._v("Each NIP should have the following parts:")]),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),s("p",[e._v("NIP should be written in markdown format.")]),e._v(" "),e._m(17),e._v(" "),s("p",[e._v("Each NIP must use the RFC 822 style as the head of the document. The headers must be arranged in the following order. The headers marked with * are optional, others are required.")]),e._v(" "),e._m(18),e._m(19),e._v(" "),s("p",[e._v('NIPs may include auxiliary files such as diagrams. Auxiliary files must be named NIP-XXXX-Y.ext, where "XXXX" is the NIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png").')]),e._v(" "),e._m(20),e._v(" "),s("p",[e._v("It occasionally becomes necessary to transfer ownership of NIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred NIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the NIP process or has fallen off the face of the 'net' (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the NIP. We try to build consensus around a NIP, but if that's not possible, you can always submit a competing NIP.")]),e._v(" "),s("p",[e._v("If you are interested in assuming ownership of a NIP, send a message asking to take over, addressed to both the original author and the NIP editors. If the original author doesn't respond to email in a timely manner, the NIP editors will make a unilateral decision (it's not like such decisions can't be reversed).")]),e._v(" "),e._m(21),e._v(" "),s("p",[e._v("The current NIP editors are:")]),e._v(" "),e._m(22),e._m(23),e._v(" "),s("p",[e._v("For each new NIP that comes in an editor does the following:")]),e._v(" "),e._m(24),e._v(" "),s("p",[e._v("If the NIP isn't ready, an editor will send it back to the author for revision, with specific instructions. Once the NIP is ready for the repository, a NIP editor will:")]),e._v(" "),e._m(25),e._v(" "),s("p",[e._v("Many NIPs are written and maintained by developers with write access to the NULS codebase. The NIP editors monitor NIP changes, and correct any structure, grammar, spelling, or markup mistakes they see. NIP editors don't pass judgment on NIPs. They merely do the administrative and editorial part.")]),e._v(" "),e._m(26),e._v(" "),s("p",[e._v("This document was derived heavily from Bitcoin's "),s("a",{attrs:{href:"https://github.com/bitcoin/bips",target:"_blank",rel:"noopener noreferrer"}},[e._v("Bitcoin's BIP-0001"),s("OutboundLink")],1),e._v(", written by Amir Taake, and the text he wrote was mainly from "),s("a",{attrs:{href:"https://www.python.org/dev/peps/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Python's PEP-0001"),s("OutboundLink")],1),e._v(". According to this situation, NIP makes some modifications based on their documents, such as adding the Council in the NIP process, modifying NIP types, etc. Please direct all comments to the NULS NIP editors.")]),e._v(" "),s("link",{attrs:{rel:"stylesheet",href:"https://use.fontawesome.com/releases/v5.0.13/css/all.css"}}),e._v(" "),s("p",[e._v("​")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-1-nip-purpose-and-guidelines"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-1-nip-purpose-and-guidelines","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-1 NIP Purpose and Guidelines")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("NIP: 1\nTitle: NIP Purpose and Guidelines\nStatus: Last call\nType: Process\nAuthor: Lin Yang \nCreated: 2018-12-27\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"what-is-a-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-a-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("What is a NIP?")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"reasons-for-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#reasons-for-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Reasons for NIP")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.")]),this._v(" "),t("li",[this._v("For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-types"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-types","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Types")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[e._v("A Core NIP describes improvements in the NULS core code, such as consensus mechanisms, network protocols, etc.")]),e._v(" "),s("li",[e._v("A Module NIP describes improvements in module submission and review requirements, such as the certain minimum criteria a NIP must meet to be accepted and merged into the module repository.")]),e._v(" "),s("li",[e._v("An Interface NIP describes improvements in the specifications and standards of the NULS client API/RPC, such as API name and method name.")]),e._v(" "),s("li",[e._v("An NRC Standards NIP describes improvements in application-level standards, such as contract standards, token standards, etc.")]),e._v(" "),s("li",[e._v("An Informational NIP describes a NULS design issue or provides general guidelines or information to the NULS community--but does not propose a new feature. Informational NIPs do not necessarily represent a NULS community consensus or recommendation, so users and implementers are free to ignore Informational NIPs or follow their advice.")]),e._v(" "),s("li",[e._v("A Process NIP describes improvements in all NULS-related operational processes, such as the ambassador election in the community. A Process NIP is not only a recommendation, but also a specification that community members need to follow to accomplish certain things, but it does not involve code-level specifications.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-work-flow"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-work-flow","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Work Flow")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("The parties involved in the workflow include some or all of the following roles:")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("p",[e._v("Most members of the community")]),e._v(" "),s("p",[e._v("The main responsibility is to participate in the discussion and voting of the NIPs, making constructive comments as well.")])]),e._v(" "),s("li",[s("p",[e._v("NIP Authors")]),e._v(" "),s("p",[e._v("Propose and improve NIPs and lead the community to discuss.")])]),e._v(" "),s("li",[s("p",[e._v("NIP Editors")]),e._v(" "),s("p",[e._v("Manage and edit NIPs.")])]),e._v(" "),s("li",[s("p",[e._v("NULS Council")]),e._v(" "),s("p",[e._v("The NIPs, about to “Final” or “Accepted”, can be rejected by the final decision of the Council via internal voting.")])]),e._v(" "),s("li",[s("p",[e._v("NULS Core Developers")]),e._v(" "),s("p",[e._v("They are responsible for the audit and code implementation of the Core, Module, NRC Standards and Interface NIPs.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" [ Draft ]->[ Last Call ]->[ Accepted ]->[ Final ]\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A complete NIP process is as follows:")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("p",[e._v("The NIP author writes the NIP using the mandated format and style and shepherds the discussions in the community. The NIP author should first attempt to ascertain whether the idea is NIP-able, and then submit the NIP as a PR to the NIP repository, including a link to the discussion post. The NIP editors will handle these requests based on actual situation.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Draft:")]),e._v(" Once approved, the NIP editors will assign the NIP a number and squash commit the pull request onto master. The NIP editors will not unreasonably deny a NIP.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Draft:")]),e._v(" Reasons for denying NIP status include being unfocused or too broad, duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the NULS philosophy.")])])]),e._v(" "),s("li",[s("p",[e._v("Updates to drafts may also be submitted by the author as pull requests before it can be considered mature enough and ready for the next status.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Last call")]),e._v(": Once approved, the NIP editors will change the NIP status from Draft to last call and set the end date for the last call, usually 15 days.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Last call")]),e._v(": Once the NIP has been published, it will be re-assigned to Draft status when necessary revisions are made on the NIP. We hope that a NIP will enter last call status only once to avoid unnecessary controversy in the community.")])])]),e._v(" "),s("li",[s("p",[e._v("The NIP in last call status will be pinned at https://nuls.community/")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Accepted (involved in Core, Module, NRC Standards and Interface NIPs only):")]),e._v(" If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Accepted” by the NIP editors.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Final (involved in Informational and Process NIPs only):")]),e._v(" If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Final” by the NIP editors.")]),e._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),e._v(" "),s("strong",[e._v("Last call:")]),e._v(" The NIP will be re-assigned to Draft status if there are material changes or technical issues raised by the community cannot be solved during the last call period. In addition, if the Council has different views on the NIP, a vote can be initiated within the Council members. If more than 70% of the Council members reject the NIP (giving reasons), the NIP will be re-assigned to “Draft” status or directly “Rejected” according to actual reasons.")])])]),e._v(" "),s("li",[s("p",[e._v("Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the NULS core developers must implement the NIPs in the form of code before they can be considered “Final”.")]),e._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),e._v(" "),s("strong",[e._v("Final (involved in Core, Module, NRC Standards and Interface NIPs only):")]),e._v(' After the NIP is implemented in the form of code, and is running on the main-net stably for certain amount of time or has become effectively verified, with changes recognized by the community as well, the status can be changed to "Final".')])])])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("strong",[e._v("Deferred:")]),e._v(" Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the developers do not complete the reference implementation as scheduled.")]),e._v(" "),s("li",[s("strong",[e._v("Rejected:")]),e._v(" A NIP can also be “Rejected”. Perhaps core developers reject to propose an implementation or the Council finds it unfeasible.")]),e._v(" "),s("li",[s("strong",[e._v("Superseded:")]),e._v(" A NIP used to “Final”, but it is no longer considered the most advanced. Another better NIP appears, referring to this NIP, and becomes the Final status.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"what-belongs-in-a-successful-nip"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-belongs-in-a-successful-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" What belongs in a successful NIP?")])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ul",[s("li",[s("strong",[e._v("Preamble:")]),e._v(" RFC 822 style headers containing meta-data about the NIP, including the NIP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. See NIP Header Preamble for details.")]),e._v(" "),s("li",[s("strong",[e._v("Summary:")]),e._v(" The NIP author needs to provide a simple and understandable summary of the NIP for the general public. If you can't explain it in a simple way, it means that you don't fully understand it.")]),e._v(" "),s("li",[s("strong",[e._v("Abstract:")]),e._v("  A short (~200 word) description of the technical issue being addressed.")]),e._v(" "),s("li",[s("strong",[e._v("Motivation:")]),e._v(" The motivation is critical for NIPs that want to change the NULS protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the NIP solves. NIP submissions without sufficient motivation may be rejected outright.")]),e._v(" "),s("li",[s("strong",[e._v("Specification:")]),e._v(" The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current NULS platforms (NULS client, explorer).")]),e._v(" "),s("li",[s("strong",[e._v("Rationale:")]),e._v(" The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion.")]),e._v(" "),s("li",[s("strong",[e._v("Backwards Compatibility:")]),e._v(" All NIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The NIP must explain how the author proposes to deal with these incompatibilities. NIP submissions without a sufficient backwards compatibility treatise may be rejected outright.")]),e._v(" "),s("li",[s("strong",[e._v("Test Cases:")]),e._v(" For NIPs that affect the consensus mechanism, test cases for their implementation must be provided.")]),e._v(" "),s("li",[s("strong",[e._v("Reference Implementation:")]),e._v(' The reference implementation must be completed before any NIP is given status "Final", but it need not be completed before the NIP is accepted.')]),e._v(" "),s("li",[s("strong",[e._v("History:")]),e._v(" History records show the whole process of the NIP from being proposed to the Final state, which can be displayed as additional links.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-formats-and-templates"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-formats-and-templates","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Formats and Templates")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-header-preamble"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-header-preamble","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Header Preamble")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" Title: < NIP title>\n Author: \n* Discussions-To: < links to official discussion channels>\n Status: \n Type: \n Created: \n* Replaces: < NIP number>\n* Superseded-By: < NIP number>\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"auxiliary-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#auxiliary-files","aria-hidden":"true"}},[this._v("#")]),this._v(" Auxiliary Files")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"transferring-nip-ownership"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#transferring-nip-ownership","aria-hidden":"true"}},[this._v("#")]),this._v(" Transferring NIP Ownership")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-editors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-editors","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Editors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("Niels \nPen \n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nip-editor-responsibilities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-editor-responsibilities","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP Editor Responsibilities")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Read the NIP to check if it is ready: sound and complete. The ideas in the NIP must make technical sense, even if they don’t seem likely to be accepted.")]),this._v(" "),t("li",[this._v("The title should accurately describe the content.")]),this._v(" "),t("li",[this._v("Skim the NIP for obvious defects in language (spelling, grammar, sentence structure, etc.), markup (for Github style), and code style.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Assign a NIP number (usually a PR number)")]),this._v(" "),t("li",[this._v("Merge the pull request")]),this._v(" "),t("li",[this._v("Send email back to the NIP author with next steps")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#history","aria-hidden":"true"}},[this._v("#")]),this._v(" History")])}],!1,null,null,null);a.options.__file="NIP-1.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/13.6ff2f0d4.js b/docs/.vuepress/dist/assets/js/13.6ff2f0d4.js new file mode 100644 index 00000000..470c5767 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/13.6ff2f0d4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{564:function(t,e,s){t.exports=s.p+"assets/img/Install.33ff9464.jpg"},565:function(t,e,s){t.exports=s.p+"assets/img/Install2.23136d69.jpg"},566:function(t,e,s){t.exports=s.p+"assets/img/Install3.145b9c4e.jpg"},567:function(t,e,s){t.exports=s.p+"assets/img/createProject.e78abf06.jpg"},568:function(t,e,s){t.exports=s.p+"assets/img/createProject2.b7246453.jpg"},569:function(t,e,s){t.exports=s.p+"assets/img/code.785ccdb5.jpg"},570:function(t,e,s){t.exports=s.p+"assets/img/Deploy.0f2d2d88.jpg"},571:function(t,e,s){t.exports=s.p+"assets/img/Add.e1d751e6.jpg"},572:function(t,e,s){t.exports=s.p+"assets/img/Add3.fbd88d0f.jpg"},573:function(t,e,s){t.exports=s.p+"assets/img/Add5.dfc1a6d7.jpg"},574:function(t,e,s){t.exports=s.p+"assets/img/package.6fff1f40.jpg"},575:function(t,e,s){t.exports=s.p+"assets/img/package1.e07eba9a.jpg"},576:function(t,e,s){t.exports=s.p+"assets/img/package3.e7db1454.jpg"},577:function(t,e,s){t.exports=s.p+"assets/img/package2.698a4145.jpg"},578:function(t,e,s){t.exports=s.p+"assets/img/package4.a9a579bf.jpg"},579:function(t,e,s){t.exports=s.p+"assets/img/Deploy2.ccca3cbd.jpg"},580:function(t,e,s){t.exports=s.p+"assets/img/Deploy3.131a59dc.jpg"},581:function(t,e,s){t.exports=s.p+"assets/img/Deploy4.ebcdade6.jpg"},582:function(t,e,s){t.exports=s.p+"assets/img/Deploy5.37a2c168.jpg"},583:function(t,e,s){t.exports=s.p+"assets/img/Deploy6.f4b26eb1.jpg"},584:function(t,e,s){t.exports=s.p+"assets/img/Deploy7.e33e7d01.jpg"},864:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"idea插件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#idea插件","aria-hidden":"true"}},[this._v("#")]),this._v(" IDEA插件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-在idea安装nuls插件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-在idea安装nuls插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 在IDEA安装NULS插件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(564),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("选择之前获取到的ZIP包,然后点击OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(565),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("勾选上NULS插件,点击Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(566),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-创建一个nuls项目"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-创建一个nuls项目","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 创建一个NULS项目")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(567),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(568),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-编写智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-编写智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 编写智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(569),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-设置部署合约的节点和账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-设置部署合约的节点和账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 设置部署合约的节点和账户")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("点击右方的NULS插件,调出NULS插件面板")]),t._v(" "),a("p",[a("img",{attrs:{src:s(570),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址")]),t._v(" "),a("p",[t._v("点击面板左上角的+号,选择Add Node")]),t._v(" "),a("p",[a("img",{attrs:{src:s(571),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("输入Node地址,点击OK")]),t._v(" "),a("p",[a("img",{attrs:{src:s(572),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK")]),t._v(" "),a("p",[a("img",{attrs:{src:s(573),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-打包合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-打包合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 打包合约")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码")]),t._v(" "),a("p",[a("img",{attrs:{src:s(574),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤)")]),t._v(" "),a("p",[a("img",{attrs:{src:s(575),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面")]),t._v(" "),a("p",[a("img",{attrs:{src:s(576),alt:"code"}})]),t._v(" "),a("p",[a("img",{attrs:{src:s(577),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-部署合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-部署合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 部署合约")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径")]),t._v(" "),a("p",[a("img",{attrs:{src:s(578),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("紧接JarFilePath的参数为该合约构造函数的参数")]),t._v(" "),a("p",[a("img",{attrs:{src:s(579),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败")]),t._v(" "),a("p",[a("img",{attrs:{src:s(580),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息")]),t._v(" "),a("p",[a("img",{attrs:{src:s(581),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功")]),t._v(" "),a("p",[a("img",{attrs:{src:s(582),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("可在面板上方查看已部署的合约")]),t._v(" "),a("p",[a("img",{attrs:{src:s(583),alt:"code"}})])]),t._v(" "),a("li",[a("p",[t._v("点击部署成功的合约,可查看该合约的所有方法")]),t._v(" "),a("p",[a("img",{attrs:{src:s(584),alt:"code"}})])])])}],r=s(0),i=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("获取NULS插件"),s("OutboundLink")],1),t._v("ZIP包,存放在磁盘\n点击File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("输入Project名,点击finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("智能合约代码编写可查看"),s("a",{attrs:{href:"http://dev.nuls.io/contract/",target:"_blank",rel:"noopener noreferrer"}},[t._v("开发者文档"),s("OutboundLink")],1)]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},a,!1,null,null,null);i.options.__file="ideaPlugin.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/130.cacc4ae3.js b/docs/.vuepress/dist/assets/js/130.cacc4ae3.js new file mode 100644 index 00000000..0a7f8814 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/130.cacc4ae3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[130],{952:function(e,t,i){"use strict";i.r(t);var o=i(0),n=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),i("p",[e._v("Due to the development requirement of NULS and to better facilitate the favorable operation of the NULS community and to make blockchain technology easier with NULS, the NULS community will constantly seek and implement NULS community autonomy for the realization of self-governance and self-evolution. This Constitution is hereby formulated based on the NULS community culture and philosophy.")]),e._v(" "),i("p",[e._v("NULS community culture: openness, freedom, autonomy, evolution")]),e._v(" "),i("p",[e._v("NULS community philosophy: share, inherit, grow, innovate")]),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("NULS Foundation")]),e._v(" "),i("p",[e._v("December 2018")]),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")]),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("In order to build a good community operation mechanism, promote community autonomy, and promote the NULS project to enable the community to evolve and drive independently.")]),e._v(" "),e._m(6),e._v(" "),i("p",[e._v("The following is a specification of the NULS Community Constitution.")]),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),i("p",[e._v("NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),i("p",[e._v("NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.")]),e._v(" "),e._m(11),e._v(" "),i("p",[e._v("Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:")]),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),i("p",[e._v("20,000,000 NULS from the NULS and entrusted revenues from the contributors.")]),e._v(" "),e._m(14),e._v(" "),i("p",[e._v("The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.")]),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),i("p",[e._v("As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.")]),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),i("p",[e._v("The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.")]),e._v(" "),e._m(28),e._v(" "),i("p",[e._v("We stick to the following philosophy in the technology community:")]),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),i("p",[e._v("The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).")]),e._v(" "),i("p",[e._v("The process of joining CCC is:")]),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),i("p",[e._v("Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at "),i("strong",[i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),i("OutboundLink")],1)]),e._v(".")]),e._v(" "),e._m(39),e._v(" "),i("p",[e._v("Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.")]),e._v(" "),e._m(40),e._v(" "),e._m(41),e._v(" "),i("p",[e._v("Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.")]),e._v(" "),e._m(42),e._v(" "),i("p",[e._v("The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.")]),e._v(" "),e._m(43),e._v(" "),e._m(44),e._v(" "),e._m(45),e._v(" "),e._m(46),e._v(" "),e._m(47),e._v(" "),e._m(48),e._v(" "),i("p",[e._v("We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:")]),e._v(" "),i("p",[e._v("NULS community website: "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),i("OutboundLink")],1)]),e._v(" "),i("p",[e._v("Feedback post: "),i("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community/d/132-we-need-your-suggestions"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-2-nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-2-nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-2 NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 2\n Title: NULS Community Constitution\n Author: Reaper Ran \n Discussions-To: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207\n Status: Last call\n Type: Process\n Created: 2018-12-28\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preamble"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preamble","aria-hidden":"true"}},[this._v("#")]),this._v(" Preamble")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("The following rules will be based on the NULS development consensus governance module. The Council members and Ambassadors will be appointed by a vote within the NULS core team before consensus governance module is set in motion.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-community-constitution"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-community-constitution","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Community Constitution")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-nuls-community-profile"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-nuls-community-profile","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. NULS Community Profile")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.")]),this._v(" NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-objectives-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-objectives-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I)")]),this._v(" "),t("strong",[this._v("Objectives")]),this._v(" "),t("strong",[this._v("of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Code writing")]),this._v(" "),t("li",[this._v("Applications development")]),this._v(" "),t("li",[this._v("Operation and promotion")]),this._v(" "),t("li",[this._v("Other actions in favor of NULS community ecology development")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-source-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-source-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Source of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-management-of-nuls-foundation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-management-of-nuls-foundation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Management of NULS Foundation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-appointment-of-council-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-appointment-of-council-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Appointment of Council members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers "),t("strong",[this._v("(developer council member)")]),this._v(" elected based on a ballot participated by all developers; and 7 members elected by ballot within the community "),t("strong",[this._v("(standing council member)")]),this._v(". The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.")]),this._v(" "),t("li",[this._v("Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.")]),this._v(" "),t("li",[this._v("Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.")]),this._v(" "),t("li",[this._v("Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-rights-and-responsibilities-of-council-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-rights-and-responsibilities-of-council-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Rights and responsibilities of Council member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:")]),this._v(" "),t("p",[this._v("(1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.")])]),e._v(" "),i("li",[i("p",[e._v("Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.")]),e._v(" "),i("p",[e._v("(2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of lower node agency commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of transfer commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of contract call commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of Council member proposal commission.")])]),e._v(" "),i("li",[i("p",[e._v("Adjustment of adjustable system parameter in other systems.")]),e._v(" "),i("p",[e._v("(3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.")])]),e._v(" "),i("li",[i("p",[e._v("Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.")])]),e._v(" "),i("li",[i("p",[e._v("Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.")])]),e._v(" "),i("li",[i("p",[e._v("Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.")])]),e._v(" "),i("li",[i("p",[e._v("Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"2"}},[t("li",[this._v("Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.")]),this._v(" "),t("li",[this._v("Responsibilities of Council member.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Council member shall communicate with the community in good time.")])]),this._v(" "),t("li",[t("p",[this._v("Act in strict accordance with the community’s Constitution.")])]),this._v(" "),t("li",[t("p",[this._v("Share the same vision and purpose with NULS.")])]),this._v(" "),t("li",[t("p",[this._v("Take it as its own mission to protect community members’ interests.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note:")]),this._v(" "),t("strong",[this._v("All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-code-craft-council-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. CODE CRAFT COUNCIL (CCC)")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-introduction-to-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-introduction-to-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Introduction to the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-philosophy-of-the-ccc"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-philosophy-of-the-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Philosophy of the CCC")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Equal: the technology community and core team are equal and work together for joint development.")])]),this._v(" "),t("li",[t("p",[this._v("Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.")])]),this._v(" "),t("li",[t("p",[this._v("Sharing:")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",[i("li",[i("p",[e._v("The whole community shares the achievements of NULS technology.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares the development dividend of NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The whole community shares NULS’s influence and reputation.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares the technical innovation brought by NULS.")])]),e._v(" "),i("li",[i("p",[e._v("The industry shares NULS’s standard establishment to promote industry development.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"4"}},[t("li",[t("p",[this._v("Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.")])]),this._v(" "),t("li",[t("p",[this._v("Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iii-appointment-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-appointment-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(III) Appointment of the CCC member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.")]),this._v(" "),t("li",[this._v("Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.")]),this._v(" "),t("li",[this._v("Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.")]),this._v(" "),t("li",[this._v("After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"iv-rights-and-responsibilities-of-the-ccc-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-rights-and-responsibilities-of-the-ccc-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(IV) Rights and responsibilities of the CCC member")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ol",[i("li",[i("p",[e._v("NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.")])]),e._v(" "),i("li",[i("p",[e._v("The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.")])]),e._v(" "),i("li",[i("p",[e._v("After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.")])]),e._v(" "),i("li",[i("p",[e._v("Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.")])]),e._v(" "),i("li",[i("p",[e._v("The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-contributor-for-campaign"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-contributor-for-campaign","aria-hidden":"true"}},[this._v("#")]),this._v(" (I) Contributor for campaign")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-permanent-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-permanent-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" (II) Permanent contributor")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vi-project-budget"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vi-project-budget","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VI. Project Budget")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-with-respect-to-contributor"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-with-respect-to-contributor","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) With respect to contributor")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-with-respect-to-other-transaction-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-with-respect-to-other-transaction-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) With respect to other transaction funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"vii-other-votes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vii-other-votes","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VII. Other votes")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"i-start-a-vote"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-start-a-vote","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(I) Start a vote")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("The Council member shall start a vote and only the transaction fee is required.")])]),this._v(" "),t("li",[t("p",[this._v("Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"ii-vote-by-proxy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-vote-by-proxy","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("(II) Vote by proxy")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("p",[this._v("Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.")])]),this._v(" "),t("li",[t("p",[this._v("Any NULS user can be an agent.")])]),this._v(" "),t("li",[t("p",[this._v("Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.")])]),this._v(" "),t("li",[t("p",[this._v("The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"viii-feedback"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#viii-feedback","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("VIII.")]),this._v(" Feedback")])}],!1,null,null,null);n.options.__file="NIP-2.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/131.84d456ba.js b/docs/.vuepress/dist/assets/js/131.84d456ba.js new file mode 100644 index 00000000..bc9e28a6 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/131.84d456ba.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[131],{950:function(e,t,a){"use strict";a.r(t);var n=a(0),o=Object(n.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),e._m(3),e._v(" "),a("p",[e._v("In order to enable the community to have more talents to join, community funds are opened to the community for joint management and use.")]),e._v(" "),e._m(4),e._v(" "),a("p",[e._v("The following is a specification of the Community Fund Management and Use of Process.")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),e._m(7),e._v(" "),a("p",[e._v("According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.")]),e._v(" "),a("p",[e._v("Community Fund Account Address:")]),e._v(" "),a("p",[a("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[e._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),a("OutboundLink")],1)]),e._v(" "),a("p",[e._v("According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.")]),e._v(" "),a("p",[e._v("The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.")]),e._v(" "),e._m(8),e._v(" "),a("p",[e._v("**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),a("p",[e._v("All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.")]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),a("p",[e._v("The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.")]),e._v(" "),e._m(15),e._v(" "),a("p",[e._v("The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.")]),e._v(" "),e._m(16),e._v(" "),a("p",[e._v("Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.")]),e._v(" "),e._m(17),e._v(" "),a("p",[e._v("Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),a("p",[e._v("(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;")]),e._v(" "),a("p",[e._v("(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;")]),e._v(" "),a("p",[e._v("(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;")]),e._v(" "),a("p",[e._v("(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;")]),e._v(" "),a("p",[e._v("(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;")]),e._v(" "),a("p",[e._v("(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;")]),e._v(" "),a("p",[e._v("(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;")]),e._v(" "),e._m(20),e._v(" "),a("p",[e._v("(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;")]),e._v(" "),a("p",[e._v("(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;")]),e._v(" "),a("p",[e._v("(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;")]),e._v(" "),a("p",[e._v("(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.")]),e._v(" "),e._m(21),e._v(" "),a("p",[e._v("(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;")]),e._v(" "),a("p",[e._v("(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).")]),e._v(" "),e._m(22),e._v(" "),a("p",[e._v("All community discussion suggestions are made at "),a("a",{attrs:{href:"https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),a("OutboundLink")],1),e._v(" .")]),e._v(" "),a("p",[e._v("This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.")]),e._v(" "),a("p",[e._v("Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.")]),e._v(" "),a("p",[e._v("The specific node generates revenue with reference to the NULS POC consensus mechanism.")]),e._v(" "),e._m(23),e._v(" "),a("p",[e._v("Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),e._v(" "),a("p",[e._v("CCC Members")]),e._v(" "),a("p",[e._v("Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),e._v(" "),a("p",[e._v("Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),e._v(" "),a("p",[e._v("Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),e._v(" "),a("p",[e._v("Berzeck’s staking – Same as above")]),e._v(" "),a("p",[e._v("Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),e._v(" "),a("p",[e._v("Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),e._v(" "),a("p",[e._v("Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),e._v(" "),a("p",[e._v("Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),e._v(" "),a("p",[e._v("Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),e._v(" "),a("p",[e._v("Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),e._v(" "),a("p",[e._v("Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),e._v(" "),a("p",[e._v("Moshe’s staking – Same as above")]),e._v(" "),a("p",[e._v("Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),e._v(" "),a("p",[e._v("Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),e._v(" "),e._m(24)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-3-community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-3-community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-3 Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 3\n Title: Community Fund Management and Use of Process\n Author: Reaper Ran \n Discussions-To: https://nuls.community/d/262-community-fund-management-and-use-of-process-discussion-draft-ngc20181221\n Status: Last call\n Type: Process\n Created: 2018-12-28\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"community-fund-management-and-use-of-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-fund-management-and-use-of-process","aria-hidden":"true"}},[this._v("#")]),this._v(" Community Fund Management and Use of Process")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png",alt:"img"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"i-community-fund-management"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#i-community-fund-management","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("I. Community Fund Management")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"ii-the-application-member"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ii-the-application-member","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("II. The Application Member")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-ordinary-members"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-ordinary-members","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Ordinary Members")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-contributor-role"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-contributor-role","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Contributor Role")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. "),t("strong",[this._v("The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.")]),this._v(" The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iii-the-type-of-application"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iii-the-type-of-application","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("III. The Type of Application")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-proposal-to-pay-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-proposal-to-pay-funds","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. Proposal to Pay Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-proposal-budget-item"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-proposal-budget-item","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Proposal Budget Item")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-the-proposal-to-create-a-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-the-proposal-to-create-a-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. The Proposal to Create a Node")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("4. Proposal Entrusted Funds")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"iv-the-application-process"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#iv-the-application-process","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("IV. The Application Process")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_1-the-plan-is-openly-and-thoroughly-discussed"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-the-plan-is-openly-and-thoroughly-discussed","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("1. The Plan is Openly and Thoroughly Discussed")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_2-council-member-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-council-member-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("2. Council Member Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"_3-foundation-implementation-proposal"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-foundation-implementation-proposal","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("3. Foundation Implementation Proposal")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"v-process-explanation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#v-process-explanation","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("V. Process Explanation")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"attachment-current-contributor-role-delegation-and-node"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#attachment-current-contributor-role-delegation-and-node","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Attachment: Current Contributor Role Delegation and Node:")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);o.options.__file="NIP-3.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/132.2aae8ca6.js b/docs/.vuepress/dist/assets/js/132.2aae8ca6.js new file mode 100644 index 00000000..944020a6 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/132.2aae8ca6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[132],{948:function(e,t,o){"use strict";o.r(t);var a=o(0),s=Object(a.a)({},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._m(2),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(3),e._v(" "),o("p",[e._v("During the period between September to November 2018, we have had 9 ambassadors who have actively worked within the NULS Community to attract more members and developers. Once smart contracts are launched on the NULS main-net, there will be a community voting tool. Appointments of the ambassadors should be decided by the community. During this time, community members have given many suggestions, so we have set up some new detailed campaigning rules for the ambassadors. This will be the first step toward community autonomy, which is an important goal for NULS. It requires many fundamental tools, as well as the support from everyone in the community.")]),e._v(" "),e._m(4),e._v(" "),o("p",[e._v("The following is a specification of the Ambassadors participate in the election rules.")]),e._v(" "),e._m(5),e._v(" "),e._m(6),e._v(" "),o("p",[e._v("The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.")]),e._v(" "),o("p",[e._v("The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.")]),e._v(" "),o("p",[e._v("The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.")]),e._v(" "),o("p",[e._v("Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).")]),e._v(" "),o("p",[e._v("The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.")]),e._v(" "),e._m(7),e._v(" "),o("p",[e._v("a. A candidate for the NULS ambassador is required to create a NULS node.")]),e._v(" "),o("p",[e._v("b. Identify with the NULS concepts of values, understand the core knowledge of NULS and respect the members of the NULS community. The election cycle is quarterly and requires a full 3 month commitment. Consider this commitment before running for election. Ambassadors are expected to meet the full term of the quarterly commitment.")]),e._v(" "),o("p",[e._v("c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.")]),e._v(" "),o("p",[e._v("d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.")]),e._v(" "),o("p",[e._v("e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.")]),e._v(" "),o("p",[e._v("f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.")]),e._v(" "),o("p",[e._v("g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.")]),e._v(" "),o("p",[e._v("h. Half of all rewards of the ambassador's nodes are rewarded to ambassador(for he need to pay the node server cost and he shall get the rewards of 20,000 NULS he is staking on this nodes). And the other half must be used as development fund of ambassador for community development.")]),e._v(" "),o("p",[e._v("i.About the resignation of ambassador, if the ambassador is voluntarily resigned or subject to recall by the community, please ambassador return the remaining development fund of ambassador to the community fund.")]),e._v(" "),o("p",[e._v("j.The ambassador is a community contributor. If you need to initiate other community fund applications, please carry them out based on the community fund use and management process.")]),e._v(" "),e._m(8),e._v(" "),o("p",[e._v("a. Publish the work report for the previous month and the work plan for the next month:")]),e._v(" "),o("p",[e._v("Please post on the NULS forum: "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!")]),e._v(" "),o("p",[e._v("c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.")]),e._v(" "),o("p",[e._v("Final Tribute to your efforts:")]),e._v(" "),o("p",[e._v("• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.")]),e._v(" "),o("p",[e._v("• Start your work of community-building and outreach!")]),e._v(" "),o("p",[e._v("• Help NULS dock more DApps!")]),e._v(" "),o("p",[e._v("• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.")]),e._v(" "),o("p",[e._v("For all ambassador related discussions, please post on the NULS forum at "),o("a",{attrs:{href:"https://community.nuls.world/t/elections",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://community.nuls.world/t/elections"),o("OutboundLink")],1)]),e._v(" "),o("p",[e._v("Welcome to the NULS community! Let’s work together to create a brighter future for NULS!")]),e._v(" "),o("p",[e._v("If you can deliver more, we have these expectations of you:")]),e._v(" "),e._m(9),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),e._m(15),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),o("p",[e._v("Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),o("p",[e._v("NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.")]),e._v(" "),e._m(21),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),e._m(25),e._v(" "),e._m(26),e._v(" "),e._m(27),e._v(" "),e._m(28),e._v(" "),o("ol",[o("li",[e._v("NULS Ambassador Board (["),o("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[e._v("Click to enter"),o("OutboundLink")],1),e._v("]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.")]),e._v(" "),o("li",[e._v("You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.")]),e._v(" "),o("li",[e._v("If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.")]),e._v(" "),o("li",[e._v("Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.")]),e._v(" "),o("li",[e._v("You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.")]),e._v(" "),o("li",[e._v("If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.")]),e._v(" "),o("li",[e._v("If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).")]),e._v(" "),o("li",[e._v("Any suggestions, questions and ideas, and all work progress can be posted on the community forum "),o("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.community"),o("OutboundLink")],1),e._v(".")])]),e._v(" "),e._m(29),e._v(" "),e._m(30),e._v(" "),e._m(31),e._v(" "),e._m(32),e._v(" "),e._m(33),e._v(" "),e._m(34),e._v(" "),e._m(35),e._v(" "),e._m(36),e._v(" "),e._m(37),e._v(" "),e._m(38),e._v(" "),e._m(39),e._v(" "),e._m(40),e._v(" "),e._m(41)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nip-4-ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nip-4-ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-4 Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v(" NIP: 4\n Title: Ambassadors participate in the election rules\n Author: Reaper Ran Penny \n Discussions-To: https://nuls.community/d/206-ambassadors-participate-in-the-election-rules-ncg-20181114\n Status: Last call\n Type: Process\n Created: 2019-2-15\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"abstract"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[this._v("#")]),this._v(" Abstract")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"motivation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[this._v("#")]),this._v(" Motivation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"specification"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[this._v("#")]),this._v(" Specification")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassadors-participate-in-the-election-rules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassadors-participate-in-the-election-rules","aria-hidden":"true"}},[this._v("#")]),this._v(" Ambassadors participate in the election rules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-introduction-of-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction-of-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction of NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-duties-and-compensation-for-nuls-ambassadors"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-duties-and-compensation-for-nuls-ambassadors","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Duties and Compensation for NULS Ambassadors")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-how-to-participate-in-the-election"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-how-to-participate-in-the-election","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. How to participate in the election")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("3. Share the story of NULS to the community;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("em",[this._v("8. Help NULS with publicity and be committed to NULS press releases through your local media.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"ambassador-guide"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ambassador-guide","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Ambassador Guide")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"preface"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preface","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Preface")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Transparency")]),this._v(" "),t("li",[this._v("Freedom")]),this._v(" "),t("li",[this._v("Autonomy")]),this._v(" "),t("li",[this._v("Evolution")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"the-vision-of-the-nuls-project-is-based-on-the-following-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#the-vision-of-the-nuls-project-is-based-on-the-following-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" The vision of the NULS project is based on the following mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Making blockchain technology easy and simple")]),this._v(" "),t("li",[this._v("Breaking through the bottleneck of blockchain performance and adoption")]),this._v(" "),t("li",[this._v("Reducing the cost of using blockchain technology")]),this._v(" "),t("li",[this._v("Increasing security and reliability of data")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-you-will-obtain"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-you-will-obtain","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, you will obtain")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.")]),this._v(" "),t("li",[this._v("Rewards produced by one node. Rewards are used to develop the local NULS community.")]),this._v(" "),t("li",[this._v("Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.")]),this._v(" "),t("li",[this._v("The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"as-an-ambassador-of-nuls-your-mission-is"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#as-an-ambassador-of-nuls-your-mission-is","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("As an Ambassador of NULS, Your Mission is")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("A. Community Development")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Let others know about NULS via Internet or offline communications.")]),e._v(" "),o("li",[e._v("Organize some NULS fans or volunteers to promote the technology and concepts of NULS.")]),e._v(" "),o("li",[e._v("Share the development from other areas of the NULS community with your local community.")]),e._v(" "),o("li",[e._v("Continuously share the progress, planning, news, etc. of the NULS project to the local community.")]),e._v(" "),o("li",[e._v("Contact local media and forums to help NULS publicize presentations or news.")]),e._v(" "),o("li",[e._v("Share the story of NULS with the local community.")]),e._v(" "),o("li",[e._v("Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.")]),e._v(" "),o("li",[e._v("Share videos or other content produced by the team in the local language of the people in your country/region.")]),e._v(" "),o("li",[e._v("If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.")]),e._v(" "),o("li",[e._v("Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("strong",[this._v("B.")]),this._v(" "),t("strong",[this._v("Community Activities")])])},function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("ol",[o("li",[e._v("Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.")]),e._v(" "),o("li",[e._v("Participate in any possible cryptocurrency gatherings in your area and represent NULS.")]),e._v(" "),o("li",[e._v("Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.")]),e._v(" "),o("li",[e._v("Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.")]),e._v(" "),o("li",[e._v("Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"get-started-with-everything-you-need-here"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#get-started-with-everything-you-need-here","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Get Started With Everything You Need Here")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"recruit-volunteers-to-organize-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recruit-volunteers-to-organize-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Recruit Volunteers to Organize Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.")]),this._v(" "),t("li",[this._v("Organize some offline meet-ups.")]),this._v(" "),t("li",[this._v("Introduce more blockchain investors to NULS and guide them towards investing in NULS.")]),this._v(" "),t("li",[this._v("Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"develop-a-local-nuls-ecology"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#develop-a-local-nuls-ecology","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Develop a Local NULS Ecology")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.")]),this._v(" "),t("li",[this._v("Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.")]),this._v(" "),t("li",[this._v("If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"spread-the-concepts-and-features-of-nuls-technology-with-local-communities"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#spread-the-concepts-and-features-of-nuls-technology-with-local-communities","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("Spread the Concepts and Features of NULS Technology with Local Communities")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.")]),this._v(" "),t("li",[this._v("Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.")]),this._v(" "),t("li",[this._v("Use local mainstream media websites to spread the news and progress of NULS.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nulstar-guidelines-and-duties"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nulstar-guidelines-and-duties","aria-hidden":"true"}},[this._v("#")]),this._v(" "),t("strong",[this._v("NULStar Guidelines And Duties")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Requirements for becoming a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.")]),this._v(" "),t("li",[this._v("Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.")]),this._v(" "),t("li",[this._v("Must live in a city with over 350k population.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Duties of a NULStar")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.")]),this._v(" "),t("li",[this._v("Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[t("strong",[this._v("Rewards for NULStars")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.")]),this._v(" "),t("li",[this._v("NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.")])])}],!1,null,null,null);s.options.__file="NIP-4.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/133.1a312ad1.js b/docs/.vuepress/dist/assets/js/133.1a312ad1.js new file mode 100644 index 00000000..b39ec4dc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/133.1a312ad1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[133],{946:function(t,e,i){"use strict";i.r(e);var n=i(0),s=Object(n.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("p",[t._v("NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),i("p",[t._v("All NIP files are available through NULS's github:"),i("a",{attrs:{href:"https://github.com/nuls-io/NIPs",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/NIPs"),i("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"what-is-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" What is NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"reasons-for-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#reasons-for-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Reasons for NIP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.")])]),this._v(" "),e("li",[e("p",[this._v("For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"get-all-the-nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-all-the-nip","aria-hidden":"true"}},[this._v("#")]),this._v(" Get all the NIP")])}],!1,null,null,null);s.options.__file="NIPIntroduction.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/134.703ce965.js b/docs/.vuepress/dist/assets/js/134.703ce965.js new file mode 100644 index 00000000..5a32afdc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/134.703ce965.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[134],{944:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"content"},[this._m(0),this._v(" "),s("NavBars")],1)},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls-portal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls-portal","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS Portal")])}],!1,null,null,null);n.options.__file="NULSNav.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/135.8cee3887.js b/docs/.vuepress/dist/assets/js/135.8cee3887.js new file mode 100644 index 00000000..dd50babd --- /dev/null +++ b/docs/.vuepress/dist/assets/js/135.8cee3887.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[135],{942:function(t,e,i){"use strict";i.r(e);var n=i(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),i("p",[t._v("Although the main network is now in a stable state of operation, in order to cope with changes, the development of the main network is still in progress. We need the help of the community to solve the challenges in the development of the main network and improve the NULS blockchain infrastructure together. We urge developers in the community to join us and contribute, and your efforts will be rewarded.")]),t._v(" "),i("ul",[i("li",[t._v("How to join the tech community:"),i("a",{attrs:{href:"https://nuls.io/developer",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/developer"),i("OutboundLink")],1)]),t._v(" "),i("li",[t._v("NULS Github:"),i("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io"),i("OutboundLink")],1)])]),t._v(" "),t._m(3),t._v(" "),i("p",[t._v("In the software development process, although there are strict tests, we still can't avoid bugs in the program. So if you find bugs in the process of using our application or developing, please timely feedback to us, and we will actively deal with them. There are three ways to feed back bugs:")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Feedback through "),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("community forum"),i("OutboundLink")],1)]),t._v(" "),t._m(4)]),t._v(" "),t._m(5),t._v(" "),t._m(6)]),t._v(" "),t._m(7),t._v(" "),i("p",[t._v("NULS formulated the document writing incentive plan, invited the community to write NULS related documents together, and gave corresponding rewards according to the efforts of community members.")]),t._v(" "),t._m(8),t._v(" "),i("p",[t._v("As a global open source blockchain project, NULS needs a lot of bilingual documents in Chinese and English. If you are a professional in this field, we really need your help.")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"how-to-contribute"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#how-to-contribute","aria-hidden":"true"}},[this._v("#")]),this._v(" How to contribute")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The development of NULS is inseparable from the community and requires the participation of community members. We provide different ways for community members to participate, and you can choose what you are good at to contribute to NULS. For each contributor, the name of the contributor is published with its consent (we also attach the node name if the node is owned)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"join-the-mainnet-development"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#join-the-mainnet-development","aria-hidden":"true"}},[this._v("#")]),this._v(" Join the Mainnet development")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"report-bugs"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#report-bugs","aria-hidden":"true"}},[this._v("#")]),this._v(" Report bugs")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Mainnet:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs")]),this._v(" "),e("li",[this._v("Testnet:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Send email to support@nuls.io")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Direct feedback to the community manager or operations staff")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"write-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#write-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Write document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"translate-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#translate-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Translate document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"list-of-contributors"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#list-of-contributors","aria-hidden":"true"}},[this._v("#")]),this._v(" List of contributors")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The rankings are arranged alphabetically, in no particular order")])])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("Name")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("Email")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("Node Alias/ID")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Angang Tang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("tangangang@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Albert")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("albert@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Charlie Li")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lichao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Cody Lan")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lanjinsheng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Davi Yang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("davi@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yuanchen Jiang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("jiangyuanchen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yifeng Qin")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("qinyifeng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Niels")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pierre Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("luohao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pen Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("pen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Siwei")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("13809668344@139.com")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("siwei")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Vivi Zhou")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("zhouwei@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])])])])}],!1,null,null,null);a.options.__file="howToContribute.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/136.b36f5811.js b/docs/.vuepress/dist/assets/js/136.b36f5811.js new file mode 100644 index 00000000..d476befd --- /dev/null +++ b/docs/.vuepress/dist/assets/js/136.b36f5811.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[136],{940:function(e,t,i){"use strict";i.r(t);var r=i(0),a=Object(r.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("Following the principles of pluggability, modularization and parallel expansion, NULS provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and usage, and to promote the application of blockchain in the commercial field and the interaction among chains")]),e._v(" "),i("p",[e._v('Upholding the "chain" as the core in the NULS development philosophy, NULS is striving for building its core product: "Chain Factory". In the meantime, NULS will realize the value circulation among chains through cross-chain module and build the ecosystem of blockchains.')]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),e._m(4),e._v(" "),i("p",[e._v("The NULS whitepaper is an authoritative report that addresses what NULS’ goal is and how we plan to achieve it.")]),e._v(" "),i("p",[i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NulsWhitepaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more from whitepaper"),i("OutboundLink")],1)]),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("The NULS yellowpaper is the technical detailed version of the whitepaper, which drills down into the underlying aspects of NULS.")]),e._v(" "),i("p",[i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("Learn more from Yellowpaper"),i("OutboundLink")],1)])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"what-is-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#what-is-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" What is NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"nuls-is-a-blockchain-infrastructure-for-customizable-services-driven-by-our-global-open-source-community"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-is-a-blockchain-infrastructure-for-customizable-services-driven-by-our-global-open-source-community","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_1-our-mission"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-our-mission","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Our Mission")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ul",[t("li",[this._v("Provide flexible blockchain technology that supports a wide variety of enterprise applications")]),this._v(" "),t("li",[this._v("Efficient, high performance technology to solve bottlenecks")]),this._v(" "),t("li",[this._v("Promote usage of blockchain technology by reducing the barrier of entry development cost")]),this._v(" "),t("li",[this._v("Provide the most powerful system of trust through a decentralized network")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_2-whitepaper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-whitepaper","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Whitepaper")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"_3-yellowpaper"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-yellowpaper","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. Yellowpaper")])}],!1,null,null,null);a.options.__file="introduction.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/137.eda59c8e.js b/docs/.vuepress/dist/assets/js/137.eda59c8e.js new file mode 100644 index 00000000..824a77a3 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/137.eda59c8e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[137],{938:function(t,e,o){"use strict";o.r(e);var n=o(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/overview/introduction.html"}},[t._v("Overview")])],1)]),t._v(" "),o("p",[t._v("This section can help readers unfamiliar with NULS understand what NULS is and what can be done")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/guide/GUIGuide.html"}},[t._v("Users guide")])],1)]),t._v(" "),o("p",[t._v("If you are a beginner, here is what you need.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/community/toolsGuide.html"}},[t._v("NULS community")])],1)]),t._v(" "),o("p",[t._v("Blockchain projects are always community-based, and here you can learn about all aspects of the NULS community")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/startNULS/sourceCodeStartNULS.html"}},[t._v("Launching NULS")])],1)]),t._v(" "),o("p",[t._v("Launch NULS to see what NULS can do, what different experiences NULS can bring to you")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/buildChain/buildPrivateChain.html"}},[t._v("Quickly building a chain")])],1)]),t._v(" "),o("p",[t._v("If you want to build a private chain, this section should help you")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/NULSInfrastructure/NULS2.0Introduction.html"}},[t._v("NULS2.0")])],1)]),t._v(" "),o("p",[t._v("What is the modular design? What is NULS2.0? This section will answer these questions one by one. It elaborates on the design concept of NULS and the design details of each module")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/smartContract/startSmartContract.html"}},[t._v("Smart contracts")])],1)]),t._v(" "),o("p",[t._v("Do you want to develop DAPPs or do other cool things based on smart contracts? This section is what you want. It includes developer documents, NRC standards, plug-ins, and some interesting contract examples.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/developerTools/sdk.html"}},[t._v("Developer tools")])],1)]),t._v(" "),o("p",[t._v("NULS has always been developer-friendly, and we continue to provide tools for developers. Developers can come here to see what they are.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"/nips/NIPIntroduction.html"}},[t._v("NIPs")])],1)]),t._v(" "),o("p",[t._v("All related proposals of NULS are here, where you can learn more about NULS's protocals, regulations ,standards and etc.")]),t._v(" "),o("ul",[o("li",[o("router-link",{attrs:{to:"./nulsNav/NULSNav.html"}},[t._v("NULS portal")])],1)]),t._v(" "),o("p",[t._v("The NULS documentation portal is only a part of NULS. For more information and products about NULS Blockchain, you can find the access here.")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"documentation-structure"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#documentation-structure","aria-hidden":"true"}},[this._v("#")]),this._v(" Documentation structure")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"this-documentation-consists-of-eight-sections"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#this-documentation-consists-of-eight-sections","aria-hidden":"true"}},[this._v("#")]),this._v(" This documentation consists of eight sections.")])}],!1,null,null,null);a.options.__file="structure.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/138.551346e5.js b/docs/.vuepress/dist/assets/js/138.551346e5.js new file mode 100644 index 00000000..6a5b0e33 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/138.551346e5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[138],{934:function(a,t,e){"use strict";e.r(t);var s=e(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"nrc-20-token-standard"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nrc-20-token-standard","aria-hidden":"true"}},[a._v("#")]),a._v(" NRC-20 Token Standard")]),a._v(" "),e("h2",{attrs:{id:"simple-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#simple-summary","aria-hidden":"true"}},[a._v("#")]),a._v(" Simple Summary")]),a._v(" "),e("p",[a._v("A standard interface for tokens.")]),a._v(" "),e("h2",{attrs:{id:"abstract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[a._v("#")]),a._v(" Abstract")]),a._v(" "),e("p",[a._v("The following standard allows for the implementation of a standard API for tokens within smart contracts.\nThis standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.")]),a._v(" "),e("h2",{attrs:{id:"motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[a._v("#")]),a._v(" Motivation")]),a._v(" "),e("p",[a._v("A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.")]),a._v(" "),e("h2",{attrs:{id:"specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[a._v("#")]),a._v(" Specification")]),a._v(" "),e("h2",{attrs:{id:"token"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token","aria-hidden":"true"}},[a._v("#")]),a._v(" Token")]),a._v(" "),e("h3",{attrs:{id:"methods"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#methods","aria-hidden":"true"}},[a._v("#")]),a._v(" Methods")]),a._v(" "),e("p",[e("strong",[a._v("NOTE")]),a._v(": Callers MUST handle "),e("code",[a._v("false")]),a._v(" from "),e("code",[a._v("return boolean")]),a._v(". Callers MUST NOT assume that "),e("code",[a._v("false")]),a._v(" is never returned!")]),a._v(" "),e("h4",{attrs:{id:"name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#name","aria-hidden":"true"}},[a._v("#")]),a._v(" name")]),a._v(" "),e("p",[a._v("Returns the name of the token - e.g. "),e("code",[a._v('"MyToken"')]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"symbol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#symbol","aria-hidden":"true"}},[a._v("#")]),a._v(" symbol")]),a._v(" "),e("p",[a._v('Returns the symbol of the token. E.g. "MT".')]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("symbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"decimals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#decimals","aria-hidden":"true"}},[a._v("#")]),a._v(" decimals")]),a._v(" "),e("p",[a._v("Returns the number of decimals the token uses - e.g. "),e("code",[a._v("8")]),a._v(", means to divide the token amount by "),e("code",[a._v("100000000")]),a._v(" to get its user representation.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("int")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("decimals")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"totalsupply"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#totalsupply","aria-hidden":"true"}},[a._v("#")]),a._v(" totalSupply")]),a._v(" "),e("p",[a._v("Returns the total token supply.")]),a._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[a._v("@View\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("totalSupply")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"balanceof"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#balanceof","aria-hidden":"true"}},[a._v("#")]),a._v(" balanceOf")]),a._v(" "),e("p",[a._v("Returns the account balance of another account with address "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("balanceOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[a._v("#")]),a._v(" transfer")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" if the "),e("code",[a._v("from")]),a._v(" account balance does not have enough tokens to spend.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transfer")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transferfrom"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferfrom","aria-hidden":"true"}},[a._v("#")]),a._v(" transferFrom")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens from address "),e("code",[a._v("from")]),a._v(" to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("p",[a._v("The "),e("code",[a._v("transferFrom")]),a._v(" method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf.\nThis can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" unless the "),e("code",[a._v("from")]),a._v(" account has deliberately authorized the sender of the message via some mechanism, such as calling "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transferFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"approve"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approve","aria-hidden":"true"}},[a._v("#")]),a._v(" approve")]),a._v(" "),e("p",[a._v("Allows "),e("code",[a._v("spender")]),a._v(" to withdraw from your account multiple times, up to the "),e("code",[a._v("value")]),a._v(" amount. If this function is called again it overwrites the current allowance with "),e("code",[a._v("value")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("approve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"allowance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#allowance","aria-hidden":"true"}},[a._v("#")]),a._v(" allowance")]),a._v(" "),e("p",[a._v("Returns the amount which "),e("code",[a._v("spender")]),a._v(" is still allowed to withdraw from "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("allowance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h3",{attrs:{id:"events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#events","aria-hidden":"true"}},[a._v("#")]),a._v(" Events")]),a._v(" "),e("h4",{attrs:{id:"transferevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferevent","aria-hidden":"true"}},[a._v("#")]),a._v(" TransferEvent")]),a._v(" "),e("p",[a._v("MUST trigger when tokens are transferred, including zero value transfers.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("TransferEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h4",{attrs:{id:"approvalevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approvalevent","aria-hidden":"true"}},[a._v("#")]),a._v(" ApprovalEvent")]),a._v(" "),e("p",[a._v("MUST trigger on any successful call to "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("ApprovalEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h2",{attrs:{id:"implementation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation","aria-hidden":"true"}},[a._v("#")]),a._v(" Implementation")]),a._v(" "),e("h4",{attrs:{id:"example-implementations-are-available-at"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-implementations-are-available-at","aria-hidden":"true"}},[a._v("#")]),a._v(" Example implementations are available at")]),a._v(" "),e("ul",[e("li",[a._v("https://github.com/nuls-io/nuls-nrc20")])])])}],!1,null,null,null);n.options.__file="NRC-20TokenStandard.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/139.3a3f1471.js b/docs/.vuepress/dist/assets/js/139.3a3f1471.js new file mode 100644 index 00000000..e542ce6e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/139.3a3f1471.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[139],{932:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("NULS smart contract adopts IntelliJ IDEA as development tool")]),t._v(" "),t._m(6),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Click to download the plugin"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("NULS smart contract plug-ins provide the following main functions:")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("NULS smart contract syntax is a subset of Java syntax, with some restrictions")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),a("p",[t._v("Java key words are listed as follows and those not applicable for NULS smart contract will be marked")]),t._v(" "),a("p",[t._v("Access control")]),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class")]),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("Key words of package")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("Key words of data type")]),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("Conditional loops (process control)")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("Error processing")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("Modification method, class, property and variables")]),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("other")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("NULS smart contract can be developed with the following class")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("a simple contract")]),t._v(" "),t._m(27),t._v(" "),t._m(28),a("p",[t._v("In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details\nThe project has several classes and interfaces")]),t._v(" "),a("p",[t._v("When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class")]),t._v(" "),a("p",[t._v("After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status")]),t._v(" "),a("p",[t._v("Explanatory comments")]),t._v(" "),a("p",[t._v("@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means")]),t._v(" "),a("p",[t._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")]),t._v(" "),a("p",[t._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value")]),t._v(" "),a("p",[t._v("Go to download NULS source code on github, and get some contract examples")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("Contract SDK provides several classes to be convenient for contract development:")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._m(36),t._v(" "),t._m(37),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"smart-contract-development-manual"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#smart-contract-development-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" Smart Contract Development Manual")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_1-introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_2-development-environment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-development-environment","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Development environment")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-setup-of-nuls-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-setup-of-nuls-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Setup of NULS wallet")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-setup-of-jdk-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-setup-of-jdk-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Setup of JDK 8")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-setup-of-intellij-idea"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-setup-of-intellij-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Setup of IntelliJ IDEA")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-4-setup-of-nuls-smart-contract-plug-ins"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-setup-of-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Setup of NULS smart contract plug-ins")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Newly create NULS contract project")]),this._v(" "),s("li",[this._v("Provide the unavailable Java properties, classes ad methods")]),this._v(" "),s("li",[this._v("Compile, package and deploy contracts")]),this._v(" "),s("li",[this._v("Display and call contract methods")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_3-nuls-smart-contract-specifications-and-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-nuls-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. NULS smart contract specifications and syntax")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-1-nuls-smart-contract-specifications"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-nuls-smart-contract-specifications","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 NULS smart contract specifications")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-2-keywords"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-keywords","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Keywords")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("public")]),this._v(" "),s("li",[this._v("protected")]),this._v(" "),s("li",[this._v("private")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("class")]),t._v(" "),a("li",[t._v("interface")]),t._v(" "),a("li",[t._v("abstract")]),t._v(" "),a("li",[t._v("implements")]),t._v(" "),a("li",[t._v("extends")]),t._v(" "),a("li",[t._v("new")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("import")]),this._v(" "),s("li",[this._v("package")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("byte")]),t._v(" "),a("li",[t._v("char")]),t._v(" "),a("li",[t._v("boolean")]),t._v(" "),a("li",[t._v("short")]),t._v(" "),a("li",[t._v("int")]),t._v(" "),a("li",[t._v("float")]),t._v(" "),a("li",[t._v("long")]),t._v(" "),a("li",[t._v("double")]),t._v(" "),a("li",[t._v("void")]),t._v(" "),a("li",[t._v("null")]),t._v(" "),a("li",[t._v("true")]),t._v(" "),a("li",[t._v("false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("if")]),t._v(" "),a("li",[t._v("else")]),t._v(" "),a("li",[t._v("while")]),t._v(" "),a("li",[t._v("for")]),t._v(" "),a("li",[t._v("switch")]),t._v(" "),a("li",[t._v("case")]),t._v(" "),a("li",[t._v("default")]),t._v(" "),a("li",[t._v("do")]),t._v(" "),a("li",[t._v("break")]),t._v(" "),a("li",[t._v("continue")]),t._v(" "),a("li",[t._v("return")]),t._v(" "),a("li",[t._v("instanceof")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("catch")]),t._v(" "),a("li",[t._v("try")]),t._v(" "),a("li",[t._v("finally")]),t._v(" "),a("li",[t._v("throw")]),t._v(" "),a("li",[t._v("throws")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("static")]),t._v(" "),a("li",[t._v("final")]),t._v(" "),a("li",[t._v("super")]),t._v(" "),a("li",[t._v("this")]),t._v(" "),a("li",[t._v("native(not supported)")]),t._v(" "),a("li",[t._v("strictfp(not supported)")]),t._v(" "),a("li",[t._v("synchronized(not supported)")]),t._v(" "),a("li",[t._v("transient(not supported)")]),t._v(" "),a("li",[t._v("volatile(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("enum(not supported)")]),this._v(" "),s("li",[this._v("assert(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-3-basic-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-basic-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 Basic syntax")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign")]),t._v(" "),a("li",[t._v("Basic data type: byte short int long float double char boolean")]),t._v(" "),a("li",[t._v("Reference data type: class, interface, array")]),t._v(" "),a("li",[t._v("Arithmetic operators: + - * /%++ -")]),t._v(" "),a("li",[t._v("Relational operator: > <> = <= ==! =")]),t._v(" "),a("li",[t._v("Logical Operators: ! &| ^ && ||")]),t._v(" "),a("li",[t._v("Bit operator: &| ^~>> << >>>")]),t._v(" "),a("li",[t._v("Assignment operator: =")]),t._v(" "),a("li",[t._v("Extension assignment operators: + = - = * = / =")]),t._v(" "),a("li",[t._v("String link operator: +")]),t._v(" "),a("li",[t._v("Conditional operators: ? :")]),t._v(" "),a("li",[t._v("Process control sentence (if, switch, for, while, do...while)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-4-available-class"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-available-class","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 Available class")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("io.nuls.contract.sdk.Address")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Block")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.BlockHeader")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Contract")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Event")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Msg")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Utils")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.View")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Required")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Payable")]),t._v(" "),a("li",[t._v("java.lang.Boolean")]),t._v(" "),a("li",[t._v("java.lang.Byte")]),t._v(" "),a("li",[t._v("java.lang.Short")]),t._v(" "),a("li",[t._v("java.lang.Character")]),t._v(" "),a("li",[t._v("java.lang.Integer")]),t._v(" "),a("li",[t._v("java.lang.Long")]),t._v(" "),a("li",[t._v("java.lang.Float")]),t._v(" "),a("li",[t._v("java.lang.Double")]),t._v(" "),a("li",[t._v("java.lang.String")]),t._v(" "),a("li",[t._v("java.lang.StringBuilder")]),t._v(" "),a("li",[t._v("java.math.BigInteger")]),t._v(" "),a("li",[t._v("java.math.BigDecimal")]),t._v(" "),a("li",[t._v("java.util.Collection")]),t._v(" "),a("li",[t._v("java.util.List")]),t._v(" "),a("li",[t._v("java.util.ArrayList")]),t._v(" "),a("li",[t._v("java.util.LinkedList")]),t._v(" "),a("li",[t._v("java.util.Map")]),t._v(" "),a("li",[t._v("java.util.HashMap")]),t._v(" "),a("li",[t._v("java.util.LinkedHashMap")]),t._v(" "),a("li",[t._v("java.util.Set")]),t._v(" "),a("li",[t._v("java.util.HashSet")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-5-other-restrictions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-other-restrictions","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 Other restrictions")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Contract class can have one construction method. No restriction for other classes")]),this._v(" "),s("li",[this._v("The maximum gas consumption for executing a contract method once is 10 million, including the method of the "),s("code",[this._v("@View")]),this._v(" type, Make sure to optimize the contract code as much as possible.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_4-nuls-smart-contract-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-nuls-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Nuls smart contract example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" contracts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("examples"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleStorage")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("storedData "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_5-nuls-contract-sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-nuls-contract-sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. NULS Contract SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-address","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Address")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Get the balance of the address (only the balance of contract address)\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Transfer amount to the address from contract \n *\n * @param value transfer amount (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract method to call the address\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Call the contract method of this address with a return value(String)\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n * @return return value after calling the contract\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("callWithReturnValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Verify the address \n *\n * @param address\n * @see io.nuls.kernel.utils.AddressTool#validAddress(String)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Address address1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-block","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Block")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Block")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s head\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Current block’s head\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Newest block’s head\n *\n * @return \n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newestBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s hash\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockhash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * CCurrent block’s miner address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("coinbase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s No.\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("number")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s time stamp\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.BlockHeader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockHeader")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Address packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTxCount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStateRoot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n BlockHeader that "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BlockHeader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BlockHeader{"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", time="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", height="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", txCount="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", packingAddress="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", stateRoot=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'}'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Contract")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract interface, implemented by contract class\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-event","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n* Event interface, implemented by event class\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Event")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-msg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-msg","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Msg")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Msg")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Remaining gas\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasleft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * sender of the contract\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Gas price\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasprice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-utils","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Utils")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Utils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Utils")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back.\n *\n * @param expression\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back\n *\n * @param expression\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n *\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Send events\n *\n * @param event\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Event event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @param seed a private seed\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash4 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash4"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("xBL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param src source string (hex encoding string)\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param bytes source byte array\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bytes"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]verify signature data(ECDSA)\n *\n * @param data(hex encoding string)\n * @param signature(hex encoding string)\n * @param pubkey(hex encoding string)\n * @return verify result\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("verifySignatureData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String signature"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String pubkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-payable"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-payable","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Payable")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Payable")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-required"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-required","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Required")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PARAMETER"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-view"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-view","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.View")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_6-main-rpc-interface-of-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-main-rpc-interface-of-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Main RPC interface of smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-1-create-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-create-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 Create smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4687")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-2-estimate-the-gas-consumption-for-creating-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-estimate-the-gas-consumption-for-creating-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 Estimate the gas consumption for creating smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-3-call-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-3-call-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.3 Call smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/call")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractAddress*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address of smart contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodName*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method signature which may be not transferred if the method name is not repeated")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qwe"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.4 Estimate the gas consumption for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/call")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.5 Estimate the price for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedprice")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-6-terminate-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-6-terminate-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.6 Terminate smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/delete")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.7 Call the smart contract function which is not linked to blockchain (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/view")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.8 Get the implementation results of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/result/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.9 Get the basic information of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/info/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-10-verify-if-it-is-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-10-verify-if-it-is-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.10 Verify if it is contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.11 Get the NULS balance of smart contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/balance/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.12 Get the transaction details of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.13 Get the transaction list of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/list/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.14 Inquire contract UTXO as per address and limit (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/limit/{address}/{limit}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.15 Inquire contract UTXO as per address and amount (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/amount/{address}/{amount}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-16-transfer-amount-to-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-16-transfer-amount-to-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.16 Transfer amount to smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/transfer")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_7-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-1-voting-smart-contract-code-segments-are-as-follows"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-voting-smart-contract-code-segments-are-as-follows","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.1 Voting smart contract code "),s("code",[this._v("segments")]),this._v(" are as follows")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-vote")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BaseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteInterface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("List"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" VoteInterface baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("VoteContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n baseVote "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n VoteEntity voteEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n VoteConfig config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" success "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("success"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("If the methods of smart contract include the parameter of "),s("code",[this._v("array type")]),this._v(", please use the following method to transfer parameters")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Refer to the "),s("code",[this._v("create")]),this._v(" method in the aforesaid voting contract code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtydTVWskMc7GkZzbsq2FoChqKFwMf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseLt14NacjTDhXaTXUdrk6VF7aEwtW4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Test voting 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Voting contract 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536044066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536184066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-2-standard-token-smart-contract-code-segments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-standard-token-smart-contract-code-segments","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.2 Standard Token Smart contract code "),s("code",[this._v("segments")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-nrc20")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("HashMap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("emit"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("require"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleToken")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Token "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" BigInteger totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" balances "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decimals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("totalSupply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleToken")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("decimals "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TEN"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ownerAllowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferFrom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("approve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("increaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decreaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger oldValue "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("oldValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient approved token"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The value must be greater than or equal to 0."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient balance of token."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])}],!1,null,null,null);e.options.__file="developerManual.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/14.fa820f23.js b/docs/.vuepress/dist/assets/js/14.fa820f23.js new file mode 100644 index 00000000..e3387637 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/14.fa820f23.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{668:function(t,e,r){t.exports=r.p+"assets/img/1552373134638.64de5bfc.png"},669:function(t,e,r){t.exports=r.p+"assets/img/20190312145034.0a656cae.png"},670:function(t,e,r){t.exports=r.p+"assets/img/20190312145056.3f134cfe.png"},671:function(t,e,r){t.exports=r.p+"assets/img/20190312150103.4981632b.png"},672:function(t,e,r){t.exports=r.p+"assets/img/20190312150047.df608632.png"},673:function(t,e,r){t.exports=r.p+"assets/img/20190312151157.e0d24572.png"},674:function(t,e,r){t.exports=r.p+"assets/img/20190312151528.1be54755.png"},675:function(t,e,r){t.exports=r.p+"assets/img/20190312152642.636c3486.png"},676:function(t,e,r){t.exports=r.p+"assets/img/20190312153112.e10d3148.png"},677:function(t,e,r){t.exports=r.p+"assets/img/20190312153758.2decc7c9.png"},678:function(t,e,r){t.exports=r.p+"assets/img/20190312154059.a051284c.png"},679:function(t,e,r){t.exports=r.p+"assets/img/20190312154512.6da50cbb.png"},680:function(t,e,r){t.exports=r.p+"assets/img/20190312154925.f127eb93.png"},681:function(t,e,r){t.exports=r.p+"assets/img/20190312155458.c35956eb.png"},682:function(t,e,r){t.exports=r.p+"assets/img/20190312155710.3b00c0ae.png"},683:function(t,e,r){t.exports=r.p+"assets/img/20190312160126.44144b2b.png"},684:function(t,e,r){t.exports=r.p+"assets/img/20190312160629.4f000d32.png"},685:function(t,e,r){t.exports=r.p+"assets/img/20190312160828.c04ec122.png"},686:function(t,e,r){t.exports=r.p+"assets/img/20190312162211.93951a94.png"},687:function(t,e,r){t.exports=r.p+"assets/img/20190312161634.406c6ace.png"},688:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAn0AAABwCAYAAABrcsY6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAABd9SURBVHhe7d3vb9RWvsfx/YN4lEflEcqjSFeKVAkpDxq1CooUtmqKljJKhciKTbqluQqCjXpptFtINwq3UaK0SoKUlKs0qLlRUEsoYiqqYS8J3ewlsCVQZYcKeqXqe8+xfRyP59jjzAwQj98PXhKMPZ6MPT7++Pzyb375v18FAAAAjY3QBwAAkAGEPgAAgAwg9AEAAGTAb+7+708CAACAxkboAwAAyACadwEAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMSHXo27o1L73Hzsu1bftyANlTuDwlM6trsvXUvlzbvHxaDnZ0y4Ub3mvbBVn8+lHZehXdmpLcwLhMrN6Xom15VjwsyMz0ddmyLbNYXzgvZ4fPy/xd+3Lsws9r8uV/Lsq9Z5ZlFk++nZOJr9bkp4Tro7GkOPQVZflMh+x7pU1azlyvqsDdun1dllfqKS/rT+yf1QiKD4uyZVQI2sU789Lf3SP902vVXQxXzzvHdt8rKtTblj9PL/OzX7Qn9+Wa9bdcg9uB8PQ4L2Pq4q4v8M9DWWh4WpCPXtXHbkgWY87FzekTzjEeWNX/fyTzJ9vV/9vltZF8bFgs9UyWB/X72uTIXBWBsWHcl4nf6X3eLv1LRcvycteG9Ppm/6N6/5KrH74nb7z5nnT+cU5++Nm2TsCz7+Vizlv/wxX5ybYOGlq6m3e3r0p/sy48uuSjG8/s68QwBU/9nJCJe/bPSqWnRSlcGZdcV4c02b5vc4e8dnJUJm6EL3iPZOaYWa/KfULoezHuzcthczzrZSj/fLcfUBYa8qPSol5vGrwae7NRGvqUpxsycdwNcPuPz0ohSevBwwU5ov+O5iFZbuCbvUS8/b6vbVTyCULzbkNf/cvqBgqc23m5+HsvyP1+Ur6P+e3+MHHGWe+N3JjcrPgb/1Y+0evWzYfyxT9sn4MXaU+Gvq3VWetdvU1/d4ccePO0dVmZhY2Sz3ELkm4ZmLPUVuzSheN6W40T+oq3Z+VIS2khGel387IZen9+pMtd1qaCU8QFsXi3IIWH9mWEvhfEhLLjU9bf9a7MDctBva1g6Hv6bKd2OJYKXT16n7dJ7+X7luV2xVDAyH/s1v7n5sLbKL0pLAt92tNHsjiofrdtQ7L4IPB6BPNZ+1q6nKbiXXt/oey8SS91o+eUge0y8HXlG/BqQ19Tq2U/Vslv2m8E2yqgveuGq853P5WbRcs6303K2zp8vaXC198ty8sQ+hrRngx9pkCuu+DFSHELkvoEtXpu62XbXBqSVrPPWnpkYDov649DBfl2UdbzC3Kht1uaLKFP083B4Yuy48GC5LxAGVnoE/peDBP6QudGVWraVl7OOrX2p2T+sW15Ak9Mzb9N6bG0hj7tqQqIST6/HjWYx+znTWptrEk+6iYupNrQd3j6vnV5RbocStxsn1I6+OXek76Jv5U32/rNuoPyyeq/SpfV6Oaf3VD3ScJjiZdrT4e+pAVCReYivtvQ90RdACo123gFSaOEvqLaVybwNR2bStbM9ViFO9vrUQIXTELfS5YgqBUfVuivZi6mtYS+O1NuLeHxhcSDAcK25vqc49baM2yp6V+S9cC6poxxahXvFpyaysXpcWfd/h63JuiADpDWYPZI5nvdPoCHL1URQmoKx3uHGQwTpfdy9O+m9tBXlMLcglxLeINQGD8qTV3nZblBWmJ+2VyUPx0flHfCch+Uv+a87tW2vRWx/Pjn8r3tcxIg9KULoU8HtXxeLvSekAu3Au9RiitD0qQK9t4rEZ2TdT+W5g7JqQtHQ4Q+3Qm+zS1c93WOS+F53RkT+vYOP4BclcLlYTn8/lIodG3IWKda/rq6ASh53XCb9far38u1uxXCzMO18iZhz+LH7jnfOjhvXV4iOFDEMAM4mk/JvLW2qSjXJocl160DSZfsd45vtP1ter0eyV3Ml4XQrcun3D6unWqfVHOONEroq9AiE1crV2voW790wj0GbadlpsII4J0b2S71eckGmux5/5iTPr/ZtB7G5KbtcxIg9KXL3gx9wekU7i6F7th3xxndd2PcvfscLZR8jh/Ubl+XAX3BKCnEi+puXi/vk5kHRclPD6u/p7SJ89qQvts/KmPqMxoh9JmaEuc73bGvk5TfL3Ny56LpvzZ4wu30rbx2MnC8gn0uw8HLGVQy5dfCHOwZkrErG/aRlv6I0dnomoDAqNKyEaCW0Le5Oi9nT/a4n93RJ/2TS1KothlyL/EDyHVZ/0xfxEMjMG+5HfRbPi5I8d51+Wgo1A/Ne78zcKJSmPH3a40s2zcBpHWk9BwPWj7jvt8JdG3uoI2WY6Myo4NkXv2WdN+/SjX7G+o7msFjoZvExBok9Fk99W4SvDKkuJG3Bne3D3SbHLlYvky7thEua931/SCpyoNrIz1u8GvulrNfR4Q5/3i1V980nFarY26g+8Oc3LMtrxNCX7rsydBXosYLRdydZDCombv3w595BYM3Ms+5mG17oTA4Mu3hkuR0YeI1R6U/9JlpF3a+k329ZPxagEB/v0o1AyUXwWDw2i7IR13uRTqs6di8rIeDn7moxh0Pfx3LbyT42U/vy4w3qrNMc498lE95zUEwgJia3leHZdlr1ncHK7g3NiYU5gLNdu6AnQ61H0LbMtsPMvu12kEjF72bkvD2zSj+5nY54NTQlXOaGoO/E+9vaYkJiWXUb2HiWMRvIZLlN9jAoc/9jaj9qr6b7vJR8ZyPEA5oZaHPsz7d59XadknvXOlAPT2qdcBruWj1/p6S5Y2O0AeL9IS+XRaQppBIGvr80NPsNg/pPiD+xUytGw6F65N6ebv0r7h3pKkPfboTvFN4tskhE3xrYAt9/l2/GeWplNzpB5vt/ODVJ7nedml6/bSMrXq1MXfzMtbvjQ7W2wjPkVa30HdaBobU57SocDdXkHVnFOh9KVwZlUNmZHPzCZlJ6zHXQgFEN4Xpmj2nxsyEKXMTEA6FZuBE56zbXy5p6Itabpp/bc23WtT7vYv74c9mZUAvtyir5fFqMJOXK0V1jru/OX2jMeHVGpbUVJcYlsPOfIGW32Cl/ZBWG7Pu8W8ekkXvpuG51fQF7Aw80/MsFtxwFwjo1hvDLDChb3Dxuc7HR+hLF0JfsFBWFwJdeDSdPO3W4pmLmSMQClVBFm4OTn3oUwX2IafgjN9nSdlCny8ucBnmuGt62hfvIuLzm5GUcGf7uoU+RR3vGdv0HX6zkdv0WbY8LcqCmhmkcFR6+0tvbLRgKFx3jnGgObjW0FfL8o0N/8Ke6Fw0f2vvkmzpAVs6zK+qwHFlXi6o0DbgNeUfUKHe2Y5e36lNdG8KK5cvpubc8ndU+p5p5NeqJZugOUn5HGTWj2qi1b/Lg9752Dq4IDNeQLeWHVlhQt+fv7Uvj5SXCetgD7u3j7ihrzNnX16u+kEjqB2hr6RQfqZe8+beCl3sHCYUNuuLYmkzV/m2Usbs57h9FlinVPn3rl/osxwHz/pnPd46O33vHP72Y45H3N8Q+J5xT1rw52lrDn1+mpj9EDy/Avum9MZH2xm52qQvssEuD7ZtBVU6l2td7rGfi89kM29G6A5HTzge4A7m6PMHCqxfGpUJ79+Vy5fKoa9pOP57pEaw2bt/yatpC60TkqR8DjLrR4U+rXh7yr8Rc7SoY7dhXzfVth/JT1sJfDXihr5zS/blNs78fvWeny+s+kEjqB19+sKFsqnx+jfdnyvwuqMoiwNe4Raaed5+oUmRG+f9i2DlIBZW/r3rF/pi5m3z13leoe+EvZbPCKyX2uMeEdTMoAfrlCR3puQ153uX3vjs7dCnXh/2zt0SRyU3fF4uTC+Jfoxi4V6x4iMGtcqhpXLoiwswqaEC33ygq8W+oSXJj/TI/gpNqpX3Xymzfvw+23k0p9bUpcroBqzlM82pz0PfpU31Gb/IE1sgjLB0zn3vua/sy8vVd55A7E56Ql/nqVCfmXg5r+kvrlCxXRzcvnzRBYy/PDRdQ9SFJjUCISh3OaJ5Jvx0hVtTXpNw+feuX+iLqUWLWsfffszxiPsbkny2luRz9jrzHYJByn+8ofKq2gfhEa3+8lBTnm1bQWa/RiwvLg05yyNrwKLeH3q+r3vud8jhwUCZMJmXzY01N9Q5E42b0fmWY6eDzOh87ByVJoRU06dP9w/W70196As8us5t/dDHxowCjx88Uf/QV1ShvtsfzXvQG8Chm3eXG2GUfcAPi5/KJyOVDXpP6HjjzQ+k75x9nbBL30a3bEShT1+6NGzz7vqCW/iWTccRUBbUzIjczhNugR3okFyyXP89jda86z8RQRXgSfd1TOjJROjz+0Gm+Lhbgpo7IrddDh9zj+Fr46WjIv1H7Gl1bN41zfWRF/ao9weOZSTL7zA/4tYKDXwdfD0wYOP9q5Gj2E0IqSz63Dh8afcX2L3jmSyf8QLf6+o8uRI4Nn5zb/Q0KXUNfebxefrzm0/I2G11I/JA3Zj4we+0zDdiM2+c4oqce8uEvvfk3Yk1+3p1QOhLl4YNfUmUBjXTNNChCqJn/mjdnXm/TNNul5xdWXJrOgJTW6Q/9KlCfNC7W0/6APmYcLU3Ql+PTEQV9nF/Q5LP1vz1KjQD72VmP5jzy4zA1MfNjNZtDkx47DXt6hGRy84IdnUhNqO9w9sKiz2Xn6nzSy1Ty0tDWEDU+0M10IuDejs9MnZr5zW3di/wHu3rYWd7wWlb9OAUp7aowgCA3YaWID9spvwi6ZSRpgk1fGx0bXBrj1y4YW81qFvo216TMdOfsKXP73PpCAa/Ru3fF+HepQ+dINY5OCLn3lGhLPHzdneP0JcuDd+nLy6IlQQ1M0hDj+bTy/3Roe7yorpA6FGLTQNXS+afMqEw/aFP0U8Y8fZb3CS3Pj847bHQ93hJcpW2b6bssK3jbzf+eJqL975X1YXPsjwVSoKaGaSxM/GwbnLVIciZd03X4Dj91LzJu594o9ibvVBYS+jbXpJevSxJH86o7XsSn4tmmqIO92kjulnSCXwJAsJuQ4vPzPnp/32PZP1OSmv8tlWYNrW8tmPzvPv03V2Q3kq1eY/V/jbr6JHYMS0/DePHRRl0avkG5eJ3v8qPC8PSqQPgH+fk3jPL+jUi9KVLw/bp09y+PdGFv39x2DA1GqVzrjkXvJaj0n9p3i04zMVNL/cfWeZuP/GFZk8zF339XdrlyHRostOwvRr6Ak3VBy/amzX8kbe2v8HfbnnTpi/Q761Rpmzxa7eHA32xnJufdjlwbErmJ91QFLwhMO9xQmENoS/Yl7bp9VNywfa0lZj3ByU/F03tYocc7jFPd9DlgVn+SJYn52XZEsqShJatpWF3cujuUzKgy6SBPmn15nf0by4fePvszfAo6ZRJeGyMJPsvyKxvQt/63Gl/ihZd2xj7DN5gjZ9p/rWt1wh+XpNLf3RD2G+Hv3Hn53u2IV94r719ZrHuwY/Qly4N3bxbqfB3l/dI/0ComSpIP+7H6eNT/nB1Uwty4D/yslzhs1IjMIu9/s4He8dl0VYTsb0hyyPmcWq7DH1P1d23876YUOUHr2pCX7CpWv1tobv7nclcXXGhT9d69V8J/S4eB5qUmgM3Amlkglr/UFmXBZ8OX2ZeQt3sGWz6NzXi+oZptULoM82woe0Hn416qOfoznNx9Q2XHoBhwl/E+8PKznt9vM7MWp8dbAaPOMpqi7ybB68mMPi+RKHlzpQ/CXnQ/u7xnVGlpsbZa0Eo20Za7LKcTrT/Asz6OvRtXTntBnSltX8p2cTLfvBT5/NSmvtSxtj+m3zuhbs3cmNyM3iebH8rn+TcZZ0fzMr/VDiHdoPQly6EPr387n1Znr4aUXgUpTB9Wl47bpmC4Ol9ubbqBoJKn5Uqup9M2aPH2uXA63reMsvD6pv184lLtxEb+oKhTG+365QM6FqQjwPHODLQBcStE5g8WX9Gq1PbMiRHnGeutktuZNQNKEp06POeyKH+vb+tR3JnzjvP/j3gb7cBHuDu185dl61bCzIT9Vi5B9flo+6j1u9bvJ2XvK5pqVTTZ7F5ZSeA+zWMDwsyM9Sz8ztr7pbc6HVZT9LPVAmei5tXhr0aofJm461bs3LEPFnllY7ySYVNN4Ez10tfV0wIiQ0t4dHulsBqRvIejLr5SYsXGPr0/9dVmdw7vba7oLyxJGONGvjuLsqfzGjd3IhctfUx/vt/ySlvIuU3cn+RL27VZ18Q+tKF0FenoFbPbe0VmyvjsZPY7m/rk4HpvPViHB/6lO28nH29NFiWTNVRa+hTivlxOdwaCq+69uiyunCYgKJEhz61XV3TOxoIIJ79nUMycasBmomqCGqRdrGtrfyCDHTvBP+Dwyp0hm+qHq9Zw59f8xfBnWOwQw6a35d+jN5KoLZWbXfifW96D/3Zx3rc4BmuFfbmrrQ9ltCEkLjJuyt7JDPe48giB6+kxQsOffD8vCmrf/3Q6bPn1OL9flJublnWMx6syF/8qVzek3f+/XNZ/fvP9nUTWh0m9KVJekJfS5fbP2YX3P4zzyH0ldX4bchY1ESsjcCrsVjPX5drd+47/y5WuPAmVfRrQexP3aiHovOILffZuVX/3fpRXXcL7ve3jQRNq2pDn2U/bq24g52itlV8sCaLk0OlQVwFuYFw83nYw0IgpLnv0bU8ZSFRe7BQMq3SwfcD8+09uS/LH5/YqanVYfBrN7T5o3abe+SsFxALF7vVeh3+oJYgU0On1++dXCh7dmxFc1PSb0Jv0tHye5kl9G2tzlr7WmtmHtXoeQ5nS/rpmdBXV7v9ze8lxQ25OTUi75qaO6X3r9/Ij0n666mguDQ86AdF7bf9I/L5V3+TH50nckTYWpPVq9/I6ncb/kTLP6xOSp83NQyhLx0IfVUEtcK4vhh4BUeQHsVZpzAEvBDVhj4z8tUiWPtVvLskFwIDGHy7bLLVihu6iTkQGFvPl08cbZr1VaArmS7Ef4qI1i6HPg7XGBalMNkXqFVsd0Ng1Dn99L7MlHWBqIL+O6Oa1NPEEvr82v6qlJbL10btZXxNRtM4AGtDvjxzpiSwdf7hU1nd/MWybryfbi3KX/6wsx092vfcf//Tuq5ja1EGA59b4q0RuRoXGLFn0LxbTe3cjdGyAuTQyXFZ3u12gJet6uZdFXpOlp4D+jm1A3OhGrgneTkbGBjU2jMsEysRtXQJba6MyqGW8oFVRlHXSFtGcxbGe+TQ0ILkYwbebN2al/5OUwPXLWcr9NncupO31+Qlkd+oW435S2cpp4sbNeybFXu3Eaiwtjomb6ug9dv+Mfnyu1r75f0iP36nwl//B3LqUqV+pXmZOD4o74Sc+nC2qtCJl2Pvh76EI/Zstm5TeAAvm77462bxugac5x2WtuvXhSETaiinsVs/y08/1tYPD9m190MfAAAAakboAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAICG96v8P6CfytMEp8u9AAAAAElFTkSuQmCC"},801:function(t,e,r){"use strict";r.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls浏览器使用指南"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls浏览器使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS浏览器使用指南")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nuls-explorer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nuls-explorer","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NULS Explorer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(668),alt:"1552373134638"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"搜索"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#搜索","aria-hidden":"true"}},[this._v("#")]),this._v(" 搜索")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(669),alt:"20190312145034"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(670),alt:"20190312145056"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"共识奖励计算器"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#共识奖励计算器","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识奖励计算器")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(671),alt:"20190312150103"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(672),alt:"20190312150047"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"区块"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 区块")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(673),alt:"20190312151157"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(674),alt:"20190312151528"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"账户资产"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#账户资产","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户资产")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(675),alt:"20190312152642"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(676),alt:"20190312153112"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(677),alt:"20190312153758"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(678),alt:"20190312154059"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(679),alt:"20190312154512"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"节点信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#节点信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 节点信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(680),alt:"20190312154925"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(681),alt:"20190312155458"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"轮次信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#轮次信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 轮次信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(682),alt:"20190312155710"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(683),alt:"20190312160126"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(684),alt:"20190312160629"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(685),alt:"20190312160828"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"代币详情"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#代币详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 代币详情")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(686),alt:"20190312162211"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"合约认证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#合约认证","aria-hidden":"true"}},[this._v("#")]),this._v(" 合约认证")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(687),alt:"20190312161634"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"链接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#链接","aria-hidden":"true"}},[this._v("#")]),this._v(" 链接")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(688),alt:"20190312162707"}})])}],A=r(0),n=Object(A.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),r("p",[t._v("首先进入"),r("a",{attrs:{href:"https://nulscan.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS Explore"),r("OutboundLink")],1)]),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("​\tNULS浏览器是NULS核心团队开发的一个图形化的用户界面,为您提供与NULS区块链交互。通过NULS浏览器,您可以浏览NULS区块链的基本信息、已添加到NULS区块链中的区块、链上的交易、账户、共识及智能合约等相关信息.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),r("p",[t._v("​\t如果您想精确搜索某区块、交易、地址等信息,可以通过NULS Explorer首页或其他页面顶部导航栏中的搜索框进行搜索")]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),r("p",[t._v("​\tNULS区块链使用的是POC共识机制,您可以通过锁定一定数目(2000-500000)的NULS进行挖矿。NULS Explorer提供了共识奖励计算器,供您计算参与委托和创建节点的日、周、月、年奖励。共识奖励计算器中的参数都自带默认值,您可以随意进行修改计算(符合参数取值范围)。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏“区块”进入区块页面,区块列表中分页显示NULS链全部区块(高度、时间、交易数量、出块节点、区块大小、块奖励),可以通过列表右上角的“隐藏共识奖励区块”对列表进行筛选(过滤只有共识奖励的区块)。")]),t._v(" "),t._m(10),t._v(" "),r("p",[t._v("如果您需要查看某个区块的更多信息,直接点击该区块高度(或搜索框输入高度进行搜索),将跳转至区块详情页面看到该区块更为详细的参数信息。")]),t._v(" "),t._m(11),t._v(" "),r("p",[t._v("PS:区块列表中的出块节点、区块详情中的出块节点、打包地址、TXID都可以点击跳转至对应的详情页面。")]),t._v(" "),t._m(12),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“账户”进入账户页面,账户列表显示NULS区块链中所有持有NULS的账户地址信息(地址、总计、总收入、总支出),列表中“总计”列可以进行排序(默认从大到小)。")]),t._v(" "),t._m(13),t._v(" "),r("p",[t._v("如果您需要获取某个地址的更多信息,直接点击列表中的地址(或搜索框输入地址进行搜索),将跳转至地址详情页面,展示更多该地址的参数信息。")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),r("p",[t._v("​\tNULS Explorer中,您可以通过导航栏的“交易”进入交易页面(也可以通过首页“14天NULS交易历史”图表右上角的“更多”进入该页面),该页面上半部一图表方式显示交易历史数量,下部分以列表显示NULS区块链的全部交易,可以进行筛选和一次共识奖励交易。")]),t._v(" "),t._m(16),t._v(" "),r("p",[t._v("​\t当您需要查看某个交易的详细信息时,您可以点击交易列表中的TXID(或者在导航栏中的搜索框输入该交易的TXID进行搜索)进入该交易的详情页面,获取该交易的更多信息。")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“共识”进入共识页面(也可以通过点击首页的“共识节点”)。在共识页面,上部分显示NULS区块链的全网委托信息(图表),下部分显示节点信息和轮次信息。")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),r("p",[t._v("​\t您可以对节点信息的进行视图切换、排序、筛选(节点类型、别名、地址、ID)。")]),t._v(" "),t._m(21),t._v(" "),r("p",[t._v("如需查看某个节点的更多信息,可以点击节点进入详情页面(运行信息、基本信息、出块列表、当前委托信息、历史委托信息)")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),r("p",[t._v("​\t轮次信息显示当前轮次的信息和轮次列表(轮次、时间区间、出块节点数、红/黄牌、正常出块节点、丢块率)")]),t._v(" "),t._m(24),t._v(" "),r("p",[t._v("您可以点击轮次列表中的轮次查看该轮次的出块详情(首页的区块动图可以点击进入当前轮次详情页面),详情页面将展示更多更详细的轮次信息。")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“合约”进入合约页面,合约页面有全部合约和NRC-20合约。所有合约列表右上角有“隐藏NRC-20合约”,打开开关即可隐藏NRC-20合约。")]),t._v(" "),t._m(27),t._v(" "),r("p",[t._v("如果你需要查看合约的详情,直接点击列表中的合约地址即可进入合约详情页面(基本信息、交易列表、代码、方法)。")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),r("p",[t._v("​\t如果你需要查询NRC-20代币的信息,可以切换到NRC-20列表,点击通证的缩写,或者进入NRC-20合约详情页面点击基本信息中的“通证”。")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),r("p",[t._v("​\t在新版的NULS Explorer中,我们新增了合约代码认证的功能,极大地增强了合约的安全性。您可以在合约列表中直接点击状态列的未认证跳转至代码认证页面,或者进入合约详情页面点击代码,进行合约代码认证,您只需要上传该合约的压缩包即可,会自行认证返回结果。")]),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),r("p",[t._v("​\tNULS Explorer底部footer提供了一些链接,包含NULS官网、NULS GitHub、NULS网页轻钱包、NULS社区。")]),t._v(" "),t._m(34)])},s,!1,null,null,null);n.options.__file="NULSExplorerGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/140.1e504789.js b/docs/.vuepress/dist/assets/js/140.1e504789.js new file mode 100644 index 00000000..e46eb009 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/140.1e504789.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[140],{928:function(e,t,a){"use strict";a.r(t);var n=a(0),r=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"ways-of-creating-random-numbers-for-nuls"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ways-of-creating-random-numbers-for-nuls","aria-hidden":"true"}},[e._v("#")]),e._v(" Ways of creating random numbers for NULS")]),e._v(" "),a("blockquote",[a("p",[e._v("References:")]),e._v(" "),a("p",[e._v("[Solidity Pitfalls: Random Number Generation for Ethereum]\n(https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/)")]),e._v(" "),a("p",[e._v("[Predicting Random Numbers in Ethereum Smart Contracts]\n(https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620)")])]),e._v(" "),a("h3",{attrs:{id:"_1-linear-congruential-generator-lcg-algorithm-to-generate-pseudorandom-numbers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-linear-congruential-generator-lcg-algorithm-to-generate-pseudorandom-numbers","aria-hidden":"true"}},[e._v("#")]),e._v(" 1. "),a("code",[e._v("Linear Congruential Generator (LCG)")]),e._v(": algorithm to generate pseudorandom numbers")]),e._v(" "),a("p",[e._v("The NULS smart contract SDK provides a way to create random numbers. It takes the current block's miner address, contract address, contract invoker address, and current block’s timestamp as random factors, and uses the algorithm "),a("code",[e._v("linear congruential generator (LCG)")]),e._v(" to generate pseudorandom numbers")]),e._v(" "),a("p",[e._v("Invoking like this:")]),e._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[e._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[e._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * add a random factor\n */")]),e._v("\nio"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[e._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("long")]),e._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_2-using-the-blockhash-of-the-future-block"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-the-blockhash-of-the-future-block","aria-hidden":"true"}},[e._v("#")]),e._v(" 2. Using the "),a("code",[e._v("BlockHash")]),e._v(" of the future block")]),e._v(" "),a("p",[e._v("Taking lottery as an example, it needs to invoke contract transactions twice - close the lottery and pick the winner.")]),e._v(" "),a("p",[e._v("Once the lottery is closed, record the current block height H1 and generate a number N. Pick the winner when the height of the future block reaches "),a("code",[e._v("H1+N")]),e._v("。")]),e._v(" "),a("p",[e._v("When picking the winner, add up the recorded block height H1 and block number in interval (0~80] (to be determined) to the block height H2, and take the "),a("code",[e._v("BlockHash")]),e._v(" of the block H2 as a random seed.")]),e._v(" "),a("p",[e._v("ETH cannot use this way for the following reasons:\n"),a("img",{attrs:{src:"https://cdn-images-1.medium.com/max/1600/1*eyNTfWTkmM-3YuMca-1H0A.png",alt:""}})]),e._v(" "),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_3-random-seeds-limited-to-participants"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-random-seeds-limited-to-participants","aria-hidden":"true"}},[e._v("#")]),e._v(" 3. Random seeds limited to participants")]),e._v(" "),a("p",[e._v("In the case of lottery, we need more arbitrary data for picking our winner. When we determine the winner, we can use the addresses of the players that have entered our lottery smart contract as random factors to generate random numbers.")]),e._v(" "),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_4-commit-reveal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-commit-reveal","aria-hidden":"true"}},[e._v("#")]),e._v(" 4. commit-reveal")]),e._v(" "),a("p",[e._v("Also take the lottery as an example.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("The contract sets aside awards for the random number.")])]),e._v(" "),a("li",[a("p",[e._v("Each user generates own secret random number N.")])]),e._v(" "),a("li",[a("p",[e._v("Users can hash their N and address to generate the hash value of their secret random numbers: String hash = sha3(N + Msg.sender()).")])])]),e._v(" "),a("p",[e._v("Note: step 2 and 3 should be performed locally, for instance, the user submits N to the lottery application, which performs the hash operation.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Users submit their hash to the smart contract.")])]),e._v(" "),a("li",[a("p",[e._v("Submission is open until the number of blocks reaches a certain value, or until enough participants join.")])]),e._v(" "),a("li",[a("p",[e._v("Once the submission is closed, it’s time to pick the winner.")])]),e._v(" "),a("li",[a("p",[e._v("Each user submits their random number N to the smart contract.")])]),e._v(" "),a("li",[a("p",[e._v("The contract verifies sha3 (N + Msg.sender()) to match the original submission.")])]),e._v(" "),a("li",[a("p",[e._v("If the user fails to submit a valid N in time, his deposit will be forfeited.")])]),e._v(" "),a("li",[a("p",[e._v("Perform XOR operation on all-verified N to get random numbers.")])]),e._v(" "),a("li",[a("p",[e._v("These numbers are used to determine the winners --\x3e (N % numUsers).")])])])])}],!1,null,null,null);r.options.__file="randomImplementations.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/141.4bf908a3.js b/docs/.vuepress/dist/assets/js/141.4bf908a3.js new file mode 100644 index 00000000..ed4821e9 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/141.4bf908a3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[141],{926:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"wallet-adds-a-random-seed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-adds-a-random-seed","aria-hidden":"true"}},[t._v("#")]),t._v(" Wallet adds a random seed")]),t._v(" "),s("h2",{attrs:{id:"一、wallet-adds-a-random-seed-rpc-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、wallet-adds-a-random-seed-rpc-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、Wallet adds a random seed RPC interface")]),t._v(" "),s("p",[t._v("The random seed you get is a big number, and notice, it could be a negative number")]),t._v(" "),s("h3",{attrs:{id:"get-a-random-seed-list-based-on-the-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-a-random-seed-list-based-on-the-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get a random seed list based on the height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cutoff height, cannot exceed startHeight+1000")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"get-random-seed-list-according-to-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-random-seed-list-according-to-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get random seed list according to height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cut-off height,endHeight-startHeight<=1000")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),s("h2",{attrs:{id:"二、smart-contracts-support-random-numbers-in-the-underlying-chain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、smart-contracts-support-random-numbers-in-the-underlying-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、Smart contracts support random Numbers in the underlying chain")]),t._v(" "),s("p",[t._v("Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code.\nTake one of these methods as an example"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v(" Shows how to generate random Numbers using random number seeds.")]),t._v(" "),s("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height range, a specific algorithm is used to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get the set of original seeds according to the height range\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"_2)-a-dice-example-shaking-at-the-same-time-n"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2)-a-dice-example-shaking-at-the-same-time-n","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) A dice "),s("code",[t._v("example")]),t._v(" shaking at the same time N")]),t._v(" "),s("h4",{attrs:{id:"_2-1-calculation-method-1"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-calculation-method-1","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) Calculation method 1")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("The original seed is multiplied by the number of tosses, resulting in an array of bytes")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"_2-2-calculation-method-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-calculation-method-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) Calculation method 2")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/142.618b966f.js b/docs/.vuepress/dist/assets/js/142.618b966f.js new file mode 100644 index 00000000..c6a62faf --- /dev/null +++ b/docs/.vuepress/dist/assets/js/142.618b966f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[142],{924:function(t,s,e){"use strict";e.r(s);var a=e(0),r=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"service-charge-for-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#service-charge-for-smart-contracts","aria-hidden":"true"}},[t._v("#")]),t._v(" Service charge for smart contracts")]),t._v(" "),e("h3",{attrs:{id:"_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?")]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Background:")]),t._v(" Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.")])]),t._v(" "),e("p",[t._v("In the main-net, there are now three more types of transactions: "),e("code",[t._v("creating a smart contract")]),t._v(", "),e("code",[t._v("invoking a smart contract")]),t._v(", "),e("code",[t._v("deleting a smart contract")])]),t._v(" "),e("p",[t._v("The difference between those three transactions and other transactions such as "),e("code",[t._v("transfer")]),t._v(" is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.")]),t._v(" "),e("ul",[e("li",[t._v("Calculation of smart contract service charge")])]),t._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" COMPARISON "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Compare bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONSTANT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Simple numeric type bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LDC "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Numeric constant, string constant (length * LDC) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONTROL "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Control bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TABLESWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * TABLESWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOOKUPSWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * LOOKUPSWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONVERSION "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Value conversion ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" EXTENDED "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Null determine ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MULTIANEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Multidimensional Array (size * MULTIANEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send the local variable to the top of the stack \n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYLOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send an item of the array to the top of the stack\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MATH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Mathematical operations and shift operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" REFERENCE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Object related operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" NEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//One-dimensional array (size * NEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STACK "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Stack operation ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Save the value in the top of the stack to a local variable ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYSTORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Save the value of the stack to an array ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TRANSFER "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Transfer transaction")]),t._v("\n\n")])])]),e("ul",[e("li",[t._v("Total service charge for invoking a smart contract\nThe total service charge for a contract transaction consists of three parts")])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.")])]),t._v(" "),e("li",[e("p",[t._v("The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.")])])]),t._v(" "),e("blockquote",[e("p",[t._v("For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.")])]),t._v(" "),e("ul",[e("li",[t._v("The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")])]),t._v(" "),e("ul",[e("li",[t._v("How much does a contract invoker pay?")])]),t._v(" "),e("p",[t._v("To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")]),t._v(" "),e("ul",[e("li",[t._v("Who receives the service charge?")])]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Precondition:")]),t._v("This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.")])]),t._v(" "),e("p",[t._v("The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.")])])}],!1,null,null,null);r.options.__file="smartContractFee.md";s.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/143.36491f90.js b/docs/.vuepress/dist/assets/js/143.36491f90.js new file mode 100644 index 00000000..72c4bbe7 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/143.36491f90.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[143],{922:function(t,n,a){"use strict";a.r(n);var s=a(0),e=Object(s.a)({},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[a("router-link",{attrs:{to:"/startNULS/connectTestnet.html"}},[t._v("Preparations for deployment and invocation of smart contracts")])],1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("Preparations for the development of smart contract code")]),t._v(" "),a("p",[t._v("[Downloading JDK8]\n(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading NULS smart contract plug-ins]\n(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)")]),t._v(" "),a("p",[t._v("[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._m(7),t._v(" "),a("p",[t._v("[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)")]),t._v(" "),a("p",[t._v("[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)")]),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("[How to deploy and invoke the wallet smart contract]\n(https://dev.nuls.io/zh-cn/contract/smartContract.html)")]),t._v(" "),t._m(9),t._v(" "),a("p",[t._v("[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)")])])},[function(){var t=this.$createElement,n=this._self._c||t;return n("h1",{attrs:{id:"quick-start"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick Start")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Running the test-net environment, creating an account, and claiming test tokens.")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_3-smart-contract-example"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. Smart contract example")])},function(){var t=this.$createElement,n=this._self._c||t;return n("p",[n("strong",[this._v("_Quickly compile and deploy a smart contract with the example _")])])},function(){var t=this.$createElement,n=this._self._c||t;return n("ul",[n("li",[this._v("Simple example")])])},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigDecimal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nPublic "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n Private String sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferToContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// mark the @Payable annotation. Smart contract can receive NULS when invoking this method")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigDecimal nuls "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigDecimal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("movePointLeft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I received your transfer amount: "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toPlainString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayWhat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("If")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say nothing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_4-smart-contract-repository"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-smart-contract-repository","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Smart contract repository")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_5-deploying-and-invoking-smart-contracts"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_5-deploying-and-invoking-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. Deploying and invoking smart contracts")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_6-smart-contract-specifications-and-syntax"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_6-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Smart contract specifications and syntax")])}],!1,null,null,null);e.options.__file="startSmartContract.md";n.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/144.76d9a156.js b/docs/.vuepress/dist/assets/js/144.76d9a156.js new file mode 100644 index 00000000..a47f4deb --- /dev/null +++ b/docs/.vuepress/dist/assets/js/144.76d9a156.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[144],{916:function(e,t,n){"use strict";n.r(t);var o=n(0),i=Object(o.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"launching-nuls-with-source-code"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-nuls-with-source-code","aria-hidden":"true"}},[e._v("#")]),e._v(" Launching NULS with source code")]),e._v(" "),n("h2",{attrs:{id:"downloading-source-code"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-source-code","aria-hidden":"true"}},[e._v("#")]),e._v(" Downloading source code")]),e._v(" "),n("p",[e._v("Visit the NULS project on github: https://github.com/nuls-io/nuls")]),e._v(" "),n("p",[e._v("Option 1: downloading the source code directly")]),e._v(" "),n("pre",[n("code",[e._v('After accessing the github, click the "Clone or download" button and select Download ZIP to download the source-code package.\n')])]),e._v(" "),n("p",[e._v("Option 2: running the git command to clone the NULS repository")]),e._v(" "),n("pre",[n("code",[e._v("` git clone https://github.com/nuls-io/nuls.git`\n")])]),e._v(" "),n("p",[e._v("Option 3: (recommended): cloning the NULS repository with development tools such as IntelliJ IDEA.")]),e._v(" "),n("h2",{attrs:{id:"environment-description"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#environment-description","aria-hidden":"true"}},[e._v("#")]),e._v(" Environment description")]),e._v(" "),n("pre",[n("code",[e._v("Operating Systems: macOS, Windows\n\nBuilding Tools: maven\n\nDevelopment Tools: IntelliJ IDEA\n\nDevelopment Language: Java (JDK1.8)\n")])]),e._v(" "),n("h2",{attrs:{id:"basic-introduction-of-launching-nuls"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#basic-introduction-of-launching-nuls","aria-hidden":"true"}},[e._v("#")]),e._v(" Basic introduction of launching NULS")]),e._v(" "),n("pre",[n("code",[e._v("Since blockchain is a decentralized network composed of multiple nodes, it makes no sense to launch a node with NULS source code alone, and it is also not feasible. This tutorial assumes an existing custom test-net running with NULS source code, and the source code other than the network parameters is not modified when building the network. How can we run the NULS source code and join the network \n")])]),e._v(" "),n("ol",[n("li",[e._v("First install jdk1.8 and the build tool - maven.")])]),e._v(" "),n("p",[e._v("2. Run IntelliJ IDEA\n     - If you download the source code package, extract it and import the NULS project via IntelliJ IDEA\n     - If you download the source code by running git command to clone the NULS repository, import the NULS project via IntelliJ IDEA.\n     - Clone the NULS repository via IntelliJ IDEA’s Git plugin.\n 3. Configure network environment parameters consistent with the existing network.\n     - Open the module.ini configuration file in the client-module project\n     - It is recommended to replace the module.ini file with that of other nodes in the known custom test-net to ensure the consistency of the network environment parameters.\n 4. Run the NULS boot class Bootstrap.java in the client-module project, located in "),n("code",[e._v("io.nuls.client")]),e._v(" package.\n 5. The NULS wallet interface will be opened during start-up process and the block height of the custom test-net will be synchronized, indicating that the startup is successful.")])])}],!1,null,null,null);i.options.__file="sourceCodeStartNULS.md";t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/145.be4615d5.js b/docs/.vuepress/dist/assets/js/145.be4615d5.js new file mode 100644 index 00000000..0897257e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/145.be4615d5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[145],{914:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"api手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#api手册","aria-hidden":"true"}},[this._v("#")]),this._v(" API手册")])])}],!1,null,null,null);i.options.__file="APIManual.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/146.a073f6bd.js b/docs/.vuepress/dist/assets/js/146.a073f6bd.js new file mode 100644 index 00000000..a2277770 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/146.a073f6bd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[146],{910:function(a,t,s){"use strict";s.r(t);var e=s(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,s=a._self._c||t;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"nrc-20合约标准"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nrc-20合约标准","aria-hidden":"true"}},[a._v("#")]),a._v(" NRC-20合约标准")]),a._v(" "),s("h2",{attrs:{id:"简述"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#简述","aria-hidden":"true"}},[a._v("#")]),a._v(" 简述")]),a._v(" "),s("p",[a._v("token的接口标准")]),a._v(" "),s("h2",{attrs:{id:"摘要"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[a._v("#")]),a._v(" 摘要")]),a._v(" "),s("p",[a._v("以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。")]),a._v(" "),s("h2",{attrs:{id:"动机"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[a._v("#")]),a._v(" 动机")]),a._v(" "),s("p",[a._v("标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。")]),a._v(" "),s("h2",{attrs:{id:"规则"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#规则","aria-hidden":"true"}},[a._v("#")]),a._v(" 规则")]),a._v(" "),s("h2",{attrs:{id:"token"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#token","aria-hidden":"true"}},[a._v("#")]),a._v(" Token")]),a._v(" "),s("h3",{attrs:{id:"方法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#方法","aria-hidden":"true"}},[a._v("#")]),a._v(" 方法")]),a._v(" "),s("p",[s("strong",[a._v("注意")]),a._v(": 调用者必须处理返回"),s("code",[a._v("false")]),a._v("的"),s("code",[a._v("return boolean")]),a._v(".调用者绝对不能假设返回"),s("code",[a._v("false")]),a._v("的情况不存在。")]),a._v(" "),s("h4",{attrs:{id:"name"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#name","aria-hidden":"true"}},[a._v("#")]),a._v(" name")]),a._v(" "),s("p",[a._v("返回令牌的名称 - 例如 "),s("code",[a._v('"MyToken"')]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("name")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"symbol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#symbol","aria-hidden":"true"}},[a._v("#")]),a._v(" symbol")]),a._v(" "),s("p",[a._v('返回令牌的符号 - 例如 "MT".')]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("symbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"decimals"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#decimals","aria-hidden":"true"}},[a._v("#")]),a._v(" decimals")]),a._v(" "),s("p",[a._v("返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("int")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("decimals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"totalsupply"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#totalsupply","aria-hidden":"true"}},[a._v("#")]),a._v(" totalSupply")]),a._v(" "),s("p",[a._v("返回总令牌供应量。")]),a._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[a._v("@View\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("totalSupply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"balanceof"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceof","aria-hidden":"true"}},[a._v("#")]),a._v(" balanceOf")]),a._v(" "),s("p",[a._v("返回地址为“owner”的帐户余额。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("balanceOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"transfer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[a._v("#")]),a._v(" transfer")]),a._v(" "),s("p",[a._v("转移"),s("code",[a._v("value")]),a._v("的token数量到的地址"),s("code",[a._v("to")]),a._v(",并且必须触发"),s("code",[a._v("TransferEvent")]),a._v("事件。 如果"),s("code",[a._v("from")]),a._v("帐户余额没有足够的令牌来支出,该函数应该被revert。")]),a._v(" "),s("p",[a._v("创建新令牌的令牌合同应该在创建令牌时将"),s("code",[a._v("from")]),a._v("地址设置为"),s("code",[a._v("null")]),a._v("触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("p",[a._v("注意 0值的传输必须被视为正常传输并触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("transfer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"transferfrom"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transferfrom","aria-hidden":"true"}},[a._v("#")]),a._v(" transferFrom")]),a._v(" "),s("p",[a._v("从地址"),s("code",[a._v("from")]),a._v("发送数量为"),s("code",[a._v("value")]),a._v("的token到地址"),s("code",[a._v("to")]),a._v(",必须触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("p",[s("code",[a._v("transferFrom")]),a._v("方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了"),s("code",[a._v("from")]),a._v("帐户已经通过某种机制(比如调用"),s("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(")故意地授权消息的发送者之外,否则该函数应该"),s("code",[a._v("revert")]),a._v("。")]),a._v(" "),s("p",[a._v("注意 0值的传输必须被视为正常传输并触发传输事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("transferFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address from"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"approve"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#approve","aria-hidden":"true"}},[a._v("#")]),a._v(" approve")]),a._v(" "),s("p",[a._v("允许"),s("code",[a._v("spender")]),a._v("多次支配您的帐户,最高达"),s("code",[a._v("value")]),a._v("金额。 如果再次调用此函数,它将以"),s("code",[a._v("value")]),a._v("覆盖当前的余量。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("approve")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"allowance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#allowance","aria-hidden":"true"}},[a._v("#")]),a._v(" allowance")]),a._v(" "),s("p",[a._v("返回"),s("code",[a._v("spender")]),a._v("仍然被允许从"),s("code",[a._v("owner")]),a._v("提取的金额。\nReturns the amount which "),s("code",[a._v("spender")]),a._v(" is still allowed to withdraw from "),s("code",[a._v("owner")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("allowance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h3",{attrs:{id:"events"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#events","aria-hidden":"true"}},[a._v("#")]),a._v(" Events")]),a._v(" "),s("h4",{attrs:{id:"transferevent"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transferevent","aria-hidden":"true"}},[a._v("#")]),a._v(" TransferEvent")]),a._v(" "),s("p",[a._v("当token被转移(包括0值),必须被触发。")]),a._v(" "),s("p",[a._v("创建新令牌的令牌合同应该在创建令牌时将"),s("code",[a._v("from")]),a._v("地址设置为"),s("code",[a._v("null")]),a._v("触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("TransferEvent")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("Address from"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),s("h4",{attrs:{id:"approvalevent"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#approvalevent","aria-hidden":"true"}},[a._v("#")]),a._v(" ApprovalEvent")]),a._v(" "),s("p",[a._v("当任何成功调用"),s("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v("后,必须被触发。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("ApprovalEvent")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),s("h2",{attrs:{id:"implementation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementation","aria-hidden":"true"}},[a._v("#")]),a._v(" Implementation")]),a._v(" "),s("h4",{attrs:{id:"example-implementations-are-available-at"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-implementations-are-available-at","aria-hidden":"true"}},[a._v("#")]),a._v(" Example implementations are available at")]),a._v(" "),s("ul",[s("li",[a._v("https://github.com/nuls-io/nuls-nrc20")])])])}],!1,null,null,null);n.options.__file="NRC-20TokenStandard.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/147.fec28542.js b/docs/.vuepress/dist/assets/js/147.fec28542.js new file mode 100644 index 00000000..fa78a0fa --- /dev/null +++ b/docs/.vuepress/dist/assets/js/147.fec28542.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[147],{908:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等")]),t._v(" "),t._m(2),t._v(" "),a("h4",{attrs:{id:"前往体验"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#前往体验","aria-hidden":"true"}},[t._v("#")]),t._v(" "),a("router-link",{attrs:{to:"/zh/NULS2.0/"}},[t._v("前往体验")])],1)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"欢迎来到nuls"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#欢迎来到nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" 欢迎来到NULS")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nuls2-0-alpha版本已发布"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha版本已发布","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha版本已发布")])}],!1,null,null,null);r.options.__file="README.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/148.1a4b00b2.js b/docs/.vuepress/dist/assets/js/148.1a4b00b2.js new file mode 100644 index 00000000..7adeabce --- /dev/null +++ b/docs/.vuepress/dist/assets/js/148.1a4b00b2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[148],{904:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("​\t本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("Linux内核版本推荐使用 2.6.32及以上")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),a("ul",[t._m(15),t._v(" "),a("li",[a("p",[t._v("进入"),a("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官网钱包下载"),a("OutboundLink")],1),t._v("界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。")]),t._v(" "),a("p",[t._v("Linux系统中下载v1.0.0版的钱包可以使用如下命令:")]),t._v(" "),t._m(16),a("p",[t._v("注:如果后续有其他版本,下载地址可能会不同。")])])]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("输出打印所有的命令,")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("返回信息 help")]),t._v(" "),t._m(30),a("p",[t._v("返回信息 help -a")]),t._v(" "),t._m(31),a("p",[t._v("示例")]),t._v(" "),t._m(32),t._m(33),t._v(" "),a("p",[t._v("创建账户,返回账户地址集合")]),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter;")]),t._v(" "),a("p",[t._v("返回账户集合")]),t._v(" "),t._m(36),a("p",[t._v("示例 创建2个没有密码的账户")]),t._v(" "),t._m(37),t._m(38),t._v(" "),a("p",[t._v("备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),a("p",[t._v("注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。")]),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(41),a("p",[t._v("示例 备份一个有密码的账户")]),t._v(" "),t._m(42),t._m(43),t._v(" "),a("p",[t._v("根据账户地址移除本地账户,如果账户已加密,则需要输入密码")]),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(46),a("p",[t._v("示例")]),t._v(" "),t._m(47),t._m(48),t._v(" "),a("p",[t._v("根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。")]),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(51),a("p",[t._v("示例")]),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(56),a("p",[t._v("示例")]),t._v(" "),t._m(57),t._m(58),t._v(" "),a("p",[t._v("给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示")]),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("返回信息 交易hash")]),t._v(" "),t._m(61),a("p",[t._v("示例")]),t._v(" "),t._m(62),t._m(63),t._v(" "),a("p",[t._v("导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),a("p",[t._v("注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(66),a("p",[t._v("示例")]),t._v(" "),t._m(67),t._m(68),t._v(" "),a("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("p",[t._v("注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(71),a("p",[t._v("示例")]),t._v(" "),t._m(72),t._m(73),t._v(" "),a("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。")]),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),a("p",[t._v("注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。")]),t._v(" "),a("p",[t._v("覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(76),a("p",[t._v("示例")]),t._v(" "),t._m(77),t._m(78),t._v(" "),a("p",[t._v("根据账户地址查询账户信息")]),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(81),a("p",[t._v("示例")]),t._v(" "),t._m(82),t._m(83),t._v(" "),a("p",[t._v("根据分页参数查询账户列表,所有账户以创建时间倒序输出。")]),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),a("p",[t._v("返回信息,将输出账户集合")]),t._v(" "),t._m(86),a("p",[t._v("示例 获取账户列表 显示第一页,每页显示2条")]),t._v(" "),t._m(87),t._m(88),t._v(" "),a("p",[t._v("根据账户地址查询账户私钥,如果账户已加密,则需要输入密码")]),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(91),a("p",[t._v("示例")]),t._v(" "),t._m(92),t._m(93),t._v(" "),a("p",[t._v("根据账户地址查询账户余额")]),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(96),a("p",[t._v("示例")]),t._v(" "),t._m(97),t._m(98),t._v(" "),a("p",[t._v("根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。")]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),a("p",[t._v("返回信息 转账交易hash")]),t._v(" "),t._m(101),a("p",[t._v("示例")]),t._v(" "),t._m(102),t._m(103),t._v(" "),a("p",[t._v("根据交易hash查询交易详细信息")]),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),a("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(106),a("p",[t._v("示例 查询转账交易")]),t._v(" "),t._m(107),t._m(108),t._v(" "),a("p",[t._v("根据账户地址,查询该账户的交易列表")]),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),a("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(111),a("p",[t._v("示例")]),t._v(" "),t._m(112),t._m(113),t._v(" "),a("p",[t._v("根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。")]),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),a("p",[t._v("返回信息 返回节点的agent hash")]),t._v(" "),t._m(116),a("p",[t._v("示例 创建一个节点,佣金比例为10%,押金20000NULS。")]),t._v(" "),t._m(117),t._m(118),t._v(" "),a("p",[t._v("根据账户地址和节点agentHash,加入共识,至少需要2000NULS")]),t._v(" "),t._m(119),t._v(" "),t._m(120),t._v(" "),a("p",[t._v("返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。")]),t._v(" "),t._m(121),a("p",[t._v("示例")]),t._v(" "),t._m(122),t._m(123),t._v(" "),a("p",[t._v("根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。")]),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("返回信息 退出共识交易hash")]),t._v(" "),t._m(126),a("p",[t._v("示例")]),t._v(" "),t._m(127),t._m(128),t._v(" "),a("p",[t._v("停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。")]),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),a("p",[t._v("返回信息 停止节点交易hash")]),t._v(" "),t._m(131),a("p",[t._v("示例")]),t._v(" "),t._m(132),t._m(133),t._v(" "),a("p",[t._v("根据节点agentHash获取节点详情")]),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(136),a("p",[t._v("示例")]),t._v(" "),t._m(137),t._m(138),t._v(" "),a("p",[t._v("根据共识节点列表")]),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(141),a("p",[t._v("示例")]),t._v(" "),t._m(142),t._m(143),t._v(" "),a("p",[t._v("查询全网共识总体信息")]),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(145),a("p",[t._v("示例")]),t._v(" "),t._m(146),t._m(147),t._v(" "),a("p",[t._v("根据账户地址获取该账户参与的所有委托(共识)信息的总览")]),t._v(" "),t._m(148),t._v(" "),t._m(149),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(150),a("p",[t._v("示例")]),t._v(" "),t._m(151),t._m(152),t._v(" "),a("p",[t._v("根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表")]),t._v(" "),t._m(153),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(155),a("p",[t._v("示例")]),t._v(" "),t._m(156),t._m(157),t._v(" "),a("p",[t._v("根据地址查询该账户委托的节点列表(返回节点信息列表)")]),t._v(" "),t._m(158),t._v(" "),t._m(159),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(160),a("p",[t._v("示例 获取第一页,每页显示两条")]),t._v(" "),t._m(161),t._m(162),t._v(" "),a("p",[t._v("获取最新的区块头信息")]),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(164),a("p",[t._v("示例")]),t._v(" "),t._m(165),t._m(166),t._v(" "),a("p",[t._v("根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(169),a("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(170),t._m(171),t._v(" "),a("p",[t._v("根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(174),a("p",[t._v("示例 根据高度获取区块头")]),t._v(" "),t._m(175),t._m(176),t._v(" "),a("p",[t._v("查询网络基本信息")]),t._v(" "),t._m(177),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(178),a("p",[t._v("示例")]),t._v(" "),t._m(179),t._m(180),t._v(" "),a("p",[t._v("查询网络节点IP")]),t._v(" "),t._m(181),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(182),a("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(183),t._m(184),t._v(" "),a("p",[t._v("查询当前版本号")]),t._v(" "),t._m(185),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(186),a("p",[t._v("示例")]),t._v(" "),t._m(187),t._m(188),t._v(" "),a("p",[t._v("查询当前版本号")]),t._v(" "),t._m(189),t._v(" "),a("p",[t._v("示例")]),t._v(" "),t._m(190),t._m(191),t._v(" "),a("p",[t._v("退出操作钱包的命令行程序,不会退出已启动的钱包节点。")]),t._v(" "),t._m(192),t._v(" "),a("p",[t._v("示例")]),t._v(" "),t._m(193)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"linux-cli-手册"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#linux-cli-手册","aria-hidden":"true"}},[this._v("#")]),this._v(" Linux CLI 手册")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"版本更新记录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内容")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-12")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("主网正式版全部功能")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"准备"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#准备","aria-hidden":"true"}},[this._v("#")]),this._v(" 准备")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"服务器硬件配置"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#服务器硬件配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 服务器硬件配置")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("建立NULS节点的服务器不低于如下配置:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("四核 3.0GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("128G硬盘")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20M上行")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("推荐配置:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("八核 3.0GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("256G硬盘")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("100M上行")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"系统及内核版本"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#系统及内核版本","aria-hidden":"true"}},[this._v("#")]),this._v(" 系统及内核版本")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("Linux系统")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("CentOS (推荐)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"开始"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 开始")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"下载"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#下载","aria-hidden":"true"}},[this._v("#")]),this._v(" 下载")])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"安装"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[this._v("#")]),this._v(" 安装")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("在Linux中解压已下载的文件")]),this._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"运行"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#运行","aria-hidden":"true"}},[this._v("#")]),this._v(" 运行")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("进入解压后的bin目录,并运行启动脚本,启动全节点钱包")]),this._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ cd bin\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"使用钱包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 使用钱包")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"快速入门"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。")]),t._v(" "),a("p",[t._v("进入bin目录,执行如下命令:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("$ ./cmd.sh\n")])])]),a("p",[t._v("将会出现NULS命名输入提示符"),a("code",[t._v("nuls>>>")]),t._v(" ,然后可直接输入NULS钱包操作命令,来进行操作。")]),t._v(" "),a("p",[t._v("例如,创建账户的示例如下:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),a("p",[t._v("执行"),a("code",[t._v("create")]),t._v("命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"约定"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("设置密码规则:密码长度在8至20位,必须同时包含字母和数字。")]),this._v(" "),s("li",[this._v('命令参数说明: 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。')])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"钱包命令"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#钱包命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 钱包命令")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"帮助命令"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#帮助命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 帮助命令")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令: help [-a] **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[this._v("-a")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("格式化打印命令,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("getaccount
--get account information\n\tOPTIONS"),s("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> help\nnuls>>> help -a\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"创建账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令: create [number] **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("创建账户的数量,选填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> create 2\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:\n[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"备份账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:backup
[path]")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("[path]")]),t._v(" "),a("td",[t._v("文件生成备份文件的目标文件夹,默认为当前文件夹,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nThe path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"移除账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 移除账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:remove
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"设置账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#设置账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:setpwd
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"修改账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#修改账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:resetpwd
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nEnter your old password:**********\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"设置别名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:setalias
")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户的地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("别名名称,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias\n"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户keystore")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:importkeystore **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("待导入的keystore文件地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:import **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户私钥-覆盖导入"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥-覆盖导入","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥(覆盖导入)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:import **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getaccount
")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("账户地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//别名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//公钥\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//私钥(如果账户设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加密后的私钥(如果账户没有设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//是否加密(是否设置了密码"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\n{\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getaccounts ")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//别名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//公钥\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//私钥(如果账户设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加密后的私钥(如果账户没有设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//是否加密(是否设置了密码"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:02:23"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getaccounts 1 2\n[ {\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}, {\n "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",\n "alias" : null,\n "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",\n "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",\n "encryptedPriKey" : "",\n "extend" : null,\n "createTime" : "2018-07-13 11:02:23",\n "encrypted" : false\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getprikey
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\n"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户余额"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户余额")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getbalance
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//已锁定余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//可用余额\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "balance" : "9999998.99",\n "locked" : "0",\n "usable" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"转账"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 转账")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:transfer
[remark] **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("转出地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("接收地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("转账数量,最多可以有8位小数(单位:NULS),必填")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("备注信息,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询交易详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:gettx ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("交易hash,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型(此示例为转账交易)\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包交易的区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//(转账)交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//备注\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//签名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易确认状态(已确认或者未确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("46")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("254")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易的输入\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979998.98"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易的输出\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"')]),t._v("//交易输出的目标地址(此数据相当于转出"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("给目标地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易输出的目标地址(此数据相当于找零给自己"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979898.979"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596\n{\n "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "type" : "transfer",\n "time" : "2018-07-16 11:21:46",\n "blockHeight" : 26269,\n "fee" : "0.001",\n "value" : "100",\n "remark" : "转账",\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",\n "status" : "confirm",\n "confirmCount" : 46,\n "size" : 254,\n "inputs" : [ {\n "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979998.98",\n "lockTime" : 0\n } ],\n "outputs" : [ {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 0,\n "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",\n "value" : "100",\n "lockTime" : 0,\n "status" : "usable"\n }, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979898.979",\n "lockTime" : 0,\n "status" : "usable"\n } ]\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询交易列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询交易列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:gettxlist
")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26473")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:55:43"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("//信息\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10\n[ {\n "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",\n "blockHeight" : 26473,\n "time" : "2018-07-16 11:55:43",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n}, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "blockHeight" : 26269,\n "time" : "2018-07-16 11:21:46",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"创建节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建节点")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:createagent **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("创建节点的账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("代理佣金比例,范围:10~100,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("创建节点的保证金,不能低于20000NULS,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"加入共识(委托节点)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#加入共识(委托节点)","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入共识(委托节点)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:deposit
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("节点的agentHash,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("加入共识保证金,不能低于2000NULS,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"退出共识(退出委托)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#退出共识(退出委托)","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识(退出委托)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:withdraw
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("委托时的交易hash,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"停止节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#停止节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 停止节点")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:stopagent
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取节点详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取节点详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取节点详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getagent **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("节点agentHash值,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6\n{\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.05,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取节点列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取节点列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取节点列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getagents **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getagents 1 2\n[ {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.18,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}, {\n "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",\n "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "deposit" : "20000",\n "commissionRate" : 10.0,\n "agentName" : null,\n "agentId" : "5CE291D8",\n "time" : "2018-07-16 16:31:12",\n "blockHeight" : 28126,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.16,\n "totalDeposit" : "208000",\n "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取全网共识总体信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取全网共识总体信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取全网共识总体信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getconsensus **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1758000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//总委托数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusAccountNumber"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识账户数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAgentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v("//打包地址数量\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getconsensus\n{\n "agentCount" : 6,\n "totalDeposit" : "1758000",\n "rewardOfDay" : "0",\n "consensusAccountNumber" : 6,\n "packingAgentCount" : 6\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托总览"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托总览","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托总览")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositedinfo
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建的节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1600000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//总共委托的数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"joinAgentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加入委托的节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usableBalance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8048998.869"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//可用余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//得到的奖励总数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//一天得到的奖励数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"')]),t._v("//节点hash\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "agentCount" : 1,\n "totalDeposit" : "1600000",\n "joinAgentCount" : 6,\n "usableBalance" : "8048998.869",\n "reward" : "219.65910271",\n "rewardOfDay" : "219.65910271",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托信息列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托信息列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托信息列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositeds
[agentHash] **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])]),t._v(" "),a("tr",[a("td",[t._v("[agentHash]")]),t._v(" "),a("td",[t._v("节点Hash,选填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托金额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托者地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:38:25"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28148")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),t._v("//节点地址\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "deposit" : "2000",\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:25",\n "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",\n "blockHeight" : 28148,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "35024DE6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"\n}, {\n "deposit" : "2000",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:43",\n "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",\n "blockHeight" : 28149,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "E09EB7FD",\n "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托节点列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托节点列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托节点列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositedagents
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0198ACAF"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:32:52"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28136")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"204000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",\n "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "deposit" : "20000",\n "commissionRate" : 40.0,\n "agentName" : null,\n "agentId" : "0198ACAF",\n "time" : "2018-07-16 16:32:52",\n "blockHeight" : 28136,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.91,\n "totalDeposit" : "204000",\n "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "memberCount" : 3\n}, {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.91,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取最新的区块头信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取最新的区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取最新的区块头信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getbestblockheader")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:40"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33950")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("668413")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("204")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",\n "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",\n "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",\n "time" : "2018-07-17 10:25:40",\n "height" : 33950,\n "txCount" : 1,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 668413,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-17 10:25:30",\n "packingIndexOfRound" : 1,\n "reward" : "0",\n "fee" : "0",\n "confirmCount" : 0,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询区块信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询区块信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getblock | **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的hash值")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的高度")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易集合\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coinbase"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易所在区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的输入\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //交易的输出\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("29115")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6174,\n "size" : 507,\n "txList" : [ {\n "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",\n "type" : "coinbase",\n "time" : "2018-07-16 16:29:30",\n "blockHeight" : 28115,\n "fee" : "0",\n "value" : null,\n "remark" : null,\n "scriptSig" : null,\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 54,\n "inputs" : [ ],\n "outputs" : [ {\n "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "value" : 100000,\n "lockTime" : 29115\n } ]\n }, {\n "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",\n "type" : "transfer",\n "time" : "2018-07-16 16:29:27",\n "blockHeight" : 28115,\n "fee" : "0.001",\n "value" : null,\n "remark" : null,\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 249,\n "inputs" : [ {\n "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 972899896100000\n } ],\n "outputs" : [ {\n "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",\n "value" : 3000000000000,\n "lockTime" : 0\n }, {\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 969899896000000,\n "lockTime" : 0\n } ]\n } ],\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询区块头信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getblockheader | **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的hash值")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的高度")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询网络信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询网络信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getnetinfo **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//本地最新区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络最新区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络时间偏移值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//被动连接节点数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//主动连接节点数量\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getnetinfo\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询网络节点ip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询网络节点ip","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络节点IP")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getnetnodes **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getnetnodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询当前版本信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询当前版本信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询当前版本信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:version **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> version\n{\n "myVersion" : "1.0.0",\n "newestVersion" : "0.9.11",\n "upgradable" : false,\n "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"版本更新"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:upgrade **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> version 1.0.0\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"退出钱包命令程序"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#退出钱包命令程序","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出钱包命令程序")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:exit")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="clientCLI.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/149.6671cebe.js b/docs/.vuepress/dist/assets/js/149.6671cebe.js new file mode 100644 index 00000000..32067964 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/149.6671cebe.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[149],{898:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("Nuls智能合约使用的开发工具为IntelliJ IDEA。")]),t._v(" "),t._m(6),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击下载插件"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("NULS智能合约插件提供的主要功能:")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),a("p",[t._v("下面列出Java关键字,其中将标注NULS智能合约不支持的关键字")]),t._v(" "),a("p",[t._v("访问控制")]),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象")]),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("包的关键字")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("数据类型的关键字")]),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("条件循环(流程控制)")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("错误处理")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("修饰方法、类、属性和变量")]),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("其他")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("下面的语法与Java相同,只是简单列出,具体可参考Java相关文档")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("Nuls智能合约只能使用下面的类进行开发")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("一个简单的合约")]),t._v(" "),t._m(27),t._v(" "),t._m(28),a("p",[t._v("在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。\n项目中可以有多个类和接口。")]),t._v(" "),a("p",[t._v("合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。\n合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。")]),t._v(" "),a("p",[t._v("注解说明")]),t._v(" "),a("p",[t._v("@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。")]),t._v(" "),a("p",[t._v("@Payable 标记@Payable的方法,才能在调用时候传入金额")]),t._v(" "),a("p",[t._v("@Required 标记@Required的参数,调用时候必须传入值")]),t._v(" "),a("p",[t._v("去github下载NULS源码,里面有一些合约示例。")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("合约SDK提供了几个类,方便合约开发:")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._m(36),t._v(" "),t._m(37),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("这里列举几个接口的参数结构及简单实例,其他接口请参见"),a("a",{attrs:{href:"http://127.0.0.1:8001/docs#/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Swagger UI"),a("OutboundLink")],1)]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"开发手册"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#开发手册","aria-hidden":"true"}},[this._v("#")]),this._v(" 开发手册")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_1-简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-简介","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. 简介")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_2-开发环境"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-开发环境","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. 开发环境")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-安装nuls钱包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-安装nuls钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 安装NULS钱包")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-安装jdk-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-安装jdk-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 安装JDK 8")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-安装intellij-idea"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-安装intellij-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 安装IntelliJ IDEA")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-4-安装nuls智能合约插件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-安装nuls智能合约插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 安装NULS智能合约插件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("新建NULS合约工程")]),this._v(" "),s("li",[this._v("提示不支持的Java特性、Java类、Java方法")]),this._v(" "),s("li",[this._v("编译、打包、部署合约")]),this._v(" "),s("li",[this._v("展示、调用合约方法。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_3-nuls智能合约规范与语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-nuls智能合约规范与语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. NULS智能合约规范与语法")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-1-nuls智能合约规范"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-nuls智能合约规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 NULS智能合约规范")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-2-关键字"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-关键字","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 关键字")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("public")]),this._v(" "),s("li",[this._v("protected")]),this._v(" "),s("li",[this._v("private")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("class")]),t._v(" "),a("li",[t._v("interface")]),t._v(" "),a("li",[t._v("abstract")]),t._v(" "),a("li",[t._v("implements")]),t._v(" "),a("li",[t._v("extends")]),t._v(" "),a("li",[t._v("new")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("import")]),this._v(" "),s("li",[this._v("package")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("byte")]),t._v(" "),a("li",[t._v("char")]),t._v(" "),a("li",[t._v("boolean")]),t._v(" "),a("li",[t._v("short")]),t._v(" "),a("li",[t._v("int")]),t._v(" "),a("li",[t._v("float")]),t._v(" "),a("li",[t._v("long")]),t._v(" "),a("li",[t._v("double")]),t._v(" "),a("li",[t._v("void")]),t._v(" "),a("li",[t._v("null")]),t._v(" "),a("li",[t._v("true")]),t._v(" "),a("li",[t._v("false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("if")]),t._v(" "),a("li",[t._v("else")]),t._v(" "),a("li",[t._v("while")]),t._v(" "),a("li",[t._v("for")]),t._v(" "),a("li",[t._v("switch")]),t._v(" "),a("li",[t._v("case")]),t._v(" "),a("li",[t._v("default")]),t._v(" "),a("li",[t._v("do")]),t._v(" "),a("li",[t._v("break")]),t._v(" "),a("li",[t._v("continue")]),t._v(" "),a("li",[t._v("return")]),t._v(" "),a("li",[t._v("instanceof")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("catch")]),t._v(" "),a("li",[t._v("try")]),t._v(" "),a("li",[t._v("finally")]),t._v(" "),a("li",[t._v("throw")]),t._v(" "),a("li",[t._v("throws")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("static")]),t._v(" "),a("li",[t._v("final")]),t._v(" "),a("li",[t._v("super")]),t._v(" "),a("li",[t._v("this")]),t._v(" "),a("li",[t._v("native(不支持)")]),t._v(" "),a("li",[t._v("strictfp(不支持)")]),t._v(" "),a("li",[t._v("synchronized(不支持)")]),t._v(" "),a("li",[t._v("transient(不支持)")]),t._v(" "),a("li",[t._v("volatile(不支持)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("enum(不支持)")]),this._v(" "),s("li",[this._v("assert(不支持)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-3-基本语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-基本语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 基本语法")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头")]),t._v(" "),a("li",[t._v("基本数据类型:byte short int long float double char boolean")]),t._v(" "),a("li",[t._v("引用数据类型:类、接口、数组")]),t._v(" "),a("li",[t._v("算术运算符:+ - * / % ++ --")]),t._v(" "),a("li",[t._v("关系运算符:> < >= <= == !=")]),t._v(" "),a("li",[t._v("逻辑运算符:! & | ^ && ||")]),t._v(" "),a("li",[t._v("位运算符:& | ^ ~ >> << >>>")]),t._v(" "),a("li",[t._v("赋值运算符:=")]),t._v(" "),a("li",[t._v("拓展赋值运算符:+ = -= *= /=")]),t._v(" "),a("li",[t._v("字符串链接运算符:+")]),t._v(" "),a("li",[t._v("三目条件运算符 ? :")]),t._v(" "),a("li",[t._v("流程控制语句(if,switch,for,while,do...while)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-4-支持的类"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-支持的类","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 支持的类")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("io.nuls.contract.sdk.Address")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Block")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.BlockHeader")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Contract")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Event")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Msg")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Utils")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.View")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Required")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Payable")]),t._v(" "),a("li",[t._v("java.lang.Boolean")]),t._v(" "),a("li",[t._v("java.lang.Byte")]),t._v(" "),a("li",[t._v("java.lang.Short")]),t._v(" "),a("li",[t._v("java.lang.Character")]),t._v(" "),a("li",[t._v("java.lang.Integer")]),t._v(" "),a("li",[t._v("java.lang.Long")]),t._v(" "),a("li",[t._v("java.lang.Float")]),t._v(" "),a("li",[t._v("java.lang.Double")]),t._v(" "),a("li",[t._v("java.lang.String")]),t._v(" "),a("li",[t._v("java.lang.StringBuilder")]),t._v(" "),a("li",[t._v("java.math.BigInteger")]),t._v(" "),a("li",[t._v("java.math.BigDecimal")]),t._v(" "),a("li",[t._v("java.util.Collection")]),t._v(" "),a("li",[t._v("java.util.List")]),t._v(" "),a("li",[t._v("java.util.ArrayList")]),t._v(" "),a("li",[t._v("java.util.LinkedList")]),t._v(" "),a("li",[t._v("java.util.Map")]),t._v(" "),a("li",[t._v("java.util.HashMap")]),t._v(" "),a("li",[t._v("java.util.LinkedHashMap")]),t._v(" "),a("li",[t._v("java.util.Set")]),t._v(" "),a("li",[t._v("java.util.HashSet")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-5-其他限制"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-其他限制","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 其他限制")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("合约类只能有一个构造方法,其他类不限制")]),this._v(" "),s("li",[this._v("执行一次合约方法最大的Gas消耗是1000万,包括"),s("code",[this._v("@View")]),this._v("类型的方法调用,请保证尽可能的优化合约代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_4-nuls智能合约简单示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-nuls智能合约简单示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. NULS智能合约简单示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" contracts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("examples"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleStorage")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("storedData "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_5-nuls-contract-sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-nuls-contract-sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. NULS Contract SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-address","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Address")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 获取该地址的余额(只能获取合约地址余额)\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约向该地址转账\n *\n * @param value 转账金额(多少Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 调用该地址的合约方法\n *\n * @param methodName 方法名\n * @param methodDesc 方法签名\n * @param args 参数\n * @param value 附带的货币量(多少Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 调用该地址的合约方法并带有返回值(String)\n *\n * @param methodName 方法名\n * @param methodDesc 方法签名\n * @param args 参数\n * @param value 附带的货币量(多少Na)\n * @return 调用合约后的返回值\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("callWithReturnValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 验证地址\n *\n * @param address\n * @see io.nuls.kernel.utils.AddressTool#validAddress(String)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Address address1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-block","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Block")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Block")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 给定块的区块头\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块的区块头\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 最新块的区块头\n *\n * @return 最新块的区块头\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newestBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 给定块的哈希值\n * hash of the given block\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockhash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块矿工地址\n * current block miner’s address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("coinbase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块编号\n * current block number\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("number")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块时间戳\n * current block timestamp\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.BlockHeader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockHeader")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Address packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTxCount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStateRoot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n BlockHeader that "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BlockHeader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BlockHeader{"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", time="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", height="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", txCount="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", packingAddress="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", stateRoot=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'}'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Contract")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约接口,合约类实现这个接口\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-event","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n* 事件接口,事件类实现这个接口\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Event")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-msg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-msg","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Msg")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Msg")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 剩余Gas\n * remaining gas\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasleft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约发送者地址\n * sender of the contract\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na\n * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Gas价格\n * gas price\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasprice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约地址\n * contract address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-utils","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Utils")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Utils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Utils")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 检查条件,如果条件不满足则回滚\n *\n * @param expression\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 检查条件,如果条件不满足则回滚\n *\n * @param expression\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 终止执行并还原改变的状态\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 终止执行并还原改变的状态\n *\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 发送事件\n *\n * @param event\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Event event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @param seed a private seed\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash4 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash4"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("xBL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param src source string (hex encoding string)\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param bytes source byte array\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bytes"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]verify signature data(ECDSA)\n *\n * @param data(hex encoding string)\n * @param signature(hex encoding string)\n * @param pubkey(hex encoding string)\n * @return verify result\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("verifySignatureData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String signature"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String pubkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用特定的算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,获取原始种子的集合\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-payable"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-payable","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Payable")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Payable 标记@Payable的方法,才能在调用时候转入金额")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Payable")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-required"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-required","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Required")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Required 标记@Required的参数,调用时候必须传入值")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PARAMETER"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-view"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-view","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.View")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_6-智能合约主要的rpc接口"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-智能合约主要的rpc接口","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. 智能合约主要的RPC接口")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("测试网的"),s("code",[this._v("Swagger UI")]),this._v("的端口默认是8001,正式网的端口默认是6001")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-1-创建智能合约"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-创建智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 创建智能合约")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("最大gas消耗")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约代码(字节码的Hex编码字符串)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("备注")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4687")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-2-估算创建智能合约的gas消耗"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-估算创建智能合约的gas消耗","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 估算创建智能合约的Gas消耗")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约代码(字节码的Hex编码字符串)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-3-调用智能合约"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-3-调用智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.3 调用智能合约")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/call")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractAddress*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("最大Gas消耗")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodName*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("方法名")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("方法签名,如果方法名不重复,可以不传")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("备注")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qwe"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-4-估算调用智能合约的gas消耗-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-4-估算调用智能合约的gas消耗-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.4 估算调用智能合约的Gas消耗(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/call")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-5-估算智能合约的price-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-5-估算智能合约的price-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.5 估算智能合约的price(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedprice")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-6-终止智能合约-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-6-终止智能合约-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.6 终止智能合约(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/delete")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-7-调用不上链的智能合约函数-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-7-调用不上链的智能合约函数-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.7 调用不上链的智能合约函数(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/view")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-8-获取智能合约执行结果-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-8-获取智能合约执行结果-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.8 获取智能合约执行结果(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/result/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-9-获取智能合约基本信息-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-9-获取智能合约基本信息-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.9 获取智能合约基本信息(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/info/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-10-验证是否为合约地址-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-10-验证是否为合约地址-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.10 验证是否为合约地址(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-11-获取智能合约地址的nuls余额-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-11-获取智能合约地址的nuls余额-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.11 获取智能合约地址的NULS余额(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/balance/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-12-获取智能合约交易详情-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-12-获取智能合约交易详情-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.12 获取智能合约交易详情(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-13-获取智能合约的交易列表-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-13-获取智能合约的交易列表-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.13 获取智能合约的交易列表(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/list/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-14-根据address和limit查询合约utxo-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-14-根据address和limit查询合约utxo-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.14 根据address和limit查询合约UTXO(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/limit/{address}/{limit}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-15-根据address和amount查询合约utxo-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-15-根据address和amount查询合约utxo-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.15 根据address和amount查询合约UTXO(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/amount/{address}/{amount}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-16-向智能合约转账-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-16-向智能合约转账-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.16 向智能合约转账(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/transfer")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_7-示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. 示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-1-投票智能合约代码片段-如下"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-投票智能合约代码片段-如下","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.1 投票智能合约代码"),s("code",[this._v("片段")]),this._v(", 如下")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("完整代码: "),s("code",[this._v("https://github.com/nuls-io/nuls-vote")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BaseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteInterface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("List"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" VoteInterface baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("VoteContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n baseVote "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n VoteEntity voteEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n VoteConfig config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" success "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("success"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("智能合约的方法中如果有"),s("code",[this._v("数组类型")]),this._v("的参数,请使用如下方式传递参数")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("参考以上投票合约代码中的"),s("code",[this._v("create")]),this._v("方法")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtydTVWskMc7GkZzbsq2FoChqKFwMf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseLt14NacjTDhXaTXUdrk6VF7aEwtW4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"测试投票1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第一个投票合约"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第一个选项"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第二个选项"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第三个选项"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536044066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536184066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-2-standard-token-智能合约代码片段"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-standard-token-智能合约代码片段","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.2 Standard Token 智能合约代码"),s("code",[this._v("片段")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("完整代码: "),s("code",[this._v("https://github.com/nuls-io/nuls-nrc20")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("HashMap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("emit"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("require"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleToken")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Token "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" BigInteger totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" balances "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decimals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("totalSupply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleToken")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("decimals "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TEN"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ownerAllowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferFrom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("approve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("increaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decreaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger oldValue "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("oldValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient approved token"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The value must be greater than or equal to 0."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient balance of token."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])}],!1,null,null,null);e.options.__file="developerManual.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/15.1f656e2a.js b/docs/.vuepress/dist/assets/js/15.1f656e2a.js new file mode 100644 index 00000000..51a676e2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/15.1f656e2a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{728:function(t,e,r){t.exports=r.p+"assets/img/1552373134638.64de5bfc.png"},729:function(t,e,r){t.exports=r.p+"assets/img/20190312145034.0a656cae.png"},730:function(t,e,r){t.exports=r.p+"assets/img/20190312145056.3f134cfe.png"},731:function(t,e,r){t.exports=r.p+"assets/img/20190312150103.4981632b.png"},732:function(t,e,r){t.exports=r.p+"assets/img/20190312150047.df608632.png"},733:function(t,e,r){t.exports=r.p+"assets/img/20190312151157.e0d24572.png"},734:function(t,e,r){t.exports=r.p+"assets/img/20190312151528.1be54755.png"},735:function(t,e,r){t.exports=r.p+"assets/img/20190312152642.636c3486.png"},736:function(t,e,r){t.exports=r.p+"assets/img/20190312153112.e10d3148.png"},737:function(t,e,r){t.exports=r.p+"assets/img/20190312153758.2decc7c9.png"},738:function(t,e,r){t.exports=r.p+"assets/img/20190312154059.a051284c.png"},739:function(t,e,r){t.exports=r.p+"assets/img/20190312154512.6da50cbb.png"},740:function(t,e,r){t.exports=r.p+"assets/img/20190312154925.f127eb93.png"},741:function(t,e,r){t.exports=r.p+"assets/img/20190312155458.c35956eb.png"},742:function(t,e,r){t.exports=r.p+"assets/img/20190312155710.3b00c0ae.png"},743:function(t,e,r){t.exports=r.p+"assets/img/20190312160126.44144b2b.png"},744:function(t,e,r){t.exports=r.p+"assets/img/20190312160629.4f000d32.png"},745:function(t,e,r){t.exports=r.p+"assets/img/20190312160828.c04ec122.png"},746:function(t,e,r){t.exports=r.p+"assets/img/20190312162211.93951a94.png"},747:function(t,e,r){t.exports=r.p+"assets/img/20190312161634.406c6ace.png"},748:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAn0AAABwCAYAAABrcsY6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAHYcAAB2HAY/l8WUAABd9SURBVHhe7d3vb9RWvsfx/YN4lEflEcqjSFeKVAkpDxq1CooUtmqKljJKhciKTbqluQqCjXpptFtINwq3UaK0SoKUlKs0qLlRUEsoYiqqYS8J3ewlsCVQZYcKeqXqe8+xfRyP59jjzAwQj98PXhKMPZ6MPT7++Pzyb375v18FAAAAjY3QBwAAkAGEPgAAgAwg9AEAAGTAb+7+708CAACAxkboAwAAyACadwEAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMSHXo27o1L73Hzsu1bftyANlTuDwlM6trsvXUvlzbvHxaDnZ0y4Ub3mvbBVn8+lHZehXdmpLcwLhMrN6Xom15VjwsyMz0ddmyLbNYXzgvZ4fPy/xd+3Lsws9r8uV/Lsq9Z5ZlFk++nZOJr9bkp4Tro7GkOPQVZflMh+x7pU1azlyvqsDdun1dllfqKS/rT+yf1QiKD4uyZVQI2sU789Lf3SP902vVXQxXzzvHdt8rKtTblj9PL/OzX7Qn9+Wa9bdcg9uB8PQ4L2Pq4q4v8M9DWWh4WpCPXtXHbkgWY87FzekTzjEeWNX/fyTzJ9vV/9vltZF8bFgs9UyWB/X72uTIXBWBsWHcl4nf6X3eLv1LRcvycteG9Ppm/6N6/5KrH74nb7z5nnT+cU5++Nm2TsCz7+Vizlv/wxX5ybYOGlq6m3e3r0p/sy48uuSjG8/s68QwBU/9nJCJe/bPSqWnRSlcGZdcV4c02b5vc4e8dnJUJm6EL3iPZOaYWa/KfULoezHuzcthczzrZSj/fLcfUBYa8qPSol5vGrwae7NRGvqUpxsycdwNcPuPz0ohSevBwwU5ov+O5iFZbuCbvUS8/b6vbVTyCULzbkNf/cvqBgqc23m5+HsvyP1+Ur6P+e3+MHHGWe+N3JjcrPgb/1Y+0evWzYfyxT9sn4MXaU+Gvq3VWetdvU1/d4ccePO0dVmZhY2Sz3ELkm4ZmLPUVuzSheN6W40T+oq3Z+VIS2khGel387IZen9+pMtd1qaCU8QFsXi3IIWH9mWEvhfEhLLjU9bf9a7MDctBva1g6Hv6bKd2OJYKXT16n7dJ7+X7luV2xVDAyH/s1v7n5sLbKL0pLAt92tNHsjiofrdtQ7L4IPB6BPNZ+1q6nKbiXXt/oey8SS91o+eUge0y8HXlG/BqQ19Tq2U/Vslv2m8E2yqgveuGq853P5WbRcs6303K2zp8vaXC198ty8sQ+hrRngx9pkCuu+DFSHELkvoEtXpu62XbXBqSVrPPWnpkYDov649DBfl2UdbzC3Kht1uaLKFP083B4Yuy48GC5LxAGVnoE/peDBP6QudGVWraVl7OOrX2p2T+sW15Ak9Mzb9N6bG0hj7tqQqIST6/HjWYx+znTWptrEk+6iYupNrQd3j6vnV5RbocStxsn1I6+OXek76Jv5U32/rNuoPyyeq/SpfV6Oaf3VD3ScJjiZdrT4e+pAVCReYivtvQ90RdACo123gFSaOEvqLaVybwNR2bStbM9ViFO9vrUQIXTELfS5YgqBUfVuivZi6mtYS+O1NuLeHxhcSDAcK25vqc49baM2yp6V+S9cC6poxxahXvFpyaysXpcWfd/h63JuiADpDWYPZI5nvdPoCHL1URQmoKx3uHGQwTpfdy9O+m9tBXlMLcglxLeINQGD8qTV3nZblBWmJ+2VyUPx0flHfCch+Uv+a87tW2vRWx/Pjn8r3tcxIg9KULoU8HtXxeLvSekAu3Au9RiitD0qQK9t4rEZ2TdT+W5g7JqQtHQ4Q+3Qm+zS1c93WOS+F53RkT+vYOP4BclcLlYTn8/lIodG3IWKda/rq6ASh53XCb9far38u1uxXCzMO18iZhz+LH7jnfOjhvXV4iOFDEMAM4mk/JvLW2qSjXJocl160DSZfsd45vtP1ter0eyV3Ml4XQrcun3D6unWqfVHOONEroq9AiE1crV2voW790wj0GbadlpsII4J0b2S71eckGmux5/5iTPr/ZtB7G5KbtcxIg9KXL3gx9wekU7i6F7th3xxndd2PcvfscLZR8jh/Ubl+XAX3BKCnEi+puXi/vk5kHRclPD6u/p7SJ89qQvts/KmPqMxoh9JmaEuc73bGvk5TfL3Ny56LpvzZ4wu30rbx2MnC8gn0uw8HLGVQy5dfCHOwZkrErG/aRlv6I0dnomoDAqNKyEaCW0Le5Oi9nT/a4n93RJ/2TS1KothlyL/EDyHVZ/0xfxEMjMG+5HfRbPi5I8d51+Wgo1A/Ne78zcKJSmPH3a40s2zcBpHWk9BwPWj7jvt8JdG3uoI2WY6Myo4NkXv2WdN+/SjX7G+o7msFjoZvExBok9Fk99W4SvDKkuJG3Bne3D3SbHLlYvky7thEua931/SCpyoNrIz1u8GvulrNfR4Q5/3i1V980nFarY26g+8Oc3LMtrxNCX7rsydBXosYLRdydZDCombv3w595BYM3Ms+5mG17oTA4Mu3hkuR0YeI1R6U/9JlpF3a+k329ZPxagEB/v0o1AyUXwWDw2i7IR13uRTqs6di8rIeDn7moxh0Pfx3LbyT42U/vy4w3qrNMc498lE95zUEwgJia3leHZdlr1ncHK7g3NiYU5gLNdu6AnQ61H0LbMtsPMvu12kEjF72bkvD2zSj+5nY54NTQlXOaGoO/E+9vaYkJiWXUb2HiWMRvIZLlN9jAoc/9jaj9qr6b7vJR8ZyPEA5oZaHPsz7d59XadknvXOlAPT2qdcBruWj1/p6S5Y2O0AeL9IS+XRaQppBIGvr80NPsNg/pPiD+xUytGw6F65N6ebv0r7h3pKkPfboTvFN4tskhE3xrYAt9/l2/GeWplNzpB5vt/ODVJ7nedml6/bSMrXq1MXfzMtbvjQ7W2wjPkVa30HdaBobU57SocDdXkHVnFOh9KVwZlUNmZHPzCZlJ6zHXQgFEN4Xpmj2nxsyEKXMTEA6FZuBE56zbXy5p6Itabpp/bc23WtT7vYv74c9mZUAvtyir5fFqMJOXK0V1jru/OX2jMeHVGpbUVJcYlsPOfIGW32Cl/ZBWG7Pu8W8ekkXvpuG51fQF7Aw80/MsFtxwFwjo1hvDLDChb3Dxuc7HR+hLF0JfsFBWFwJdeDSdPO3W4pmLmSMQClVBFm4OTn3oUwX2IafgjN9nSdlCny8ucBnmuGt62hfvIuLzm5GUcGf7uoU+RR3vGdv0HX6zkdv0WbY8LcqCmhmkcFR6+0tvbLRgKFx3jnGgObjW0FfL8o0N/8Ke6Fw0f2vvkmzpAVs6zK+qwHFlXi6o0DbgNeUfUKHe2Y5e36lNdG8KK5cvpubc8ndU+p5p5NeqJZugOUn5HGTWj2qi1b/Lg9752Dq4IDNeQLeWHVlhQt+fv7Uvj5SXCetgD7u3j7ihrzNnX16u+kEjqB2hr6RQfqZe8+beCl3sHCYUNuuLYmkzV/m2Usbs57h9FlinVPn3rl/osxwHz/pnPd46O33vHP72Y45H3N8Q+J5xT1rw52lrDn1+mpj9EDy/Avum9MZH2xm52qQvssEuD7ZtBVU6l2td7rGfi89kM29G6A5HTzge4A7m6PMHCqxfGpUJ79+Vy5fKoa9pOP57pEaw2bt/yatpC60TkqR8DjLrR4U+rXh7yr8Rc7SoY7dhXzfVth/JT1sJfDXihr5zS/blNs78fvWeny+s+kEjqB19+sKFsqnx+jfdnyvwuqMoiwNe4Raaed5+oUmRG+f9i2DlIBZW/r3rF/pi5m3z13leoe+EvZbPCKyX2uMeEdTMoAfrlCR3puQ153uX3vjs7dCnXh/2zt0SRyU3fF4uTC+Jfoxi4V6x4iMGtcqhpXLoiwswqaEC33ygq8W+oSXJj/TI/gpNqpX3Xymzfvw+23k0p9bUpcroBqzlM82pz0PfpU31Gb/IE1sgjLB0zn3vua/sy8vVd55A7E56Ql/nqVCfmXg5r+kvrlCxXRzcvnzRBYy/PDRdQ9SFJjUCISh3OaJ5Jvx0hVtTXpNw+feuX+iLqUWLWsfffszxiPsbkny2luRz9jrzHYJByn+8ofKq2gfhEa3+8lBTnm1bQWa/RiwvLg05yyNrwKLeH3q+r3vud8jhwUCZMJmXzY01N9Q5E42b0fmWY6eDzOh87ByVJoRU06dP9w/W70196As8us5t/dDHxowCjx88Uf/QV1ShvtsfzXvQG8Chm3eXG2GUfcAPi5/KJyOVDXpP6HjjzQ+k75x9nbBL30a3bEShT1+6NGzz7vqCW/iWTccRUBbUzIjczhNugR3okFyyXP89jda86z8RQRXgSfd1TOjJROjz+0Gm+Lhbgpo7IrddDh9zj+Fr46WjIv1H7Gl1bN41zfWRF/ao9weOZSTL7zA/4tYKDXwdfD0wYOP9q5Gj2E0IqSz63Dh8afcX2L3jmSyf8QLf6+o8uRI4Nn5zb/Q0KXUNfebxefrzm0/I2G11I/JA3Zj4we+0zDdiM2+c4oqce8uEvvfk3Yk1+3p1QOhLl4YNfUmUBjXTNNChCqJn/mjdnXm/TNNul5xdWXJrOgJTW6Q/9KlCfNC7W0/6APmYcLU3Ql+PTEQV9nF/Q5LP1vz1KjQD72VmP5jzy4zA1MfNjNZtDkx47DXt6hGRy84IdnUhNqO9w9sKiz2Xn6nzSy1Ty0tDWEDU+0M10IuDejs9MnZr5zW3di/wHu3rYWd7wWlb9OAUp7aowgCA3YaWID9spvwi6ZSRpgk1fGx0bXBrj1y4YW81qFvo216TMdOfsKXP73PpCAa/Ru3fF+HepQ+dINY5OCLn3lGhLPHzdneP0JcuDd+nLy6IlQQ1M0hDj+bTy/3Roe7yorpA6FGLTQNXS+afMqEw/aFP0U8Y8fZb3CS3Pj847bHQ93hJcpW2b6bssK3jbzf+eJqL975X1YXPsjwVSoKaGaSxM/GwbnLVIciZd03X4Dj91LzJu594o9ibvVBYS+jbXpJevSxJH86o7XsSn4tmmqIO92kjulnSCXwJAsJuQ4vPzPnp/32PZP1OSmv8tlWYNrW8tmPzvPv03V2Q3kq1eY/V/jbr6JHYMS0/DePHRRl0avkG5eJ3v8qPC8PSqQPgH+fk3jPL+jUi9KVLw/bp09y+PdGFv39x2DA1GqVzrjkXvJaj0n9p3i04zMVNL/cfWeZuP/GFZk8zF339XdrlyHRostOwvRr6Ak3VBy/amzX8kbe2v8HfbnnTpi/Q761Rpmzxa7eHA32xnJufdjlwbErmJ91QFLwhMO9xQmENoS/Yl7bp9VNywfa0lZj3ByU/F03tYocc7jFPd9DlgVn+SJYn52XZEsqShJatpWF3cujuUzKgy6SBPmn15nf0by4fePvszfAo6ZRJeGyMJPsvyKxvQt/63Gl/ihZd2xj7DN5gjZ9p/rWt1wh+XpNLf3RD2G+Hv3Hn53u2IV94r719ZrHuwY/Qly4N3bxbqfB3l/dI/0ComSpIP+7H6eNT/nB1Uwty4D/yslzhs1IjMIu9/s4He8dl0VYTsb0hyyPmcWq7DH1P1d23876YUOUHr2pCX7CpWv1tobv7nclcXXGhT9d69V8J/S4eB5qUmgM3Amlkglr/UFmXBZ8OX2ZeQt3sGWz6NzXi+oZptULoM82woe0Hn416qOfoznNx9Q2XHoBhwl/E+8PKznt9vM7MWp8dbAaPOMpqi7ybB68mMPi+RKHlzpQ/CXnQ/u7xnVGlpsbZa0Eo20Za7LKcTrT/Asz6OvRtXTntBnSltX8p2cTLfvBT5/NSmvtSxtj+m3zuhbs3cmNyM3iebH8rn+TcZZ0fzMr/VDiHdoPQly6EPr387n1Znr4aUXgUpTB9Wl47bpmC4Ol9ubbqBoJKn5Uqup9M2aPH2uXA63reMsvD6pv184lLtxEb+oKhTG+365QM6FqQjwPHODLQBcStE5g8WX9Gq1PbMiRHnGeutktuZNQNKEp06POeyKH+vb+tR3JnzjvP/j3gb7cBHuDu185dl61bCzIT9Vi5B9flo+6j1u9bvJ2XvK5pqVTTZ7F5ZSeA+zWMDwsyM9Sz8ztr7pbc6HVZT9LPVAmei5tXhr0aofJm461bs3LEPFnllY7ySYVNN4Ez10tfV0wIiQ0t4dHulsBqRvIejLr5SYsXGPr0/9dVmdw7vba7oLyxJGONGvjuLsqfzGjd3IhctfUx/vt/ySlvIuU3cn+RL27VZ18Q+tKF0FenoFbPbe0VmyvjsZPY7m/rk4HpvPViHB/6lO28nH29NFiWTNVRa+hTivlxOdwaCq+69uiyunCYgKJEhz61XV3TOxoIIJ79nUMycasBmomqCGqRdrGtrfyCDHTvBP+Dwyp0hm+qHq9Zw59f8xfBnWOwQw6a35d+jN5KoLZWbXfifW96D/3Zx3rc4BmuFfbmrrQ9ltCEkLjJuyt7JDPe48giB6+kxQsOffD8vCmrf/3Q6bPn1OL9flJublnWMx6syF/8qVzek3f+/XNZ/fvP9nUTWh0m9KVJekJfS5fbP2YX3P4zzyH0ldX4bchY1ESsjcCrsVjPX5drd+47/y5WuPAmVfRrQexP3aiHovOILffZuVX/3fpRXXcL7ve3jQRNq2pDn2U/bq24g52itlV8sCaLk0OlQVwFuYFw83nYw0IgpLnv0bU8ZSFRe7BQMq3SwfcD8+09uS/LH5/YqanVYfBrN7T5o3abe+SsFxALF7vVeh3+oJYgU0On1++dXCh7dmxFc1PSb0Jv0tHye5kl9G2tzlr7WmtmHtXoeQ5nS/rpmdBXV7v9ze8lxQ25OTUi75qaO6X3r9/Ij0n666mguDQ86AdF7bf9I/L5V3+TH50nckTYWpPVq9/I6ncb/kTLP6xOSp83NQyhLx0IfVUEtcK4vhh4BUeQHsVZpzAEvBDVhj4z8tUiWPtVvLskFwIDGHy7bLLVihu6iTkQGFvPl08cbZr1VaArmS7Ef4qI1i6HPg7XGBalMNkXqFVsd0Ng1Dn99L7MlHWBqIL+O6Oa1NPEEvr82v6qlJbL10btZXxNRtM4AGtDvjxzpiSwdf7hU1nd/MWybryfbi3KX/6wsx092vfcf//Tuq5ja1EGA59b4q0RuRoXGLFn0LxbTe3cjdGyAuTQyXFZ3u12gJet6uZdFXpOlp4D+jm1A3OhGrgneTkbGBjU2jMsEysRtXQJba6MyqGW8oFVRlHXSFtGcxbGe+TQ0ILkYwbebN2al/5OUwPXLWcr9NncupO31+Qlkd+oW435S2cpp4sbNeybFXu3Eaiwtjomb6ug9dv+Mfnyu1r75f0iP36nwl//B3LqUqV+pXmZOD4o74Sc+nC2qtCJl2Pvh76EI/Zstm5TeAAvm77462bxugac5x2WtuvXhSETaiinsVs/y08/1tYPD9m190MfAAAAakboAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAIAMIPQBAABkAKEPAAAgAwh9AAAAGUDoAwAAyABCHwAAQAYQ+gAAADKA0AcAAJABhD4AAICG96v8P6CfytMEp8u9AAAAAElFTkSuQmCC"},837:function(t,e,r){"use strict";r.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls浏览器使用指南"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls浏览器使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS浏览器使用指南")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nuls-explorer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nuls-explorer","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NULS Explorer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(728),alt:"1552373134638"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"搜索"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#搜索","aria-hidden":"true"}},[this._v("#")]),this._v(" 搜索")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(729),alt:"20190312145034"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(730),alt:"20190312145056"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"共识奖励计算器"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#共识奖励计算器","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识奖励计算器")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(731),alt:"20190312150103"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(732),alt:"20190312150047"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"区块"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 区块")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(733),alt:"20190312151157"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(734),alt:"20190312151528"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"账户资产"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#账户资产","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户资产")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(735),alt:"20190312152642"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(736),alt:"20190312153112"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(737),alt:"20190312153758"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(738),alt:"20190312154059"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(739),alt:"20190312154512"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"节点信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#节点信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 节点信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(740),alt:"20190312154925"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(741),alt:"20190312155458"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"轮次信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#轮次信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 轮次信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(742),alt:"20190312155710"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(743),alt:"20190312160126"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(744),alt:"20190312160629"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(745),alt:"20190312160828"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"代币详情"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#代币详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 代币详情")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(746),alt:"20190312162211"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"合约认证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#合约认证","aria-hidden":"true"}},[this._v("#")]),this._v(" 合约认证")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(747),alt:"20190312161634"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"链接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#链接","aria-hidden":"true"}},[this._v("#")]),this._v(" 链接")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:r(748),alt:"20190312162707"}})])}],A=r(0),n=Object(A.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),r("p",[t._v("首先进入"),r("a",{attrs:{href:"https://nulscan.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS Explore"),r("OutboundLink")],1)]),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("​\tNULS浏览器是NULS核心团队开发的一个图形化的用户界面,为您提供与NULS区块链交互。通过NULS浏览器,您可以浏览NULS区块链的基本信息、已添加到NULS区块链中的区块、链上的交易、账户、共识及智能合约等相关信息.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),r("p",[t._v("​\t如果您想精确搜索某区块、交易、地址等信息,可以通过NULS Explorer首页或其他页面顶部导航栏中的搜索框进行搜索")]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),r("p",[t._v("​\tNULS区块链使用的是POC共识机制,您可以通过锁定一定数目(2000-500000)的NULS进行挖矿。NULS Explorer提供了共识奖励计算器,供您计算参与委托和创建节点的日、周、月、年奖励。共识奖励计算器中的参数都自带默认值,您可以随意进行修改计算(符合参数取值范围)。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏“区块”进入区块页面,区块列表中分页显示NULS链全部区块(高度、时间、交易数量、出块节点、区块大小、块奖励),可以通过列表右上角的“隐藏共识奖励区块”对列表进行筛选(过滤只有共识奖励的区块)。")]),t._v(" "),t._m(10),t._v(" "),r("p",[t._v("如果您需要查看某个区块的更多信息,直接点击该区块高度(或搜索框输入高度进行搜索),将跳转至区块详情页面看到该区块更为详细的参数信息。")]),t._v(" "),t._m(11),t._v(" "),r("p",[t._v("PS:区块列表中的出块节点、区块详情中的出块节点、打包地址、TXID都可以点击跳转至对应的详情页面。")]),t._v(" "),t._m(12),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“账户”进入账户页面,账户列表显示NULS区块链中所有持有NULS的账户地址信息(地址、总计、总收入、总支出),列表中“总计”列可以进行排序(默认从大到小)。")]),t._v(" "),t._m(13),t._v(" "),r("p",[t._v("如果您需要获取某个地址的更多信息,直接点击列表中的地址(或搜索框输入地址进行搜索),将跳转至地址详情页面,展示更多该地址的参数信息。")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),r("p",[t._v("​\tNULS Explorer中,您可以通过导航栏的“交易”进入交易页面(也可以通过首页“14天NULS交易历史”图表右上角的“更多”进入该页面),该页面上半部一图表方式显示交易历史数量,下部分以列表显示NULS区块链的全部交易,可以进行筛选和一次共识奖励交易。")]),t._v(" "),t._m(16),t._v(" "),r("p",[t._v("​\t当您需要查看某个交易的详细信息时,您可以点击交易列表中的TXID(或者在导航栏中的搜索框输入该交易的TXID进行搜索)进入该交易的详情页面,获取该交易的更多信息。")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“共识”进入共识页面(也可以通过点击首页的“共识节点”)。在共识页面,上部分显示NULS区块链的全网委托信息(图表),下部分显示节点信息和轮次信息。")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),r("p",[t._v("​\t您可以对节点信息的进行视图切换、排序、筛选(节点类型、别名、地址、ID)。")]),t._v(" "),t._m(21),t._v(" "),r("p",[t._v("如需查看某个节点的更多信息,可以点击节点进入详情页面(运行信息、基本信息、出块列表、当前委托信息、历史委托信息)")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),r("p",[t._v("​\t轮次信息显示当前轮次的信息和轮次列表(轮次、时间区间、出块节点数、红/黄牌、正常出块节点、丢块率)")]),t._v(" "),t._m(24),t._v(" "),r("p",[t._v("您可以点击轮次列表中的轮次查看该轮次的出块详情(首页的区块动图可以点击进入当前轮次详情页面),详情页面将展示更多更详细的轮次信息。")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),r("p",[t._v("​\t在NULS Explorer中,您可以通过导航栏的“合约”进入合约页面,合约页面有全部合约和NRC-20合约。所有合约列表右上角有“隐藏NRC-20合约”,打开开关即可隐藏NRC-20合约。")]),t._v(" "),t._m(27),t._v(" "),r("p",[t._v("如果你需要查看合约的详情,直接点击列表中的合约地址即可进入合约详情页面(基本信息、交易列表、代码、方法)。")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),r("p",[t._v("​\t如果你需要查询NRC-20代币的信息,可以切换到NRC-20列表,点击通证的缩写,或者进入NRC-20合约详情页面点击基本信息中的“通证”。")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),r("p",[t._v("​\t在新版的NULS Explorer中,我们新增了合约代码认证的功能,极大地增强了合约的安全性。您可以在合约列表中直接点击状态列的未认证跳转至代码认证页面,或者进入合约详情页面点击代码,进行合约代码认证,您只需要上传该合约的压缩包即可,会自行认证返回结果。")]),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),r("p",[t._v("​\tNULS Explorer底部footer提供了一些链接,包含NULS官网、NULS GitHub、NULS网页轻钱包、NULS社区。")]),t._v(" "),t._m(34)])},s,!1,null,null,null);n.options.__file="NULSExplorerGuide.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/150.75db4652.js b/docs/.vuepress/dist/assets/js/150.75db4652.js new file mode 100644 index 00000000..33b9fbdc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/150.75db4652.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[150],{892:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("blockquote",[s("p",[t._v("参考资料:")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Solidity Pitfalls: Random Number Generation for Ethereum"),s("OutboundLink")],1)]),t._v(" "),s("p",[s("a",{attrs:{href:"https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620",target:"_blank",rel:"noopener noreferrer"}},[t._v("Predicting Random Numbers in Ethereum Smart Contracts"),s("OutboundLink")],1)])]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("调用方式如下:")]),t._v(" "),t._m(3),s("p",[t._v("--")]),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("以彩票为例,抽奖需要调用两次合约交易,第一次,结束彩票,第二次,抽奖")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("--")]),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("以彩票为例,我们需要更多任意数据来挑选我们的赢家。当我们开奖时,我们可以使用已经进入我们的彩票智能合约的玩家的地址作为随机因子,以此产生随机数。")]),t._v(" "),s("p",[t._v("--")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("同样以彩票为例")]),t._v(" "),t._m(10)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"随机数的几种实现方式"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#随机数的几种实现方式","aria-hidden":"true"}},[this._v("#")]),this._v(" 随机数的几种实现方式")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-线性同余发生器(lcg)算法获取伪随机数"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-线性同余发生器(lcg)算法获取伪随机数","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. "),e("code",[this._v("线性同余发生器(LCG)")]),this._v("算法获取伪随机数")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("NULS智能合约的SDK中提供了一种获取随机数的方式,它采用当前块的矿工地址、合约地址、合约调用者地址、当前块的时间戳作为随机因子,使用"),e("code",[this._v("线性同余发生器(LCG)")]),this._v("算法获取伪随机数")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 增加一个随机因子\n */")]),t._v("\nio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-使用未来块的blockhash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-使用未来块的blockhash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. 使用未来块的"),e("code",[this._v("BlockHash")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("第一次结束彩票后,记录当前块高度H1,并生成一个数字N,在未来区块高度达到"),e("code",[this._v("H1+N")]),this._v("的时候,才能抽奖")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("第二次抽奖时,根据第一次记录的块高度H1再加上(0~80]个块(待定)得到块高度H2,获取H2这个块的"),e("code",[this._v("BlockHash")]),this._v(",以它作为随机种子")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("ETH不能使用这种方式的原因如下:\n"),e("img",{attrs:{src:"https://cdn-images-1.medium.com/max/1600/1*eyNTfWTkmM-3YuMca-1H0A.png",alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-随机种子限定在参与者内"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-随机种子限定在参与者内","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. 随机种子限定在参与者内")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-commit-reveal"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-commit-reveal","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. commit-reveal")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("合约为随机数留出奖励。")])]),t._v(" "),s("li",[s("p",[t._v("每个用户生成他们自己的秘密随机数 N。")])]),t._v(" "),s("li",[s("p",[t._v("用户通过散列他们N和地址来创建他们的秘密随机数的哈希值:String hash = sha3(N + Msg.sender())。")]),t._v(" "),s("pre",[s("code",[t._v(" 注意:步骤2和3应在本地秘密进行,例如用户把N提交到彩票应用中,彩票应用完成hash运算\n")])])]),t._v(" "),s("li",[s("p",[t._v("用户将其哈希值发送给智能合约。")])]),t._v(" "),s("li",[s("p",[t._v("提交的内容将持续一定数量的块,或者直到有足够的参与者加入。")])]),t._v(" "),s("li",[s("p",[t._v("一旦提交轮次结束,揭幕轮开始。")])]),t._v(" "),s("li",[s("p",[t._v("每个用户将其随机数提交N给智能合约。")])]),t._v(" "),s("li",[s("p",[t._v("合约验证sha3(N + Msg.sender())匹配原始提交。")])]),t._v(" "),s("li",[s("p",[t._v("如果用户未及时提交有效N,则他的存款将被没收。")])]),t._v(" "),s("li",[s("p",[t._v("把所有验证过的N 进行 XOR 异或运算得到随机数。")])]),t._v(" "),s("li",[s("p",[t._v("该数字用于确定哪些参与者获得奖励 ---\x3e(N % numUsers)。")])])])}],!1,null,null,null);n.options.__file="randomImplementations.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/151.b3ee235e.js b/docs/.vuepress/dist/assets/js/151.b3ee235e.js new file mode 100644 index 00000000..fcd82351 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/151.b3ee235e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[151],{890:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"钱包增加随机种子"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#钱包增加随机种子","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包增加随机种子")]),t._v(" "),a("h2",{attrs:{id:"一-、钱包增加随机种子rpc接口"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一-、钱包增加随机种子rpc接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 一 、钱包增加随机种子RPC接口")]),t._v(" "),a("p",[t._v("获取的随机种子是大数字,注意,它可能是负数")]),t._v(" "),a("h3",{attrs:{id:"根据高度区间获取随机种子列表:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据高度区间获取随机种子列表:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据高度区间获取随机种子列表:")]),t._v(" "),a("p",[t._v("URL:/random/seeds/height")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("startHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间起始高度")])]),t._v(" "),a("tr",[a("td",[t._v("endHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间截止高度,不能超过startHeight+1000")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("种子数组")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),a("h3",{attrs:{id:"根据高度区间获取随机种子列表:-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据高度区间获取随机种子列表:-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据高度区间获取随机种子列表:")]),t._v(" "),a("p",[t._v("URL:/random/seeds/count")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("height")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("获取种子列表的最高高度")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("随机种子数量,不能超过128")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("种子数组")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),a("h3",{attrs:{id:"根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:")]),t._v(" "),a("p",[t._v("URL:/random/seed/height")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("startHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间起始高度")])]),t._v(" "),a("tr",[a("td",[t._v("endHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间截止高度,endHeight-startHeight<=1000")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("默认为sha3算法,支持sha3、KECCAK、merkle算法")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("Object")]),t._v(" "),a("td",[t._v("结果对象")])]),t._v(" "),a("tr",[a("td",[t._v("seed")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的随机种子结果")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的 算法")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("原始随机种子个数")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),a("h3",{attrs:{id:"根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:")]),t._v(" "),a("p",[t._v("URL:/random/seed/count")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("height")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("获取种子列表的最高高度")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("随机种子数量,不能超过128")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("默认为sha3算法,支持sha3、KECCAK、merkle算法")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("Object")]),t._v(" "),a("td",[t._v("结果对象")])]),t._v(" "),a("tr",[a("td",[t._v("seed")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的随机种子结果")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的 算法")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("原始随机种子个数")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),a("h2",{attrs:{id:"二、智能合约支持底层链随机数"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、智能合约支持底层链随机数","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、智能合约支持底层链随机数")]),t._v(" "),a("p",[t._v("与以上RPC接口相同,在智能合约SDK中支持了相同的方法来获取底层区块链提供的随机数种子,如以下代码。\n后面将以其中一个方法"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v("为例,展示如何使用随机数种子产生随机数。")]),t._v(" "),a("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用特定的算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,获取原始种子的集合\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"_2)-例子同时摇n一个骰子"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2)-例子同时摇n一个骰子","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) 例子"),a("code",[t._v("同时摇N一个骰子")])]),t._v(" "),a("h4",{attrs:{id:"_2-1-计算方式一"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-计算方式一","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) 计算方式一")]),t._v(" "),a("ul",[a("li",[t._v("获取原始种子"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),a("li",[t._v("根据骰子范围求模得到第一个随机数")]),t._v(" "),a("li",[t._v("下一个随机数的计算方式\n"),a("ul",[a("li",[t._v("原始种子乘以投掷次数,得到的结果转换成字节数组")]),t._v(" "),a("li",[t._v("把字节数组进行SHA3-256得到32位字节数组的Hash")]),t._v(" "),a("li",[t._v("把此Hash的字节数组转换为BigInteger大数字")]),t._v(" "),a("li",[t._v("将此BigInteger大数字根据骰子范围求模得到下一个随机数")]),t._v(" "),a("li",[t._v("以此类推")])])])]),t._v(" "),a("p",[a("strong",[t._v("参考以下代码")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_2-2-计算方式二"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-计算方式二","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) 计算方式二")]),t._v(" "),a("ul",[a("li",[t._v("获取原始种子"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),a("li",[t._v("根据骰子范围求模得到第一个随机数")]),t._v(" "),a("li",[t._v("下一个随机数的计算方式\n"),a("ul",[a("li",[t._v("获取原始种子大数字的末位数字(根据投掷次数获取倒数第几位),将此末位数字乘以原始种子,得到的结果转换成字节数组")]),t._v(" "),a("li",[t._v("把字节数组进行SHA3-256得到32位字节数组的Hash")]),t._v(" "),a("li",[t._v("把此Hash的字节数组转换为BigInteger大数字")]),t._v(" "),a("li",[t._v("将此BigInteger大数字根据骰子范围求模得到下一个随机数")]),t._v(" "),a("li",[t._v("以此类推")])])])]),t._v(" "),a("p",[a("strong",[t._v("参考以下代码")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/152.63fb9894.js b/docs/.vuepress/dist/assets/js/152.63fb9894.js new file mode 100644 index 00000000..705368ec --- /dev/null +++ b/docs/.vuepress/dist/assets/js/152.63fb9894.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[152],{888:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"rpc-tool-websocket设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rpc-tool-websocket设计","aria-hidden":"true"}},[t._v("#")]),t._v(" RPC-Tool-WebSocket设计")]),t._v(" "),a("h1",{attrs:{id:"websocket-tool设计文档——第四版"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#websocket-tool设计文档——第四版","aria-hidden":"true"}},[t._v("#")]),t._v(" Websocket-Tool设计文档——第四版")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"写在最前的话"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#写在最前的话","aria-hidden":"true"}},[t._v("#")]),t._v(" 写在最前的话")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("如果想知道websocket的具体设计,请逐步阅读本文档\n\n如果只想知道如何使用,请跳转到章节《7.1 如何使用》\n")])])]),a("h2",{attrs:{id:"一、总体描述"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),a("h3",{attrs:{id:"_1-1-概述"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 概述")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-为什么要有《websocket-tool》"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《websocket-tool》","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《Websocket-Tool》")]),t._v(" "),a("ul",[a("li",[t._v("NULS 2.0根据功能划分模块,所有模块隔离,可以独立运行。")]),t._v(" "),a("li",[t._v("模块间通过《Websocket-Tool》调用接口")]),t._v(" "),a("li",[t._v("模块只要实现了规定接口,可以用任何语言实现")]),t._v(" "),a("li",[t._v("模块可以分布式部署")]),t._v(" "),a("li",[t._v("《Websocket-Tool》会打包成jar包,供各模块引用")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-《websocket-tool》要做什么"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《websocket-tool》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《Websocket-Tool》要做什么")]),t._v(" "),a("p",[t._v("所有模块间的接口调用都通过《Websocket-Tool》进行")]),t._v(" "),a("ul",[a("li",[t._v("启动Websocket Server")]),t._v(" "),a("li",[t._v("注册当前模块的所有cmd命令")]),t._v(" "),a("li",[t._v("把当前模块信息汇报给kernel")]),t._v(" "),a("li",[t._v("接收从kernel推送的所有模块信息")]),t._v(" "),a("li",[t._v("启动Websocket Client")]),t._v(" "),a("li",[t._v("维护调用过程产生的数据")]),t._v(" "),a("li",[t._v("封装所有数据中间处理过程,各模块只需要关心\n"),a("ul",[a("li",[t._v("输入")]),t._v(" "),a("li",[t._v("输出")])])]),t._v(" "),a("li",[t._v("各模块通过尽可能简单的方式调用cmd命令")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-《websocket-tool》在系统中的定位"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《websocket-tool》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《Websocket-Tool》在系统中的定位")]),t._v(" "),a("p",[t._v("《Websocket-Tool》是底层框架,任何模块都会依赖")]),t._v(" "),a("p",[t._v("《Websocket-Tool》维护各模块基础信息,但是不涉及具体业务")]),t._v(" "),a("h2",{attrs:{id:"二、功能设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),a("h3",{attrs:{id:"_2-1-架构图"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 架构图")]),t._v(" "),a("h2",{attrs:{id:"三、接口设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#三、接口设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 三、接口设计")]),t._v(" "),a("h2",{attrs:{id:"四、事件说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 四、事件说明")]),t._v(" "),a("h2",{attrs:{id:"五、协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 五、协议")]),t._v(" "),a("h3",{attrs:{id:"_5-1-通信协议-–-json-websockets"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-通信协议-–-json-websockets","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 通信协议 – Json/WebSockets")]),t._v(" "),a("p",[t._v("微服务的行为不像标准的客户端 - 服务器基础设施,因为每个微服务同时是客户端和服务器,因此需要全双工通信协议,这允许实现特殊类型的发布 - 订阅模式; 在这个实现中,方法只能被调用一次,然后调用者可以通过两种不同的方式接收不断的更新:")]),t._v(" "),a("ul",[a("li",[t._v("基于事件:当方法在预定义数量的事件之后发送通知时")]),t._v(" "),a("li",[t._v("基于时间:当方法在预定义的秒数后发送通知时")])]),t._v(" "),a("p",[t._v("WebSocket是一种成熟的选项,可以本机提供全双工连接,其他选项如标准Json-RPC不提供双向通道。\n消息将使用JSon格式进行编码,因为它是最广泛用于消息交换的,并且易于调试。")]),t._v(" "),a("h3",{attrs:{id:"_5-2-消息结构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-消息结构","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 消息结构")]),t._v(" "),a("p",[t._v("所有消息都有一个由5个字段组成的公共基础结构:")]),t._v(" "),a("ul",[a("li",[t._v("MessageID:这是一个标识请求的字符串。 它的长度不应超过256个字符")]),t._v(" "),a("li",[t._v("Timestamp:自纪元以来的秒数(1970年1月1日格林威治标准时间00:00:00)")]),t._v(" "),a("li",[t._v("TimeZone:发起请求的时区,它应为介于-12和12之间的数字")]),t._v(" "),a("li",[t._v("MessageType:消息类型,这些在第3节中指定")]),t._v(" "),a("li",[t._v("MessageData:保存消息有效负载的Json对象")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompressionRate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompressionAlgorithm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlib"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_5-3-message-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-message-types","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3 Message Types")]),t._v(" "),a("p",[t._v("目前只定义了9种类型的消息:NegotiateConnection, NegotiateConnectionResponse, Request, Unsubscribe, Response, Ack, Notificatioin, RegisterCompoundMethod, UnregisterCompoundMethod")]),t._v(" "),a("h4",{attrs:{id:"_5-3-1-negotiateconnection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-1-negotiateconnection","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.1 NegotiateConnection")]),t._v(" "),a("p",[t._v("这应该是在与微服务建立连接时应该发送的第一个对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。")]),t._v(" "),a("p",[t._v("它由两个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。")]),t._v(" "),a("li",[t._v("CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543133816985"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"protocolVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compressionAlgorithm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlib"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compressionRate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-2-negotiateconnectionresponse"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-2-negotiateconnectionresponse","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.2 NegotiateConnectionResponse")]),t._v(" "),a("p",[t._v("仅在响应先前传入的NegotiateConnection消息时发送此类消息。 它由两个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1")]),t._v(" "),a("li",[t._v("NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnectionReponse"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NegotiationStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NegotiationComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Incompatible protocol version"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-3-request"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-3-request","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.3 Request")]),t._v(" "),a("p",[t._v("调用者服务必须发送一个Request对象来执行Nulstar网络内某些服务提供的方法。")]),t._v(" "),a("p",[t._v("如果在单个请求对象中包含两个或更多方法,则应按顺序执行方法,然后发送一个response包喊所有回执信息,如果其中一个请求失败,则整个操作被视为失败。")]),t._v(" "),a("p",[t._v("它由六个字段组成:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("RequestAck(默认值:0):这是一个布尔值")]),t._v(" "),a("ul",[a("li",[t._v("0:发出的请求只需要一条Response消息,如果它订阅了该函数,那么它可能会有很多响应消息")]),t._v(" "),a("li",[t._v("1:发出的请求需要Ack和Response(译者注:有的请求可能需要一段时间处理,不会立刻返回Response,但是我要确保对方接收到了我的请求),如果它订阅了该函数,那么它可能会有很多响应消息")])])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionEventCounter(默认值:0):这是一个无符号整数,指定目标方法发送Response的值的"),a("code",[t._v("改变次数")]),t._v("。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每改变两次就发送。以此类推。")])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionPeriod(默认值:0):这是一个无符号整数,指定目标方法发送Response的时间间隔。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每2秒都会检测是否发送。以此类推。")])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionRange:如果请求的事件返回的是一个数字,则定义何时返回这个数字。\n这是一个字符串,表示将触发响应的条件。 字符串是一对带符号的十进制数,第一个是下限,第二个是上限,如果不可用则为空。 如果该对分别以“(”或“)”开始或结束,则表示该数字不包括在内,如果该对分别以“[”或“]”开始或结束,则表示该数字包括在内。")]),t._v(" "),a("p",[t._v("示例:假设我们只希望仅在余额等于或大于1000时收到通知。然后,getbalance请求应以“[1000,)”字符串作为SubscriptionRange参数发送")])]),t._v(" "),a("li",[a("p",[t._v("ResponseMaxSize(默认值:0):无符号整数,指定方法应返回的最大对象数,值为零(默认值)表示无限制。只针对返回结果为List有效,指定的是返回的记录个数。")])]),t._v(" "),a("li",[a("p",[t._v("RequestMethods:一个数组,包含所请求的所有方法及其各自的参数")])])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543133968578"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionEventCounter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"paramName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-4-unsubscribe"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-4-unsubscribe","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.4 Unsubscribe")]),t._v(" "),a("p",[t._v("当服务不再希望从其订阅的方法接收响应时,它必须向目标服务发送Unsubscribe消息。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("UnsubscribeMethods:一个数组,包含调用者想要取消订阅的所有方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543134296019"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unsubscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unsubscribeMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-5-response"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-5-response","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.5 Response")]),t._v(" "),a("p",[t._v("当目标服务完成处理请求时,应该发送响应以及操作结果。")]),t._v(" "),a("p",[t._v("它由六个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("RequestID:这是引用的原始Request消息请求ID")]),t._v(" "),a("li",[t._v("ResponseProcessingTime:目标服务处理请求所用的时间(以毫秒为单位)")]),t._v(" "),a("li",[t._v("ResponseStatus:响应状态,如果成功则为1,否则为0")]),t._v(" "),a("li",[t._v("ResponseComment:一个字符串,可以提供有关该过程结果的更多说明")]),t._v(" "),a("li",[t._v("ResponseMaxSize:响应包含每个请求的最大对象数")]),t._v(" "),a("li",[t._v("ResponseData:一个对象数组,包含已处理方法的结果,每个请求一个对象")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543134299030"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Response"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseProcessingTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Congratulations! Processing completed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight->1.3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-6-ack"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-6-ack","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.6 Ack")]),t._v(" "),a("p",[t._v("其唯一目的是通知呼叫者已成功接收请求。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("RequestID:这是引用的原始Request消息请求ID")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Ack"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"RequestID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sdj8jcf8899ekffEFefee"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-7-notification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-7-notification","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.7 Notification")]),t._v(" "),a("p",[t._v("当需要将某些事件通知给连接的组件而不期望响应消息时(例如,即将对服务执行升级时),将发送此消息类型。 通知将信息推送到其他组件,因此通知只应由Manager,Controller和Connector模块使用")]),t._v(" "),a("p",[t._v("它由四个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("NotificationAck :(默认值:0):这是一个布尔值\n"),a("ul",[a("li",[t._v("0:发出的通知不期望任何类型的消息作为回执")]),t._v(" "),a("li",[t._v("1:发出的通知需要一条Ack消息")])])]),t._v(" "),a("li",[t._v("NotificationType:通知的类别,每个服务都可以定义自己的类型,因此不需要接收方处理此字段")]),t._v(" "),a("li",[t._v("NotificationComment:字符串注释,提供有关通知原因的更多信息")]),t._v(" "),a("li",[t._v("NotificationData:与通知相关的数据,接收方不需要处理此字段")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Notification"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SystemUpgrade"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A system upgrade is about to be performed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Date"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-11-11"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"23:00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NewVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1.6"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-8-registercompoundmethod"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-8-registercompoundmethod","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.8 RegisterCompoundMethod")]),t._v(" "),a("p",[t._v("请求可以由多个方法组成,使用此消息类型,我们注册一个虚拟方法,该方法将按顺序执行其各个实际方法,如果其子方法之一失败,则虚方法返回失败。")]),t._v(" "),a("p",[t._v("某些子方法可能共享相同的参数名称,因此可以创建别名,如示例中所示。")]),t._v(" "),a("p",[t._v("它由三个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("CompoundMethodName:这是标识虚方法的字符串")]),t._v(" "),a("li",[t._v("CompoundMethodDescription:描述方法功能,在查询API以获取帮助时将提供描述")]),t._v(" "),a("li",[t._v("CompoundMethods:这是一个数组,包含构成虚方法的各自参数别名的方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"RegisterCompoundMethod"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetMyInfo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get useful information."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"GetBalance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetBalanceAddress"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"GetHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("在该示例中,正在注册一个名为GetMyInfo的虚方法,它由GetBalance和GetHeight方法组成,还为Address参数创建了一个名为GetBalanceAddress的别名。\nGetMyInfo的请求可以作为标准方法发送。")]),t._v(" "),a("p",[t._v("(我确实没看懂这个的意义在哪,感觉就是单纯为了多这么个功能,有疑问请直接找Berzeck或者坚哥,哈哈)")]),t._v(" "),a("h4",{attrs:{id:"_3-5-9-unregistercompoundmethod"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-9-unregistercompoundmethod","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.9 UnregisterCompoundMethod")]),t._v(" "),a("p",[t._v("此消息类型用于取消注册复合(虚拟)方法。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("UnregisterCompoundMethodName:这是标识虚方法的字符串。 如果它为空,则应取消注册调用者注册的所有虚拟方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnregisterCompoundMethod"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"UnregisterCompoundMethodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetMyInfo"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_5-4-具体细节"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-4-具体细节","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.4 具体细节")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("传输过程的所有属性都是string类型")])]),t._v(" "),a("li",[a("p",[t._v('如果是boolean类型,"1"代表true,"0"代表false')])]),t._v(" "),a("li",[a("p",[t._v("当调用一个方法的时候,调用者需要知道:提供方法的角色,以及方法的使用方式")])]),t._v(" "),a("li",[a("p",[t._v("注册的时候,Role1有method1,Role2有method2,如何定义?\n答:不需要定义,这是写在文档中的。\napiMethods = Role1Methods + Role2Methods。因此注册的时候不需要知道每个Role都包含什么方法,这些应该在文档中体现。")])]),t._v(" "),a("li",[a("p",[t._v("注册接口的字符串格式")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543204508986"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionEventCounter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"registerAPI"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"apiMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinEvent"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodScope"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"aaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"int"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(1,100]"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRegExp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bbb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRegExp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^[A-Za-z0-9\\\\-]+$"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 2.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinEvent"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodScope"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Role_Ledger"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"connectionInformation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"17733"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleDomain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls.io"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleRoles"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleAbbreviation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Chain Manager"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Manager返回各模块连接信息的字符串格式")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543204714006"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Response"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseProcessingTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Congratulations! Processing completed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"registerAPI"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Dependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"14694"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ke"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8887"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"17733"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),a("h2",{attrs:{id:"六、配置"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#六、配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、配置")]),t._v(" "),a("h2",{attrs:{id:"七、java特有的设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、Java特有的设计")]),t._v(" "),a("h3",{attrs:{id:"_7-1-设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.1 设计")]),t._v(" "),a("blockquote",[a("p",[t._v("io.nuls.rpc")]),t._v(" "),a("blockquote",[a("p",[t._v("client")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("WsClient")]),t._v(":与其他模块建立连接的对象,完全封装,不需要开发人员关注")]),t._v(" "),a("p",[a("code",[t._v("ClientRuntime")]),t._v(":客户端运行时需要的数据,方法")]),t._v(" "),a("p",[a("code",[t._v("CmdDispatcher")]),t._v(":开发人员应该只使用它来调用接口")])]),t._v(" "),a("p",[t._v("cmd")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd_package_1")]),t._v(" "),a("p",[t._v("cmd_package_2")]),t._v(" "),a("p",[a("code",[t._v("BaseCmd")]),t._v(":所有对外提供方法的类的父类,提供success, failed方法返回Response对象")])]),t._v(" "),a("p",[t._v("info")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("Constants")]),t._v(":常量")]),t._v(" "),a("p",[a("code",[t._v("HostInfo")]),t._v(":获取IP地址,随机获得端口")])]),t._v(" "),a("p",[t._v("model")]),t._v(" "),a("blockquote",[a("p",[t._v("message")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("Message")]),t._v(":所有消息都应该用该对象进行传输")]),t._v(" "),a("p",[a("code",[t._v("MessageType")]),t._v(":消息类型(包含以下9种)")]),t._v(" "),a("p",[a("code",[t._v("Ack")]),t._v(":确认收到消息")]),t._v(" "),a("p",[a("code",[t._v("NegotiateConnection")]),t._v(":握手")]),t._v(" "),a("p",[a("code",[t._v("NegotiateConnectionResponse")]),t._v(":回复握手")]),t._v(" "),a("p",[a("code",[t._v("Notification")]),t._v(":通知")]),t._v(" "),a("p",[a("code",[t._v("Request")]),t._v(":请求调用远程方法")]),t._v(" "),a("p",[a("code",[t._v("Response")]),t._v(":回复Request")]),t._v(" "),a("p",[a("code",[t._v("Unsubscribe")]),t._v(":取消订阅的远程方法")]),t._v(" "),a("p",[a("code",[t._v("RegisterCompoundMethod")]),t._v(":订阅多个远程方法")]),t._v(" "),a("p",[a("code",[t._v("UnregisterCompoundMethod")]),t._v(":取消订阅多个远程方法")])]),t._v(" "),a("p",[a("code",[t._v("CmdAnnotation")]),t._v(":注解类,有该注解的方法可以对外提供接口")]),t._v(" "),a("p",[a("code",[t._v("Parameter")]),t._v(":注解类,用以描述对外提供接口的参数信息")]),t._v(" "),a("p",[a("code",[t._v("Parameters")]),t._v(":注解类,Parameter的集合")]),t._v(" "),a("p",[a("code",[t._v("CmdDetail")]),t._v(":对外提供的方法的具体信息")]),t._v(" "),a("p",[a("code",[t._v("CmdParameter")]),t._v(":对外提供的方法的参数信息")]),t._v(" "),a("p",[a("code",[t._v("ModuleE")]),t._v(":枚举类型,NULS2.0基础架构下的模块信息")]),t._v(" "),a("p",[a("code",[t._v("RegisterApi")]),t._v(":一个模块对外提供的所有方法的合集")])]),t._v(" "),a("p",[t._v("server")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("CmdHandler")]),t._v(":根据Request消息,调用正确的方法")]),t._v(" "),a("p",[a("code",[t._v("ServerRuntime")]),t._v(":服务器运行时需要的参数,方法")]),t._v(" "),a("p",[a("code",[t._v("WsProcessor")]),t._v(":处理收到的消息队列")]),t._v(" "),a("p",[a("code",[t._v("WsServer")]),t._v(":服务器对象,负责接收消息,然后放入消息队列")])])])]),t._v(" "),a("h3",{attrs:{id:"_7-2-如何使用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-如何使用","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2 如何使用")]),t._v(" "),a("p",[t._v("Websocket-Tool会做成JAR包供各模块引用")]),t._v(" "),a("h4",{attrs:{id:"_7-2-1-测试专用:模拟kernel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-1-测试专用:模拟kernel","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.1 测试专用:模拟kernel")]),t._v(" "),a("p",[t._v("非常重要!")]),t._v(" "),a("p",[t._v("各模块接口是在kernel中进行维护,但是kernel由社区成员开发,因此这一部分是内部测试的模拟代码,可以直接复制使用,无需额外操作。")]),t._v(" "),a("p",[t._v("(test/java/io.nuls.test.WsKernel)")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Test")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("kernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" Exception "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// url: "ws://127.0.0.1:8887"')]),t._v("\n WsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mockKernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-2-自定义cmd"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-2-自定义cmd","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.2 自定义cmd")]),t._v(" "),a("p",[t._v("scope的值:public,private,admin")]),t._v(" "),a("ul",[a("li",[t._v("public:暴露出去,第三方应用/平台也能调用的公开接口")]),t._v(" "),a("li",[t._v("private:只有模块间内部才能调用的接口")]),t._v(" "),a("li",[t._v("admin:专门为管理员设计的特定接口(管理员定义在在Berzeck的connector中,我们并不需要关心)")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n * 该类所在的包需要通过7.1.3中的方法进行扫描\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyCmd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseCmd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@CmdAnnotation")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cmd "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" version "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" scope "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" minEvent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" minPeriod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n description "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Parameter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("parameterName "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"aaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterType "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"int"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterValidRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(1,100]"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterValidRegExp "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Parameter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("parameterName "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bbb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterType "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Object "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Log"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("info")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight version 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// success")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("success")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Here is your real return value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 预定义错误")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("failed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ErrorCode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 非预定义错误")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("failed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-3-启动server"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-3-启动server","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.3 启动Server")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Start server instance")]),t._v("\nWsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getInstance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("moduleRoles")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("moduleVersion")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dependencies")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LG"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dependencies")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scanPackage")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"io.nuls.rpc.cmd.test"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ws://127.0.0.1:8887"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get information from kernel")]),t._v("\nCmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncKernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-4-为kernel提供的接口"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-4-为kernel提供的接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.4 为kernel提供的接口")]),t._v(" "),a("p",[t._v("现阶段忽略!")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-5-调用cmd"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-5-调用cmd","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.5 调用cmd")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n 单元测试专用:单元测试时需要告知内核地址,以及同步接口列表\n 如果不是单元测试,在模块中进行连调测试,下面两句话是不需要的\n */")]),t._v("\nWsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mockModule")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n 单元测试专用结束\n */")]),t._v("\n\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Build params map")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" params "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// Version information ("1.1" or 1.1 is both available)')]),t._v("\nparams"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Constants"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VERSION_KEY_STR"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparams"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paramName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 可以看成是一个同步方法,发送Request,获得Response")]),t._v("\nResponse response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndResponse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 发送Request,当有Response的时候会自动调用预设的方法,返回的messageId是为了取消订阅")]),t._v("\nString messageId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndInvoke")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" InvokeMethod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invokeGetHeight2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 与requestAndInvoke一样,但是必须在收到Ack之后才会返回messageId")]),t._v("\nString messageId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndInvokeWithAck")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" InvokeMethod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invokeGetHeight2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 取消订阅")]),t._v("\nCmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unsubscribe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("messageId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nSystem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("println")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"我已经取消了订阅"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),a("h2",{attrs:{id:"八、补充内容"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 八、补充内容")])])}],!1,null,null,null);e.options.__file="rpcToolWebsocketDesign.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/153.852b7cff.js b/docs/.vuepress/dist/assets/js/153.852b7cff.js new file mode 100644 index 00000000..f3ae666f --- /dev/null +++ b/docs/.vuepress/dist/assets/js/153.852b7cff.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[153],{886:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("使用构建工具导入jar包")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._m(10),t._v(" "),a("p",[t._v("首先添加SDK命名空间")]),t._v(" "),t._m(11),a("p",[t._v("引入后 使用下列代码生成一个实例client")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._m(14),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),a("p",[t._v("--")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._m(25),t._v(" "),t._m(26),a("hr"),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(28),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(31),t._v(" "),t._m(32),t._m(33),t._v(" "),t._m(34),a("hr"),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(36),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._m(41),t._v(" "),t._m(42),a("hr"),t._v(" "),t._m(43),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(44),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),a("hr"),t._v(" "),t._m(52),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(53),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(56),t._v(" "),t._m(57),t._m(58),t._v(" "),t._m(59),a("hr"),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(61),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(64),t._v(" "),t._m(65),t._m(66),t._v(" "),t._m(67),a("hr"),t._v(" "),t._m(68),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(69),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(72),t._v(" "),t._m(73),t._m(74),t._v(" "),t._m(75),a("hr"),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(77),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._m(82),t._v(" "),t._m(83),t._m(84),t._v(" "),t._m(85),t._m(86),t._v(" "),t._m(87),a("hr"),t._v(" "),t._m(88),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(89),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(92),t._v(" "),t._m(93),t._m(94),t._v(" "),t._m(95),a("hr"),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(97),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._m(102),t._v(" "),t._m(103),a("hr"),t._v(" "),t._m(104),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(105),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(108),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),a("hr"),t._v(" "),t._m(112),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(116),t._v(" "),t._m(117),t._m(118),t._v(" "),t._m(119),t._m(120),t._v(" "),t._m(121),t._m(122),t._v(" "),t._m(123),a("hr"),t._v(" "),t._m(124),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(128),t._v(" "),t._m(129),t._m(130),t._v(" "),t._m(131),t._m(132),t._v(" "),t._m(133),a("hr"),t._v(" "),t._m(134),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(135),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(138),t._v(" "),t._m(139),t._m(140),t._v(" "),t._m(141),t._m(142),t._v(" "),t._m(143),a("hr"),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(145),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(148),t._v(" "),t._m(149),t._m(150),t._v(" "),t._m(151),t._m(152),t._v(" "),t._m(153),a("hr"),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(155),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(156),t._v(" "),t._m(157),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(158),t._v(" "),t._m(159),t._m(160),t._v(" "),t._m(161),t._m(162),t._v(" "),t._m(163),a("hr"),t._v(" "),t._m(164),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(165),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(166),t._v(" "),t._m(167),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(168),t._v(" "),t._m(169),t._m(170),t._v(" "),t._m(171),a("hr"),t._v(" "),t._m(172),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(174),t._v(" "),t._m(175),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(176),t._v(" "),t._m(177),t._m(178),t._v(" "),t._m(179),a("hr"),t._v(" "),t._m(180),t._v(" "),t._m(181),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(182),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(183),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),a("hr"),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(189),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(190),t._v(" "),t._m(191),t._v(" "),t._m(192),t._v(" "),t._m(193),a("blockquote"),t._v(" "),a("hr"),t._v(" "),t._m(194),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(195),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(196),t._v(" "),t._m(197),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(198),t._v(" "),t._m(199),t._m(200),t._v(" "),t._m(201),a("hr"),t._v(" "),t._m(202),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(203),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(204),t._v(" "),t._m(205),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(206),t._v(" "),t._m(207),t._m(208),t._v(" "),t._m(209),a("hr"),t._v(" "),t._m(210),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(211),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(212),t._v(" "),t._m(213),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(214),t._v(" "),t._m(215),t._m(216),t._v(" "),t._m(217),a("hr"),t._v(" "),t._m(218),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(219),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(220),t._v(" "),t._m(221),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(222),t._v(" "),t._m(223),t._m(224),t._v(" "),t._m(225),a("hr"),t._v(" "),t._m(226),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(227),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(228),t._v(" "),t._m(229),t._v(" "),t._m(230),t._v(" "),t._m(231),a("hr"),t._v(" "),t._m(232),t._v(" "),t._m(233),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(234),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(235),t._v(" "),a("table",[t._m(236),t._v(" "),t._m(237),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privKeys")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("passwords")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥对应的密码(多个账户密码必须一样)")])])]),t._v(" "),t._m(238),t._v(" "),t._m(239),a("blockquote"),t._v(" "),t._m(240),t._v(" "),t._m(241),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(242),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(243),t._v(" "),t._m(244),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(245),t._v(" "),t._m(246),t._m(247),t._v(" "),t._m(248),a("hr"),t._v(" "),t._m(249),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(250),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(251),t._v(" "),t._m(252),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(253),t._v(" "),t._m(254),t._m(255),t._v(" "),t._m(256),a("hr"),t._v(" "),t._m(257),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(258),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(259),t._v(" "),t._m(260),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(261),t._v(" "),t._m(262),t._m(263),t._v(" "),t._m(264),a("hr"),t._v(" "),t._m(265),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(266),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(267),t._v(" "),t._m(268),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(269),t._v(" "),t._m(270),t._m(271),t._v(" "),t._m(272),a("hr"),t._v(" "),t._m(273),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(274),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(275),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(276),t._v(" "),t._m(277),t._m(278),t._v(" "),t._m(279),a("hr"),t._v(" "),t._m(280),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(281),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(282),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(283),t._v(" "),t._m(284),t._m(285),t._v(" "),t._m(286),a("hr"),t._v(" "),t._m(287),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(288),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(289),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(290),t._v(" "),t._m(291),t._m(292),t._v(" "),t._m(293),a("hr"),t._v(" "),t._m(294),t._v(" "),t._m(295),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(296),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(297),t._v(" "),t._m(298),t._v(" "),t._m(299),t._v(" "),t._m(300),a("hr"),t._v(" "),t._m(301),t._v(" "),t._m(302),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(303),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(304),t._v(" "),t._m(305),t._v(" "),t._m(306),t._v(" "),t._m(307),a("hr"),t._v(" "),t._m(308),t._v(" "),t._m(309),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(310),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(311),t._v(" "),t._m(312),t._v(" "),t._m(313),t._v(" "),t._m(314),t._m(315),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(316),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(317),t._v(" "),t._m(318),t._v(" "),t._m(319),t._v(" "),t._m(320),t._m(321),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(322),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(323),t._v(" "),t._m(324),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(325),t._v(" "),t._m(326),t._m(327),t._v(" "),t._m(328),t._m(329),t._v(" "),t._m(330),t._v(" "),t._m(331),t._v(" "),t._m(332),t._v(" "),t._m(333),t._m(334),t._v(" "),t._m(335),t._m(336),t._v(" "),t._m(337),t._m(338),t._v(" "),t._m(339),t._m(340),t._v(" "),t._m(341),a("hr"),t._v(" "),t._m(342),t._v(" "),t._m(343),a("hr"),t._v(" "),t._m(344),t._v(" "),t._m(345),a("hr"),t._v(" "),t._m(346),t._v(" "),t._m(347),a("hr"),t._v(" "),t._m(348),t._v(" "),t._m(349),a("hr"),t._v(" "),t._m(350),t._v(" "),t._m(351),a("hr"),t._v(" "),t._m(352),t._v(" "),t._m(353),a("hr"),t._v(" "),t._m(354),t._v(" "),t._m(355)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"约定"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("所有SDK接口统一返回Result(说明见文末附件数据解释)")]),t._v(" "),a("li",[t._v("每个接口描述的返回对象是指Result中data属性的内容")]),t._v(" "),a("li",[t._v("除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na")]),t._v(" "),a("li",[t._v("运行SDK前,需要确认NULS节点服务已经启动并工作正常")]),t._v(" "),a("li",[t._v("推荐使用JDK1.8+")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"版本更新记录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新内容")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-19")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("对接NULS服务各项基础功能的接口")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-22")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.14")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-04")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.15")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-07")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增4个共识接口,4.1——4.4")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.16")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-11")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增接口4.5")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.0.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-13")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增错误码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.1.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-09-28")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增多账户转账接口")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"快速入门"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-引入文件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-引入文件","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.引入文件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("maven方式")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-xml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-xml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("dependency")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("groupId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("io.nuls.sdk"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("artifactId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("sdk-all"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1.0.1"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-创建sdk实例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-创建sdk实例","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.创建SDK实例")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//SDK启动类命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//引入SDK调用工具的命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("初始化SDK")]),this._v(" "),s("li",[this._v("初始化方法不传参数时,默认PRC ip和端口分别为"),s("code",[this._v("127.0.0.1")]),this._v(","),s("code",[this._v("8001")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//默认 ")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//传入NULS服务的ip,port")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.88"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("使用工具类调用接口方法")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 创建一个带密码的账户的完整示例")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//根据需求引入对应模块的命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\tSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"账户-accountservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#账户-accountservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户 AccountService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-创建账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 创建账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAccount(int count, String password);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户;\n成功创建的账户信息将被持久化至NULS服务本地数据库中。")]),this._v(" "),s("p",[this._v("返回成功创建的账户地址集合")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建账户的数量(默认1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //返回创建账户的地址集合\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-2-创建离线账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-创建离线账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 创建离线账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createOfflineAccount(int count, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作\nCreate encrypted off-line accounts (Not saved to the database)")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建账户的数量(默认1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiBQg72BCLmLqttRpPfp8ECRCBwbdD"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529314943624")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"')]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个没有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个没有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-3-获取账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-获取账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.3 获取账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccount(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址获取一个账户的信息")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("AccountInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-4-获取设置别名的手续费"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-获取设置别名的手续费","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.4 获取设置别名的手续费")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAliasFee(String address, String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费)")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("double")]),this._v(", unit is "),s("code",[this._v("NULS")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意!")]),this._v(" 此接口返回的手续费单位为"),s("code",[this._v("NULS")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待设置的别名名称")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.01")]),t._v(" //(单位为NULS"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAliasFee")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-5-获取账户列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-获取账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.5 获取账户列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccountList(int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据分页参数获取账户列表")]),this._v(" "),s("p",[this._v("Result.data Page "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("页码,必须大于0 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("每页返回数据记录数量, 取值范围1~100")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cid96JrTGA2XaNG6zXrRKh18kLUbLP"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529311250627")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t...\n\t\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-6-根据账户别名获取账户地址"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-根据账户别名获取账户地址","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.6 根据账户别名获取账户地址")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAddressByAlias(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户别名获取账户地址字符串")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户别名 ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[this._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAddressByAlias")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-7-获取账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-获取账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.7 获取账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getPrikey(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址和密码获取账户私钥,返回私钥字符串")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//有密码的账户调用方式")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//无密码的账户调用方式")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-8-验证别名是否可以使用"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-验证别名是否可以使用","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.8 验证别名是否可以使用")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isAliasUsable(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据别名名称验证别名是否可用(是否没有被使用)")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("别名名称")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示别名可以使用\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回 别名不可用的情况")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示别名不可以使用\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isAliasUsable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-9-备份账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.9 备份账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result backupAccount(String address, String path, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码")]),this._v(" "),s("p",[this._v("Result 返回生成的文件地址")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//备份一个没有密码的账户至当前目录")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//备份一个有密码的账户至/backup目录")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-10-导入账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-导入账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.10 导入账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByKeystore")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path/fileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String/FileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(".keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入一个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入一个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-11-导入账户-私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-导入账户-私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.11 导入账户(私钥)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByPriKey(String privateKey, String password, boolean overwrite)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据私钥导入账户")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privateKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户私钥 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入账户时设置密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入账户时不设置密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-12-验证账户是否加密"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-验证账户是否加密","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.12 验证账户是否加密")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isEncrypted(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("验证账户是否加密")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示已加密\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回 未加密")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isEncrypted")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-移除账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 移除账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result removeAccount(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("移除账户")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-设置密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-设置密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 设置密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPassword(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为未加密的账户设置密码,已加密账户不能调用此接口")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-14-修改密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-修改密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.14 修改密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPassword(String address, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为已加密的账户修改密码,未加密账户不能调用此接口")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户当前密码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-15-设置别名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.15 设置别名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setAlias(String address, String alias, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为账户设置一个别名")]),this._v(" "),s("p",[this._v("Result 返回设置别名的交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待设置的别名名称")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("密码")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"')]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("错误示例")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT007"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The account already set an alias"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-16-设置离线账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-设置离线账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.16 设置离线账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPasswordOffline(String address, String priKey, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("设置离线账户密码, sdk中独立加密,不与NULS服务交互")]),this._v(" "),s("p",[this._v("Result 返回加密后的私钥(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-17-修改离线账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-修改离线账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.17 修改离线账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("修改离线账户密码, sdk中独立修改, 不与NULS服务交互")]),this._v(" "),s("p",[this._v("Result 返回新密码生成的加密后的私钥(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("encryptedPriKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("加密后的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("原密码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"交易-accountledgerservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#交易-accountledgerservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易 AccountLedgerService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-1-创建转账交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-创建转账交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 创建转账交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("通过用户传入的交易输入\\输出,组装交易。传入的参数为json对象,详见e.g示例。"),a("strong",[t._v("示例中input和output的属性都为必填项")]),t._v("。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。"),a("strong",[t._v("有关手续费的计算会在后面详细说明")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易引用的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易新生成的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的outputs,示例中的output属性均必填")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":100000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-交易签名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-交易签名","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 交易签名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signTransaction(String txHex, String priKey, String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("通过私钥,给交易签名")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 签名后的交易,16进制后的序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("十六进制的交易序列化数据")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥对应的地址,用于验证私钥合法性")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥的密码,如果私钥未加密可不传")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString priKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS6352s!f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-根据交易hash查询交易详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-根据交易hash查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 根据交易hash查询交易详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getTxByHash(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据交易hash查询交易详情")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Transaction"}},[s("code",[this._v("Transaction")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getTxByHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-4-转账"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 转账")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result transfer(String address, String toAddress, String password, long amount, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("发起转账交易")]),this._v(" "),s("p",[this._v("Result 返回交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转出者账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("toAddress")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("接收者账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转出者账户的密码,如果账户没有加密则不填")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("amount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("long")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转账金额(单位:Na)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//账户有密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"备注1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//账户没有密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"备注1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-5-查询账户余额"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.5 查询账户余额")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBalance(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取账户余额")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BalanceInfo"}},[s("code",[this._v("BalanceInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-6-广播交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-6-广播交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.6 广播交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result broadcastTransaction(String txHex);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("广播交易")]),this._v(" "),s("p",[this._v("Result.data String 返回交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("十六进制交易序列化数据")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" service"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcastTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isSuccess")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n String txHash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-7-创建多地址转账交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-7-创建多地址转账交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.7 创建多地址转账交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("通过用户传入的交易输入\\输出,组装交易。传入的参数为json对象,详见e.g示例。"),a("strong",[t._v("示例中input和output的属性都为必填项")]),t._v("。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。"),a("strong",[t._v("有关手续费的计算会在后面详细说明")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易引用的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易新生成的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("nInputAccount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入账户数")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" nInputAccount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的outputs,示例中的output属性均必填")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createMultipleInputAddressTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("nInputAccount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":100000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-8-多地址转账交易签名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-8-多地址转账交易签名","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.8 多地址转账交易签名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("通过私钥,给交易签名")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 签名后的交易,16进制后的序列化字符串")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("th",{attrs:{align:"center"}},[this._v("参数")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("类型")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("是否必填")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("说明")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",{attrs:{align:"center"}},[this._v("txHex")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("String")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("必填")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("十六进制的交易序列化数据")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" priKeys "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" passwords "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signMultiTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" passwords"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"区块-blockservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#区块-blockservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 区块 BlockService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-1-根据区块高度获取区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-根据区块高度获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 根据区块高度获取区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块高度获取区块头信息")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块高度")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-2-根据区块hash获取区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-根据区块hash获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 根据区块hash获取区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块hash获取区块头")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-3-根据区块高度获取区块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-根据区块高度获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 根据区块高度获取区块")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块高度获取区块")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块高度")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-4-根据区块hash获取区块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-根据区块hash获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 根据区块hash获取区块")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块hash获取区块")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-5-获取最新区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-获取最新区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 获取最新区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新的区块头")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-6-获取最新区块的高度"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-6-获取最新区块的高度","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.6 获取最新区块的高度")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHight()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新区块的高度")]),this._v(" "),s("p",[this._v("Result.data 高度(Long)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5210")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-7-获取最新区块的块hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-7-获取最新区块的块hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.7 获取最新区块的块Hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新区块的块Hash")]),this._v(" "),s("p",[this._v("Result.data Hash值(String)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"共识-consensusservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#共识-consensusservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识 ConsensusService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-1-离线组装创建节点交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-离线组装创建节点交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 离线组装创建节点交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装创建节点交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("agentInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易手续费")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点信息,示例总AgentInfo的属性均必填")]),t._v("\nAgentInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AgentInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//申请共识节点的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//实际打包区块的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的保证金, 最低20000NULS,最高200000NULS ")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setCommissionRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//佣金比例 1-100")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的手续费")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("创建共识节点交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":1000000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(288 + 50 * inputs.length)/1024 ,\n其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-2-离线组装委托共识交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-离线组装委托共识交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 离线组装委托共识交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装委托共识交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("depositInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易手续费")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托共识信息,示例中DepositInfo的属性均必填")]),t._v("\nDepositInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DepositInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托共识的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托代币数量:2000NULS —— 500000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建共识节点的交易id")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的手续费")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("创建委托交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":1000000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(288 + 50 * inputs.length)/1024 ,\n其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-3-离线组装退出委托共识交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-离线组装退出委托共识交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.3 离线组装退出委托共识交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createCancelDepositTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装退出委托共识交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("参与共识时被锁定的那条output")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额,")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将output作为参数,生成退出委托共识交易")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCancelDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-4-离线组装删除共识节点交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-离线组装删除共识节点交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.4 离线组装删除共识节点交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createStopAgentTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装删除共识节点交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点时被锁定的那条output")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金,")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将output作为参数,生成退出委托共识交易")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createStopAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-5-获取委托共识列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-获取委托共识列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.5 获取委托共识列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getDeposits(String address, int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取地址的委托共识列表")]),this._v(" "),s("p",[this._v("Result.data List委托列表信息")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("委托地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("页码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("每页显示条数,1-100之间")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000010000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("98")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDeposits")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"附录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#附录","aria-hidden":"true"}},[this._v("#")]),this._v(" 附录")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"接口返回result示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#接口返回result示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 接口返回Result示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"result"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#result","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回具体的数据")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" data\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回true")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示接口访问正常,业务返回"),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" //接口业务功能的返回结果\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" //接口业务功能的返回结果\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误,异常等")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("这是创建一个带密码的离线账户的完整返回结果")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n //data为List\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529041525794")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\t \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Account"}},[this._v(" Account ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"input"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#input","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Input"}},[this._v(" Input ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址 \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 锁定时间\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"output"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#output","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Output"}},[this._v(" Output ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 索引\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer 状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(未花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(高度锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(参与共识锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(已花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Transaction"}},[this._v(" Transaction ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易类型\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易发起时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易金额\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 备注\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(待确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(已确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 索引\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer 状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(未花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(高度锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(参与共识锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(已花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"balanceinfo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceinfo","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BalanceInfo"}},[this._v(" BalanceInfo ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 余额\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(' 可用余额\n\tlocked"'),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long 锁定余额\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BlockHeader"}},[this._v(" BlockHeader")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 上一个区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 梅克尔hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块生成时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块打包交易数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 打包地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识轮次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 参与共识成员数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前共识轮开始时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前轮次打包出块的名次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识奖励\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 获取的打包手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#block","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Block"}},[this._v(" Block")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 上一个区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 梅克尔hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块生成时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块打包交易数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 打包地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识轮次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 参与共识成员数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前共识轮开始时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前轮次打包出块的名次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识奖励\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 获取的打包手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易的hash值\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易类型\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易发起时间\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易手续费\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易金额\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 备注\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(待确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(已确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" 输入\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" 输出\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])}],!1,null,null,null);e.options.__file="sdk.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/154.dbd3a07d.js b/docs/.vuepress/dist/assets/js/154.dbd3a07d.js new file mode 100644 index 00000000..a318fc71 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/154.dbd3a07d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[154],{884:function(t,e,s){"use strict";s.r(e);var n=s(0),a=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"示例"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 示例")])])}],!1,null,null,null);a.options.__file="smartContractDemo.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/155.6f6f946b.js b/docs/.vuepress/dist/assets/js/155.6f6f946b.js new file mode 100644 index 00000000..61d5d3b8 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/155.6f6f946b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[155],{882:function(s,t,a){"use strict";a.r(t);var e=a(0),r=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"手续费"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#手续费","aria-hidden":"true"}},[s._v("#")]),s._v(" 手续费")]),s._v(" "),a("h3",{attrs:{id:"_1-智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?","aria-hidden":"true"}},[s._v("#")]),s._v(" 1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?")]),s._v(" "),a("blockquote",[a("p",[a("code",[s._v("背景:")]),s._v("由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一")])]),s._v(" "),a("p",[s._v("在主链上,多出三个类型的交易,"),a("code",[s._v("创建智能合约")]),s._v(", "),a("code",[s._v("调用智能合约")]),s._v(", "),a("code",[s._v("删除智能合约")])]),s._v(" "),a("p",[s._v("三个交易与其他交易如"),a("code",[s._v("转账")]),s._v("不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一")]),s._v(" "),a("ul",[a("li",[s._v("智能合约收费计算方式")])]),s._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" COMPARISON "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//比较字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONSTANT "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//简单数值类型字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LDC "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数值常量,字符串常量(长度 * LDC)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONTROL "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//控制字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" TABLESWITCH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//switch字节码(大小 * TABLESWITCH)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LOOKUPSWITCH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//switch字节码(大小 * LOOKUPSWITCH)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONVERSION "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数值转换")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" EXTENDED "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//null判断")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" MULTIANEWARRAY "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//多维数组(大小 * MULTIANEWARRAY)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LOAD "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把本地变量送到栈顶")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" ARRAYLOAD "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把数组的某项送到栈顶")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" MATH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数学操作及移位操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" REFERENCE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//对象相关操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" NEWARRAY "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//一维数组(大小 * NEWARRAY)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" STACK "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//栈操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" STORE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把栈顶的值存入本地变量")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" ARRAYSTORE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把栈项的值存到数组里")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" TRANSFER "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//转账交易")]),s._v("\n\n")])])]),a("ul",[a("li",[a("p",[s._v("一次智能合约总手续费")]),s._v(" "),a("p",[s._v("一次合约交易的总手续费由三部分构成")]),s._v(" "),a("ul",[a("li",[a("p",[s._v("第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费")])]),s._v(" "),a("li",[a("p",[s._v("第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na")])])]),s._v(" "),a("blockquote",[a("p",[s._v("举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是"),a("code",[s._v("20000 * 20 = 400000")]),s._v(",既是0.004NULS")])]),s._v(" "),a("ul",[a("li",[s._v("第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还")])]),s._v(" "),a("blockquote",[a("p",[s._v("举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是"),a("code",[s._v("10000 * 20 = 200000")]),s._v(",既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方")])])]),s._v(" "),a("li",[a("p",[s._v("合约调用方付多少钱?")]),s._v(" "),a("p",[s._v("在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方")])]),s._v(" "),a("li",[a("p",[s._v("由谁收到了这些费用?")]),s._v(" "),a("blockquote",[a("p",[a("code",[s._v("前提:")]),s._v("这部分费用都体现在区块的CoinBase交易(共识奖励)中")])]),s._v(" "),a("p",[s._v("区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用")])])])])}],!1,null,null,null);r.options.__file="smartContractFee.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/156.8e16b0e8.js b/docs/.vuepress/dist/assets/js/156.8e16b0e8.js new file mode 100644 index 00000000..12098ae5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/156.8e16b0e8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[156],{880:function(t,i,l){"use strict";l.r(i);var a=l(0),v=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,i=t.$createElement,l=t._self._c||i;return l("div",{staticClass:"content"},[l("h1",{attrs:{id:"源码启动nuls"}},[l("a",{staticClass:"header-anchor",attrs:{href:"#源码启动nuls","aria-hidden":"true"}},[t._v("#")]),t._v(" 源码启动NULS")]),t._v(" "),l("h2",{attrs:{id:"下载源码"}},[l("a",{staticClass:"header-anchor",attrs:{href:"#下载源码","aria-hidden":"true"}},[t._v("#")]),t._v(" 下载源码")]),t._v(" "),l("p",[t._v("访问NULS项目github地址:https://github.com/nuls-io/nuls")]),t._v(" "),l("p",[t._v("方式一:直接下载源代码")]),t._v(" "),l("p",[t._v('​\t进入github地址后,点击"Clone or download" 按钮,选择Download ZIP 下载源码包。')]),t._v(" "),l("p",[t._v("方式二:通过git命令克隆NULS仓库")]),t._v(" "),l("p",[t._v("​\t"),l("code",[t._v("$ git clone https://github.com/nuls-io/nuls.git")])]),t._v(" "),l("p",[t._v("方式三(推荐):通过开发工具,例如IntelliJ IDEA,克隆NULS仓库。")]),t._v(" "),l("h2",{attrs:{id:"环境说明"}},[l("a",{staticClass:"header-anchor",attrs:{href:"#环境说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 环境说明")]),t._v(" "),l("p",[t._v("​\t操作系统:macOS、Windows")]),t._v(" "),l("p",[t._v("​\t构建工具:maven")]),t._v(" "),l("p",[t._v("​\t开发工具:IntelliJ IDEA")]),t._v(" "),l("p",[t._v("​\t开发语言:Java (JDK1.8)")]),t._v(" "),l("h2",{attrs:{id:"nuls启动基本介绍"}},[l("a",{staticClass:"header-anchor",attrs:{href:"#nuls启动基本介绍","aria-hidden":"true"}},[t._v("#")]),t._v(" NULS启动基本介绍")]),t._v(" "),l("p",[t._v("​\t由于区块链是去中心化网络,是由多个节点组成,所以单独用NULS源代码启动一个节点是没有意义的,也是不可行的。本文假定一个已经存在的利用NULS源码运行的自定义测试网络,并且搭建该网络时没有修改除网络参数以外的源代码,我们该如何启动NULS源代码,并加入该网络。")]),t._v(" "),l("ol",[l("li",[l("p",[t._v("首先安装jdk1.8和maven构建工具。")]),t._v(" "),l("ol",{attrs:{start:"2"}},[l("li",[t._v("运行IntelliJ IDEA")])]),t._v(" "),l("ul",[l("li",[t._v("如果下载的源码包,则先解压然后通过IntelliJ IDEA导入NULS项目")]),t._v(" "),l("li",[t._v("如果通过git命令克隆NULS仓库下载的源代码,再通过IntelliJ IDEA导入NULS项目")]),t._v(" "),l("li",[t._v("通过IntelliJ IDEA的Git插件克隆NULS仓库。")])]),t._v(" "),l("ol",{attrs:{start:"3"}},[l("li",[t._v("配置与已存在网络一致的网络环境参数")])]),t._v(" "),l("ul",[l("li",[t._v("打开client-module项目中module.ini配置文件文件")]),t._v(" "),l("li",[t._v("建议用已知自定义测试网络中其他节点的module.ini配置文件来将此module.ini文件替换掉,来保证网络环境参数一致。")])]),t._v(" "),l("ol",{attrs:{start:"4"}},[l("li",[t._v("运行client-module项目中NULS启动类Bootstrap.java。位置:"),l("code",[t._v("io.nuls.client")]),t._v(" 包中。")]),t._v(" "),l("li",[t._v("启动过程中将打开NULS网钱包界面,并开始同步该自定义测试网高度,表示启动成功。")])])])])])}],!1,null,null,null);v.options.__file="sourceCodeStartNULS.md";i.default=v.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/157.8dbfeb43.js b/docs/.vuepress/dist/assets/js/157.8dbfeb43.js new file mode 100644 index 00000000..dc1bbde8 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/157.8dbfeb43.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[157],{878:function(t,n,a){"use strict";a.r(n);var s=a(0),e=Object(s.a)({},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[a("router-link",{attrs:{to:"/zh/startNULS/connectTestnet.html"}},[t._v("为部署、调用智能合约做准备")])],1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("为开发智能合约代码做准备")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载JDK8"),a("OutboundLink")],1),t._v("(安装略)")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.jetbrains.com/idea/download/",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载IntelliJ IDEA"),a("OutboundLink")],1),t._v("(安装略)")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载NULS智能合约插件"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("安装NULS智能合约插件"),a("OutboundLink")],1)]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._m(7),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/nuls-io/contracts",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官方收集的智能合约代码仓库"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/amalcaraz/nuls-partnership-smartcontract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Angelillou的智能合约-合作委托挖矿"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/amalcaraz/nuls-lottery-smartcontract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Angelillou的智能合约-彩票"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/naveen7252/ProductReviewContract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Naveen的智能合约-评论"),a("OutboundLink")],1)]),t._v(" "),t._m(8),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/smartContract.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("全节点钱包智能合约部署与调用方式"),a("OutboundLink")],1)]),t._v(" "),t._m(9),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("智能合约代码规范与语法说明"),a("OutboundLink")],1)])])},[function(){var t=this.$createElement,n=this._self._c||t;return n("h1",{attrs:{id:"快速入门"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"一、运行公测环境,创建账户,领取测试币"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、运行公测环境,创建账户,领取测试币","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、运行公测环境,创建账户,领取测试币")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"二、安装jdk8、intellij-idea、nuls智能合约插件"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、安装jdk8、intellij-idea、nuls智能合约插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、安装JDK8、IntelliJ IDEA、NULS智能合约插件")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"三、智能合约代码示例"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、智能合约代码示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、智能合约代码示例")])},function(){var t=this.$createElement,n=this._self._c||t;return n("p",[n("strong",[n("em",[this._v("用示例快速编译、部署一个智能合约")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("ul",[n("li",[this._v("简单示例")])])},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigDecimal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 覆写这个方法并标记@Payable注解,这个智能合约可以接收全节点钱包NULS资产的直接转账")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferToContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 标记@Payable注解,调用这个方法时,智能合约可接受NULS转入")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigDecimal nuls "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigDecimal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("movePointLeft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I received your transfer amount: "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toPlainString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayWhat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say nothing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"四、智能合约代码仓库"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#四、智能合约代码仓库","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、智能合约代码仓库")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"五、智能合约部署与调用"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#五、智能合约部署与调用","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、智能合约部署与调用")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"六、智能合约代码规范与语法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#六、智能合约代码规范与语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、智能合约代码规范与语法")])}],!1,null,null,null);e.options.__file="startSmartContract.md";n.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/158.919c857b.js b/docs/.vuepress/dist/assets/js/158.919c857b.js new file mode 100644 index 00000000..81afa3f2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/158.919c857b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[158],{876:function(a,t,s){"use strict";s.r(t);var e=s(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,s=a._self._c||t;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"nrc-20合约标准"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nrc-20合约标准","aria-hidden":"true"}},[a._v("#")]),a._v(" NRC-20合约标准")]),a._v(" "),s("h2",{attrs:{id:"简述"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#简述","aria-hidden":"true"}},[a._v("#")]),a._v(" 简述")]),a._v(" "),s("p",[a._v("token的接口标准")]),a._v(" "),s("h2",{attrs:{id:"摘要"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[a._v("#")]),a._v(" 摘要")]),a._v(" "),s("p",[a._v("以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。")]),a._v(" "),s("h2",{attrs:{id:"动机"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[a._v("#")]),a._v(" 动机")]),a._v(" "),s("p",[a._v("标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。")]),a._v(" "),s("h2",{attrs:{id:"规则"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#规则","aria-hidden":"true"}},[a._v("#")]),a._v(" 规则")]),a._v(" "),s("h2",{attrs:{id:"token"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#token","aria-hidden":"true"}},[a._v("#")]),a._v(" Token")]),a._v(" "),s("h3",{attrs:{id:"方法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#方法","aria-hidden":"true"}},[a._v("#")]),a._v(" 方法")]),a._v(" "),s("p",[s("strong",[a._v("注意")]),a._v(": 调用者必须处理返回"),s("code",[a._v("false")]),a._v("的"),s("code",[a._v("return boolean")]),a._v(".调用者绝对不能假设返回"),s("code",[a._v("false")]),a._v("的情况不存在。")]),a._v(" "),s("h4",{attrs:{id:"name"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#name","aria-hidden":"true"}},[a._v("#")]),a._v(" name")]),a._v(" "),s("p",[a._v("返回令牌的名称 - 例如 "),s("code",[a._v('"MyToken"')]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("name")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"symbol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#symbol","aria-hidden":"true"}},[a._v("#")]),a._v(" symbol")]),a._v(" "),s("p",[a._v('返回令牌的符号 - 例如 "MT".')]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("symbol")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"decimals"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#decimals","aria-hidden":"true"}},[a._v("#")]),a._v(" decimals")]),a._v(" "),s("p",[a._v("返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("int")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("decimals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"totalsupply"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#totalsupply","aria-hidden":"true"}},[a._v("#")]),a._v(" totalSupply")]),a._v(" "),s("p",[a._v("返回总令牌供应量。")]),a._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[a._v("@View\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("totalSupply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"balanceof"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceof","aria-hidden":"true"}},[a._v("#")]),a._v(" balanceOf")]),a._v(" "),s("p",[a._v("返回地址为“owner”的帐户余额。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("balanceOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"transfer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[a._v("#")]),a._v(" transfer")]),a._v(" "),s("p",[a._v("转移"),s("code",[a._v("value")]),a._v("的token数量到的地址"),s("code",[a._v("to")]),a._v(",并且必须触发"),s("code",[a._v("TransferEvent")]),a._v("事件。 如果"),s("code",[a._v("from")]),a._v("帐户余额没有足够的令牌来支出,该函数应该被revert。")]),a._v(" "),s("p",[a._v("创建新令牌的令牌合同应该在创建令牌时将"),s("code",[a._v("from")]),a._v("地址设置为"),s("code",[a._v("null")]),a._v("触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("p",[a._v("注意 0值的传输必须被视为正常传输并触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("transfer")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"transferfrom"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transferfrom","aria-hidden":"true"}},[a._v("#")]),a._v(" transferFrom")]),a._v(" "),s("p",[a._v("从地址"),s("code",[a._v("from")]),a._v("发送数量为"),s("code",[a._v("value")]),a._v("的token到地址"),s("code",[a._v("to")]),a._v(",必须触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("p",[s("code",[a._v("transferFrom")]),a._v("方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了"),s("code",[a._v("from")]),a._v("帐户已经通过某种机制(比如调用"),s("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(")故意地授权消息的发送者之外,否则该函数应该"),s("code",[a._v("revert")]),a._v("。")]),a._v(" "),s("p",[a._v("注意 0值的传输必须被视为正常传输并触发传输事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("transferFrom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address from"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"approve"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#approve","aria-hidden":"true"}},[a._v("#")]),a._v(" approve")]),a._v(" "),s("p",[a._v("允许"),s("code",[a._v("spender")]),a._v("多次支配您的帐户,最高达"),s("code",[a._v("value")]),a._v("金额。 如果再次调用此函数,它将以"),s("code",[a._v("value")]),a._v("覆盖当前的余量。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("approve")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h4",{attrs:{id:"allowance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#allowance","aria-hidden":"true"}},[a._v("#")]),a._v(" allowance")]),a._v(" "),s("p",[a._v("返回"),s("code",[a._v("spender")]),a._v("仍然被允许从"),s("code",[a._v("owner")]),a._v("提取的金额。\nReturns the amount which "),s("code",[a._v("spender")]),a._v(" is still allowed to withdraw from "),s("code",[a._v("owner")]),a._v(".")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("allowance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),s("h3",{attrs:{id:"events"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#events","aria-hidden":"true"}},[a._v("#")]),a._v(" Events")]),a._v(" "),s("h4",{attrs:{id:"transferevent"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transferevent","aria-hidden":"true"}},[a._v("#")]),a._v(" TransferEvent")]),a._v(" "),s("p",[a._v("当token被转移(包括0值),必须被触发。")]),a._v(" "),s("p",[a._v("创建新令牌的令牌合同应该在创建令牌时将"),s("code",[a._v("from")]),a._v("地址设置为"),s("code",[a._v("null")]),a._v("触发"),s("code",[a._v("TransferEvent")]),a._v("事件。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("TransferEvent")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("Address from"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),s("h4",{attrs:{id:"approvalevent"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#approvalevent","aria-hidden":"true"}},[a._v("#")]),a._v(" ApprovalEvent")]),a._v(" "),s("p",[a._v("当任何成功调用"),s("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v("后,必须被触发。")]),a._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("ApprovalEvent")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),s("h2",{attrs:{id:"implementation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implementation","aria-hidden":"true"}},[a._v("#")]),a._v(" Implementation")]),a._v(" "),s("h4",{attrs:{id:"example-implementations-are-available-at"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-implementations-are-available-at","aria-hidden":"true"}},[a._v("#")]),a._v(" Example implementations are available at")]),a._v(" "),s("ul",[s("li",[a._v("https://github.com/nuls-io/nuls-nrc20")])])])}],!1,null,null,null);n.options.__file="NRC-20TokenStandard.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/159.09925f42.js b/docs/.vuepress/dist/assets/js/159.09925f42.js new file mode 100644 index 00000000..f249154e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/159.09925f42.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[159],{872:function(t,e,r){"use strict";r.r(e);var n=r(0),s=Object(n.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),r("p",[t._v("亲爱的用户:")]),t._v(" "),r("p",[t._v("很荣幸的宣布,NULS2.0 Alpha版本已于北京时间:2019-03-28日上午10:30发布,诚邀您参与内测。")]),t._v(" "),r("p",[t._v("NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。")]),t._v(" "),r("p",[t._v("此次Alpha版本测试内容主要包含:")]),t._v(" "),r("ul",[r("li",[t._v("Linux钱包全部功能,例如:账户创建、导入、转账和创建节点等等")]),t._v(" "),r("li",[t._v("基于NULS2.0核心模块搭建区块链")]),t._v(" "),r("li",[t._v("搭建包含"),r("router-link",{attrs:{to:"/zh/NULS2.0/developModule.html"}},[t._v("业务模块")]),t._v("的区块链")],1)]),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("1 "),r("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/pangu/NULS-Wallet-linux64-alpha1.tgz",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载linux客户端"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("2 "),r("router-link",{attrs:{to:"/zh/NULS2.0/linuxTutorial.html"}},[t._v("linux钱包使用教程")])],1),t._v(" "),r("p",[t._v("3 "),r("a",{attrs:{href:"https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141",target:"_blank",rel:"noopener noreferrer"}},[t._v("申请测试币"),r("OutboundLink")],1),t._v("并在帖子中回复:Alpha+地址")]),t._v(" "),r("p",[t._v("4 访问区块链浏览器:"),r("a",{attrs:{href:"http://alpha.nulscan.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://alpha.nulscan.io/"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("5 "),r("router-link",{attrs:{to:"/zh/NULS2.0/howToUseNulsBuildChain.html"}},[t._v("使用NULS2.0搭建区块链")])],1),t._v(" "),r("p",[t._v("6 提交bug:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls_2.0/issues"),r("OutboundLink")],1)]),t._v(" "),t._m(2),t._v(" "),r("ul",[r("li",[t._v("Github:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls_2.0"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("论坛:"),r("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("技术社区Telegram:"),r("a",{attrs:{href:"https://t.me/nulstest",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://t.me/nulstest"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("微信公众号:NULS中文社区")])]),t._v(" "),r("p",[t._v("想了解更多与NULS相关的信息,可以访问我们的"),r("a",{attrs:{href:"https://nuls.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("官网"),r("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls2-0-alpha版本已发布"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha版本已发布","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha版本已发布")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"参与测试:"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参与测试:","aria-hidden":"true"}},[this._v("#")]),this._v(" 参与测试:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"相关链接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#相关链接","aria-hidden":"true"}},[this._v("#")]),this._v(" 相关链接")])}],!1,null,null,null);s.options.__file="README.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/16.aa19419e.js b/docs/.vuepress/dist/assets/js/16.aa19419e.js new file mode 100644 index 00000000..51b37b3b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/16.aa19419e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{640:function(t,v,_){t.exports=_.p+"assets/img/network-context.8f5dc235.png"},641:function(t,v,_){t.exports=_.p+"assets/img/network-functions.811c83fd.png"},642:function(t,v,_){t.exports=_.p+"assets/img/recMessage2.ccf47917.png"},643:function(t,v,_){t.exports=_.p+"assets/img/sendMsg1.02c2c1dd.png"},644:function(t,v,_){t.exports=_.p+"assets/img/sendMsg2.de353050.png"},645:function(t,v,_){t.exports=_.p+"assets/img/createNodeGroup.dcac4eab.png"},646:function(t,v,_){t.exports=_.p+"assets/img/deleteNodeGroup2.a41d2684.png"},647:function(t,v,_){t.exports=_.p+"assets/img/start.b7d30232.png"},648:function(t,v,_){t.exports=_.p+"assets/img/shutdown.9b647f72.png"},649:function(t,v,_){t.exports=_.p+"assets/img/discoverPeer.3e4de810.png"},650:function(t,v,_){t.exports=_.p+"assets/img/connection.6ef3c5f5.png"},651:function(t,v,_){t.exports=_.p+"assets/img/pingpong.19416293.png"},652:function(t,v,_){t.exports=_.p+"assets/img/connet-validate.01cd9ec6.png"},653:function(t,v,_){t.exports=_.p+"assets/img/saveNodeIp.3650e4e2.png"},654:function(t,v,_){t.exports=_.p+"assets/img/connectSelf.201d795a.png"},655:function(t,v,_){t.exports=_.p+"assets/img/connectSelf-recieve.7af46eff.png"},656:function(t,v,_){t.exports=_.p+"assets/img/crossPortDeliver.60021595.png"},827:function(t,v,_){"use strict";_.r(v);var e=[function(){var t=this,v=t.$createElement,e=t._self._c||v;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"网络模块设计文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#网络模块设计文档","aria-hidden":"true"}},[t._v("#")]),t._v(" 网络模块设计文档")]),t._v(" "),e("p",[t._v("[TOC]")]),t._v(" "),e("h2",{attrs:{id:"一、总体描述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),e("h3",{attrs:{id:"_1-1-模块概述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 模块概述")]),t._v(" "),e("h4",{attrs:{id:"_1-1-1-为什么要有《网络模块》"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《网络模块》","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《网络模块》")]),t._v(" "),e("p",[t._v("网络模块保障了去中心化节点间的通讯,为NULS基础模块之一,提供最底层的网络通信、节点发现等服务。区块链的网络基础就是Peer to Peer,即P2P。P2P网络中的所有参与者,可以是提供服务(server),也可以是资源使用者(client)。P2P网络的特点:去中心化、可扩展性、健壮性、高性价比、隐私保护、负载均衡。")]),t._v(" "),e("h4",{attrs:{id:"_1-1-2-《网络模块》要做什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《网络模块》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《网络模块》要做什么")]),t._v(" "),e("p",[t._v("网络模块是整个系统的基础模块,用来管理节点、节点间的连接及连接的状态、数据的发送与接收。网络模块不涉及复杂的业务逻辑。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接收到的网络消息,根据内核模块中的指令服务映射关系,推送消息相应的处理模块中。")])]),t._v(" "),e("li",[e("p",[t._v("开放接口供其他模块封装好的消息调用推送到指定的peer节点以及广播到指定的网络组中。")])])]),t._v(" "),e("h4",{attrs:{id:"_1-1-3-《网络模块》在系统中的定位"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《网络模块》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《网络模块》在系统中的定位")]),t._v(" "),e("ul",[e("li",[t._v("网络模块是底层应用模块,任何需要网络通讯的模块都要通过网络模块来进行消息的收发。")]),t._v(" "),e("li",[t._v("网络模块依赖核心模块进行服务接口的治理。")]),t._v(" "),e("li",[t._v("网络模块按网络id(魔法参数) 来进行不同网络的构建。")]),t._v(" "),e("li",[t._v("网络模块在卫星链中的节点在进行跨链网络组建时,需要链管理模块提供跨链配置信息。")]),t._v(" "),e("li",[t._v("网络模块在子链中的节点在进行跨链网络组建时,需要跨链模块提供跨链配置信息。")])]),t._v(" "),e("h3",{attrs:{id:"_1-2-架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 架构图")]),t._v(" "),e("p",[e("img",{attrs:{src:_(640),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"二、功能设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),e("h3",{attrs:{id:"_2-1-功能架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 功能架构图")]),t._v(" "),e("p",[t._v("网络模块在业务上功能有:节点管理,节点组管理,p2p网络连接管理,消息的收发管理。")]),t._v(" "),e("p",[t._v("在内部基础功能含有:模块的状态管理(包含启动与关闭管理),对外的接口提供管理,")]),t._v(" "),e("p",[t._v("线程任务管理,数据存储管理等。")]),t._v(" "),e("p",[e("img",{attrs:{src:_(641),alt:""}})]),t._v(" "),e("ul",[e("li",[e("p",[t._v("节点管理 Node management")]),t._v(" "),e("p",[t._v("管理所有可连接的、已连接的节点信息、状态,提供节点操作接口")]),t._v(" "),e("ul",[e("li",[t._v("节点发现")]),t._v(" "),e("li",[t._v("节点存储")])])]),t._v(" "),e("li",[e("p",[t._v("节点组管理 Node Group management")]),t._v(" "),e("p",[t._v("管理不同的网络节点,将节点分为不同的集合,每个集合分别管理。每个集合内的节点连接的魔法参数都是相同的,并且和其他集合的魔法参数不同。")]),t._v(" "),e("p",[t._v("每个NodeGroup都根据链登记的信息或者自身配置的网络信息进行初始化(魔法参数、节点数量限制等)")]),t._v(" "),e("p",[t._v("每初始化一个NodeGroup,网络服务都多监听一个MagicNumber。")])]),t._v(" "),e("li",[e("p",[t._v("连接器管理 Connection management")]),t._v(" "),e("ul",[e("li",[t._v("初始化连接\n"),e("ul",[e("li",[t._v("卫星链节点:随机连接")]),t._v(" "),e("li",[t._v("跨链节点:已固定的算法连接,目标是将跨链节点分散并全部连接")])])]),t._v(" "),e("li",[t._v("连接管理:心跳维护")]),t._v(" "),e("li",[t._v("连接断开")])])]),t._v(" "),e("li",[e("p",[t._v("消息收发管理")]),t._v(" "),e("p",[t._v("1>消息接收 Message receiver")]),t._v(" "),e("p",[t._v("接收网络节点发送过来的消息,对消息进行简单的判断(判断cmd),根据消息cmd字段,将消息发送到关心的模块服务中。")])])]),t._v(" "),e("p",[t._v("​ 2> 消息发送 Message sender")]),t._v(" "),e("p",[t._v("​ a> 对NodeGroup广播消息")]),t._v(" "),e("p",[t._v("​ b> 对一个节点发送消息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("模块状态管理")]),t._v(" "),e("p",[t._v("​ a>启动,关闭逻辑处理")])])]),t._v(" "),e("p",[t._v("​ b>对自身模块状态的维护与管理:管理模块的运行状态,内部功能状态等")]),t._v(" "),e("p",[t._v("​")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口管理")]),t._v(" "),e("p",[t._v("a>注册自身接口到kernel模块中")]),t._v(" "),e("p",[t._v("b>同步模块信息与状态到kernel模块中")]),t._v(" "),e("p",[t._v("c>获取服务列表到本地模块")]),t._v(" "),e("p",[t._v("d>开放对外接口调用")])]),t._v(" "),e("li",[e("p",[t._v("线程任务管理")]),t._v(" "),e("p",[t._v("a>管理 心跳线程")]),t._v(" "),e("p",[t._v("b>管理 节点发现/淘汰机制线程")]),t._v(" "),e("p",[t._v("c>管理 接口信息同步线程")])])]),t._v(" "),e("h3",{attrs:{id:"_2-2-模块服务"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 模块服务")]),t._v(" "),e("h4",{attrs:{id:"_2-2-1-网络消息接收"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-网络消息接收","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 网络消息接收")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("接收(外部)网络节点发送过来的消息,对消息进行简单的判断(判断魔法参数),根据消息头含有的command字段,将消息发送到关心的模块服务中。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:_(642),alt:""}})])]),t._v(" "),e("li",[e("p",[t._v("消息校验部分:")])])]),t._v(" "),e("p",[t._v("​ payload校验")]),t._v(" "),e("p",[t._v("​ magicNumber校验")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("外部模块提供的接口参数约束")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("method : *** //同消息头中的CMD指令,约束12字节")])]),t._v(" "),e("li",[e("p",[t._v("params")])])])])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" 0:chainId //链id\n 1:nodeId //节点Id\n 2:message //16进制网络序消息体\n ......\n")])])]),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 解析消息头中的command参数,在调用远程接口处理时,依赖内核模块提供的远程的服务接口数据。")]),t._v(" "),e("h4",{attrs:{id:"_2-2-2网络消息发送"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2网络消息发送","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2网络消息发送")]),t._v(" "),e("p",[t._v("转发 其他或自身模块封装的消息,含广播消息以及指定节点发送消息。")]),t._v(" "),e("h5",{attrs:{id:"_2-2-2-1、广播网络消息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-1、广播网络消息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2.1、广播网络消息")]),t._v(" "),e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("转发 其他或自身模块封装的消息,对外部模块提供转发调用的接口有以下2种情况:")]),t._v(" "),e("p",[t._v("a> 对NodeGroup(指定某个网络)广播消息。")]),t._v(" "),e("p",[t._v("b> 对NodeGroup(指定某个网络)广播消息,并排除某些节点。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:_(643),alt:""}})])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("method : nw_broadcast")]),t._v(" "),e("p",[t._v("外部模块可以通过该接口去广播消息")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":1234,\n "excludeNodes": "10.13.25.36:5003,20.30.25.65:8009",\n "params": "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3"\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("excludeNodes")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("排除节点,逗号分割")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("message")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("对象16进制字符")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h5",{attrs:{id:"_2-2-2-2、指定节点发送网络消息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-2、指定节点发送网络消息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2.2、指定节点发送网络消息")]),t._v(" "),e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("转发 其他或自身模块封装的消息,可以指定某些节点(可以为1个节点)发送消息。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:_(644),alt:""}})])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("外部模块可以通过该接口去广播消息")]),t._v(" "),e("p",[t._v("method : nw_sendPeersMsg")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 1234,\n "nodes": "10.13.25.36:5003,20.30.25.65:8009",\n "message":"03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3"\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("nodes")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("发送节点,逗号分割")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("message")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("对象16进制字符")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-3-创建节点组"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-创建节点组","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 创建节点组")]),t._v(" "),e("p",[t._v("卫星链除了自身卫星网络,还存在n个跨链网络,友链上除了自身网络,还可以注册跨链网络。")]),t._v(" "),e("p",[t._v("节点组就是用来管理不同网络信息的。网络模块通过节点组去隔离维护不同网络。")]),t._v(" "),e("p",[t._v("节点组类型:1>自身网络 2>跨链网络 (卫星链跨链网络&友链跨链网络)")]),t._v(" "),e("p",[t._v("网络模块是接收外部模块的调用,来创建节点组。跨链的基本网络配置信息主要通过2种途径获得:")]),t._v(" "),e("p",[t._v("1>自身的配置文件加载创建自身网络组。")]),t._v(" "),e("p",[t._v("2>跨链网络:")]),t._v(" "),e("p",[t._v("​ 作为卫星链节点,由链管理模块进行注册登记后,系统产生交易验证确认后调用,产生跨链网络组,之后存储配置,后续模块启动自动加载。")]),t._v(" "),e("p",[t._v("​ 作为友链节点,由跨链协议模块启动时,跨链协议模块从模块配置中获取跨链配置信息,通知网络模块,")]),t._v(" "),e("p",[t._v("网络模块触发跨链 连接。")]),t._v(" "),e("h5",{attrs:{id:"_2-2-3-1-自有网络创建节点组"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-1-自有网络创建节点组","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3.1 自有网络创建节点组")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("自有网络对应自有chainId,以及一个魔法参数,通过配置初始化创建节点组")])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("通过配置文件加载创建节点组")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")])])]),t._v(" "),e("p",[t._v("​ 内部创建,无外部接口。")]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h5",{attrs:{id:"_2-2-3-2-创建跨链节点组"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-2-创建跨链节点组","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3.2 创建跨链节点组")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("卫星链上的跨链节点组由友链在卫星链进行跨链注册触发。友链则获得跨链配置信息,由跨链协议来更新自有网络组的跨链状态。")])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("1>卫星链通过 链管理模块调用来触发跨链节点组的创建。")]),t._v(" "),e("p",[t._v("2>友链通过跨链协议模块来 更新自有网络组的跨链状态。")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(645),alt:""}})]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("接收外部模块的调用,创建节点组")]),t._v(" "),e("p",[t._v("method : nw_createNodeGroup")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 1234,\n "magicNumber": 232342,\n "maxOut": 10,\n "maxIn": 100,\n "minAvailableCount": 20,\n "seedIps": "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",\n "isMoonNode": 0\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("magicNumber")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("魔法参数")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("maxOut")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("最大主动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("3")]),t._v(" "),e("td",[t._v("maxIn")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("最大被动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("minAvailableCount")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("友链最小连接数")])]),t._v(" "),e("tr",[e("td",[t._v("5")]),t._v(" "),e("td",[t._v("seedIps")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("种子节点,逗号分割")])]),t._v(" "),e("tr",[e("td",[t._v("6")]),t._v(" "),e("td",[t._v("isMoonNode")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("是否卫星链节点,默认0")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])])]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 依赖内核模块提供的远程的服务接口数据。")]),t._v(" "),e("p",[t._v("​")]),t._v(" "),e("h4",{attrs:{id:"_2-2-4-注销节点组"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-注销节点组","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 注销节点组")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("接收外部模块的调用,注销跨链节点组。")]),t._v(" "),e("p",[t._v("作为卫星链节点,由链管理模块进行注销登记,系统产生交易验证确认后调用。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:_(646),alt:""}})])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("接收外部模块的调用,删除节点组")]),t._v(" "),e("p",[t._v("method : nw_delNodeGroup")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 1234\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("依赖内核模块提供的远程的服务接口数据。")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-5-跨链种子节点提供"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-跨链种子节点提供","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 跨链种子节点提供")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("种子节点是在网络初始化时候,用于提供peer连接信息的节点。链管理模块在进行链注册时,需要获取卫星链上种子节点信息用于初始化连接。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("无")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("获取卫星链种子节点")]),t._v(" "),e("p",[t._v("method : nw_getSeeds")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 1234\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("seedsIps")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("种子节点信息逗号分割")])])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("依赖内核模块提供的远程的服务接口数据。")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-6-添加连接节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-添加连接节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 添加连接节点")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("cmd指令下,对某个网络添加peer连接信息。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("添加的节点会触发网络连接 流程。")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("添加网络peer节点")]),t._v(" "),e("p",[t._v("method : nw_addNodes")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":455,\n "isCross":0,\n "nodes":"10.20.23.02:5006,53.26.65.58:8003"\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("isCross")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("是否跨链:0 非跨链,1跨链")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("nodes")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("节点组")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("​ 无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-7-删除连接节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-删除连接节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 删除连接节点")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("cmd指令下,删除某个网络下的peers连接信息。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("删除节点会触发 网络节点的断开。")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("删除网络peer节点")]),t._v(" "),e("p",[t._v("method : nw_delNodes")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":234,\n "nodes": "10.20.23.02:5006,53.26.65.58:8003"\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("nodes")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("节点组")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-8重连指定网络"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8重连指定网络","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8重连指定网络")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("cmd指令下,对指定的nodeGroup进行网络重新连接")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("接收指令后,对指定的nodeGroup下的所有peer进行断连接后,重新连接网络。")]),t._v(" "),e("p",[t._v("重新刷新nodegroup下peer 连接地址 ,并重启网络连接。")]),t._v(" "),e("p",[t._v("如果peer连接 为多个 网络业务所有,则只需要取消关联关系,如果只有自身业务使用,则可以断开连接。")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("重新刷新并连接网络节点")]),t._v(" "),e("p",[t._v("method : nw_reconnect")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":1234\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链标识")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-9-获取nodegroup列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-获取nodegroup列表","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 获取nodeGroup列表")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("获取节点管理的所有网络列表。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("无")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("获取节点组信息")]),t._v(" "),e("p",[t._v("method : nw_getGroups")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "startPage":1,\n "pageSize":10\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("startPage")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("开始页数")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("pageSize")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("每页记录数")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n list:[{\n chainId:1212, //链id\n magicNumber:324234,//魔法参数\n totalCount:2323, //总连接数\n inCount:22, //被动连接数\n outCount:33, //主动连接数\n isActive:1,//0未激活,1 已激活\n isCrossChain:1 //0不是跨链网络,1跨链网络\n },{}\n ]\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("链id")])]),t._v(" "),e("tr",[e("td",[t._v("magicNumber")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("魔法参数")])]),t._v(" "),e("tr",[e("td",[t._v("totalCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("总连接数")])]),t._v(" "),e("tr",[e("td",[t._v("inCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("被动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("outCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("主动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("isActive")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0未激活,1 已激活")])]),t._v(" "),e("tr",[e("td",[t._v("isCrossChain")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0不是跨链网络,1跨链网络")])])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")])])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h4",{attrs:{id:"_2-2-10-获取指定nodegroup下的连接信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-获取指定nodegroup下的连接信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.10 获取指定nodeGroup下的连接信息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("获取指定的网络id下所有节点的信息")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("无")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("获取节点信息")]),t._v(" "),e("p",[t._v("method : nw_getNodes")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")])])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":125,\n "state":1,\n "isCross":1,\n "startPage":1,\n "pageSize":5\n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("网络id")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("state")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("0所有链接,1已连接,2 未 连接")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("isCross")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("0普通连接 1跨链连接")])]),t._v(" "),e("tr",[e("td",[t._v("3")]),t._v(" "),e("td",[t._v("startPage")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("开始页数")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("pageSize")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("每页记录数")])])])]),t._v(" "),e("ul",[e("li",[t._v("返回示例")])]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "minVersion": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "minVersion": 1.2,\n "code":0,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{\n list:[{\n chainId:122,//链id\n nodeId:"20.20.30.10:9902"\n magicNumber:134124,//魔法参数\n version:2,//协议版本号\n blockHeight:6000, //区块高度\n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", //区块Hash值\n ip:"200.25.36.41",//ip地址\n port:54,//\n state:"已连接",\n isOut:"1", //0被动连接,1主动连接\n time:"6449878789", //最近连接时间\n\t },{}\n\t ]\n }\n}\n\n')])])]),e("ul",[e("li",[t._v("返回字段说明")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("链id")])]),t._v(" "),e("tr",[e("td",[t._v("nodeId")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("节点id")])]),t._v(" "),e("tr",[e("td",[t._v("magicNumber")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("魔法参数")])]),t._v(" "),e("tr",[e("td",[t._v("version")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("协议版本号")])]),t._v(" "),e("tr",[e("td",[t._v("blockHeight")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",[t._v("最新区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("blockHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("最新区块hash")])]),t._v(" "),e("tr",[e("td",[t._v("ip")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("ip地址")])]),t._v(" "),e("tr",[e("td",[t._v("port")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("端口号")])]),t._v(" "),e("tr",[e("td",[t._v("state")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("连接状态 1 连接 0 未连接")])]),t._v(" "),e("tr",[e("td",[t._v("isOut")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0被动连接,1主动连接")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",[t._v("最近连接时间")])])])]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("无")]),t._v(" "),e("h4",{attrs:{id:"_2-2-11-获取指定链网络概要信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-获取指定链网络概要信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.11 获取指定链网络概要信息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("获取指定chainId的网络信息。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("无")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("获取链网络信息")]),t._v(" "),e("p",[t._v("method : nw_getGroupByChainId")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":142\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链Id")])])])])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "result":{\n chainId:1212, //链id\n magicNumber:324234,//魔法参数\n totalCount:2323, //总连接数\n inCount:22, //被动连接数\n outCount:33, //主动连接数\n blockHeight:6000, //网络最高区块高度\n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", //最大高度区块Hash值\n isActive:1,//0未激活,1 已激活\n isCrossActive:1, //0跨链网络未激活,1跨链激活\n isMoonNet:0 //0友链 ,1卫星链\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("链id")])]),t._v(" "),e("tr",[e("td",[t._v("magicNumber")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("魔法参数")])]),t._v(" "),e("tr",[e("td",[t._v("totalCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("总连接数")])]),t._v(" "),e("tr",[e("td",[t._v("inCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("被动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("outCount")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("主动连接数")])]),t._v(" "),e("tr",[e("td",[t._v("blockHeight")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",[t._v("网络最高区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("blockHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("最大高度区块Hash值")])]),t._v(" "),e("tr",[e("td",[t._v("isActive")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0未激活,1 已激活")])]),t._v(" "),e("tr",[e("td",[t._v("isCrossActive")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0跨链网络未激活,1跨链激活")])]),t._v(" "),e("tr",[e("td",[t._v("isMoonNet")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("0友链 ,1卫星链")])])])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")])])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h4",{attrs:{id:"_2-2-12-更新peer连接节点的信息(高度-hash)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-更新peer连接节点的信息(高度-hash)","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.12 更新peer连接节点的信息(高度&Hash)")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("网络连接,在进行握手连接时带有peer节点的高度与Hash值,后续的peer连接节点的高度与Hash值由外部模块(区块管理模块)进行调用更新。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("1>节点启动时等待 区块管理接口 初始化完成,然后调用区块管理接口获取最新区块高度及hash值。")]),t._v(" "),e("p",[t._v("2>握手时将节点相关信息放入Verion信息中发送到peer端。")]),t._v(" "),e("p",[t._v("3>建立连接后,区块管理模块会调用该接口进行最新区块高度与hash值的更新。")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("区块管理模块 调用进行节点的高度与Hash值的更新。")]),t._v(" "),e("p",[t._v("method : nw_updateNodeInfo")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "method":"nw_reconnect",\n "minVersion":1.1,\n "params":[\n 1598,\n "10.20.30.20:8856",\n 10,\n "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"\n ]\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("网络id")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("nodeId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("网络节点id")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("blockHeight")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("开始页数")])]),t._v(" "),e("tr",[e("td",[t._v("3")]),t._v(" "),e("td",[t._v("blockHash")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("区块最新hash")])])])]),t._v(" "),e("ul",[e("li",[t._v("返回示例")])]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code":0,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{\n \n }\n}\n\n')])])]),e("ul",[e("li",[t._v("返回字段说明")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h4",{attrs:{id:"_2-2-13-注册网络协议处理器"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-注册网络协议处理器","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.13 注册网络协议处理器")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("网络模块在接收到对端发送过来的消息后,需要根据 消息协议头中的 cmd 来调用对应模块处理。")]),t._v(" "),e("p",[t._v("cmd与模块的映射关系,需要各个模块在启动时候进行提交注册。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("区块管理模块 调用进行节点的高度与Hash值的更新。")]),t._v(" "),e("p",[t._v("method : nw_protocolRegister")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "role": "bl",\n "protocolCmds": [\n {\n "protocolCmd":"getBlock",\n "handler":"getBlockRequest"\n },\n {\n "protocolCmd":"sendBlock",\n "handler":"downLoadBlock"\n }\n ]\n}\n\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("role")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("模块角色")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("protocolCmds")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("array")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("协议指令数组")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("protocolCmd")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("协议指令,12字节")])]),t._v(" "),e("tr",[e("td",[t._v("3")]),t._v(" "),e("td",[t._v("handler")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("对应模块处理器")])]),t._v(" "),e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td"),t._v(" "),e("td"),t._v(" "),e("td",{staticStyle:{"text-align":"center"}})])])]),t._v(" "),e("ul",[e("li",[t._v("返回示例")])]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "registerStatus":"0"\n}\n\n\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "registerStatus":"1" \n}\n\n')])])]),e("ul",[e("li",[t._v("返回字段说明")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("registerStatus")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v('注册状态"0"为失败,"1" 为成功')])])])]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h4",{attrs:{id:"_2-2-14-网络时间获取"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-网络时间获取","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.14 网络时间获取")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("获取网络时间进行本地时间偏差同步。")])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("网络模块获取网络上若干服务器的时间,进行偏差计算调整。如果网络时间获取失败,则向10个对等节点发出“时间获取协议”获取对等节点时间 进行偏差计算,如果还无法获取,则直接返回本地时间。")]),t._v(" "),e("p",[t._v("说明:定时进行偏差修正。")])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口说明")]),t._v(" "),e("p",[t._v("获取网络时间")]),t._v(" "),e("p",[t._v("method : nw_currentTimeMillis")])]),t._v(" "),e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("RPC 统一格式\n")])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td"),t._v(" "),e("td"),t._v(" "),e("td",{staticStyle:{"text-align":"center"}})])])]),t._v(" "),e("ul",[e("li",[t._v("返回示例")])]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("RPC 统一格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "currentTimeMillis":11544545466 \n}\n\n\n')])])]),e("ul",[e("li",[t._v("返回字段说明")])])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("currentTimeMillis")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",[t._v("1970-01-01至今的差值,单位毫秒")])])])]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h3",{attrs:{id:"_2-3-模块内部功能"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 模块内部功能")]),t._v(" "),e("h4",{attrs:{id:"_2-3-1-模块启动"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-模块启动","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.1 模块启动")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("模块启动时,进行配置信息的初始化,注册服务初始化,各个内部功能管理数据库信息的初始化等。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[t._v("​ "),e("img",{attrs:{src:_(647),alt:""}})]),t._v(" "),e("p",[t._v("​ 1>本地进行配置数据加载,数据库节点组及节点信息数据加载。")]),t._v(" "),e("p",[t._v("​ 2>监听区块管理模块的状态进入初始化完成,接口可调用,则调用获取最新本地节点的区块高度与Hash值。")]),t._v(" "),e("p",[t._v("​ 3>初始化完成,进入peer节点连接。")]),t._v(" "),e("p",[t._v("​ 4>网络模块在启动连接稳定后,通知区块管理模块 网络 最大区块高度与hash值。区块管理模块提供接口供 网络模块调用。")]),t._v(" "),e("p",[t._v("网络模块启动连接稳定的判定条件:x秒内 无新的握手连接产生,x秒内无高度的增长。x=10")]),t._v(" "),e("p",[t._v("​ 5>网络稳定后代表该网络处于可工作状态,各个chain的业务状态以事件方式发布给其他模块。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("依赖 核心模块,区块管理模块")])])]),t._v(" "),e("h4",{attrs:{id:"_2-3-2-模块关闭"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-模块关闭","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.2 模块关闭")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("模块关闭时,进行连接的关闭,线程管理的关闭,各个资源的释放,并通知状态给核心接口。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(648),alt:""}})]),t._v(" "),e("ul",[e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-3-3-peer节点发现"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-peer节点发现","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.3 peer节点发现")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("在网络模块启动后,进行peer节点的获取管理。")]),t._v(" "),e("p",[t._v("节点获取的途径有:")]),t._v(" "),e("p",[t._v("1>连接向种子节点,并请求地址获取。")]),t._v(" "),e("p",[t._v("2>接收广播过来的节点消息。")]),t._v(" "),e("p",[t._v("2>跨链网络的连接,比如作为卫星链上的节点与子链的连接,或者子链上的节点与卫星链的连接。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(649),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("h4",{attrs:{id:"_2-3-4-网络连接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-网络连接","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.4 网络连接")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("一个节点即作为client端,主动连接已知的peer节点,同时也是server端,等待peer节点的连接。")]),t._v(" "),e("p",[t._v("一个连接能够正常工作,需要通过握手协议,即互相发送version协议消息,协议具体定义参看下面的")]),t._v(" "),e("p",[t._v("“协议-网络通讯协议部分”。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[t._v("​ client在与server完成tcp连接后,需要通过业务version协议握手,只有握手成功的连接才能进行业务转发工作。连接中状态在持续X分钟后无法跃迁到已连接,则主动断开连接。")]),t._v(" "),e("p",[t._v("流程中发送version协议(参看协议的version结构体):")]),t._v(" "),e("p",[t._v("1>协议携带了节点的信息,包含:协议的版本信息,本端口的最高区块高度,区块hash值,")]),t._v(" "),e("p",[t._v("​ 对方节点的外网IP,端口,及跨链服务端口,以及本节点的外网IP,端口,及跨链服务端口。")]),t._v(" "),e("p",[t._v("2>只有通过version协议,才能建立业务连接,否则等待X=1分钟后将断开连接。")]),t._v(" "),e("p",[e("img",{attrs:{src:_(650),alt:""}})]),t._v(" "),e("p",[t._v("PS:为了满足一个进程同时承载多链业务需求,一个node peer 连接建立后,应该满足多个NodeGroup业务。")]),t._v(" "),e("p",[t._v("​ 即 node peer connection 与 nodeGroup 对象间是 多对多,n:n 关系。")]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-5-心跳检测"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-心跳检测","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.5 心跳检测")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("检测连接是否还保持连接。通过client与server的ping-pong消息来进行维持保活。涉及的ping-pong协议定义参看“协议-网络通讯协议部分”")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(651),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-6-连接数量验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-连接数量验证","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.6 连接数量验证")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("在建立节点连接时,会进行连接数量,如果达到最大值,则主动断开连接。")]),t._v(" "),e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[t._v("​ "),e("img",{attrs:{src:_(652),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-7-节点的外网ip存储"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-节点的外网ip存储","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.7 节点的外网IP存储")]),t._v(" "),e("ul",[e("li",[t._v("功能说明:")])]),t._v(" "),e("p",[t._v("​ 一个节点可能存在多个网卡,也可能是在某个局域网内,所以在建立连接时,并不知道自己的外网IP地址。")]),t._v(" "),e("p",[t._v("而节点要广播自己的地址供外网peers节点连接,则需要知道自身的外网IP地址。我们的设计中,节点的外网是通过version协议消息进行携带发出的。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("在client接收到version消息时,可以知道自己的IP地址信息。")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(653),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-8-节点的外网可连接检测"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-节点的外网可连接检测","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.8 节点的外网可连接检测")]),t._v(" "),e("ul",[e("li",[t._v("功能说明:")])]),t._v(" "),e("p",[t._v("​ 一个节点在建立连接时,可以广播自身的外网IP+port,给其他节点。但若一个节点是在某局域网内,则其外网的IP地址是是无法直接去连接通的。因此为了检测节点的外网IP是否可用,可以通过自己的client连接自己的server来,如果连接成功,则IP可以用于广播,如果不成功则节点外网IP不能广播给其他节点。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("自我连接可能成功,也可能失败,如果成功则说明外网IP是可达的,便可以在建立连接时广播传递给网络中其他节点,如果不可达,则连接无法建立不用处理。")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(654),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-9-peer节点的广播"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-peer节点的广播","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.9 peer节点的广播")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("将自身节点广播给网络中其他节点,在设计中,我们将通过上面建立的自我连接,成功时,便可进行广播。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("约束:跨链网络peer间不进行地址的广播,即 卫星链中节点发现不会广播给子链,同样子链中的节点发现,不会广播给卫星链。卫星链与子链需要建立连接可以通过初始peer节点发getAdrr消息来请求连接地址。")])])]),t._v(" "),e("p",[e("img",{attrs:{src:_(655),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-10-请求-回复-getaddr协议消息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-请求-回复-getaddr协议消息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.10 请求/回复 getaddr协议消息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("请求地址协议消息,获取更多的网络连接")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("请求getaddr:")])])]),t._v(" "),e("p",[t._v("​ 1>一个nodeGroup里连接未达到网络业务需要阈值minAvailableCount时,向种子节点请求地址列表。")]),t._v(" "),e("p",[t._v("​ 2>卫星链节点中的跨链nodeGroup可以直接向已连接的peer节点请求获取地址。")]),t._v(" "),e("p",[t._v("​ 回复 getaddr")]),t._v(" "),e("p",[t._v("​ 1>peer跨链连接,节点则回复地址列表( IP+跨链端口)")]),t._v(" "),e("p",[t._v("​ 2>peer自有网络连接,节点则回复地址列表(IP+自有链端口)")]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-11-发送-接收地址逻辑"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-发送-接收地址逻辑","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.11 发送/接收地址逻辑")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("接收 网络传送的 addr协议消息处理逻辑")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("发送addr:")])])]),t._v(" "),e("p",[t._v("​ 1>在新节点接入时会向同一nodegroup的其他连接peer广播 addr 消息。")]),t._v(" "),e("p",[t._v("​ 2> 在请求getaddr消息时,会得到addr消息回复。")]),t._v(" "),e("p",[t._v("​ 接收addr:")]),t._v(" "),e("p",[t._v("​ 1>判断地址是否本地已经拥有,如果拥有不转发,获取新增的addr。")]),t._v(" "),e("p",[t._v("​ 2>PEER是跨链网络不转发")]),t._v(" "),e("p",[t._v("​ 3>自有网络,新增addr>0, 存储并广播转发(接收peer除外)")]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h4",{attrs:{id:"_2-3-12-跨链server端口的传递"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-12-跨链server端口的传递","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.12 跨链server端口的传递")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("一个node可以存在2个角色,一个是维护自有的内部链网络。另一个是作为跨链角色维护跨链网络。")]),t._v(" "),e("p",[t._v("因此在server定义中我们将这2个网络的端口监听进行区分,以便各自相对独立。自有链定义一个serverPort1,跨链部分定义一个serverPort2.")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("如下图,我们卫星链网络与友链网络产生一个跨链连接,当卫星链中有个节点2连接上节点1时,是通过内部服务Port1来建立的连接,而节点1是可以将节点2 发送给 友链的节点A与节点B来进行连接,则此时发送给友链的信息中 应该是serverPort2,因此serverPort2需要再卫星链的内部交互中进行传递。我们将该部分数据定义在version协议中进行传递。")])])]),t._v(" "),e("p",[t._v("​ "),e("img",{attrs:{src:_(656),alt:""}})]),t._v(" "),e("ul",[e("li",[t._v("依赖服务")])]),t._v(" "),e("h2",{attrs:{id:"三、事件说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 三、事件说明")]),t._v(" "),e("h3",{attrs:{id:"_3-1-发布的事件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-发布的事件","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 发布的事件")]),t._v(" "),e("h4",{attrs:{id:"_3-1-1-nodegroup达到节点数量下限"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-nodegroup达到节点数量下限","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.1 NodeGroup达到节点数量下限")]),t._v(" "),e("p",[t._v("说明:NodeGroup达到节点数量下限,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "evt_nw_inNodeLimit",')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n}\n")])])]),e("h4",{attrs:{id:"_3-1-2-nodegroup少于节点数量下限"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-nodegroup少于节点数量下限","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.2 NodeGroup少于节点数量下限")]),t._v(" "),e("p",[t._v("说明:NodeGroup少于节点数量下限,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "evt_nw_lessNodeLimit",')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n}\n")])])]),e("h4",{attrs:{id:"_3-1-3-节点握手成功"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-节点握手成功","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.3 节点握手成功")]),t._v(" "),e("p",[t._v("说明:节点握手成功,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "evt_nw_connectSuccess",')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("data:{\n chainId\n magicNumber\n nodeId\n time\n version\n}\n")])])]),e("h4",{attrs:{id:"_3-1-4-节点断开连接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-节点断开连接","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.4 节点断开连接")]),t._v(" "),e("p",[t._v("说明:节点断开连接,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "evt_nw_nodeDisconnect",')]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("data:{\n chainId\n magicNumber\n nodeId\n time\n version\n}\n")])])]),e("h3",{attrs:{id:"_3-2-订阅的事件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-订阅的事件","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 订阅的事件")]),t._v(" "),e("p",[t._v("​ 暂无")]),t._v(" "),e("ul",[e("li")]),t._v(" "),e("h2",{attrs:{id:"四、协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 四、协议")]),t._v(" "),e("h3",{attrs:{id:"_4-1-网络通讯协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-网络通讯协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 网络通讯协议")]),t._v(" "),e("h4",{attrs:{id:"version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version","aria-hidden":"true"}},[t._v("#")]),t._v(" version")]),t._v(" "),e("p",[t._v("用于建立连接(握手)")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("version")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("节点使用的协议版本标识")])]),t._v(" "),e("tr",[e("td",[t._v("20")]),t._v(" "),e("td",[t._v("addr_you")]),t._v(" "),e("td",[t._v("byte[20]")]),t._v(" "),e("td",[t._v("对方网络地址【IP+PORT1+PORT2】PORT2为跨链server端口 如:[10.32.12.25 8003 9003] 16byte+2byte+2byte")])]),t._v(" "),e("tr",[e("td",[t._v("20")]),t._v(" "),e("td",[t._v("addr_me")]),t._v(" "),e("td",[t._v("byte[20]")]),t._v(" "),e("td",[t._v("本节点网络地址【IP+PORT1+PORT2】PORT2为跨链server端口 如:[20.32.12.25 7003 6003] 16byte+2byte+2byte")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("block_height")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("节点高度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("block_hash")]),t._v(" "),e("td",[t._v("varInt")]),t._v(" "),e("td",[t._v("区块hash")])]),t._v(" "),e("tr",[e("td",[t._v("6")]),t._v(" "),e("td",[t._v("network_time")]),t._v(" "),e("td",[t._v("uint48")]),t._v(" "),e("td",[t._v("网络时间")])]),t._v(" "),e("tr",[e("td",[t._v("??")]),t._v(" "),e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("VarByte")]),t._v(" "),e("td",[t._v("扩展字段,不超过10个字节?")])])])]),t._v(" "),e("h4",{attrs:{id:"verack"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#verack","aria-hidden":"true"}},[t._v("#")]),t._v(" verack")]),t._v(" "),e("p",[t._v("用于应答version")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("ack_code")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("返回码,1代表正常,2代表连接已满")])])])]),t._v(" "),e("h4",{attrs:{id:"ping"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ping","aria-hidden":"true"}},[t._v("#")]),t._v(" ping")]),t._v(" "),e("p",[t._v("用于维护连接,当一段时间未收到某个节点任何信息后,发送该消息,若能得到pong消息的回馈,则节点依然保持连接,否则关闭连接并删除节点")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("randomCode")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("随机数")])])])]),t._v(" "),e("h4",{attrs:{id:"pong"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#pong","aria-hidden":"true"}},[t._v("#")]),t._v(" pong")]),t._v(" "),e("p",[t._v("用于回应ping")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("randomCode")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("随机数")])])])]),t._v(" "),e("h4",{attrs:{id:"getaddr"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#getaddr","aria-hidden":"true"}},[t._v("#")]),t._v(" getaddr")]),t._v(" "),e("p",[t._v("用于获取网络中可用节点的连接信息,无消息体")]),t._v(" "),e("h4",{attrs:{id:"addr"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#addr","aria-hidden":"true"}},[t._v("#")]),t._v(" addr")]),t._v(" "),e("p",[t._v("用于应答getaddr,或向网络中宣告自身的存在,节点接收到该消息后,判断节点是否已知,如果是未知节点,则向网络中传播该消息")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("??")]),t._v(" "),e("td",[t._v("addr_list")]),t._v(" "),e("td",[t._v("network address")]),t._v(" "),e("td",[t._v("每个节点18字节(16字节IP+2字节port)")])])])]),t._v(" "),e("h4",{attrs:{id:"bye"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#bye","aria-hidden":"true"}},[t._v("#")]),t._v(" bye")]),t._v(" "),e("p",[t._v("用于对等连接主动断开连接,拒绝服务对端消息业务")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("byeCode")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("预留字段")])])])]),t._v(" "),e("h4",{attrs:{id:"gettime"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#gettime","aria-hidden":"true"}},[t._v("#")]),t._v(" getTime")]),t._v(" "),e("p",[t._v("用于向对等节点获取时间")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("messageId")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("请求id")])])])]),t._v(" "),e("h4",{attrs:{id:"responsetime"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#responsetime","aria-hidden":"true"}},[t._v("#")]),t._v(" responseTime")]),t._v(" "),e("p",[t._v("回复对等节点时间")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("messageId")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("请求id")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("time")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("时间值")])])])]),t._v(" "),e("h3",{attrs:{id:"_4-2-交易协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-交易协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 交易协议")]),t._v(" "),e("p",[t._v("​ 暂无")]),t._v(" "),e("h2",{attrs:{id:"五、模块配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、模块配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 五、模块配置")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("[network]\nnetwork.self.server.port=8003\nnetwork.self.chainId=9861\nnetwork.self.magic=68866996\nnetwork.self.max.in=100\nnetwork.self.max.out=10\nnetwork.self.seed.ip=127.0.0.1:8003\n#卫星链配置信息\nnetwork.moon.node=true\nnetwork.moon.server.port=8004\nnetwork.moon.max.in=100\nnetwork.moon.max.out=10\nnetwork.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003\n")])])]),e("h2",{attrs:{id:"六、java特有的设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、Java特有的设计")]),t._v(" "),e("h2",{attrs:{id:"七、补充内容"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、补充内容")])])}],a=_(0),r=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},e,!1,null,null,null);r.options.__file="networkModuleDesign.md";v.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/160.797785d9.js b/docs/.vuepress/dist/assets/js/160.797785d9.js new file mode 100644 index 00000000..0d33804e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/160.797785d9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[160],{868:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("Nuls智能合约使用的开发工具为IntelliJ IDEA。")]),t._v(" "),t._m(6),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击下载插件"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("NULS智能合约插件提供的主要功能:")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),a("p",[t._v("下面列出Java关键字,其中将标注NULS智能合约不支持的关键字")]),t._v(" "),a("p",[t._v("访问控制")]),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象")]),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("包的关键字")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("数据类型的关键字")]),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("条件循环(流程控制)")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("错误处理")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("修饰方法、类、属性和变量")]),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("其他")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("下面的语法与Java相同,只是简单列出,具体可参考Java相关文档")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("Nuls智能合约只能使用下面的类进行开发")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("一个简单的合约")]),t._v(" "),t._m(27),t._v(" "),t._m(28),a("p",[t._v("在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。\n项目中可以有多个类和接口。")]),t._v(" "),a("p",[t._v("合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。\n合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。")]),t._v(" "),a("p",[t._v("注解说明")]),t._v(" "),a("p",[t._v("@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。")]),t._v(" "),a("p",[t._v("@Payable 标记@Payable的方法,才能在调用时候传入金额")]),t._v(" "),a("p",[t._v("@Required 标记@Required的参数,调用时候必须传入值")]),t._v(" "),a("p",[t._v("去github下载NULS源码,里面有一些合约示例。")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("合约SDK提供了几个类,方便合约开发:")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._m(36),t._v(" "),t._m(37),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("这里列举几个接口的参数结构及简单实例,其他接口请参见"),a("a",{attrs:{href:"http://127.0.0.1:8001/docs#/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Swagger UI"),a("OutboundLink")],1)]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"开发手册"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#开发手册","aria-hidden":"true"}},[this._v("#")]),this._v(" 开发手册")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_1-简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-简介","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. 简介")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_2-开发环境"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-开发环境","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. 开发环境")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-安装nuls钱包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-安装nuls钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 安装NULS钱包")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-安装jdk-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-安装jdk-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 安装JDK 8")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-安装intellij-idea"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-安装intellij-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 安装IntelliJ IDEA")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-4-安装nuls智能合约插件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-安装nuls智能合约插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 安装NULS智能合约插件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("新建NULS合约工程")]),this._v(" "),s("li",[this._v("提示不支持的Java特性、Java类、Java方法")]),this._v(" "),s("li",[this._v("编译、打包、部署合约")]),this._v(" "),s("li",[this._v("展示、调用合约方法。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_3-nuls智能合约规范与语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-nuls智能合约规范与语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. NULS智能合约规范与语法")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-1-nuls智能合约规范"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-nuls智能合约规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 NULS智能合约规范")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-2-关键字"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-关键字","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 关键字")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("public")]),this._v(" "),s("li",[this._v("protected")]),this._v(" "),s("li",[this._v("private")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("class")]),t._v(" "),a("li",[t._v("interface")]),t._v(" "),a("li",[t._v("abstract")]),t._v(" "),a("li",[t._v("implements")]),t._v(" "),a("li",[t._v("extends")]),t._v(" "),a("li",[t._v("new")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("import")]),this._v(" "),s("li",[this._v("package")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("byte")]),t._v(" "),a("li",[t._v("char")]),t._v(" "),a("li",[t._v("boolean")]),t._v(" "),a("li",[t._v("short")]),t._v(" "),a("li",[t._v("int")]),t._v(" "),a("li",[t._v("float")]),t._v(" "),a("li",[t._v("long")]),t._v(" "),a("li",[t._v("double")]),t._v(" "),a("li",[t._v("void")]),t._v(" "),a("li",[t._v("null")]),t._v(" "),a("li",[t._v("true")]),t._v(" "),a("li",[t._v("false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("if")]),t._v(" "),a("li",[t._v("else")]),t._v(" "),a("li",[t._v("while")]),t._v(" "),a("li",[t._v("for")]),t._v(" "),a("li",[t._v("switch")]),t._v(" "),a("li",[t._v("case")]),t._v(" "),a("li",[t._v("default")]),t._v(" "),a("li",[t._v("do")]),t._v(" "),a("li",[t._v("break")]),t._v(" "),a("li",[t._v("continue")]),t._v(" "),a("li",[t._v("return")]),t._v(" "),a("li",[t._v("instanceof")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("catch")]),t._v(" "),a("li",[t._v("try")]),t._v(" "),a("li",[t._v("finally")]),t._v(" "),a("li",[t._v("throw")]),t._v(" "),a("li",[t._v("throws")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("static")]),t._v(" "),a("li",[t._v("final")]),t._v(" "),a("li",[t._v("super")]),t._v(" "),a("li",[t._v("this")]),t._v(" "),a("li",[t._v("native(不支持)")]),t._v(" "),a("li",[t._v("strictfp(不支持)")]),t._v(" "),a("li",[t._v("synchronized(不支持)")]),t._v(" "),a("li",[t._v("transient(不支持)")]),t._v(" "),a("li",[t._v("volatile(不支持)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("enum(不支持)")]),this._v(" "),s("li",[this._v("assert(不支持)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-3-基本语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-基本语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 基本语法")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头")]),t._v(" "),a("li",[t._v("基本数据类型:byte short int long float double char boolean")]),t._v(" "),a("li",[t._v("引用数据类型:类、接口、数组")]),t._v(" "),a("li",[t._v("算术运算符:+ - * / % ++ --")]),t._v(" "),a("li",[t._v("关系运算符:> < >= <= == !=")]),t._v(" "),a("li",[t._v("逻辑运算符:! & | ^ && ||")]),t._v(" "),a("li",[t._v("位运算符:& | ^ ~ >> << >>>")]),t._v(" "),a("li",[t._v("赋值运算符:=")]),t._v(" "),a("li",[t._v("拓展赋值运算符:+ = -= *= /=")]),t._v(" "),a("li",[t._v("字符串链接运算符:+")]),t._v(" "),a("li",[t._v("三目条件运算符 ? :")]),t._v(" "),a("li",[t._v("流程控制语句(if,switch,for,while,do...while)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-4-支持的类"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-支持的类","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 支持的类")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("io.nuls.contract.sdk.Address")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Block")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.BlockHeader")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Contract")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Event")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Msg")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Utils")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.View")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Required")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Payable")]),t._v(" "),a("li",[t._v("java.lang.Boolean")]),t._v(" "),a("li",[t._v("java.lang.Byte")]),t._v(" "),a("li",[t._v("java.lang.Short")]),t._v(" "),a("li",[t._v("java.lang.Character")]),t._v(" "),a("li",[t._v("java.lang.Integer")]),t._v(" "),a("li",[t._v("java.lang.Long")]),t._v(" "),a("li",[t._v("java.lang.Float")]),t._v(" "),a("li",[t._v("java.lang.Double")]),t._v(" "),a("li",[t._v("java.lang.String")]),t._v(" "),a("li",[t._v("java.lang.StringBuilder")]),t._v(" "),a("li",[t._v("java.math.BigInteger")]),t._v(" "),a("li",[t._v("java.math.BigDecimal")]),t._v(" "),a("li",[t._v("java.util.Collection")]),t._v(" "),a("li",[t._v("java.util.List")]),t._v(" "),a("li",[t._v("java.util.ArrayList")]),t._v(" "),a("li",[t._v("java.util.LinkedList")]),t._v(" "),a("li",[t._v("java.util.Map")]),t._v(" "),a("li",[t._v("java.util.HashMap")]),t._v(" "),a("li",[t._v("java.util.LinkedHashMap")]),t._v(" "),a("li",[t._v("java.util.Set")]),t._v(" "),a("li",[t._v("java.util.HashSet")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-5-其他限制"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-其他限制","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 其他限制")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("合约类只能有一个构造方法,其他类不限制")]),this._v(" "),s("li",[this._v("执行一次合约方法最大的Gas消耗是1000万,包括"),s("code",[this._v("@View")]),this._v("类型的方法调用,请保证尽可能的优化合约代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_4-nuls智能合约简单示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-nuls智能合约简单示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. NULS智能合约简单示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" contracts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("examples"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleStorage")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("storedData "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_5-nuls-contract-sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-nuls-contract-sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. NULS Contract SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-address","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Address")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 获取该地址的余额(只能获取合约地址余额)\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约向该地址转账\n *\n * @param value 转账金额(多少Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 调用该地址的合约方法\n *\n * @param methodName 方法名\n * @param methodDesc 方法签名\n * @param args 参数\n * @param value 附带的货币量(多少Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 调用该地址的合约方法并带有返回值(String)\n *\n * @param methodName 方法名\n * @param methodDesc 方法签名\n * @param args 参数\n * @param value 附带的货币量(多少Na)\n * @return 调用合约后的返回值\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("callWithReturnValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 验证地址\n *\n * @param address\n * @see io.nuls.kernel.utils.AddressTool#validAddress(String)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Address address1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-block","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Block")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Block")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 给定块的区块头\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块的区块头\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 最新块的区块头\n *\n * @return 最新块的区块头\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newestBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 给定块的哈希值\n * hash of the given block\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockhash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块矿工地址\n * current block miner’s address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("coinbase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块编号\n * current block number\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("number")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 当前块时间戳\n * current block timestamp\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.BlockHeader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockHeader")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Address packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTxCount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStateRoot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n BlockHeader that "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BlockHeader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BlockHeader{"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", time="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", height="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", txCount="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", packingAddress="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", stateRoot=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'}'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Contract")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约接口,合约类实现这个接口\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-event","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n* 事件接口,事件类实现这个接口\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Event")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-msg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-msg","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Msg")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Msg")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 剩余Gas\n * remaining gas\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasleft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约发送者地址\n * sender of the contract\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na\n * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Gas价格\n * gas price\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasprice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 合约地址\n * contract address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-utils","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Utils")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Utils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Utils")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 检查条件,如果条件不满足则回滚\n *\n * @param expression\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 检查条件,如果条件不满足则回滚\n *\n * @param expression\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 终止执行并还原改变的状态\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 终止执行并还原改变的状态\n *\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 发送事件\n *\n * @param event\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Event event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @param seed a private seed\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash4 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash4"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("xBL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param src source string (hex encoding string)\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param bytes source byte array\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bytes"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]verify signature data(ECDSA)\n *\n * @param data(hex encoding string)\n * @param signature(hex encoding string)\n * @param pubkey(hex encoding string)\n * @return verify result\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("verifySignatureData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String signature"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String pubkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用特定的算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,获取原始种子的集合\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-payable"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-payable","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Payable")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Payable 标记@Payable的方法,才能在调用时候转入金额")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Payable")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-required"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-required","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Required")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Required 标记@Required的参数,调用时候必须传入值")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PARAMETER"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-view"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-view","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.View")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_6-智能合约主要的rpc接口"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-智能合约主要的rpc接口","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. 智能合约主要的RPC接口")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("测试网的"),s("code",[this._v("Swagger UI")]),this._v("的端口默认是8001,正式网的端口默认是6001")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-1-创建智能合约"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-创建智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 创建智能合约")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("最大gas消耗")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约代码(字节码的Hex编码字符串)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("备注")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4687")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-2-估算创建智能合约的gas消耗"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-估算创建智能合约的gas消耗","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 估算创建智能合约的Gas消耗")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约代码(字节码的Hex编码字符串)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-3-调用智能合约"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-3-调用智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.3 调用智能合约")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/call")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者账户密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractAddress*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("智能合约地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("最大Gas消耗")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("执行合约单价")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodName*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("方法名")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("方法签名,如果方法名不重复,可以不传")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("备注")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参数列表")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qwe"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-4-估算调用智能合约的gas消耗-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-4-估算调用智能合约的gas消耗-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.4 估算调用智能合约的Gas消耗(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/call")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-5-估算智能合约的price-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-5-估算智能合约的price-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.5 估算智能合约的price(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedprice")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-6-终止智能合约-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-6-终止智能合约-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.6 终止智能合约(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/delete")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-7-调用不上链的智能合约函数-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-7-调用不上链的智能合约函数-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.7 调用不上链的智能合约函数(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/view")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-8-获取智能合约执行结果-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-8-获取智能合约执行结果-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.8 获取智能合约执行结果(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/result/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-9-获取智能合约基本信息-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-9-获取智能合约基本信息-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.9 获取智能合约基本信息(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/info/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-10-验证是否为合约地址-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-10-验证是否为合约地址-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.10 验证是否为合约地址(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-11-获取智能合约地址的nuls余额-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-11-获取智能合约地址的nuls余额-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.11 获取智能合约地址的NULS余额(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/balance/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-12-获取智能合约交易详情-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-12-获取智能合约交易详情-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.12 获取智能合约交易详情(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-13-获取智能合约的交易列表-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-13-获取智能合约的交易列表-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.13 获取智能合约的交易列表(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/list/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-14-根据address和limit查询合约utxo-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-14-根据address和limit查询合约utxo-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.14 根据address和limit查询合约UTXO(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/limit/{address}/{limit}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-15-根据address和amount查询合约utxo-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-15-根据address和amount查询合约utxo-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.15 根据address和amount查询合约UTXO(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/amount/{address}/{amount}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-16-向智能合约转账-参见swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-16-向智能合约转账-参见swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.16 向智能合约转账(参见"),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/transfer")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_7-示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. 示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-1-投票智能合约代码片段-如下"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-投票智能合约代码片段-如下","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.1 投票智能合约代码"),s("code",[this._v("片段")]),this._v(", 如下")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("完整代码: "),s("code",[this._v("https://github.com/nuls-io/nuls-vote")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BaseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteInterface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("List"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" VoteInterface baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("VoteContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n baseVote "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n VoteEntity voteEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n VoteConfig config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" success "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("success"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("智能合约的方法中如果有"),s("code",[this._v("数组类型")]),this._v("的参数,请使用如下方式传递参数")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("参考以上投票合约代码中的"),s("code",[this._v("create")]),this._v("方法")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtydTVWskMc7GkZzbsq2FoChqKFwMf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseLt14NacjTDhXaTXUdrk6VF7aEwtW4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"测试投票1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第一个投票合约"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第一个选项"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第二个选项"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"第三个选项"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536044066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536184066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-2-standard-token-智能合约代码片段"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-standard-token-智能合约代码片段","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.2 Standard Token 智能合约代码"),s("code",[this._v("片段")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("完整代码: "),s("code",[this._v("https://github.com/nuls-io/nuls-nrc20")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("HashMap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("emit"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("require"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleToken")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Token "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" BigInteger totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" balances "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decimals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("totalSupply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleToken")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("decimals "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TEN"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ownerAllowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferFrom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("approve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("increaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decreaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger oldValue "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("oldValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient approved token"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The value must be greater than or equal to 0."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient balance of token."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])}],!1,null,null,null);e.options.__file="developerManual.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/161.4d34eb09.js b/docs/.vuepress/dist/assets/js/161.4d34eb09.js new file mode 100644 index 00000000..b5f37792 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/161.4d34eb09.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[161],{862:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("本文档为NULS2.0 alpha版本测试网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("Linux内核版本推荐使用 2.6.32及以上")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("ul",[t._m(15),t._v(" "),s("li",[s("p",[t._v("进入"),s("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官网钱包下载"),s("OutboundLink")],1),t._v("界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。")]),t._v(" "),s("p",[t._v("Linux系统中下载v2.0.0-alpha-1版的钱包可以使用如下命令:")]),t._v(" "),t._m(16),s("p",[t._v("注:如果后续有其他版本,下载地址可能会不同。")])])]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),s("p",[t._v("输出打印所有的命令,")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),s("p",[t._v("返回信息 help")]),t._v(" "),t._m(30),s("p",[t._v("返回信息 help -a")]),t._v(" "),t._m(31),s("p",[t._v("示例")]),t._v(" "),t._m(32),t._m(33),t._v(" "),s("p",[t._v("创建账户,返回账户地址集合")]),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),s("p",[t._v("创建账户时,将会提示输入密码,为了保证资产安全,必须给账户设置密码;")]),t._v(" "),s("p",[t._v("返回账户集合")]),t._v(" "),t._m(36),s("p",[t._v("示例")]),t._v(" "),s("p",[t._v("创建1个账户")]),t._v(" "),t._m(37),s("p",[t._v("一次创建多个账户")]),t._v(" "),t._m(38),t._m(39),t._v(" "),s("p",[t._v("备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件")]),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(42),s("p",[t._v("示例 备份一个有密码的账户")]),t._v(" "),t._m(43),t._m(44),t._v(" "),s("p",[t._v("根据账户地址移除本地账户,需要输入密码")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(47),s("p",[t._v("示例")]),t._v(" "),t._m(48),t._m(49),t._v(" "),s("p",[t._v("根据账户地址和账户密码重新设置新密码。")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(52),s("p",[t._v("示例")]),t._v(" "),t._m(53),t._m(54),t._v(" "),s("p",[t._v("给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),s("p",[t._v("返回信息 交易hash")]),t._v(" "),t._m(57),s("p",[t._v("示例")]),t._v(" "),t._m(58),t._m(59),t._v(" "),s("p",[t._v("导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),s("p",[t._v("注意:导入keystore文件生成账户时,需要原始密码")]),t._v(" "),s("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(62),s("p",[t._v("示例")]),t._v(" "),t._m(63),t._m(64),t._v(" "),s("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将覆盖,导入时需要给账户设置密码。此功能可以用于忘记账户密码后,通过私钥重新找回账户。")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),s("p",[t._v("示例")]),t._v(" "),t._m(68),t._m(69),t._v(" "),s("p",[t._v("根据账户地址查询账户信息")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(72),s("p",[t._v("示例")]),t._v(" "),t._m(73),t._m(74),t._v(" "),s("p",[t._v("根据分页参数查询账户列表,所有账户以创建时间倒序输出。")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),s("p",[t._v("返回信息,将输出账户集合")]),t._v(" "),t._m(77),s("p",[t._v("示例 获取账户列表")]),t._v(" "),t._m(78),t._m(79),t._v(" "),s("p",[t._v("根据账户地址个密码查询账户私钥")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("返回信息 导入的账户的私钥(未加密)")]),t._v(" "),t._m(82),s("p",[t._v("示例")]),t._v(" "),t._m(83),t._m(84),t._v(" "),s("p",[t._v("根据账户地址查询账户余额")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),s("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(87),s("p",[t._v("示例")]),t._v(" "),t._m(88),t._m(89),t._v(" "),s("p",[t._v("根据账户地址或别名将NULS转入另一账户地址或别名中")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),s("p",[t._v("返回信息 转账交易hash")]),t._v(" "),t._m(92),s("p",[t._v("示例")]),t._v(" "),t._m(93),t._m(94),t._v(" "),s("p",[t._v("根据交易hash查询交易详细信息")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(97),s("p",[t._v("示例 查询转账交易")]),t._v(" "),t._m(98),t._m(99),t._v(" "),t._m(100),t._m(101),t._v(" "),s("p",[t._v("根据账户地址创建节点,创建节点时需要提供两个地址,第一个地址为节点地址,需要输入节点地址账户密码,第二地址为打包地址,不需要输入密码。同时需要至少20000NULS的保证金。")]),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),s("p",[t._v("返回信息 返回节点的agent hash")]),t._v(" "),t._m(104),s("p",[t._v("示例 创建一个节点,佣金比例为10%,押金20000NULS。")]),t._v(" "),t._m(105),t._m(106),t._v(" "),s("p",[t._v("根据账户地址和节点agentHash,加入共识,至少需要2000NULS")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),s("p",[t._v("返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。")]),t._v(" "),t._m(109),s("p",[t._v("示例")]),t._v(" "),t._m(110),t._m(111),t._v(" "),s("p",[t._v("根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。")]),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),s("p",[t._v("返回信息 退出共识交易hash")]),t._v(" "),t._m(114),s("p",[t._v("示例")]),t._v(" "),t._m(115),t._m(116),t._v(" "),s("p",[t._v("停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。")]),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),s("p",[t._v("返回信息 停止节点交易hash")]),t._v(" "),t._m(119),s("p",[t._v("示例")]),t._v(" "),t._m(120),t._m(121),t._v(" "),s("p",[t._v("获取最新的区块头信息")]),t._v(" "),t._m(122),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(123),s("p",[t._v("示例")]),t._v(" "),t._m(124),t._m(125),t._v(" "),s("p",[t._v("根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(128),s("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(129),t._m(130),t._v(" "),s("p",[t._v("根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(133),s("p",[t._v("示例 根据高度获取区块头")]),t._v(" "),t._m(134),t._m(135),t._v(" "),s("p",[t._v("调用此接口在链上创建一个智能合约")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),s("p",[t._v("返回信息 创建合约的交易hash和合约的地址")]),t._v(" "),t._m(138),s("p",[t._v("示例 创建一个合约(contractCode 省略中间部分)")]),t._v(" "),t._m(139),t._m(140),t._v(" "),s("p",[t._v("获取智能合约的描述信息以及构造函数、调用方法的参数列表")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(143),s("p",[t._v("示例")]),t._v(" "),t._m(144),t._m(145),t._v(" "),s("p",[t._v("调用智能合约提供的函数")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),s("p",[t._v("返回信息 本次调用的交易hash")]),t._v(" "),t._m(148),t._m(149),t._v(" "),t._m(150),t._m(151),t._v(" "),s("p",[t._v("停止一个可用的智能合约")]),t._v(" "),t._m(152),t._v(" "),t._m(153),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(154),s("p",[t._v("示例")]),t._v(" "),t._m(155),t._m(156),t._v(" "),s("p",[t._v("调用合约的视图方法,会立即返回结果,不会产生交易")]),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(159),s("p",[t._v("示例 调用NRC20-Token合约的查询Token余额函数查询指定地址的Token余额")]),t._v(" "),t._m(160),t._m(161),t._v(" "),s("p",[t._v("向指定的合约地址转入主网币")]),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(164),s("p",[t._v("示例 向指定合约转入2个NULS")]),t._v(" "),t._m(165),t._m(166),t._v(" "),s("p",[t._v("NRC20 token转账")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(169),s("p",[t._v("示例 token转账:")]),t._v(" "),t._m(170),t._m(171),t._v(" "),s("p",[t._v("获取合约的交易信息, 包含交易详情,合约调用参数,合约执行结果")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(174),s("p",[t._v("示例")]),t._v(" "),t._m(175),t._m(176),t._v(" "),s("p",[t._v("获取一个合约的执行结果")]),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(179),s("p",[t._v("示例")]),t._v(" "),t._m(180),t._m(181),t._v(" "),s("p",[t._v("获取创建指定合约时需要传入的参数列表")]),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(184),s("p",[t._v("示例")]),t._v(" "),t._m(185),t._m(186),t._v(" "),s("p",[t._v("获取指定账户地址所创建的合约列表")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(189),s("p",[t._v("示例")]),t._v(" "),t._m(190),t._m(191),t._v(" "),s("p",[t._v("查询网络基本信息")]),t._v(" "),t._m(192),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(193),s("p",[t._v("示例")]),t._v(" "),t._m(194),t._m(195),t._v(" "),s("p",[t._v("查询网络节点IP")]),t._v(" "),t._m(196),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(197),s("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(198),t._m(199),t._v(" "),s("p",[t._v("退出操作钱包的命令行程序,不会退出已启动的钱包节点。")]),t._v(" "),t._m(200),t._v(" "),s("p",[t._v("示例")]),t._v(" "),t._m(201)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"linux-cli-手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#linux-cli-手册","aria-hidden":"true"}},[this._v("#")]),this._v(" Linux CLI 手册")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"版本更新记录"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内容")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("2018-03-18")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("alpha版功能")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"准备"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#准备","aria-hidden":"true"}},[this._v("#")]),this._v(" 准备")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"服务器硬件配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#服务器硬件配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 服务器硬件配置")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("建立NULS节点的服务器不低于如下配置:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("四核 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("128G硬盘")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("20M上行")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("推荐配置:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("八核 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("256G硬盘")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("100M上行")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"系统及内核版本"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#系统及内核版本","aria-hidden":"true"}},[this._v("#")]),this._v(" 系统及内核版本")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux系统")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS 6,7")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"开始"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 开始")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"下载"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#下载","aria-hidden":"true"}},[this._v("#")]),this._v(" 下载")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"安装"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[this._v("#")]),this._v(" 安装")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("在Linux中解压已下载的文件")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"运行"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#运行","aria-hidden":"true"}},[this._v("#")]),this._v(" 运行")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("进入解压后的目录,并运行启动脚本,启动全节点钱包")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ cd NULS-Wallet-linux64-2.0.0-alpha-1\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"使用钱包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#使用钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 使用钱包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"快速入门"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。")]),t._v(" "),s("p",[t._v("进入cmdclient/1.0.0目录,执行如下命令:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ cd cmdclient/1.0.0\n$ ./cmd.sh\n")])])]),s("p",[t._v("将会出现NULS命名输入提示符"),s("code",[t._v("nuls>>>")]),t._v(" ,然后可直接输入NULS钱包操作命令,来进行操作。")]),t._v(" "),s("p",[t._v("例如,创建账户的示例如下:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),s("p",[t._v("执行"),s("code",[t._v("create")]),t._v("命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"约定"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("设置密码规则:密码长度在8至20位,必须同时包含字母和数字。")]),this._v(" "),e("li",[this._v('命令参数说明: 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"钱包命令"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#钱包命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 钱包命令")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"帮助命令"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#帮助命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 帮助命令")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令: help [-a]|[group]|[command]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("-a")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("格式化打印命令,选填")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("command")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("查看指定命令使用说明")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("group")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("查看指定命令组的所有命令使用说明")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n\tOPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\nnuls>>> help account\nnuls>>> help create\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令: create [number]")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("创建账户的数量,选填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create \nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 3\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"备份账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:backup
[path]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("[path]")]),t._v(" "),s("td",[t._v("文件生成备份文件的目标文件夹,默认为当前文件夹,选填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj\nEnter account password\n***************\nThe path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"移除账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 移除账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:remove
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\nEnter your password for account**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"修改账户密码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#修改账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改账户密码")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:resetpwd
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N\nEnter your old password:**********\nEnter new password**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"设置别名"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:setalias
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户的地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("别名名称,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("txHash"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[this._v("0020")]),this._v('f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj\nEnter your account password**********\ntxHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"导入账户keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#导入账户keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:importkeystore ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("待导入的keystore文件地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"导入账户私钥"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:import ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccount
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("账户地址,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //加密后的私钥\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //别名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baglance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //冻结的资产数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //总的资产数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),t._v(" //可用的资产数量\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //账户地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),t._v(" //公钥\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n{\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //加密后的私钥\n "alias" : "zlj", //别名\n "baglance" : { \n "freeze" : 0, //冻结的资产数量\n "total" : 997999999800000, //总的资产数量\n "available" : 997999999800000 //可用的资产数量\n },\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //账户地址\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //加密后的公钥\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户列表")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccounts ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //别名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //公钥\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),t._v(" //私钥\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts\n[ {\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //地址\n "alias" : null, //别名\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //加密后的公钥\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //加密后的私钥\n}, {\n "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",\n "alias" : null,\n "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",\n "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"\n}, {\n "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",\n "alias" : "zlj",\n "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",\n "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户私钥"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户私钥")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getprikey
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token number"}},[this._v("00")]),this._v("a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9\nEnter your account password**********\n7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户余额"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户余额")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getbalance
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//余额\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//已锁定余额\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//可用余额\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "total" : "9999998.99",\n "freeze" : "0",\n "available" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:transfer | | [remark] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出地址(与formAlias任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出地址别名(与formAddress任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("接收地址(与toAlias任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("接收地址别名(与toAddress任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转账数量,必填")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注信息,选填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询交易详情"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易详情")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:gettx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //交易类型(枚举说明见下表【type 枚举类型说明】)\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinData"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txData"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1552979783918")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"transactionSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg=="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"6L2s6LSm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestAlgType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestBytes"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f"')]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("341")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONFIRMED"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //确认状态\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("225")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inBlockIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinDataInstance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABmAU91zVafgSLoRrxnHo7k3r/Azg="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"79acNPim+aw="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABL/80LO1f8vxvfNXc5l9eeIDTGKM="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //手续费\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"multiSignTx"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f\n{\n "type" : 2, //交易类型(枚举说明见下表【type 枚举类型说明】)\n "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",\n "txData" : null,\n "time" : 1552979783918,\n "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",\n "remark" : "6L2s6LSm",\n "hash" : {\n "digestAlgType" : 0,\n "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", \n "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" \n },\n "blockHeight" : 341, //区块高度\n "status" : "CONFIRMED", //确认状态\n "size" : 225,\n "inBlockIndex" : 0,\n "coinDataInstance" : { \n "from" : [ {\n "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100100000,\n "nonce" : "79acNPim+aw=",\n "locked" : 0\n } ],\n "to" : [ {\n "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100000000,\n "lockTime" : 0\n } ]\n },\n "fee" : 100000, //手续费\n "multiSignTx" : false\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"type-枚举类型说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#type-枚举类型说明","aria-hidden":"true"}},[this._v("#")]),this._v(" type 枚举类型说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("/** coinbase交易*/\n int TX_TYPE_COINBASE = 1;\n /** 转账交易*/\n int TX_TYPE_TRANSFER = 2;\n /** 设置别名*/\n int TX_TYPE_ALIAS = 3;\n /** 创建共识节点交易*/\n int TX_TYPE_REGISTER_AGENT = 4;\n /** 委托交易(加入共识)*/\n int TX_TYPE_JOIN_CONSENSUS = 5;\n /** 取消委托交易(退出共识)*/\n int TX_TYPE_CANCEL_DEPOSIT = 6;\n /** 黄牌惩罚*/\n int TX_TYPE_YELLOW_PUNISH = 7;\n /** 红牌惩罚*/\n int TX_TYPE_RED_PUNISH = 8;\n /** 停止节点(删除共识节点)*/\n int TX_TYPE_STOP_AGENT = 9;\n /** 跨链转账交易*/\n int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;\n /** 注册链交易*/\n int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;\n /** 销毁链*/\n int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;\n /** 为链新增一种资产*/\n int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;\n /** 删除链上资产*/\n int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;\n /** 创建智能合约交易*/\n int TX_TYPE_CREATE_CONTRACT = 100;\n /** 调用智能合约交易*/\n int TX_TYPE_CALL_CONTRACT = 101;\n /** 删除智能合约交易*/\n int TX_TYPE_DELETE_CONTRACT = 102;\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:createagent ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建节点的账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("代理佣金比例,范围:10~100,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建节点的保证金,不能低于20000NULS,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"加入共识(委托节点)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#加入共识(委托节点)","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入共识(委托节点)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deposit
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("节点的agentHash,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("加入共识保证金,不能低于2000NULS,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"退出共识(退出委托)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#退出共识(退出委托)","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识(退出委托)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:withdraw
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("委托时的交易hash,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"停止节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#停止节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 停止节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:stopagent
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取最新的区块头信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取最新的区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取最新的区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getbestblockheader")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //上一个区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //包含的交易数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块签名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",\n "time" : "2019-03-19 18:26:20.020",\n "height" : 1479,\n "txCount" : 0,\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",\n "size" : 0,\n "packingAddress" : null,\n "roundIndex" : 155299118,\n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1,\n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询区块头信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getblock | ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的hash值")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的高度")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //上一个区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //包含的交易数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块签名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //区块hash\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //上一个区块hash\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash\n "time" : "2019-03-19 18:26:20.020", //打包时间\n "height" : 1479, //区块高度\n "txCount" : 1, //包含的交易数\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名\n "size" : 0, //区块大小\n "packingAddress" : null, //打包地址\n "roundIndex" : 155299118, \n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1, \n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询区块头信息-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getblockheader | ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的hash值")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的高度")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:createcontract [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建智能合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("本次创建合约最大消耗的Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约代码的hex编码")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //交易hash\n "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //合约地址\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo\nThe arguments structure: \n[ {\n "type" : "String",\n "name" : "name",\n "required" : true\n}, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n}, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n}, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n} ]\nPlease enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'").\nEnter the arguments:"KQB","KQB",10000,2\n{\n "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约基本信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约基本信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约基本信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractinfo ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("合约地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 ,见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\nnuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ngetcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\n{\n "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "createTime" : 1553563706022,\n "blockHeight" : 46,\n "isNrc20" : true,\n "nrc20TokenName" : "QKB",\n "nrc20TokenSymbol" : "QKB",\n "decimals" : 2,\n "totalSupply" : "200000000",\n "status" : "normal",\n "method" : [ {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },{\n "name" : "transfer",\n "desc" : "(Address to, BigInteger value) return boolean",\n "args" : [ {\n "type" : "Address",\n "name" : "to",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "value",\n "required" : true\n } ],\n "returnArg" : "boolean",\n "view" : false,\n "event" : false,\n "payable" : false\n }]\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"调用智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#调用智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 调用智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:callcontract [-d methodDesc] [-r remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调动合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("本次合约执行最大消耗的Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约的方法名")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("如果要向合约转账,转账的数量")])]),t._v(" "),s("tr",[s("td",[t._v("[-d methodDesc]")]),t._v(" "),s("td",[t._v("如果合约中有同名方法时,使用此方法来描述参数列表")])]),t._v(" "),s("tr",[s("td",[t._v("[-r remark]")]),t._v(" "),s("td",[t._v("备注信息")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("示例 调用一个指定合约的NRC20-Token转账函数, 示例中"),e("code",[this._v("tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L")]),this._v("为NRC20合约地址,输入的参数为 接收地址和转账数量")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\ncallcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\nPlease Enter your account passwordzhoujun172\n**********\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2\n"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"删除智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#删除智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 删除智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deletecontract ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的合约地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ndeletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\nPlease enter your account passwordzhoujun172\n**********\n"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"调用合约视图方法"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#调用合约视图方法","aria-hidden":"true"}},[this._v("#")]),this._v(" 调用合约视图方法")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deletecontractviewcontract [-d methodDesc] --view contract")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的合约地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的方法")])]),t._v(" "),s("tr",[s("td",[t._v("[-d methodDesc]")]),t._v(" "),s("td",[t._v("如果合约中有同名方法时,使用此方法来描述参数列表")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("根据具体调用函数返回值不同\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nviewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n{\n "result" : "20000000"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"向合约地址转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#向合约地址转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 向合约地址转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:transfertocontract [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转入数量")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark\nPlease enter your account password\n**********\n"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"token转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token转账","aria-hidden":"true"}},[this._v("#")]),this._v(" token转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:tokentransfer [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转入数量")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000\nPlease enter your account password\n**********\n"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontracttx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\ngetcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "type" : "100",\n "time" : "2019-03-26 09:28:26",\n "blockHeight" : 46,\n "fee" : 0.0,\n "value" : 0.0,\n "remark" : null,\n "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",\n "status" : "confirm",\n "confirmCount" : 0,\n "size" : 6686,\n "inputs" : [ {\n "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "assetsChainId" : 2,\n "assetsId" : 1,\n "amount" : "5700000",\n "nonce" : "ffffffff",\n "locked" : 0,\n "value" : 0.0\n } ],\n "outputs" : [ ],\n "txData" : {\n "data" : {\n "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "value" : 0.0,\n "hexCode" : "504b03040a0000080...........31600000000",\n "gasLimit" : 200000,\n "price" : "0.00000025",\n "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]\n }\n },\n "contractResult" : {\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n }\n}\n\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约执行结果"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约执行结果","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约执行结果")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractresult ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约构造函数"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约构造函数","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约构造函数")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractcontructor ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("合约代码的hex编码")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000\n{\n "constructor" : {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },\n "isNrc20" : true\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取指定账户创建的合约列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取指定账户创建的合约列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取指定账户创建的合约列表")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccountcontracts ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("账户地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\n[ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",\n "createTime" : "2019-03-25 16:08:25.025",\n "height" : 253,\n "confirmCount" : 195,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",\n "createTime" : "2019-03-25 15:33:54.054",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询网络信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询网络信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:network info **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//本地最新区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络最新区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络时间偏移值\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//被动连接节点数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//主动连接节点数量\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network info\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询网络节点ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询网络节点ip","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络节点IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:network nodes **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network nodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"退出钱包命令程序"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#退出钱包命令程序","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出钱包命令程序")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="linuxTutorial.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/162.94099c67.js b/docs/.vuepress/dist/assets/js/162.94099c67.js new file mode 100644 index 00000000..f9479605 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/162.94099c67.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[162],{856:function(s,t,a){"use strict";a.r(t);var e=a(0),r=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"手续费"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#手续费","aria-hidden":"true"}},[s._v("#")]),s._v(" 手续费")]),s._v(" "),a("h3",{attrs:{id:"_1-智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?","aria-hidden":"true"}},[s._v("#")]),s._v(" 1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?")]),s._v(" "),a("blockquote",[a("p",[a("code",[s._v("背景:")]),s._v("由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一")])]),s._v(" "),a("p",[s._v("在主链上,多出三个类型的交易,"),a("code",[s._v("创建智能合约")]),s._v(", "),a("code",[s._v("调用智能合约")]),s._v(", "),a("code",[s._v("删除智能合约")])]),s._v(" "),a("p",[s._v("三个交易与其他交易如"),a("code",[s._v("转账")]),s._v("不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一")]),s._v(" "),a("ul",[a("li",[s._v("智能合约收费计算方式")])]),s._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" COMPARISON "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//比较字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONSTANT "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//简单数值类型字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LDC "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数值常量,字符串常量(长度 * LDC)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONTROL "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//控制字节码")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" TABLESWITCH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//switch字节码(大小 * TABLESWITCH)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LOOKUPSWITCH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//switch字节码(大小 * LOOKUPSWITCH)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" CONVERSION "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数值转换")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" EXTENDED "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//null判断")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" MULTIANEWARRAY "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//多维数组(大小 * MULTIANEWARRAY)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" LOAD "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把本地变量送到栈顶")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" ARRAYLOAD "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把数组的某项送到栈顶")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" MATH "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//数学操作及移位操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" REFERENCE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//对象相关操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" NEWARRAY "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//一维数组(大小 * NEWARRAY)")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" STACK "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//栈操作")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" STORE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把栈顶的值存入本地变量")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" ARRAYSTORE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//把栈项的值存到数组里")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("public")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("static")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("final")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("int")]),s._v(" TRANSFER "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//转账交易")]),s._v("\n\n")])])]),a("ul",[a("li",[a("p",[s._v("一次智能合约总手续费")]),s._v(" "),a("p",[s._v("一次合约交易的总手续费由三部分构成")]),s._v(" "),a("ul",[a("li",[a("p",[s._v("第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费")])]),s._v(" "),a("li",[a("p",[s._v("第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na")])])]),s._v(" "),a("blockquote",[a("p",[s._v("举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是"),a("code",[s._v("20000 * 20 = 400000")]),s._v(",既是0.004NULS")])]),s._v(" "),a("ul",[a("li",[s._v("第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还")])]),s._v(" "),a("blockquote",[a("p",[s._v("举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是"),a("code",[s._v("10000 * 20 = 200000")]),s._v(",既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方")])])]),s._v(" "),a("li",[a("p",[s._v("合约调用方付多少钱?")]),s._v(" "),a("p",[s._v("在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方")])]),s._v(" "),a("li",[a("p",[s._v("由谁收到了这些费用?")]),s._v(" "),a("blockquote",[a("p",[a("code",[s._v("前提:")]),s._v("这部分费用都体现在区块的CoinBase交易(共识奖励)中")])]),s._v(" "),a("p",[s._v("区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用")])])])])}],!1,null,null,null);r.options.__file="smartContractFee.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/163.9f984d63.js b/docs/.vuepress/dist/assets/js/163.9f984d63.js new file mode 100644 index 00000000..46d4183c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/163.9f984d63.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[163],{854:function(t,n,a){"use strict";a.r(n);var s=a(0),e=Object(s.a)({},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[a("router-link",{attrs:{to:"/zh/startNULS/connectTestnet.html"}},[t._v("为部署、调用智能合约做准备")])],1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("为开发智能合约代码做准备")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载JDK8"),a("OutboundLink")],1),t._v("(安装略)")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://www.jetbrains.com/idea/download/",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载IntelliJ IDEA"),a("OutboundLink")],1),t._v("(安装略)")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载NULS智能合约插件"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("安装NULS智能合约插件"),a("OutboundLink")],1)]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._m(7),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/nuls-io/contracts",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官方收集的智能合约代码仓库"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/amalcaraz/nuls-partnership-smartcontract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Angelillou的智能合约-合作委托挖矿"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/amalcaraz/nuls-lottery-smartcontract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Angelillou的智能合约-彩票"),a("OutboundLink")],1)]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/naveen7252/ProductReviewContract",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区成员Naveen的智能合约-评论"),a("OutboundLink")],1)]),t._v(" "),t._m(8),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/smartContract.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("全节点钱包智能合约部署与调用方式"),a("OutboundLink")],1)]),t._v(" "),t._m(9),t._v(" "),a("p",[a("a",{attrs:{href:"https://dev.nuls.io/zh-cn/contract/index.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("智能合约代码规范与语法说明"),a("OutboundLink")],1)])])},[function(){var t=this.$createElement,n=this._self._c||t;return n("h1",{attrs:{id:"快速入门"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"一、运行公测环境,创建账户,领取测试币"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、运行公测环境,创建账户,领取测试币","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、运行公测环境,创建账户,领取测试币")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"二、安装jdk8、intellij-idea、nuls智能合约插件"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、安装jdk8、intellij-idea、nuls智能合约插件","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、安装JDK8、IntelliJ IDEA、NULS智能合约插件")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"三、智能合约代码示例"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、智能合约代码示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、智能合约代码示例")])},function(){var t=this.$createElement,n=this._self._c||t;return n("p",[n("strong",[n("em",[this._v("用示例快速编译、部署一个智能合约")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("ul",[n("li",[this._v("简单示例")])])},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigDecimal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 覆写这个方法并标记@Payable注解,这个智能合约可以接收全节点钱包NULS资产的直接转账")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferToContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 标记@Payable注解,调用这个方法时,智能合约可接受NULS转入")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigDecimal nuls "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigDecimal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("movePointLeft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I received your transfer amount: "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toPlainString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayWhat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say nothing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"四、智能合约代码仓库"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#四、智能合约代码仓库","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、智能合约代码仓库")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"五、智能合约部署与调用"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#五、智能合约部署与调用","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、智能合约部署与调用")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"六、智能合约代码规范与语法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#六、智能合约代码规范与语法","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、智能合约代码规范与语法")])}],!1,null,null,null);e.options.__file="startSmartContract.md";n.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/164.9e26163d.js b/docs/.vuepress/dist/assets/js/164.9e26163d.js new file mode 100644 index 00000000..93924ef2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/164.9e26163d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[164],{835:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/SHA-2",target:"_blank",rel:"noopener noreferrer"}},[t._v("SHA-256"),a("OutboundLink")],1),t._v(" hashes are used, however "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/RIPEMD",target:"_blank",rel:"noopener noreferrer"}},[t._v("RIPEMD-160"),a("OutboundLink")],1),t._v(" is also used when a shorter hash is desirable (for example when creating a NULS address).")]),t._v(" "),a("p",[t._v('Example of double-SHA-256 encoding of string "nuls":')]),t._v(" "),t._m(4),a("p",[t._v("For NULS addresses (RIPEMD-160) this would give:")]),t._v(" "),t._m(5),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.")]),t._v(" "),a("p",[t._v("First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.")]),t._v(" "),a("p",[t._v("Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),a("p",[t._v("where")]),t._v(" "),t._m(11),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("A NULS address is in fact the hash of a ECDSA public key, computed this way:")]),t._v(" "),t._m(14),a("p",[t._v("非nuls体系的地址格式如下:")]),t._v(" "),a("p",[t._v("例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定")]),t._v(" "),t._m(15),t._m(16),t._v(" "),a("p",[t._v("Satellite-chain uses custom messaging for communication over the TCP protocol.")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("The message consists of a 24-byte header and payload.")]),t._v(" "),t._m(19),t._m(20),t._v(" "),a("p",[t._v("The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.")]),t._v(" "),t._m(21),t._v(" "),a("p",[t._v("[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),a("p",[t._v("Variable-length integers that can be encoded based on the values expressed to save space.")]),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),a("p",[t._v("A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.")]),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("Variable-length buffer, consistent with the VarString implementation.")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("6-byte number.")]),t._v(" "),t._m(30),t._v(" "),a("p",[t._v("When a network address is needed somewhere, this structure is used.")]),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("交易特性")]),t._v(" "),t._m(36),a("p",[t._v("coinData结构")]),t._v(" "),t._m(37),a("p",[t._v("CoinForm结构[40]")]),t._v(" "),t._m(38),a("p",[t._v("CoinTo结构[44]")]),t._v(" "),t._m(39),a("p",[t._v("手续费")]),t._v(" "),t._m(40),t._m(41),t._v(" "),a("p",[t._v("参考各个模块")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"通用协议设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#通用协议设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 通用协议设计")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"protocol-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#protocol-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Protocol design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-standards"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-standards","aria-hidden":"true"}},[this._v("#")]),this._v(" Common standards")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"hashes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hashes","aria-hidden":"true"}},[this._v("#")]),this._v(" Hashes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)\n7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)\nf8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"merkle-trees"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merkle-trees","aria-hidden":"true"}},[this._v("#")]),this._v(" Merkle Trees")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Merkle trees are binary trees of hashes. Merkle trees in NULS use a "),e("strong",[this._v("double")]),this._v(" SHA-256, the SHA-256 hash of the SHA-256 hash of something.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the "),e("strong",[this._v("Merkle root")]),this._v(" of the tree.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("For example, imagine a block with three transactions "),e("em",[this._v("a")]),this._v(", "),e("em",[this._v("b")]),this._v(" and "),e("em",[this._v("c")]),this._v(". The Merkle tree is:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("d1 = dhash(a)\nd2 = dhash(b)\nd3 = dhash(c)\nd4 = dhash(c) # a, b, c are 3. that's an odd number, so we take the c twice\n\nd5 = dhash(d1 concat d2)\nd6 = dhash(d3 concat d4)\n\nd7 = dhash(d5 concat d6)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("dhash(a) = sha256(sha256(a))\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("d7")]),this._v(" is the Merkle root of the 3 transactions in this block.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"addresses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#addresses","aria-hidden":"true"}},[this._v("#")]),this._v(" Addresses")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("ChainId = 2 byte,The ID of the chain in which the account belongs.\naddressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……\npkh = 20 byte , RIPEMD-160(SHA-256(public key))\nxor = 1 byte, XOR(chainId+addressType+pkh)\naddress = Base58Encode(chainId+addressType+pkh+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address = Base58Encode(chainId+原始地址长度+原始地址+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Digital binary stream using little endian。")]),this._v(" "),e("li",[this._v("Floating point numbers convert to integers and transfer by little endian")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"message"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message","aria-hidden":"true"}},[this._v("#")]),this._v(" Message")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("*---------------------------------------------------------------*\n| Header(24 Byte) | Payload |\n*---------------------------------------------------------------*\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"message-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-header","aria-hidden":"true"}},[this._v("#")]),this._v(" message header")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("MagicNumber")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Packet valid flag")])]),t._v(" "),a("tr",[a("td",[t._v("12")]),t._v(" "),a("td",[t._v("command")]),t._v(" "),a("td",[t._v("char[12]")]),t._v(" "),a("td",[t._v("ASCII string identifying the packet content, NULL padded")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("PayloadLength")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("checksum")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("First 4 bytes of sha256(sha256(payload))")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Common Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varint"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varint","aria-hidden":"true"}},[this._v("#")]),this._v(" VarInt")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Value")]),t._v(" "),a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Structure")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("< 0xfd")]),t._v(" "),a("td",[t._v("1")]),t._v(" "),a("td",[t._v("uint8")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffff")]),t._v(" "),a("td",[t._v("3")]),t._v(" "),a("td",[t._v("0xfd + uint16")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffffffff")]),t._v(" "),a("td",[t._v("5")]),t._v(" "),a("td",[t._v("0xfe + uint32")])]),t._v(" "),a("tr",[a("td",[t._v("> 0xffffffff")]),t._v(" "),a("td",[t._v("9")]),t._v(" "),a("td",[t._v("0xff + uint64")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varstring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varstring","aria-hidden":"true"}},[this._v("#")]),this._v(" VarString")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of the string")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("value")]),t._v(" "),a("td",[t._v("uint8[length]")]),t._v(" "),a("td",[t._v("The string itself")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varbyte"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varbyte","aria-hidden":"true"}},[this._v("#")]),this._v(" VarByte")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("data")]),t._v(" "),a("td",[t._v("byte[length]")]),t._v(" "),a("td",[t._v("payload")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"int48"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#int48","aria-hidden":"true"}},[this._v("#")]),this._v(" Int48")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"network-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#network-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Network address")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("16")]),t._v(" "),a("td",[t._v("IPv6/4")]),t._v(" "),a("td",[t._v("char[16]")]),t._v(" "),a("td",[t._v("IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port1")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number, network byte order")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port2")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number,for cross-chain module")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"block-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#block-headers","aria-hidden":"true"}},[this._v("#")]),this._v(" Block_headers")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("version")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("version bumber")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("preHash")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("merkleRoot")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("stateRoot")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("second")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("txCount")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("extends")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("本字段内容不同的链可设置不同的约束")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("signature")]),t._v(" "),a("td",[t._v("Varbyte")]),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" Transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("时间,精确到秒")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("业务数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("资产数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("sig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("只包含签名,不包含pubkey")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("多账户转出\n多账户转入\n多资产转账\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("froms://List格式,\ntos://List格式\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24] 账户地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount: //uint128,转出数量\nnonce : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节\nlocked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24],目标地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount : //uint128,转账金额\nlockTime://uint32,解锁高度或解锁时间,-1为永久锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-types","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Types")])}],!1,null,null,null);r.options.__file="generalProtocol.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/165.c8de855f.js b/docs/.vuepress/dist/assets/js/165.c8de855f.js new file mode 100644 index 00000000..e560e947 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/165.c8de855f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[165],{834:function(t,e,s){"use strict";s.r(e);var n=s(0),i=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"总体设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#总体设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 总体设计")])])}],!1,null,null,null);i.options.__file="generalProtocolDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/166.d8e0213d.js b/docs/.vuepress/dist/assets/js/166.d8e0213d.js new file mode 100644 index 00000000..81e1dbe6 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/166.d8e0213d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[166],{832:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"接口交互格式与规范"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#接口交互格式与规范","aria-hidden":"true"}},[t._v("#")]),t._v(" 接口交互格式与规范")]),t._v(" "),a("h2",{attrs:{id:"接口交互格式与规范-json-rpc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#接口交互格式与规范-json-rpc","aria-hidden":"true"}},[t._v("#")]),t._v(" 接口交互格式与规范 JSON-RPC")]),t._v(" "),a("h3",{attrs:{id:"request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Request Body")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls_accounts"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("请求参数")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("必选")]),t._v(" "),a("th",[t._v("类型")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("cmd")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("执行的 Command")])]),t._v(" "),a("tr",[a("td",[t._v("params")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("命令参数表")])]),t._v(" "),a("tr",[a("td",[t._v("min_version")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("float")]),t._v(" "),a("td",[t._v("兼容的最低版本")])])])]),t._v(" "),a("h3",{attrs:{id:"response-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Response Body")]),t._v(" "),a("ul",[a("li",[t._v("success")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("响应参数")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("必选")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("类型")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("ture")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),a("td",[t._v("请求想要状态,成功返回0。否则返回错误码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",[t._v("用户友好的请求执行结果描述")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("object")]),t._v(" "),a("td",[t._v("方法返回值")])])])]),t._v(" "),a("h3",{attrs:{id:"error-code"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-code","aria-hidden":"true"}},[t._v("#")]),t._v(" Error Code")]),t._v(" "),a("h4",{attrs:{id:"json-rpc-standard-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-rpc-standard-errors","aria-hidden":"true"}},[t._v("#")]),t._v(" JSON RPC Standard errors")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Code")]),t._v(" "),a("th",[t._v("Possible Return message")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Success")]),t._v(" "),a("td",[t._v("Operation success")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("Parse error")]),t._v(" "),a("td",[t._v("Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Invalid Request")]),t._v(" "),a("td",[t._v("The JSON sent is not a valid Request object.")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("Method not found")]),t._v(" "),a("td",[t._v("The method does not exist / is not available.")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("Invalid params")]),t._v(" "),a("td",[t._v("Invalid method parameter(s).")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("Internal error")]),t._v(" "),a("td",[t._v("Internal JSON-RPC error.")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("Unauthorized")]),t._v(" "),a("td",[t._v("Should be used when some action is not authorized, e.g. sending from a locked account.")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("Action not allowed")]),t._v(" "),a("td",[t._v("Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("Timeout")]),t._v(" "),a("td",[t._v("Should be used when an action timedout.")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("Conflict")]),t._v(" "),a("td",[t._v("Should be used when an action conflicts with another (ongoing?) action.")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("Execution error")]),t._v(" "),a("td",[t._v("Will contain a subset of custom errors in the data field. See below.")])]),t._v(" "),a("tr",[a("td",[t._v("11 to 100")]),t._v(" "),a("td",[a("code",[t._v("Server error")])]),t._v(" "),a("td",[t._v("Reserved for implementation-defined server-errors.")])])])]),t._v(" "),a("h4",{attrs:{id:"custom-error-fields"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-error-fields","aria-hidden":"true"}},[t._v("#")]),t._v(" Custom error fields")]),t._v(" "),a("p",[t._v("Custom error "),a("code",[t._v("10")]),t._v(" can contain custom error(s) to further explain what went wrong.")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n code"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Execution error'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);r.options.__file="interfaceStandard.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/167.778d1b2a.js b/docs/.vuepress/dist/assets/js/167.778d1b2a.js new file mode 100644 index 00000000..157676cc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/167.778d1b2a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[167],{829:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("本文档为NULS2.0 alpha版本测试网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("Linux内核版本推荐使用 2.6.32及以上")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("ul",[t._m(15),t._v(" "),s("li",[s("p",[t._v("进入"),s("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官网钱包下载"),s("OutboundLink")],1),t._v("界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。")]),t._v(" "),s("p",[t._v("Linux系统中下载v2.0.0-alpha-1版的钱包可以使用如下命令:")]),t._v(" "),t._m(16),s("p",[t._v("注:如果后续有其他版本,下载地址可能会不同。")])])]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),s("p",[t._v("输出打印所有的命令,")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),s("p",[t._v("返回信息 help")]),t._v(" "),t._m(30),s("p",[t._v("返回信息 help -a")]),t._v(" "),t._m(31),s("p",[t._v("示例")]),t._v(" "),t._m(32),t._m(33),t._v(" "),s("p",[t._v("创建账户,返回账户地址集合")]),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),s("p",[t._v("创建账户时,将会提示输入密码,为了保证资产安全,必须给账户设置密码;")]),t._v(" "),s("p",[t._v("返回账户集合")]),t._v(" "),t._m(36),s("p",[t._v("示例")]),t._v(" "),s("p",[t._v("创建1个账户")]),t._v(" "),t._m(37),s("p",[t._v("一次创建多个账户")]),t._v(" "),t._m(38),t._m(39),t._v(" "),s("p",[t._v("备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件")]),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(42),s("p",[t._v("示例 备份一个有密码的账户")]),t._v(" "),t._m(43),t._m(44),t._v(" "),s("p",[t._v("根据账户地址移除本地账户,需要输入密码")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(47),s("p",[t._v("示例")]),t._v(" "),t._m(48),t._m(49),t._v(" "),s("p",[t._v("根据账户地址和账户密码重新设置新密码。")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(52),s("p",[t._v("示例")]),t._v(" "),t._m(53),t._m(54),t._v(" "),s("p",[t._v("给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),s("p",[t._v("返回信息 交易hash")]),t._v(" "),t._m(57),s("p",[t._v("示例")]),t._v(" "),t._m(58),t._m(59),t._v(" "),s("p",[t._v("导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),s("p",[t._v("注意:导入keystore文件生成账户时,需要原始密码")]),t._v(" "),s("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(62),s("p",[t._v("示例")]),t._v(" "),t._m(63),t._m(64),t._v(" "),s("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将覆盖,导入时需要给账户设置密码。此功能可以用于忘记账户密码后,通过私钥重新找回账户。")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),s("p",[t._v("示例")]),t._v(" "),t._m(68),t._m(69),t._v(" "),s("p",[t._v("根据账户地址查询账户信息")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(72),s("p",[t._v("示例")]),t._v(" "),t._m(73),t._m(74),t._v(" "),s("p",[t._v("根据分页参数查询账户列表,所有账户以创建时间倒序输出。")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),s("p",[t._v("返回信息,将输出账户集合")]),t._v(" "),t._m(77),s("p",[t._v("示例 获取账户列表")]),t._v(" "),t._m(78),t._m(79),t._v(" "),s("p",[t._v("根据账户地址个密码查询账户私钥")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("返回信息 导入的账户的私钥(未加密)")]),t._v(" "),t._m(82),s("p",[t._v("示例")]),t._v(" "),t._m(83),t._m(84),t._v(" "),s("p",[t._v("根据账户地址查询账户余额")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),s("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(87),s("p",[t._v("示例")]),t._v(" "),t._m(88),t._m(89),t._v(" "),s("p",[t._v("根据账户地址或别名将NULS转入另一账户地址或别名中")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),s("p",[t._v("返回信息 转账交易hash")]),t._v(" "),t._m(92),s("p",[t._v("示例")]),t._v(" "),t._m(93),t._m(94),t._v(" "),s("p",[t._v("根据交易hash查询交易详细信息")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(97),s("p",[t._v("示例 查询转账交易")]),t._v(" "),t._m(98),t._m(99),t._v(" "),t._m(100),t._m(101),t._v(" "),s("p",[t._v("根据账户地址创建节点,创建节点时需要提供两个地址,第一个地址为节点地址,需要输入节点地址账户密码,第二地址为打包地址,不需要输入密码。同时需要至少20000NULS的保证金。")]),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),s("p",[t._v("返回信息 返回节点的agent hash")]),t._v(" "),t._m(104),s("p",[t._v("示例 创建一个节点,佣金比例为10%,押金20000NULS。")]),t._v(" "),t._m(105),t._m(106),t._v(" "),s("p",[t._v("根据账户地址和节点agentHash,加入共识,至少需要2000NULS")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),s("p",[t._v("返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。")]),t._v(" "),t._m(109),s("p",[t._v("示例")]),t._v(" "),t._m(110),t._m(111),t._v(" "),s("p",[t._v("根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。")]),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),s("p",[t._v("返回信息 退出共识交易hash")]),t._v(" "),t._m(114),s("p",[t._v("示例")]),t._v(" "),t._m(115),t._m(116),t._v(" "),s("p",[t._v("停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。")]),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),s("p",[t._v("返回信息 停止节点交易hash")]),t._v(" "),t._m(119),s("p",[t._v("示例")]),t._v(" "),t._m(120),t._m(121),t._v(" "),s("p",[t._v("获取最新的区块头信息")]),t._v(" "),t._m(122),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(123),s("p",[t._v("示例")]),t._v(" "),t._m(124),t._m(125),t._v(" "),s("p",[t._v("根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(128),s("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(129),t._m(130),t._v(" "),s("p",[t._v("根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(133),s("p",[t._v("示例 根据高度获取区块头")]),t._v(" "),t._m(134),t._m(135),t._v(" "),s("p",[t._v("调用此接口在链上创建一个智能合约")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),s("p",[t._v("返回信息 创建合约的交易hash和合约的地址")]),t._v(" "),t._m(138),s("p",[t._v("示例 创建一个合约(contractCode 省略中间部分)")]),t._v(" "),t._m(139),t._m(140),t._v(" "),s("p",[t._v("获取智能合约的描述信息以及构造函数、调用方法的参数列表")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(143),s("p",[t._v("示例")]),t._v(" "),t._m(144),t._m(145),t._v(" "),s("p",[t._v("调用智能合约提供的函数")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),s("p",[t._v("返回信息 本次调用的交易hash")]),t._v(" "),t._m(148),t._m(149),t._v(" "),t._m(150),t._m(151),t._v(" "),s("p",[t._v("停止一个可用的智能合约")]),t._v(" "),t._m(152),t._v(" "),t._m(153),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(154),s("p",[t._v("示例")]),t._v(" "),t._m(155),t._m(156),t._v(" "),s("p",[t._v("调用合约的视图方法,会立即返回结果,不会产生交易")]),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(159),s("p",[t._v("示例 调用NRC20-Token合约的查询Token余额函数查询指定地址的Token余额")]),t._v(" "),t._m(160),t._m(161),t._v(" "),s("p",[t._v("向指定的合约地址转入主网币")]),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(164),s("p",[t._v("示例 向指定合约转入2个NULS")]),t._v(" "),t._m(165),t._m(166),t._v(" "),s("p",[t._v("NRC20 token转账")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),s("p",[t._v("返回值 交易hash")]),t._v(" "),t._m(169),s("p",[t._v("示例 token转账:")]),t._v(" "),t._m(170),t._m(171),t._v(" "),s("p",[t._v("获取合约的交易信息, 包含交易详情,合约调用参数,合约执行结果")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(174),s("p",[t._v("示例")]),t._v(" "),t._m(175),t._m(176),t._v(" "),s("p",[t._v("获取一个合约的执行结果")]),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(179),s("p",[t._v("示例")]),t._v(" "),t._m(180),t._m(181),t._v(" "),s("p",[t._v("获取创建指定合约时需要传入的参数列表")]),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(184),s("p",[t._v("示例")]),t._v(" "),t._m(185),t._m(186),t._v(" "),s("p",[t._v("获取指定账户地址所创建的合约列表")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),s("p",[t._v("返回值")]),t._v(" "),t._m(189),s("p",[t._v("示例")]),t._v(" "),t._m(190),t._m(191),t._v(" "),s("p",[t._v("查询网络基本信息")]),t._v(" "),t._m(192),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(193),s("p",[t._v("示例")]),t._v(" "),t._m(194),t._m(195),t._v(" "),s("p",[t._v("查询网络节点IP")]),t._v(" "),t._m(196),t._v(" "),s("p",[t._v("返回信息")]),t._v(" "),t._m(197),s("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(198),t._m(199),t._v(" "),s("p",[t._v("退出操作钱包的命令行程序,不会退出已启动的钱包节点。")]),t._v(" "),t._m(200),t._v(" "),s("p",[t._v("示例")]),t._v(" "),t._m(201)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"alpha-nuls2-0-cli-使用指南"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#alpha-nuls2-0-cli-使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" [Alpha]NULS2.0 CLI 使用指南")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"版本更新记录"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内容")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("2018-03-18")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("alpha版功能")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"准备"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#准备","aria-hidden":"true"}},[this._v("#")]),this._v(" 准备")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"服务器硬件配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#服务器硬件配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 服务器硬件配置")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("建立NULS节点的服务器不低于如下配置:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("四核 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("128G硬盘")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("20M上行")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("推荐配置:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("八核 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("256G硬盘")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("100M上行")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"系统及内核版本"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#系统及内核版本","aria-hidden":"true"}},[this._v("#")]),this._v(" 系统及内核版本")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux系统")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS 6,7")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"开始"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 开始")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"下载"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#下载","aria-hidden":"true"}},[this._v("#")]),this._v(" 下载")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"安装"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[this._v("#")]),this._v(" 安装")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("在Linux中解压已下载的文件")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"运行"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#运行","aria-hidden":"true"}},[this._v("#")]),this._v(" 运行")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("进入解压后的目录,并运行启动脚本,启动全节点钱包")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ cd NULS-Wallet-linux64-2.0.0-alpha-1\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"使用钱包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#使用钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 使用钱包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"快速入门"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。")]),t._v(" "),s("p",[t._v("进入cmdclient/1.0.0目录,执行如下命令:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ cd cmdclient/1.0.0\n$ ./cmd.sh\n")])])]),s("p",[t._v("将会出现NULS命名输入提示符"),s("code",[t._v("nuls>>>")]),t._v(" ,然后可直接输入NULS钱包操作命令,来进行操作。")]),t._v(" "),s("p",[t._v("例如,创建账户的示例如下:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),s("p",[t._v("执行"),s("code",[t._v("create")]),t._v("命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"约定"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("设置密码规则:密码长度在8至20位,必须同时包含字母和数字。")]),this._v(" "),e("li",[this._v('命令参数说明: 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"钱包命令"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#钱包命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 钱包命令")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"帮助命令"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#帮助命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 帮助命令")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令: help [-a]|[group]|[command]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("参数")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("-a")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("格式化打印命令,选填")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("command")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("查看指定命令使用说明")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("group")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("查看指定命令组的所有命令使用说明")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n\tOPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\nnuls>>> help account\nnuls>>> help create\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令: create [number]")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("创建账户的数量,选填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create \nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 3\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"备份账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:backup
[path]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("[path]")]),t._v(" "),s("td",[t._v("文件生成备份文件的目标文件夹,默认为当前文件夹,选填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj\nEnter account password\n***************\nThe path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"移除账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 移除账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:remove
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\nEnter your password for account**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"修改账户密码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#修改账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改账户密码")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:resetpwd
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N\nEnter your old password:**********\nEnter new password**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"设置别名"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:setalias
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户的地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("别名名称,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("txHash"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[this._v("0020")]),this._v('f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj\nEnter your account password**********\ntxHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"导入账户keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#导入账户keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:importkeystore ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("待导入的keystore文件地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"导入账户私钥"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:import ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccount
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("账户地址,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //加密后的私钥\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //别名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baglance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //冻结的资产数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //总的资产数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),t._v(" //可用的资产数量\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //账户地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),t._v(" //公钥\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n{\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //加密后的私钥\n "alias" : "zlj", //别名\n "baglance" : { \n "freeze" : 0, //冻结的资产数量\n "total" : 997999999800000, //总的资产数量\n "available" : 997999999800000 //可用的资产数量\n },\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //账户地址\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //加密后的公钥\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户列表")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccounts ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //别名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //公钥\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),t._v(" //私钥\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts\n[ {\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //地址\n "alias" : null, //别名\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //加密后的公钥\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //加密后的私钥\n}, {\n "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",\n "alias" : null,\n "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",\n "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"\n}, {\n "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",\n "alias" : "zlj",\n "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",\n "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户私钥"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户私钥")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getprikey
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token number"}},[this._v("00")]),this._v("a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9\nEnter your account password**********\n7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询账户余额"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户余额")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getbalance
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户的地址,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//余额\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//已锁定余额\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//可用余额\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "total" : "9999998.99",\n "freeze" : "0",\n "available" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:transfer | | [remark] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出地址(与formAlias任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出地址别名(与formAddress任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("接收地址(与toAlias任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("接收地址别名(与toAddress任选一项)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转账数量,必填")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注信息,选填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询交易详情"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易详情")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:gettx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash,必填")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //交易类型(枚举说明见下表【type 枚举类型说明】)\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinData"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txData"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1552979783918")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"transactionSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg=="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"6L2s6LSm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestAlgType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestBytes"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestHex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f"')]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("341")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONFIRMED"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //确认状态\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("225")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inBlockIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinDataInstance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABmAU91zVafgSLoRrxnHo7k3r/Azg="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"79acNPim+aw="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABL/80LO1f8vxvfNXc5l9eeIDTGKM="')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //手续费\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"multiSignTx"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f\n{\n "type" : 2, //交易类型(枚举说明见下表【type 枚举类型说明】)\n "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",\n "txData" : null,\n "time" : 1552979783918,\n "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",\n "remark" : "6L2s6LSm",\n "hash" : {\n "digestAlgType" : 0,\n "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", \n "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" \n },\n "blockHeight" : 341, //区块高度\n "status" : "CONFIRMED", //确认状态\n "size" : 225,\n "inBlockIndex" : 0,\n "coinDataInstance" : { \n "from" : [ {\n "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100100000,\n "nonce" : "79acNPim+aw=",\n "locked" : 0\n } ],\n "to" : [ {\n "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100000000,\n "lockTime" : 0\n } ]\n },\n "fee" : 100000, //手续费\n "multiSignTx" : false\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"type-枚举类型说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#type-枚举类型说明","aria-hidden":"true"}},[this._v("#")]),this._v(" type 枚举类型说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("/** coinbase交易*/\n int TX_TYPE_COINBASE = 1;\n /** 转账交易*/\n int TX_TYPE_TRANSFER = 2;\n /** 设置别名*/\n int TX_TYPE_ALIAS = 3;\n /** 创建共识节点交易*/\n int TX_TYPE_REGISTER_AGENT = 4;\n /** 委托交易(加入共识)*/\n int TX_TYPE_JOIN_CONSENSUS = 5;\n /** 取消委托交易(退出共识)*/\n int TX_TYPE_CANCEL_DEPOSIT = 6;\n /** 黄牌惩罚*/\n int TX_TYPE_YELLOW_PUNISH = 7;\n /** 红牌惩罚*/\n int TX_TYPE_RED_PUNISH = 8;\n /** 停止节点(删除共识节点)*/\n int TX_TYPE_STOP_AGENT = 9;\n /** 跨链转账交易*/\n int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;\n /** 注册链交易*/\n int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;\n /** 销毁链*/\n int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;\n /** 为链新增一种资产*/\n int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;\n /** 删除链上资产*/\n int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;\n /** 创建智能合约交易*/\n int TX_TYPE_CREATE_CONTRACT = 100;\n /** 调用智能合约交易*/\n int TX_TYPE_CALL_CONTRACT = 101;\n /** 删除智能合约交易*/\n int TX_TYPE_DELETE_CONTRACT = 102;\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:createagent ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建节点的账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("代理佣金比例,范围:10~100,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建节点的保证金,不能低于20000NULS,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"加入共识(委托节点)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#加入共识(委托节点)","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入共识(委托节点)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deposit
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("节点的agentHash,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("加入共识保证金,不能低于2000NULS,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"退出共识(退出委托)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#退出共识(退出委托)","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识(退出委托)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:withdraw
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("账户地址,必填")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("委托时的交易hash,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"停止节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#停止节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 停止节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:stopagent
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("账户地址,必填")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取最新的区块头信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取最新的区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取最新的区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getbestblockheader")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //上一个区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //包含的交易数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块签名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",\n "time" : "2019-03-19 18:26:20.020",\n "height" : 1479,\n "txCount" : 0,\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",\n "size" : 0,\n "packingAddress" : null,\n "roundIndex" : 155299118,\n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1,\n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询区块头信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getblock | ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的hash值")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的高度")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //上一个区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //包含的交易数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块签名\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //区块hash\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //上一个区块hash\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash\n "time" : "2019-03-19 18:26:20.020", //打包时间\n "height" : 1479, //区块高度\n "txCount" : 1, //包含的交易数\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名\n "size" : 0, //区块大小\n "packingAddress" : null, //打包地址\n "roundIndex" : 155299118, \n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1, \n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询区块头信息-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getblockheader | ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的hash值")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("区块的高度")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"创建智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:createcontract [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("创建智能合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("本次创建合约最大消耗的Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约代码的hex编码")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //交易hash\n "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //合约地址\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo\nThe arguments structure: \n[ {\n "type" : "String",\n "name" : "name",\n "required" : true\n}, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n}, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n}, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n} ]\nPlease enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'").\nEnter the arguments:"KQB","KQB",10000,2\n{\n "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约基本信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约基本信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约基本信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractinfo ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("合约地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 ,见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\nnuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ngetcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\n{\n "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "createTime" : 1553563706022,\n "blockHeight" : 46,\n "isNrc20" : true,\n "nrc20TokenName" : "QKB",\n "nrc20TokenSymbol" : "QKB",\n "decimals" : 2,\n "totalSupply" : "200000000",\n "status" : "normal",\n "method" : [ {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },{\n "name" : "transfer",\n "desc" : "(Address to, BigInteger value) return boolean",\n "args" : [ {\n "type" : "Address",\n "name" : "to",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "value",\n "required" : true\n } ],\n "returnArg" : "boolean",\n "view" : false,\n "event" : false,\n "payable" : false\n }]\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"调用智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#调用智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 调用智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:callcontract [-d methodDesc] [-r remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调动合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("本次合约执行最大消耗的Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约的方法名")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("如果要向合约转账,转账的数量")])]),t._v(" "),s("tr",[s("td",[t._v("[-d methodDesc]")]),t._v(" "),s("td",[t._v("如果合约中有同名方法时,使用此方法来描述参数列表")])]),t._v(" "),s("tr",[s("td",[t._v("[-r remark]")]),t._v(" "),s("td",[t._v("备注信息")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("示例 调用一个指定合约的NRC20-Token转账函数, 示例中"),e("code",[this._v("tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L")]),this._v("为NRC20合约地址,输入的参数为 接收地址和转账数量")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\ncallcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\nPlease Enter your account passwordzhoujun172\n**********\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2\n"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"删除智能合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#删除智能合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 删除智能合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deletecontract ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用合约的账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的合约地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ndeletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\nPlease enter your account passwordzhoujun172\n**********\n"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"调用合约视图方法"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#调用合约视图方法","aria-hidden":"true"}},[this._v("#")]),this._v(" 调用合约视图方法")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:deletecontractviewcontract [-d methodDesc] --view contract")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的合约地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("调用的方法")])]),t._v(" "),s("tr",[s("td",[t._v("[-d methodDesc]")]),t._v(" "),s("td",[t._v("如果合约中有同名方法时,使用此方法来描述参数列表")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("根据具体调用函数返回值不同\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nviewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n{\n "result" : "20000000"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"向合约地址转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#向合约地址转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 向合约地址转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:transfertocontract [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转入数量")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark\nPlease enter your account password\n**********\n"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"token转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token转账","aria-hidden":"true"}},[this._v("#")]),this._v(" token转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:tokentransfer [remark]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("参数")]),t._v(" "),s("th",[t._v("说明")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转出账户地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("合约地址")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("转入数量")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("备注")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000\nPlease enter your account password\n**********\n"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontracttx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\ngetcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "type" : "100",\n "time" : "2019-03-26 09:28:26",\n "blockHeight" : 46,\n "fee" : 0.0,\n "value" : 0.0,\n "remark" : null,\n "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",\n "status" : "confirm",\n "confirmCount" : 0,\n "size" : 6686,\n "inputs" : [ {\n "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "assetsChainId" : 2,\n "assetsId" : 1,\n "amount" : "5700000",\n "nonce" : "ffffffff",\n "locked" : 0,\n "value" : 0.0\n } ],\n "outputs" : [ ],\n "txData" : {\n "data" : {\n "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "value" : 0.0,\n "hexCode" : "504b03040a0000080...........31600000000",\n "gasLimit" : 200000,\n "price" : "0.00000025",\n "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]\n }\n },\n "contractResult" : {\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n }\n}\n\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约执行结果"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约执行结果","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约执行结果")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractresult ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取合约构造函数"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取合约构造函数","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取合约构造函数")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getcontractcontructor ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("合约代码的hex编码")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("略 见示例\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000\n{\n "constructor" : {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },\n "isNrc20" : true\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"获取指定账户创建的合约列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取指定账户创建的合约列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取指定账户创建的合约列表")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:getaccountcontracts ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("参数")]),this._v(" "),e("th",[this._v("说明")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("账户地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\n[ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",\n "createTime" : "2019-03-25 16:08:25.025",\n "height" : 253,\n "confirmCount" : 195,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",\n "createTime" : "2019-03-25 15:33:54.054",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询网络信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询网络信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:network info **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//本地最新区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络最新区块高度\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络时间偏移值\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//被动连接节点数量\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//主动连接节点数量\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network info\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"查询网络节点ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查询网络节点ip","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络节点IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**命令:network nodes **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network nodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"退出钱包命令程序"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#退出钱包命令程序","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出钱包命令程序")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("命令:exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="linuxTutorial.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/168.6ad455d7.js b/docs/.vuepress/dist/assets/js/168.6ad455d7.js new file mode 100644 index 00000000..1b47666d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/168.6ad455d7.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[168],{825:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"钱包增加随机种子"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#钱包增加随机种子","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包增加随机种子")]),t._v(" "),a("h2",{attrs:{id:"一-、钱包增加随机种子rpc接口"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一-、钱包增加随机种子rpc接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 一 、钱包增加随机种子RPC接口")]),t._v(" "),a("p",[t._v("获取的随机种子是大数字,注意,它可能是负数")]),t._v(" "),a("h3",{attrs:{id:"根据高度区间获取随机种子列表:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据高度区间获取随机种子列表:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据高度区间获取随机种子列表:")]),t._v(" "),a("p",[t._v("URL:/random/seeds/height")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("startHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间起始高度")])]),t._v(" "),a("tr",[a("td",[t._v("endHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间截止高度,不能超过startHeight+1000")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("种子数组")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),a("h3",{attrs:{id:"根据高度区间获取随机种子列表:-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据高度区间获取随机种子列表:-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据高度区间获取随机种子列表:")]),t._v(" "),a("p",[t._v("URL:/random/seeds/count")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("height")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("获取种子列表的最高高度")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("随机种子数量,不能超过128")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("种子数组")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),a("h3",{attrs:{id:"根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:")]),t._v(" "),a("p",[t._v("URL:/random/seed/height")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("startHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间起始高度")])]),t._v(" "),a("tr",[a("td",[t._v("endHeight")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("区间截止高度,endHeight-startHeight<=1000")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("默认为sha3算法,支持sha3、KECCAK、merkle算法")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("Object")]),t._v(" "),a("td",[t._v("结果对象")])]),t._v(" "),a("tr",[a("td",[t._v("seed")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的随机种子结果")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的 算法")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("原始随机种子个数")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),a("h3",{attrs:{id:"根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:","aria-hidden":"true"}},[t._v("#")]),t._v(" 根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:")]),t._v(" "),a("p",[t._v("URL:/random/seed/count")]),t._v(" "),a("p",[t._v("Method:GET")]),t._v(" "),a("p",[t._v("Prams:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Required")]),t._v(" "),a("th",[t._v("remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("height")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("获取种子列表的最高高度")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("Long")]),t._v(" "),a("td",[t._v("True")]),t._v(" "),a("td",[t._v("随机种子数量,不能超过128")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("默认为sha3算法,支持sha3、KECCAK、merkle算法")])])])]),t._v(" "),a("p",[t._v("Returns:")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("field")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("success")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否成功")])]),t._v(" "),a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("Object")]),t._v(" "),a("td",[t._v("结果对象")])]),t._v(" "),a("tr",[a("td",[t._v("seed")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的随机种子结果")])]),t._v(" "),a("tr",[a("td",[t._v("algorithm")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("计算的 算法")])]),t._v(" "),a("tr",[a("td",[t._v("count")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("原始随机种子个数")])])])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("p",[t._v("Request:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),a("p",[t._v("Response:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),a("h2",{attrs:{id:"二、智能合约支持底层链随机数"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、智能合约支持底层链随机数","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、智能合约支持底层链随机数")]),t._v(" "),a("p",[t._v("与以上RPC接口相同,在智能合约SDK中支持了相同的方法来获取底层区块链提供的随机数种子,如以下代码。\n后面将以其中一个方法"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v("为例,展示如何使用随机数种子产生随机数。")]),t._v(" "),a("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用特定的算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @param algorithm hash算法标识\n * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合\n *\n * @param endHeight 截止高度\n * @param seedCount 原始种子数量\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]根据高度范围,获取原始种子的集合\n *\n * @param startHeight 起始高度\n * @param endHeight 截止高度\n * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"_2)-例子同时摇n一个骰子"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2)-例子同时摇n一个骰子","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) 例子"),a("code",[t._v("同时摇N一个骰子")])]),t._v(" "),a("h4",{attrs:{id:"_2-1-计算方式一"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-计算方式一","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) 计算方式一")]),t._v(" "),a("ul",[a("li",[t._v("获取原始种子"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),a("li",[t._v("根据骰子范围求模得到第一个随机数")]),t._v(" "),a("li",[t._v("下一个随机数的计算方式\n"),a("ul",[a("li",[t._v("原始种子乘以投掷次数,得到的结果转换成字节数组")]),t._v(" "),a("li",[t._v("把字节数组进行SHA3-256得到32位字节数组的Hash")]),t._v(" "),a("li",[t._v("把此Hash的字节数组转换为BigInteger大数字")]),t._v(" "),a("li",[t._v("将此BigInteger大数字根据骰子范围求模得到下一个随机数")]),t._v(" "),a("li",[t._v("以此类推")])])])]),t._v(" "),a("p",[a("strong",[t._v("参考以下代码")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_2-2-计算方式二"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-计算方式二","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) 计算方式二")]),t._v(" "),a("ul",[a("li",[t._v("获取原始种子"),a("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),a("li",[t._v("根据骰子范围求模得到第一个随机数")]),t._v(" "),a("li",[t._v("下一个随机数的计算方式\n"),a("ul",[a("li",[t._v("获取原始种子大数字的末位数字(根据投掷次数获取倒数第几位),将此末位数字乘以原始种子,得到的结果转换成字节数组")]),t._v(" "),a("li",[t._v("把字节数组进行SHA3-256得到32位字节数组的Hash")]),t._v(" "),a("li",[t._v("把此Hash的字节数组转换为BigInteger大数字")]),t._v(" "),a("li",[t._v("将此BigInteger大数字根据骰子范围求模得到下一个随机数")]),t._v(" "),a("li",[t._v("以此类推")])])])]),t._v(" "),a("p",[a("strong",[t._v("参考以下代码")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/169.f26a480a.js b/docs/.vuepress/dist/assets/js/169.f26a480a.js new file mode 100644 index 00000000..be465555 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/169.f26a480a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[169],{823:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"rpc-tool-websocket设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rpc-tool-websocket设计","aria-hidden":"true"}},[t._v("#")]),t._v(" RPC-Tool-WebSocket设计")]),t._v(" "),a("h1",{attrs:{id:"websocket-tool设计文档——第四版"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#websocket-tool设计文档——第四版","aria-hidden":"true"}},[t._v("#")]),t._v(" Websocket-Tool设计文档——第四版")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"写在最前的话"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#写在最前的话","aria-hidden":"true"}},[t._v("#")]),t._v(" 写在最前的话")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("如果想知道websocket的具体设计,请逐步阅读本文档\n\n如果只想知道如何使用,请跳转到章节《7.1 如何使用》\n")])])]),a("h2",{attrs:{id:"一、总体描述"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),a("h3",{attrs:{id:"_1-1-概述"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 概述")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-为什么要有《websocket-tool》"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《websocket-tool》","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《Websocket-Tool》")]),t._v(" "),a("ul",[a("li",[t._v("NULS 2.0根据功能划分模块,所有模块隔离,可以独立运行。")]),t._v(" "),a("li",[t._v("模块间通过《Websocket-Tool》调用接口")]),t._v(" "),a("li",[t._v("模块只要实现了规定接口,可以用任何语言实现")]),t._v(" "),a("li",[t._v("模块可以分布式部署")]),t._v(" "),a("li",[t._v("《Websocket-Tool》会打包成jar包,供各模块引用")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-《websocket-tool》要做什么"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《websocket-tool》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《Websocket-Tool》要做什么")]),t._v(" "),a("p",[t._v("所有模块间的接口调用都通过《Websocket-Tool》进行")]),t._v(" "),a("ul",[a("li",[t._v("启动Websocket Server")]),t._v(" "),a("li",[t._v("注册当前模块的所有cmd命令")]),t._v(" "),a("li",[t._v("把当前模块信息汇报给kernel")]),t._v(" "),a("li",[t._v("接收从kernel推送的所有模块信息")]),t._v(" "),a("li",[t._v("启动Websocket Client")]),t._v(" "),a("li",[t._v("维护调用过程产生的数据")]),t._v(" "),a("li",[t._v("封装所有数据中间处理过程,各模块只需要关心\n"),a("ul",[a("li",[t._v("输入")]),t._v(" "),a("li",[t._v("输出")])])]),t._v(" "),a("li",[t._v("各模块通过尽可能简单的方式调用cmd命令")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-《websocket-tool》在系统中的定位"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《websocket-tool》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《Websocket-Tool》在系统中的定位")]),t._v(" "),a("p",[t._v("《Websocket-Tool》是底层框架,任何模块都会依赖")]),t._v(" "),a("p",[t._v("《Websocket-Tool》维护各模块基础信息,但是不涉及具体业务")]),t._v(" "),a("h2",{attrs:{id:"二、功能设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),a("h3",{attrs:{id:"_2-1-架构图"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 架构图")]),t._v(" "),a("h2",{attrs:{id:"三、接口设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#三、接口设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 三、接口设计")]),t._v(" "),a("h2",{attrs:{id:"四、事件说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 四、事件说明")]),t._v(" "),a("h2",{attrs:{id:"五、协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 五、协议")]),t._v(" "),a("h3",{attrs:{id:"_5-1-通信协议-–-json-websockets"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-通信协议-–-json-websockets","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 通信协议 – Json/WebSockets")]),t._v(" "),a("p",[t._v("微服务的行为不像标准的客户端 - 服务器基础设施,因为每个微服务同时是客户端和服务器,因此需要全双工通信协议,这允许实现特殊类型的发布 - 订阅模式; 在这个实现中,方法只能被调用一次,然后调用者可以通过两种不同的方式接收不断的更新:")]),t._v(" "),a("ul",[a("li",[t._v("基于事件:当方法在预定义数量的事件之后发送通知时")]),t._v(" "),a("li",[t._v("基于时间:当方法在预定义的秒数后发送通知时")])]),t._v(" "),a("p",[t._v("WebSocket是一种成熟的选项,可以本机提供全双工连接,其他选项如标准Json-RPC不提供双向通道。\n消息将使用JSon格式进行编码,因为它是最广泛用于消息交换的,并且易于调试。")]),t._v(" "),a("h3",{attrs:{id:"_5-2-消息结构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-消息结构","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 消息结构")]),t._v(" "),a("p",[t._v("所有消息都有一个由5个字段组成的公共基础结构:")]),t._v(" "),a("ul",[a("li",[t._v("MessageID:这是一个标识请求的字符串。 它的长度不应超过256个字符")]),t._v(" "),a("li",[t._v("Timestamp:自纪元以来的秒数(1970年1月1日格林威治标准时间00:00:00)")]),t._v(" "),a("li",[t._v("TimeZone:发起请求的时区,它应为介于-12和12之间的数字")]),t._v(" "),a("li",[t._v("MessageType:消息类型,这些在第3节中指定")]),t._v(" "),a("li",[t._v("MessageData:保存消息有效负载的Json对象")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompressionRate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompressionAlgorithm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlib"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_5-3-message-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-message-types","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3 Message Types")]),t._v(" "),a("p",[t._v("目前只定义了9种类型的消息:NegotiateConnection, NegotiateConnectionResponse, Request, Unsubscribe, Response, Ack, Notificatioin, RegisterCompoundMethod, UnregisterCompoundMethod")]),t._v(" "),a("h4",{attrs:{id:"_5-3-1-negotiateconnection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-1-negotiateconnection","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.1 NegotiateConnection")]),t._v(" "),a("p",[t._v("这应该是在与微服务建立连接时应该发送的第一个对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。")]),t._v(" "),a("p",[t._v("它由两个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。")]),t._v(" "),a("li",[t._v("CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543133816985"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnection"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"protocolVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compressionAlgorithm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlib"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compressionRate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-2-negotiateconnectionresponse"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-2-negotiateconnectionresponse","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.2 NegotiateConnectionResponse")]),t._v(" "),a("p",[t._v("仅在响应先前传入的NegotiateConnection消息时发送此类消息。 它由两个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1")]),t._v(" "),a("li",[t._v("NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NegotiateConnectionReponse"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NegotiationStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NegotiationComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Incompatible protocol version"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-3-request"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-3-request","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.3 Request")]),t._v(" "),a("p",[t._v("调用者服务必须发送一个Request对象来执行Nulstar网络内某些服务提供的方法。")]),t._v(" "),a("p",[t._v("如果在单个请求对象中包含两个或更多方法,则应按顺序执行方法,然后发送一个response包喊所有回执信息,如果其中一个请求失败,则整个操作被视为失败。")]),t._v(" "),a("p",[t._v("它由六个字段组成:")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("RequestAck(默认值:0):这是一个布尔值")]),t._v(" "),a("ul",[a("li",[t._v("0:发出的请求只需要一条Response消息,如果它订阅了该函数,那么它可能会有很多响应消息")]),t._v(" "),a("li",[t._v("1:发出的请求需要Ack和Response(译者注:有的请求可能需要一段时间处理,不会立刻返回Response,但是我要确保对方接收到了我的请求),如果它订阅了该函数,那么它可能会有很多响应消息")])])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionEventCounter(默认值:0):这是一个无符号整数,指定目标方法发送Response的值的"),a("code",[t._v("改变次数")]),t._v("。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每改变两次就发送。以此类推。")])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionPeriod(默认值:0):这是一个无符号整数,指定目标方法发送Response的时间间隔。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每2秒都会检测是否发送。以此类推。")])]),t._v(" "),a("li",[a("p",[t._v("SubscriptionRange:如果请求的事件返回的是一个数字,则定义何时返回这个数字。\n这是一个字符串,表示将触发响应的条件。 字符串是一对带符号的十进制数,第一个是下限,第二个是上限,如果不可用则为空。 如果该对分别以“(”或“)”开始或结束,则表示该数字不包括在内,如果该对分别以“[”或“]”开始或结束,则表示该数字包括在内。")]),t._v(" "),a("p",[t._v("示例:假设我们只希望仅在余额等于或大于1000时收到通知。然后,getbalance请求应以“[1000,)”字符串作为SubscriptionRange参数发送")])]),t._v(" "),a("li",[a("p",[t._v("ResponseMaxSize(默认值:0):无符号整数,指定方法应返回的最大对象数,值为零(默认值)表示无限制。只针对返回结果为List有效,指定的是返回的记录个数。")])]),t._v(" "),a("li",[a("p",[t._v("RequestMethods:一个数组,包含所请求的所有方法及其各自的参数")])])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543133968578"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionEventCounter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"paramName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-4-unsubscribe"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-4-unsubscribe","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.4 Unsubscribe")]),t._v(" "),a("p",[t._v("当服务不再希望从其订阅的方法接收响应时,它必须向目标服务发送Unsubscribe消息。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("UnsubscribeMethods:一个数组,包含调用者想要取消订阅的所有方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543134296019"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unsubscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"unsubscribeMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_5-3-5-response"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-5-response","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.3.5 Response")]),t._v(" "),a("p",[t._v("当目标服务完成处理请求时,应该发送响应以及操作结果。")]),t._v(" "),a("p",[t._v("它由六个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("RequestID:这是引用的原始Request消息请求ID")]),t._v(" "),a("li",[t._v("ResponseProcessingTime:目标服务处理请求所用的时间(以毫秒为单位)")]),t._v(" "),a("li",[t._v("ResponseStatus:响应状态,如果成功则为1,否则为0")]),t._v(" "),a("li",[t._v("ResponseComment:一个字符串,可以提供有关该过程结果的更多说明")]),t._v(" "),a("li",[t._v("ResponseMaxSize:响应包含每个请求的最大对象数")]),t._v(" "),a("li",[t._v("ResponseData:一个对象数组,包含已处理方法的结果,每个请求一个对象")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543134299030"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Response"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseProcessingTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Congratulations! Processing completed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight->1.3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-6-ack"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-6-ack","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.6 Ack")]),t._v(" "),a("p",[t._v("其唯一目的是通知呼叫者已成功接收请求。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("RequestID:这是引用的原始Request消息请求ID")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Ack"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"RequestID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sdj8jcf8899ekffEFefee"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-7-notification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-7-notification","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.7 Notification")]),t._v(" "),a("p",[t._v("当需要将某些事件通知给连接的组件而不期望响应消息时(例如,即将对服务执行升级时),将发送此消息类型。 通知将信息推送到其他组件,因此通知只应由Manager,Controller和Connector模块使用")]),t._v(" "),a("p",[t._v("它由四个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("NotificationAck :(默认值:0):这是一个布尔值\n"),a("ul",[a("li",[t._v("0:发出的通知不期望任何类型的消息作为回执")]),t._v(" "),a("li",[t._v("1:发出的通知需要一条Ack消息")])])]),t._v(" "),a("li",[t._v("NotificationType:通知的类别,每个服务都可以定义自己的类型,因此不需要接收方处理此字段")]),t._v(" "),a("li",[t._v("NotificationComment:字符串注释,提供有关通知原因的更多信息")]),t._v(" "),a("li",[t._v("NotificationData:与通知相关的数据,接收方不需要处理此字段")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Notification"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SystemUpgrade"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A system upgrade is about to be performed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NotificationData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Date"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-11-11"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"23:00:00"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"NewVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1.6"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-5-8-registercompoundmethod"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-8-registercompoundmethod","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.8 RegisterCompoundMethod")]),t._v(" "),a("p",[t._v("请求可以由多个方法组成,使用此消息类型,我们注册一个虚拟方法,该方法将按顺序执行其各个实际方法,如果其子方法之一失败,则虚方法返回失败。")]),t._v(" "),a("p",[t._v("某些子方法可能共享相同的参数名称,因此可以创建别名,如示例中所示。")]),t._v(" "),a("p",[t._v("它由三个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("CompoundMethodName:这是标识虚方法的字符串")]),t._v(" "),a("li",[t._v("CompoundMethodDescription:描述方法功能,在查询API以获取帮助时将提供描述")]),t._v(" "),a("li",[t._v("CompoundMethods:这是一个数组,包含构成虚方法的各自参数别名的方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"RegisterCompoundMethod"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetMyInfo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Get useful information."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"CompoundMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"GetBalance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetBalanceAddress"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"GetHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("在该示例中,正在注册一个名为GetMyInfo的虚方法,它由GetBalance和GetHeight方法组成,还为Address参数创建了一个名为GetBalanceAddress的别名。\nGetMyInfo的请求可以作为标准方法发送。")]),t._v(" "),a("p",[t._v("(我确实没看懂这个的意义在哪,感觉就是单纯为了多这么个功能,有疑问请直接找Berzeck或者坚哥,哈哈)")]),t._v(" "),a("h4",{attrs:{id:"_3-5-9-unregistercompoundmethod"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-9-unregistercompoundmethod","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.5.9 UnregisterCompoundMethod")]),t._v(" "),a("p",[t._v("此消息类型用于取消注册复合(虚拟)方法。")]),t._v(" "),a("p",[t._v("它由一个字段组成:")]),t._v(" "),a("ul",[a("li",[t._v("UnregisterCompoundMethodName:这是标识虚方法的字符串。 如果它为空,则应取消注册调用者注册的所有虚拟方法")])]),t._v(" "),a("p",[t._v("示例:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageID"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"45sdj8jcf8899ekffEFefee"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1542102459"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"TimeZone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"UnregisterCompoundMethod"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"MessageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"UnregisterCompoundMethodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GetMyInfo"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_5-4-具体细节"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-4-具体细节","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.4 具体细节")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("传输过程的所有属性都是string类型")])]),t._v(" "),a("li",[a("p",[t._v('如果是boolean类型,"1"代表true,"0"代表false')])]),t._v(" "),a("li",[a("p",[t._v("当调用一个方法的时候,调用者需要知道:提供方法的角色,以及方法的使用方式")])]),t._v(" "),a("li",[a("p",[t._v("注册的时候,Role1有method1,Role2有method2,如何定义?\n答:不需要定义,这是写在文档中的。\napiMethods = Role1Methods + Role2Methods。因此注册的时候不需要知道每个Role都包含什么方法,这些应该在文档中体现。")])]),t._v(" "),a("li",[a("p",[t._v("注册接口的字符串格式")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543204508986"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestAck"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionEventCounter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscriptionRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"registerAPI"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"apiMethods"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinEvent"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodScope"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"aaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"int"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(1,100]"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRegExp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bbb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRange"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameterValidRegExp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^[A-Za-z0-9\\\\-]+$"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDescription"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 2.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinEvent"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodMinPeriod"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodScope"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"parameters"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Role_Ledger"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"connectionInformation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"17733"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleDomain"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls.io"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleRoles"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleAbbreviation"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Chain Manager"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Manager返回各模块连接信息的字符串格式")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1543204714006"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timezone"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Response"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"messageData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"requestId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseProcessingTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseStatus"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseComment"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Congratulations! Processing completed!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseMaxSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"responseData"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"registerAPI"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Dependencies"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"14694"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ke"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8887"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cm"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"APIVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"IP"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.65"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"Port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"17733"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),a("h2",{attrs:{id:"六、配置"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#六、配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、配置")]),t._v(" "),a("h2",{attrs:{id:"七、java特有的设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、Java特有的设计")]),t._v(" "),a("h3",{attrs:{id:"_7-1-设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.1 设计")]),t._v(" "),a("blockquote",[a("p",[t._v("io.nuls.rpc")]),t._v(" "),a("blockquote",[a("p",[t._v("client")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("WsClient")]),t._v(":与其他模块建立连接的对象,完全封装,不需要开发人员关注")]),t._v(" "),a("p",[a("code",[t._v("ClientRuntime")]),t._v(":客户端运行时需要的数据,方法")]),t._v(" "),a("p",[a("code",[t._v("CmdDispatcher")]),t._v(":开发人员应该只使用它来调用接口")])]),t._v(" "),a("p",[t._v("cmd")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd_package_1")]),t._v(" "),a("p",[t._v("cmd_package_2")]),t._v(" "),a("p",[a("code",[t._v("BaseCmd")]),t._v(":所有对外提供方法的类的父类,提供success, failed方法返回Response对象")])]),t._v(" "),a("p",[t._v("info")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("Constants")]),t._v(":常量")]),t._v(" "),a("p",[a("code",[t._v("HostInfo")]),t._v(":获取IP地址,随机获得端口")])]),t._v(" "),a("p",[t._v("model")]),t._v(" "),a("blockquote",[a("p",[t._v("message")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("Message")]),t._v(":所有消息都应该用该对象进行传输")]),t._v(" "),a("p",[a("code",[t._v("MessageType")]),t._v(":消息类型(包含以下9种)")]),t._v(" "),a("p",[a("code",[t._v("Ack")]),t._v(":确认收到消息")]),t._v(" "),a("p",[a("code",[t._v("NegotiateConnection")]),t._v(":握手")]),t._v(" "),a("p",[a("code",[t._v("NegotiateConnectionResponse")]),t._v(":回复握手")]),t._v(" "),a("p",[a("code",[t._v("Notification")]),t._v(":通知")]),t._v(" "),a("p",[a("code",[t._v("Request")]),t._v(":请求调用远程方法")]),t._v(" "),a("p",[a("code",[t._v("Response")]),t._v(":回复Request")]),t._v(" "),a("p",[a("code",[t._v("Unsubscribe")]),t._v(":取消订阅的远程方法")]),t._v(" "),a("p",[a("code",[t._v("RegisterCompoundMethod")]),t._v(":订阅多个远程方法")]),t._v(" "),a("p",[a("code",[t._v("UnregisterCompoundMethod")]),t._v(":取消订阅多个远程方法")])]),t._v(" "),a("p",[a("code",[t._v("CmdAnnotation")]),t._v(":注解类,有该注解的方法可以对外提供接口")]),t._v(" "),a("p",[a("code",[t._v("Parameter")]),t._v(":注解类,用以描述对外提供接口的参数信息")]),t._v(" "),a("p",[a("code",[t._v("Parameters")]),t._v(":注解类,Parameter的集合")]),t._v(" "),a("p",[a("code",[t._v("CmdDetail")]),t._v(":对外提供的方法的具体信息")]),t._v(" "),a("p",[a("code",[t._v("CmdParameter")]),t._v(":对外提供的方法的参数信息")]),t._v(" "),a("p",[a("code",[t._v("ModuleE")]),t._v(":枚举类型,NULS2.0基础架构下的模块信息")]),t._v(" "),a("p",[a("code",[t._v("RegisterApi")]),t._v(":一个模块对外提供的所有方法的合集")])]),t._v(" "),a("p",[t._v("server")]),t._v(" "),a("blockquote",[a("p",[a("code",[t._v("CmdHandler")]),t._v(":根据Request消息,调用正确的方法")]),t._v(" "),a("p",[a("code",[t._v("ServerRuntime")]),t._v(":服务器运行时需要的参数,方法")]),t._v(" "),a("p",[a("code",[t._v("WsProcessor")]),t._v(":处理收到的消息队列")]),t._v(" "),a("p",[a("code",[t._v("WsServer")]),t._v(":服务器对象,负责接收消息,然后放入消息队列")])])])]),t._v(" "),a("h3",{attrs:{id:"_7-2-如何使用"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-如何使用","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2 如何使用")]),t._v(" "),a("p",[t._v("Websocket-Tool会做成JAR包供各模块引用")]),t._v(" "),a("h4",{attrs:{id:"_7-2-1-测试专用:模拟kernel"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-1-测试专用:模拟kernel","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.1 测试专用:模拟kernel")]),t._v(" "),a("p",[t._v("非常重要!")]),t._v(" "),a("p",[t._v("各模块接口是在kernel中进行维护,但是kernel由社区成员开发,因此这一部分是内部测试的模拟代码,可以直接复制使用,无需额外操作。")]),t._v(" "),a("p",[t._v("(test/java/io.nuls.test.WsKernel)")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Test")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("kernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throws")]),t._v(" Exception "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// url: "ws://127.0.0.1:8887"')]),t._v("\n WsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mockKernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-2-自定义cmd"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-2-自定义cmd","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.2 自定义cmd")]),t._v(" "),a("p",[t._v("scope的值:public,private,admin")]),t._v(" "),a("ul",[a("li",[t._v("public:暴露出去,第三方应用/平台也能调用的公开接口")]),t._v(" "),a("li",[t._v("private:只有模块间内部才能调用的接口")]),t._v(" "),a("li",[t._v("admin:专门为管理员设计的特定接口(管理员定义在在Berzeck的connector中,我们并不需要关心)")])]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n * 该类所在的包需要通过7.1.3中的方法进行扫描\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyCmd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseCmd")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@CmdAnnotation")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cmd "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" version "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" scope "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"private"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" minEvent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" minPeriod "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n description "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"test getHeight 1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Parameter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("parameterName "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"aaa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterType "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"int"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterValidRange "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"(1,100]"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterValidRegExp "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Parameter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("parameterName "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bbb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" parameterType "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"string"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Object "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Log"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("info")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight version 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// success")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("success")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Here is your real return value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 预定义错误")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("failed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ErrorCode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 非预定义错误")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("failed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-3-启动server"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-3-启动server","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.3 启动Server")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Start server instance")]),t._v("\nWsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getInstance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("moduleRoles")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("moduleVersion")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dependencies")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("LG"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("dependencies")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("scanPackage")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"io.nuls.rpc.cmd.test"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("connect")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ws://127.0.0.1:8887"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get information from kernel")]),t._v("\nCmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("syncKernel")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-4-为kernel提供的接口"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-4-为kernel提供的接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.4 为kernel提供的接口")]),t._v(" "),a("p",[t._v("现阶段忽略!")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n")])])]),a("h4",{attrs:{id:"_7-2-5-调用cmd"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-5-调用cmd","aria-hidden":"true"}},[t._v("#")]),t._v(" 7.2.5 调用cmd")]),t._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n 单元测试专用:单元测试时需要告知内核地址,以及同步接口列表\n 如果不是单元测试,在模块中进行连调测试,下面两句话是不需要的\n */")]),t._v("\nWsServer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("mockModule")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n 单元测试专用结束\n */")]),t._v("\n\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Build params map")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" params "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// Version information ("1.1" or 1.1 is both available)')]),t._v("\nparams"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Constants"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VERSION_KEY_STR"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparams"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"paramName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 可以看成是一个同步方法,发送Request,获得Response")]),t._v("\nResponse response "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndResponse")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 发送Request,当有Response的时候会自动调用预设的方法,返回的messageId是为了取消订阅")]),t._v("\nString messageId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndInvoke")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" InvokeMethod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invokeGetHeight2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 与requestAndInvoke一样,但是必须在收到Ack之后才会返回messageId")]),t._v("\nString messageId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("requestAndInvokeWithAck")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ModuleE"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("CM"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abbr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"getHeight"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" params"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" InvokeMethod"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invokeGetHeight2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 取消订阅")]),t._v("\nCmdDispatcher"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unsubscribe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("messageId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nSystem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("println")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"我已经取消了订阅"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n")])])]),a("h2",{attrs:{id:"八、补充内容"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 八、补充内容")])])}],!1,null,null,null);e.options.__file="rpcToolWebsocketDesign.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/17.4eef6f4e.js b/docs/.vuepress/dist/assets/js/17.4eef6f4e.js new file mode 100644 index 00000000..d07a9cbd --- /dev/null +++ b/docs/.vuepress/dist/assets/js/17.4eef6f4e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{283:function(e,t,n){e.exports=n.p+"assets/img/network-context.8f5dc235.png"},284:function(e,t,n){e.exports=n.p+"assets/img/network-functions.51710572.png"},285:function(e,t,n){e.exports=n.p+"assets/img/recMessage2.74b8d584.png"},286:function(e,t,n){e.exports=n.p+"assets/img/sendMsg1.46198729.png"},287:function(e,t,n){e.exports=n.p+"assets/img/sendMsg2.e2d2bd96.png"},288:function(e,t,n){e.exports=n.p+"assets/img/createNodeGroup.02a8f18e.png"},289:function(e,t,n){e.exports=n.p+"assets/img/deleteNodeGroup.1bb694b1.png"},290:function(e,t,n){e.exports=n.p+"assets/img/start.1e9dac99.png"},291:function(e,t,n){e.exports=n.p+"assets/img/shutdown.c5afd6a1.png"},292:function(e,t,n){e.exports=n.p+"assets/img/discoverPeer.bc23a3c9.png"},293:function(e,t,n){e.exports=n.p+"assets/img/connection.18465077.png"},294:function(e,t,n){e.exports=n.p+"assets/img/pingpong.4acdca1b.png"},295:function(e,t,n){e.exports=n.p+"assets/img/connet-validate.a03bf001.png"},296:function(e,t,n){e.exports=n.p+"assets/img/saveNodeIp.bc667171.png"},297:function(e,t,n){e.exports=n.p+"assets/img/connectSelf.f95af1ba.png"},298:function(e,t,n){e.exports=n.p+"assets/img/connectSelf-recieve.b38cf567.png"},917:function(e,t,n){"use strict";n.r(t);var a=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"network-module-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#network-module-design-document","aria-hidden":"true"}},[e._v("#")]),e._v(" Network module design document")]),e._v(" "),a("p",[e._v("[TOC]")]),e._v(" "),a("h2",{attrs:{id:"_1、general-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[e._v("#")]),e._v(" 1、General description")]),e._v(" "),a("h3",{attrs:{id:"_1-1-module-overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1 Module overview")]),e._v(" "),a("h4",{attrs:{id:"_1-1-1-why-have-a-network-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-have-a-network-module","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1.1 Why have a Network Module")]),e._v(" "),a("p",[e._v("The network module guarantees the communication between the decentralized nodes and\nprovides the lowest level of network communication and node discovery services for one of the NULS basic modules. The network foundation of the blockchain is Peer to Peer, or P2P. All participants in the P2P network can be either a server or a client. Features of P2P networks: decentralization, scalability, robustness, cost-effectiveness, privacy protection, and load balancing.")]),e._v(" "),a("h4",{attrs:{id:"_1-1-2-what-to-do-with-network-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-to-do-with-network-module","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1.2 What to do with Network Module")]),e._v(" "),a("p",[e._v("The network module is the basic module of the entire system, which is used to manage the connection between nodes, nodes and connections, and the transmission and reception of data. Network modules do not involve complex business logic.")]),e._v(" "),a("ul",[a("li",[e._v("The received network message is pushed in the corresponding processing module according to the instruction service mapping relationship in the kernel module.")]),e._v(" "),a("li",[e._v("The open interface is used to push the message encapsulation of other modules to the specified peer node and broadcast to the specified network group.")])]),e._v(" "),a("h4",{attrs:{id:"_1-1-3-the-positioning-of-network-module-in-the-system"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-positioning-of-network-module-in-the-system","aria-hidden":"true"}},[e._v("#")]),e._v(' 1.1.3 The positioning of "Network Module" in the system')]),e._v(" "),a("ul",[a("li",[e._v("The network module is the underlying application module. Any module that needs network communication must send and receive messages through the network module.")]),e._v(" "),a("li",[e._v("Network modules rely on kernelmodules for service interface governance。")]),e._v(" "),a("li",[e._v("The network module builds different networks by network id (magic parameter).")]),e._v(" "),a("li",[e._v("When the nodes of the network module in the satellite chain are configured for cross-chain networking, a chain management module is required to provide cross-chain configuration information.")]),e._v(" "),a("li",[e._v("The nodes of the network module in the sub-chain need to provide cross-chain configuration information when the cross-chain network is built.")])]),e._v(" "),a("h3",{attrs:{id:"_1-2-architecture-diagram"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.2 Architecture diagram")]),e._v(" "),a("p",[a("img",{attrs:{src:n(283),alt:""}})]),e._v(" "),a("h2",{attrs:{id:"_2、function-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2、function-design","aria-hidden":"true"}},[e._v("#")]),e._v(" 2、function design")]),e._v(" "),a("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.1 Functional architecture diagram")]),e._v(" "),a("p",[e._v("​ The network module has functions in the business: node management, node group management, p2p network connection management, and message transmission and management.")]),e._v(" "),a("p",[e._v("​ The internal infrastructure functions include: state management of the module (including startup and shutdown management), and management of external interfaces. Thread task management, data storage management, etc. 。")]),e._v(" "),a("p",[a("img",{attrs:{src:n(284),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Peer Nodes Management")]),e._v(" "),a("p",[e._v("Manage all connectable, connected node information, status, and provide node operation interfaces")]),e._v(" "),a("ul",[a("li",[e._v("Node discovery")]),e._v(" "),a("li",[e._v("Node storage")])])]),e._v(" "),a("li",[a("p",[e._v("Node Groups Management")]),e._v(" "),a("p",[e._v("Manage different network nodes, divide nodes into different collections, and manage each collection separately. The magic parameters of the nodes connected in each set are the same and are different from the magic parameters of other sets.")]),e._v(" "),a("p",[e._v("Each NodeGroup is initialized according to the information registered in the chain or the network information configured by itself (magic parameters, number of nodes, etc.) .Every time a NodeGroup is initialized, the network service listens for more than one MagicNumber.")])]),e._v(" "),a("li",[a("p",[e._v("Connection Management")]),e._v(" "),a("ul",[a("li",[e._v("Initialize the connection\n"),a("ul",[a("li",[e._v("Satellite chain node: random connection")]),e._v(" "),a("li",[e._v("Cross-chain nodes: fixed algorithm connections, the goal is to spread and cross-link nodes across the chain")])])]),e._v(" "),a("li",[e._v("Connection Management: Heartbeat Maintenance")]),e._v(" "),a("li",[e._v("Disconnect")])])]),e._v(" "),a("li",[a("p",[e._v("Message Management")]),e._v(" "),a("ul",[a("li",[e._v("Message receiver")])]),e._v(" "),a("p",[e._v("Receiving the message sent by the network node, making a simple judgment on the message\n(judging command), and sending the message to the module service of interest\naccording to the message cmd field.")]),e._v(" "),a("p",[e._v("[^ps]: RPC API Service interface information (url) is periodically obtained and cached from the kernel module.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Message receiver")]),e._v(" "),a("ul",[a("li",[e._v("NodeGroup broadcast message")]),e._v(" "),a("li",[e._v("Send a message to a node")])])])])])]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Module Management")]),e._v(" "),a("ul",[a("li",[e._v("Start, turn off logic processing")]),e._v(" "),a("li",[e._v("Maintenance and management of the status of its own module: management module operation status, internal function status, etc.")])])]),e._v(" "),a("li",[a("p",[e._v("RPC Api Management")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Register your own interface into the kernel module")])]),e._v(" "),a("li",[a("p",[e._v("Synchronize module information and status to the kernel module")])]),e._v(" "),a("li",[a("p",[e._v("Get the list of RPC services to the local module")])]),e._v(" "),a("li",[a("p",[e._v("Open external interface call")])])])]),e._v(" "),a("li",[a("p",[e._v("Thread task management")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("heartbeat thread")])]),e._v(" "),a("li",[a("p",[e._v("Node discovery/elimination mechanism thread")])]),e._v(" "),a("li",[a("p",[e._v("Interface information synchronization thread")])])])])]),e._v(" "),a("h3",{attrs:{id:"_2-2-module-service"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2 Module service")]),e._v(" "),a("h4",{attrs:{id:"_2-2-1-network-message-recieve"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-network-message-recieve","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.1 Network message recieve")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Receiving the message sent by the (external) network node, making a simple judgment on\nthe message (determining the magic parameter), and sending the message to the module service of interest according to the command field contained in the message header.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(285),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Message verification :")])])]),e._v(" "),a("p",[e._v("​ payload validate :First 4 bytes of sha256(sha256(payload))")]),e._v(" "),a("p",[e._v("​ magicNumbe :Determine if the nodegroups collection contains the magicNumber")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("External module network message receiving interface constraint")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("method : *** //Same as the CMD instruction in the message header, constraining 12 bytes")]),e._v(" "),a("p",[e._v("Interface description: The network module transparently forwards the message to the external module.")])]),e._v(" "),a("li",[a("p",[e._v("params")])])])])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" 0:chainId \n 1:nodeId \n 2:messageBody\n ......\n")])])]),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("\n")])])]),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Parsing the command parameter in the message header, relying on the remote service interface data provided by the kernel module when calling the remote interface processing.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-2-network-messaging"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-network-messaging","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2 Network messaging")]),e._v(" "),a("p",[e._v("Forwards messages encapsulated by other or own modules, including broadcast messages and designated nodes to send messages.")]),e._v(" "),a("h5",{attrs:{id:"_2-2-2-1、broadcast-network-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-1、broadcast-network-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2.1、Broadcast network message")]),e._v(" "),a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Forwarding messages encapsulated by other or its own modules, and providing interfaces for forwarding calls to external modules have the following two cases:")]),e._v(" "),a("p",[e._v("a> Broadcast a message to a NodeGroup (specify a network).")]),e._v(" "),a("p",[e._v("b> Broadcast messages to the NodeGroup (specify a network) and exclude certain nodes.")]),e._v(" "),a("ul",[a("li",[e._v("Process description")])]),e._v(" "),a("p",[a("img",{attrs:{src:n(286),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ method : nw_broadcast")]),e._v(" "),a("p",[e._v("​ Other modules can broadcast messages through this interface")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_broadcast",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.13.25.36:5003,20.30.25.65:8009",\n "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",\n "getBlock"\n \n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("excludeNodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Exclude nodes, comma separated")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("message")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Object hexadecimal character")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("command")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("message command,12 byte")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ nothing")]),e._v(" "),a("h5",{attrs:{id:"_2-2-2-2、the-specified-node-sends-a-network-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-2、the-specified-node-sends-a-network-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2.2、The specified node sends a network message")]),e._v(" "),a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Forwarding messages encapsulated by other or its own modules, you can specify that\ncertain nodes (which can be 1 node) send messages.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(287),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("External modules can broadcast messages through this interface")]),e._v(" "),a("p",[e._v("method : nw_sendPeersMsg")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_sendPeersMsg",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.13.25.36:5003,20.30.25.65:8009",\n "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",\n "getBlock"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Send node, comma split")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("message")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Object hexadecimal character")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("command")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("message command,12 byte")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ nothing")]),e._v(" "),a("h4",{attrs:{id:"_2-2-3-create-a-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3 Create a node group")]),e._v(" "),a("p",[e._v("In addition to its own satellite network, the satellite chain also has n cross-chain networks. In addition to its own network, there is also a cross-chain network.")]),e._v(" "),a("p",[e._v("Node groups are used to manage different network information. The network module isolates and maintains different networks through node groups.")]),e._v(" "),a("p",[e._v("Node group type: 1> own network 2> cross-chain network (satellite chain cross-chain network & friend chain cross-chain network)")]),e._v(" "),a("p",[e._v("The network module is a call to receive an external module to create a node group. The basic network configuration information of the cross-chain is mainly obtained through two ways:")]),e._v(" "),a("p",[e._v("1> The own configuration file is loaded to create its own network group.")]),e._v(" "),a("p",[e._v("2> Cross-chain network:")]),e._v(" "),a("p",[e._v("As a satellite chain node, after the registration is registered by the chain management module, the system generates a transaction verification confirmation and then calls to generate a cross-chain network group.")]),e._v(" "),a("p",[e._v("As a friend chain node, when started by the cross-chain protocol module, the cross-chain protocol module obtains cross-chain configuration information from the module configuration, and notifies the network module,The network module triggers a cross-chain connection.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The actual creation of a NodeGroup also has two kinds of logic:")]),e._v(" "),a("p",[e._v("1> Generate your own network group (or data load call) by loading the configuration file.")]),e._v(" "),a("p",[e._v("2> Call by external module: Create a network group as confirmed by registering cross-chain transactions.")])])]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-1-create-a-node-group-with-its-own-network"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-1-create-a-node-group-with-its-own-network","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.1 Create a node group with its own network")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("​ The own network corresponds to its own chainId, and a magic parameter, through the configuration initialization to create a node group.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Create a node group by loading the configuration file")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")])])]),e._v(" "),a("p",[e._v("​ Created internally, no external interface。")]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-2-create-a-cross-chain-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-2-create-a-cross-chain-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.2 Create a cross-chain node group")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("1> The satellite chain is triggered by the chain management module to trigger the creation of a cross-link node group.")]),e._v(" "),a("p",[e._v("2> The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.")]),e._v(" "),a("p",[a("img",{attrs:{src:n(288),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive a call to an external module to create a node group")]),e._v(" "),a("p",[e._v("method : nw_createNodeGroup")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_createNodeGroup",\n "minVersion":1.1,\n "params":[\n 1234,\n 232342,\n 10,\n 100,\n 20,\n "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",\n 0\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("maxOut")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum active connections")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("maxIn")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum number of passive connections")])]),e._v(" "),a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("minAvailableCount")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Minimum number of links in the friend chain")])]),e._v(" "),a("tr",[a("td",[e._v("5")]),e._v(" "),a("td",[e._v("seedIps")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Seed section group comma segmentation")])]),e._v(" "),a("tr",[a("td",[e._v("6")]),e._v(" "),a("td",[e._v("isMoonNode")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Whether satellite chain node, default 0")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-3-friend-chain-activates-cross-chain-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-3-friend-chain-activates-cross-chain-connection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.3 Friend chain activates cross-chain connection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive calls from cross-chain modules, activate friend chain cross-chain")]),e._v(" "),a("p",[e._v("method : nw_activeCross")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_activeCross",\n "minVersion":1.1,\n "params":[\n 1234,\n 10,\n 100,\n "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Chain identification")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("maxOut")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum active connections")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("maxIn")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum number of passive connections")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("seedIps")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Seed node, comma segmentation")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ Relies on remote service interface data provided by the kernel module.")]),e._v(" "),a("h4",{attrs:{id:"_2-2-4-delete-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-delete-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.4 delete node group")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Receive a call from an external module and unregister the cross-chain node group.")]),e._v(" "),a("p",[e._v("As a satellite chain node, the chain management module performs deregistration, and the system generates a transaction verification confirmation and then calls it.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(289),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")])]),e._v(" "),a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive calls from external modules, delete node groups")]),e._v(" "),a("p",[e._v("method : nw_delNodeGroup")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_delNodeGroup",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-5-cross-chain-seed-node-provision"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-cross-chain-seed-node-provision","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.5 Cross-chain seed node provision")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The seed node is a node used to provide peer connection information when the network is initialized. When the chain management module performs chain registration, it needs to\nobtain the seed node information on the satellite chain for initializing\nthe connection.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("no")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Obtain satellite chain seed node")]),e._v(" "),a("p",[e._v("method : nw_getSeeds")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getSeeds",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("seedsIps")]),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-6-add-a-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-add-a-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.6 Add a connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Add a peer connection information to a network under the cmd command.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The added node triggers the network connection process。")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Add network peer node")]),e._v(" "),a("p",[e._v("method : nw_addNodes")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_addNodes",\n "minVersion":1.1,\n "params":[\n 1234,\n 1,\n "10.20.23.02:5006,53.26.65.58:8003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("isCross")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("0 false 1 true")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("nodes")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")])])]),e._v(" "),a("tbody",[a("tr",[a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-7-delete-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-delete-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.7 Delete connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Under the cmd command, the peer connection information is deleted for a network.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Deleting a node triggers the disconnection of the network node。")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Delete network peer nodes")]),e._v(" "),a("p",[e._v("method : nw_delNodes")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_addNodes",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.20.23.02:5006,53.26.65.58:8003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("peer nodes")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")])])]),e._v(" "),a("tbody",[a("tr",[a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-8-reconnect-to-the-specified-network"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-reconnect-to-the-specified-network","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.8 Reconnect to the specified network")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Network reconnection of the specified nodeGroup under the cmd command")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("After receiving the command, disconnect all the peers under the specified nodeGroup and reconnect to the network.")])])]),e._v(" "),a("p",[e._v("​ Refresh the peer connection under nodegroup and restart the network connection.")]),e._v(" "),a("p",[e._v("​ If the peer connection is owned by multiple network services, you only need to cancel the association. If only the service is used by itself, you can disconnect.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Obtain satellite chain seed node")]),e._v(" "),a("p",[e._v("method : nw_reconnect")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_reconnect",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("链标识")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service\nnone")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-9-get-the-list-of-nodegroup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-get-the-list-of-nodegroup","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.9 Get the list of nodeGroup")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Get a list of all networks managed by the node。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Get node group information")]),e._v(" "),a("p",[e._v("method : nw_getGroups")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getGroups",\n "minVersion":1.1,\n "params":[\n 1,\n 10\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("startPage")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("page of starts")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("pageSize")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Number of records per page")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n list:[{\n chainId:1212, \n magicNumber:324234, \n totalCount:2323, \n inCount:22, \n outCount:33, \n isActive:1, \n isCrossChain:1 \n },{}\n ]\n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("totalCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Total number of connections")])]),e._v(" "),a("tr",[a("td",[e._v("inCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Passive connection number")])]),e._v(" "),a("tr",[a("td",[e._v("outCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("ctive connections")])]),e._v(" "),a("tr",[a("td",[e._v("isActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not activated, 1 is activated")])]),e._v(" "),a("tr",[a("td",[e._v("isCrossChain")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not a cross-chain network, 1 cross-chain network")])])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-10-get-the-connection-under-the-nodegroup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-get-the-connection-under-the-nodegroup","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.10 Get the connection under the nodeGroup")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Get information about all nodes under the specified network id")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ Get node information")]),e._v(" "),a("p",[e._v("​ method : nw_getNodes")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_reconnect",\n "minVersion":1.1,\n "params":[\n 1598,\n 0,\n 1,\n 50\n ]\n}\n\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("state")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("0 all connected, 1 working connected")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("startPage")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("page of starts")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("pageSize")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Number of records per page")])])])]),e._v(" "),a("ul",[a("li",[e._v("Return example")])]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(' {\n "version": 1.2,\n "code":0,\n "result":{\n list:[{\n chainId:122,\n nodeId:"20.20.30.10:9902"\n magicNumber:134124,\n version:2,\n blockHeight:6000, //区块高度\n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", //区块Hash值\n ip:"200.25.36.41",\n port:54, \n state:"已连接",\n isOut:"1", \n time:"6449878789", \n\t },{}\n\t ]\n }\n}\n\n')])])]),a("ul",[a("li",[e._v("Return field description")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("nodeId")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("nodeId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("version")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("protocol version")])]),e._v(" "),a("tr",[a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("ip")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("peer Ip address")])]),e._v(" "),a("tr",[a("td",[e._v("port")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Server port")])]),e._v(" "),a("tr",[a("td",[e._v("state")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("connect state")])]),e._v(" "),a("tr",[a("td",[e._v("isOut")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 passive connection, 1 active connection")])]),e._v(" "),a("tr",[a("td",[e._v("time")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("Recent connection time")])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-11-get-the-specified-chain-network-profile-information"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-get-the-specified-chain-network-profile-information","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.11 Get the specified chain network profile information")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Gets the network information of the specified chainId.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ Gets the network information of the specified chainId.")]),e._v(" "),a("p",[e._v("​ method : nw_getNodes")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getGroupByChainId",\n "minVersion":1.1,\n "params":[\n 103\n ]}\n')])])]),a("ul",[a("li",[e._v("Request parameter description")])])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])]),e._v(" "),a("ul",[a("li",[e._v("Return example")])]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n chainId:1212, \n magicNumber:324234,\n totalCount:2323, \n inCount:22, \n outCount:33, \n blockHeight:6000, \n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", \n isActive:1,\n isCrossActive:1,\n isMoonNet:0\n }\n}\n\n')])])]),a("ul",[a("li",[e._v("Return field description")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("totalCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("total connect")])]),e._v(" "),a("tr",[a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("isActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not activated, 1 is activated")])]),e._v(" "),a("tr",[a("td",[e._v("isCrossActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not a cross-chain network, 1 cross-chain network")])]),e._v(" "),a("tr",[a("td",[e._v("outCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("active connection count")])]),e._v(" "),a("tr",[a("td",[e._v("inCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("passive connection count")])]),e._v(" "),a("tr",[a("td",[e._v("isMoonNet")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 not moon node,1 moon node")])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-12-update-the-information-of-the-peer-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-update-the-information-of-the-peer-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.12 Update the information of the peer connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The network connection has the height and hash value of the peer node when the\nhandshake connection is made, and the height and hash value of the subsequent peer connection node are called and updated by the external module (block management module).")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("1> Wait for the block management interface after the node starts Initialization, and then call the block management interface to get the latest block height and hash value.")]),e._v(" "),a("p",[e._v("2> When the handshake is performed, the node related information is placed in the Verion information and sent to the peer.")]),e._v(" "),a("p",[e._v("3> After the connection is established, the block management module will call the interface to update the latest block height and hash value.")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ The block management module calls to update the height of the node and the hash value.")]),e._v(" "),a("p",[e._v("​ method : nw_updateNodeInfo")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_updateNodeInfo",\n "minVersion":1.1,\n "params":[\n 1598,\n "10.20.30.20:8856",\n 10,\n "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"\n ]\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("网络id")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodeId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("网络节点id")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("区块高度")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("Sting")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("区块最新hash")])])])]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("返回示例")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{\n \n }\n}\n\n\n')])])])]),e._v(" "),a("li",[a("p",[e._v("返回字段说明")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h2",{attrs:{id:"_2-3-module-internal-function"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3 Module internal function")]),e._v(" "),a("h4",{attrs:{id:"_2-3-1module-start"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1module-start","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.1Module start")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When the module is started, the configuration information is initialized, the\nregistration service is initialized, and the initialization of each internal function management database information is performed.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("​ "),a("img",{attrs:{src:n(290),alt:""}})]),e._v(" "),a("p",[e._v("1> load local configuration data, database node group and node information data loading.")]),e._v(" "),a("p",[e._v("2 > When the status of the listening block management module is initialized and the interface is callable, the call obtains the block height and Hash value of the latest local node.")]),e._v(" "),a("p",[e._v("3> initialization completes and enters peer node connection.")]),e._v(" "),a("p",[e._v("4 > The network module notifies the block management module of the maximum block height and hash value after the connection is stable. The block management module provides interfaces for network module calls.")]),e._v(" "),a("p",[e._v("The criteria for the stability of network module start-up connection are: no new handshake connection occurs in X seconds, and no height increase in X seconds. X=10")]),e._v(" "),a("p",[e._v("5 > After network stabilization, the network is in a working state, and the business state of each chain is released to other modules in an event manner.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-2-module-off"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-module-off","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.2 Module off")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When the module is closed, the connection is closed, the thread management is\nclosed, the resources are released, and the status is notified to the core interface.。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(291),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-3-peer-node-discovery"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-peer-node-discovery","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.3 Peer node discovery")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("After the network module is started, the peer node is managed.")]),e._v(" "),a("p",[e._v("The ways for node acquisition are:")]),e._v(" "),a("p",[e._v("1> Connect to the seed node and request address acquisition.")]),e._v(" "),a("p",[e._v("2> Receive the broadcasted node message.")]),e._v(" "),a("p",[e._v("2> The connection of a cross-chain network, for example, as a connection between a node and a sub-chain on a satellite chain, or a connection between a node on a sub-chain and a satellite chain.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(292),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-4-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-connection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.4 connection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("A node acts as the client, actively connecting to a known peer node, and is also a server, waiting for the peer node to connect.")]),e._v(" "),a("p",[e._v("A connection can work normally, and it needs to send a version protocol message to each other through a handshake protocol. For the specific definition of the protocol, see the following.")]),e._v(" "),a("p",[e._v('"Protocol - Network Communication Protocol Part".')])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("​ After the TCP connection is complete with the server, the client needs to handshake through the rervice version protocol. Only the connection with successful handshake can forward the service. The state in the connection cannot be transitioned to connected after X minutes, and the connection is actively disconnected.")]),e._v(" "),a("p",[a("img",{attrs:{src:n(293),alt:""}})]),e._v(" "),a("p",[e._v("PS: In order to meet the requirements of one process carrying multiple-chain services at the same time, after a node peer connection is established, multiple NodeGroup services should be satisfied.")]),e._v(" "),a("p",[e._v("That is, the node peer connection and the nodeGroup object are many-to-many, n:n relationships.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-5heartbeat-detection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5heartbeat-detection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.5Heartbeat detection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v('Check if the connection is still connected. Maintain the keep-alive by ping-pong message from client and server. Refer to the "Protocol - Network Communication Protocol" section for the definition of the ping-pong protocol involved.')])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(294),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-6-connection-quantity-verification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-connection-quantity-verification","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.6 Connection quantity verification")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When a node connection is established, the number of connections is made, and\nif the maximum is reached, the connection is actively disconnected.。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("​ "),a("img",{attrs:{src:n(295),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])])])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-7-node-external-network-ip-storage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-node-external-network-ip-storage","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.7 Node external network IP storage")]),e._v(" "),a("ul",[a("li",[e._v("Function Description:")])]),e._v(" "),a("p",[e._v("​ A node may have multiple network cards, or it may be in a local area network. Therefore, when establishing a connection, it does not know its own external network IP address.")]),e._v(" "),a("p",[e._v("The node needs to know its own external network IP address to broadcast its own address for the external network peers to connect. In our design, the external network of the node is carried by the version protocol message.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("When the client receives the version message, it can know its own IP address information.")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(296),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-8-node-external-network-connection-detection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-node-external-network-connection-detection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.8 Node external network connection detection")]),e._v(" "),a("ul",[a("li",[e._v("Function Description:")])]),e._v(" "),a("p",[e._v("​ When a node establishes a connection, it can broadcast its own external network IP+port to other nodes. However, if a node is in a local area network, the IP address of the external network cannot be directly connected. Therefore,in order to detect whether the external network IP of the node is\navailable, you can connect to your own server through your own client. If the connection is successful, the IP can be used for broadcasting. If it is unsuccessful, the external network IP of the node cannot be\nbroadcast to other nodes.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Self-connection\nmay succeed or fail. If it is successful, the external network IP is reachable, and it can be broadcasted to other nodes in the network when the connection is established. If it is unreachable, the connection\ncannot be established.。")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(297),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-9-peer-node-broadcast"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-peer-node-broadcast","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.9 Peer node broadcast")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Broadcast\nits own nodes to other nodes in the network. In the design, we will\nbroadcast through the self-connection established above。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Constraint: The address broadcast is not carried out between peers in the cross-chain\nnetwork, that is, the nodes in the satellite chain are not broadcast to the sub-chain, and the nodes in the same sub-chain are found not to be broadcast to the satellite chain. The satellite chain and the sub-chain need to establish a connection. The initial peer node can send a getAdrr message to request the connection address.")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(298),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-10-request-reply-getaddr-protocol-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-request-reply-getaddr-protocol-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.10 Request/reply getaddr protocol message")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Request an address protocol message for more network connections")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Request getaddr:")]),e._v(" "),a("p",[e._v("1> When a connection in a nodeGroup does not reach the network service required threshold minAvailableCount, the address list is requested from the seed node.")]),e._v(" "),a("p",[e._v("2> The cross-chain nodeGroup in the satellite chain node can directly request the obtained address from the connected peer node.")]),e._v(" "),a("p",[e._v("Reply getaddr:")]),e._v(" "),a("p",[e._v("1>peer cross-link connection, node reply address list (IP+cross-chain port)")]),e._v(" "),a("p",[e._v("2>peer own network connection, the node will reply to the address list (IP+ own chain port)")])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-11-send-receive-address-logic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-send-receive-address-logic","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.11 send/receive address logic")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Send & Receive network protocol addr protocol message processing logic")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Send addr:")])])]),e._v(" "),a("p",[e._v("​ 1> When a new node is accessed, an addr message is broadcast to other peers of the same nodegroup.")]),e._v(" "),a("p",[e._v("​ 2> When the getaddr message is requested, the addr message will be replied.")]),e._v(" "),a("p",[e._v("​ Receive addr:")]),e._v(" "),a("p",[e._v("​ 1> Determine whether the address is already owned locally. If you do not forward it, get the new addr.")]),e._v(" "),a("p",[e._v("​ 2>PEER is not cross-chain network forwarding")]),e._v(" "),a("p",[e._v("​ 3> Own network, add addr>0, store and broadcast forwarding (except receiving peer)")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h2",{attrs:{id:"_3、event-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[e._v("#")]),e._v(" 3、Event description")]),e._v(" "),a("h3",{attrs:{id:"_3-1-published-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1 Published event")]),e._v(" "),a("p",[e._v("[^remark]: Here is the topic of the event, the format protocol of the event (accurate to byte), and the occurrence of the event.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-1-nodegroup-reaches-the-lower-limit-of-the-number-of-nodes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-nodegroup-reaches-the-lower-limit-of-the-number-of-nodes","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.1 NodeGroup reaches the lower limit of the number of nodes")]),e._v(" "),a("p",[e._v("Description: The NodeGroup reaches the lower limit of the number of nodes and the event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_inNodeLimit",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-2-nodegroup-is-less-than-the-minimum-number-of-nodes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-nodegroup-is-less-than-the-minimum-number-of-nodes","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.2 NodeGroup is less than the minimum number of nodes")]),e._v(" "),a("p",[e._v("Description: The NodeGroup is less than the lower limit of the number of nodes. The event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_lessNodeLimit",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-3-node-handshake-succeeded"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-node-handshake-succeeded","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.3 Node handshake succeeded")]),e._v(" "),a("p",[e._v("Description: The node handshake is successful and the event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_connectSuccess",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeId\n time\n version\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-4-node-disconnected"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-node-disconnected","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.4 Node disconnected")]),e._v(" "),a("p",[e._v("Description: The node is disconnected and the event is published")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_nodeDisconnect",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeId\n time\n version\n }\n \n\n")])])]),a("h3",{attrs:{id:"_3-2-subscribed-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.2 Subscribed event")]),e._v(" "),a("pre",[a("code",[e._v("​ none\n")])]),e._v(" "),a("ul",[a("li")]),e._v(" "),a("h2",{attrs:{id:"_4、protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[e._v("#")]),e._v(" 4、protocol")]),e._v(" "),a("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[e._v("#")]),e._v(" 4.1 Network communication protocol")]),e._v(" "),a("h4",{attrs:{id:"version"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#version","aria-hidden":"true"}},[e._v("#")]),e._v(" version")]),e._v(" "),a("p",[e._v("Used to establish a connection (handshake)")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("version")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("Protocol version identifier used by the node")])]),e._v(" "),a("tr",[a("td",[e._v("20")]),e._v(" "),a("td",[e._v("addr_you")]),e._v(" "),a("td",[e._v("byte[20]")]),e._v(" "),a("td",[e._v("The peer network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [10.32.12.25 8003 9003] 16byte+2byte+2byte")])]),e._v(" "),a("tr",[a("td",[e._v("20")]),e._v(" "),a("td",[e._v("addr_me")]),e._v(" "),a("td",[e._v("byte[20]")]),e._v(" "),a("td",[e._v("The self network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [20.32.12.25 8003 9003] 16byte+2byte+2byte")])]),e._v(" "),a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("block_height")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("node latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("?")]),e._v(" "),a("td",[e._v("block_hash")]),e._v(" "),a("td",[e._v("varInt")]),e._v(" "),a("td",[e._v("node latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("6")]),e._v(" "),a("td",[e._v("network_time")]),e._v(" "),a("td",[e._v("uint48")]),e._v(" "),a("td",[e._v("Network time")])]),e._v(" "),a("tr",[a("td",[e._v("??")]),e._v(" "),a("td",[e._v("extend")]),e._v(" "),a("td",[e._v("VarByte")]),e._v(" "),a("td",[e._v("extended field, no more than 10 bytes")])])])]),e._v(" "),a("h4",{attrs:{id:"verack"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#verack","aria-hidden":"true"}},[e._v("#")]),e._v(" verack")]),e._v(" "),a("p",[e._v("Used to answer version")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("ack_code")]),e._v(" "),a("td",[e._v("uint8")]),e._v(" "),a("td",[e._v("Return code, 1 means normal, 2 means the connection is full")])])])]),e._v(" "),a("h4",{attrs:{id:"ping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ping","aria-hidden":"true"}},[e._v("#")]),e._v(" ping")]),e._v(" "),a("pre",[a("code",[e._v("Used to maintain the connection. After receiving a message for a certain node for a \n")])]),e._v(" "),a("p",[e._v("period of time, the message is sent. If the pong message is received, the node remains connected. Otherwise, the connection is closed and the node is deleted.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("randomCode")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("random number")])])])]),e._v(" "),a("h4",{attrs:{id:"pong"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pong","aria-hidden":"true"}},[e._v("#")]),e._v(" pong")]),e._v(" "),a("pre",[a("code",[e._v("reply for ping\n")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("randomCode")]),e._v(" "),a("td",[e._v("uint32random number")]),e._v(" "),a("td")])])]),e._v(" "),a("h4",{attrs:{id:"getaddr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getaddr","aria-hidden":"true"}},[e._v("#")]),e._v(" getaddr")]),e._v(" "),a("p",[e._v("Used to obtain connection information of available nodes in the network, no message body")]),e._v(" "),a("h4",{attrs:{id:"addr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#addr","aria-hidden":"true"}},[e._v("#")]),e._v(" addr")]),e._v(" "),a("p",[e._v("Used to reply getaddr, or announce the existence of itself to the network. After receiving the message, the node determines whether the node is known. If it is an unknown node, it propagates the message to the network.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("??")]),e._v(" "),a("td",[e._v("addr_list")]),e._v(" "),a("td",[e._v("network address")]),e._v(" "),a("td",[e._v("18 bytes per node (16 bytes IP + 2 bytes port)")])])])]),e._v(" "),a("h4",{attrs:{id:"bye"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bye","aria-hidden":"true"}},[e._v("#")]),e._v(" Bye")]),e._v(" "),a("p",[e._v("Used for peer connection to disconnect actively, rejecting service message connection")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("byeCode")]),e._v(" "),a("td",[e._v("uint8")]),e._v(" "),a("td",[e._v("预留字段")])])])]),e._v(" "),a("h3",{attrs:{id:"_4-2-transaction-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[e._v("#")]),e._v(" 4.2 Transaction agreement")]),e._v(" "),a("pre",[a("code",[e._v("​ none\n")])]),e._v(" "),a("h2",{attrs:{id:"_5、module-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration","aria-hidden":"true"}},[e._v("#")]),e._v(" 5、Module configuration")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" [network]\n network.self.server.port=8003\n network.self.chainId=9861\n network.self.magic=68866996\n network.self.max.in=100\n network.self.max.out=10\n network.self.seed.ip=127.0.0.1:8003\n #Satellite chain configuration information\n network.moon.node=true\n network.moon.server.port=8004\n network.moon.max.in=100\n network.moon.max.out=10\n network.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003\n \n\n")])])]),a("h2",{attrs:{id:"_6、java-specific-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[e._v("#")]),e._v(" 6、Java-specific design")]),e._v(" "),a("p",[e._v("[^remark]: Core object class definition, storing data structures,......")]),e._v(" "),a("h2",{attrs:{id:"_7、-to-add-on"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7、-to-add-on","aria-hidden":"true"}},[e._v("#")]),e._v(" 7、 to add on")]),e._v(" "),a("p",[e._v("[^remark]: Required content not covered above")])])}],i=n(0),r=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);r.options.__file="networkModuleDesign.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/170.9f0e1298.js b/docs/.vuepress/dist/assets/js/170.9f0e1298.js new file mode 100644 index 00000000..5b21e371 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/170.9f0e1298.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[170],{819:function(t,e,r){"use strict";r.r(e);var n=r(0),s=Object(n.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等")]),t._v(" "),t._m(2),t._v(" "),r("p",[t._v("亲爱的用户:\n11\n很荣幸的宣布,NULS2.0 Alpha版本已于北京时间:2019-03-28日上午10:30发布,诚邀您参与内测。")]),t._v(" "),r("p",[t._v("NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。")]),t._v(" "),r("p",[t._v("此次Alpha版本测试内容主要包含:")]),t._v(" "),r("ul",[r("li",[t._v("Linux钱包全部功能,例如:账户创建、导入、转账和创建节点等等")]),t._v(" "),r("li",[t._v("基于NULS2.0核心模块搭建区块链")]),t._v(" "),r("li",[t._v("搭建包含"),r("router-link",{attrs:{to:"/zh/NULS2.0/developModule.html"}},[t._v("业务模块")]),t._v("的区块链")],1)]),t._v(" "),t._m(3),t._v(" "),r("p",[t._v("1 "),r("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/pangu/NULS-Wallet-linux64-alpha1.tgz",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载linux客户端"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("2 "),r("router-link",{attrs:{to:"/zh/NULS2.0/linuxTutorial.html"}},[t._v("linux钱包使用教程")])],1),t._v(" "),r("p",[t._v("3 "),r("a",{attrs:{href:"https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141",target:"_blank",rel:"noopener noreferrer"}},[t._v("申请测试币"),r("OutboundLink")],1),t._v("并在帖子中回复:Alpha+地址")]),t._v(" "),r("p",[t._v("4 访问区块链浏览器:"),r("a",{attrs:{href:"http://alpha.nulscan.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("http://alpha.nulscan.io/"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("5 "),r("router-link",{attrs:{to:"/zh/NULS2.0/howToUseNulsBuildChain.html"}},[t._v("使用NULS2.0搭建区块链")])],1),t._v(" "),r("p",[t._v("6 提交bug:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0/issues",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls_2.0/issues"),r("OutboundLink")],1)]),t._v(" "),t._m(4),t._v(" "),r("ul",[r("li",[t._v("Github:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls_2.0"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("论坛:"),r("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("技术社区Telegram:"),r("a",{attrs:{href:"https://t.me/nulstest",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://t.me/nulstest"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("微信公众号:NULS中文社区")])]),t._v(" "),r("p",[t._v("想了解更多与NULS相关的信息,可以访问我们的"),r("a",{attrs:{href:"https://nuls.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("官网"),r("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"欢迎来到nuls"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#欢迎来到nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" 欢迎来到NULS")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nuls2-0-alpha版本已发布"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha版本已发布","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha版本已发布")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"参与测试:"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参与测试:","aria-hidden":"true"}},[this._v("#")]),this._v(" 参与测试:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"相关链接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#相关链接","aria-hidden":"true"}},[this._v("#")]),this._v(" 相关链接")])}],!1,null,null,null);s.options.__file="README.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/171.fc4a1cfb.js b/docs/.vuepress/dist/assets/js/171.fc4a1cfb.js new file mode 100644 index 00000000..4d27d46c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/171.fc4a1cfb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[171],{817:function(t,r,s){"use strict";s.r(r);var _=s(0),e=Object(_.a)({},function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("1、参与NULS大使的选举需要具有创建NULS节点的基本条件。")]),t._v(" "),s("p",[t._v("2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员。")]),t._v(" "),s("p",[t._v("3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。")]),t._v(" "),s("p",[t._v("4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。")]),t._v(" "),s("p",[t._v("5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。")]),t._v(" "),s("p",[t._v("6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。")]),t._v(" "),s("p",[t._v("7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。")]),t._v(" "),s("p",[t._v("8、NULS大使可以向NULS基金会提报预算,申请重大事项发展的经费,该预算面向全体社区公开,发起预算投票,投票期为15天,投票量超过1000W NULS且支持率达到70%以上,基金会可以向该预算发放资金。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("发布上月的工作情况报告和下月的工作计划:")]),t._v(" "),s("p",[t._v("请发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。")]),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;")]),t._v(" "),s("p",[t._v("NULS基金会将会委托200000NULS在您的节点上。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),s("p",[t._v("欢迎大家加入NULS社区,共同创造NULS美好未来!")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),s("p",[t._v("2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),s("p",[t._v("3、分享NULS的故事给社区。")]),t._v(" "),s("p",[t._v("3、分享NULS的故事给社区;")]),t._v(" "),s("p",[t._v("4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),s("p",[t._v("6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),s("p",[t._v("7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),s("p",[t._v("8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。")]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;")]),t._v(" "),s("p",[t._v("2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;")]),t._v(" "),s("p",[t._v("3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;")]),t._v(" "),s("p",[t._v("4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("(1)通过互联网或者线下交流的方式让其他人了解NULS。")]),t._v(" "),s("p",[t._v("(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。")]),t._v(" "),s("p",[t._v("(3)将NULS社区其他地区的发展情况分享到当地社区。")]),t._v(" "),s("p",[t._v("(4)持续分享NULS项目的进展、规划、新闻等到当地社区。")]),t._v(" "),s("p",[t._v("(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。")]),t._v(" "),s("p",[t._v("(6)分享NULS的故事给社区。")]),t._v(" "),s("p",[t._v("(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),s("p",[t._v("(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),s("p",[t._v("(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),s("p",[t._v("(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),s("p",[t._v("(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),s("p",[t._v("(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。")]),t._v(" "),s("p",[t._v("(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。")]),t._v(" "),s("p",[t._v("(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("1、NULS大使工作看板("),s("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击进入"),s("OutboundLink")],1),t._v("),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。")]),t._v(" "),s("p",[t._v("2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。")]),t._v(" "),s("p",[t._v("3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。")]),t._v(" "),s("p",[t._v("4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。")]),t._v(" "),s("p",[t._v("5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。")]),t._v(" "),s("p",[t._v("6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。")]),t._v(" "),s("p",[t._v("7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注"),s("a",{attrs:{href:"https://github.com/nuls-io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Github"),s("OutboundLink")],1),t._v("和"),s("a",{attrs:{href:"https://dev.nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev.nuls.io"),s("OutboundLink")],1),t._v("。")]),t._v(" "),s("p",[t._v("7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("上面发帖。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。")]),t._v(" "),s("p",[t._v("2、组织开展一些线下见面会活动。")]),t._v(" "),s("p",[t._v("3、让更多的区块链投资人了解NULS,引导他们对NULS投资。")]),t._v(" "),s("p",[t._v("4、帮助NULS寻找更多的区块链技术爱好者加入。")]),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;")]),t._v(" "),s("p",[t._v("2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。")]),t._v(" "),s("p",[t._v("3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。")]),t._v(" "),t._m(19),t._v(" "),s("p",[t._v("1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。")]),t._v(" "),s("p",[t._v("2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。")]),t._v(" "),s("p",[t._v("3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。")]),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。")]),t._v(" "),s("p",[t._v("2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。")]),t._v(" "),s("p",[t._v("3、必须住在人口超过35万的城市。")]),t._v(" "),t._m(22),t._v(" "),s("p",[t._v("1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。")]),t._v(" "),s("p",[t._v("2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。")]),t._v(" "),t._m(23),t._v(" "),s("p",[t._v("1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。")]),t._v(" "),s("p",[t._v("2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。")]),t._v(" "),t._m(24)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"一、nuls大使介绍"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls大使介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("一、NULS大使介绍")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"二、nuls大使职责和权益"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls大使职责和权益","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("二、NULS大使职责和权益")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"三、如何参与竞选"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#三、如何参与竞选","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("三、如何参与竞选")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第一步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第二步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第三步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[r("strong",[this._v("最后祝愿:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。")]),this._v(" "),r("li",[this._v("开始社区建设和拓展工作。")]),this._v(" "),r("li",[this._v("帮助NULS对接更多的DApp接入。")]),this._v(" "),r("li",[this._v("请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"如果您能够奉献更多,对您的期望:"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#如果您能够奉献更多,对您的期望:","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("如果您能够奉献更多,对您的期望:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"大使指导手册"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#大使指导手册","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("大使指导手册")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"前言"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("前言")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你将获得"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你将获得","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你将获得")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你可以从这些方面来开展工作"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你可以从这些方面来开展工作","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你可以从这些方面来开展工作")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_1、社区拓展"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1、社区拓展","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、社区拓展")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_2、社区活动"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2、社区活动","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、社区活动")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"了解nuls可以从这里开始"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#了解nuls可以从这里开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 了解NULS可以从这里开始")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"招募志愿者组织当地的社群"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#招募志愿者组织当地的社群","aria-hidden":"true"}},[this._v("#")]),this._v(" 招募志愿者组织当地的社群")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"发展当地的nuls生态"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#发展当地的nuls生态","aria-hidden":"true"}},[this._v("#")]),this._v(" 发展当地的NULS生态")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"将nuls的理念和技术传播到当地"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#将nuls的理念和技术传播到当地","aria-hidden":"true"}},[this._v("#")]),this._v(" 将NULS的理念和技术传播到当地")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"nulstar指南和职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar指南和职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar指南和职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"成为nulstar的要求"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#成为nulstar的要求","aria-hidden":"true"}},[this._v("#")]),this._v(" 成为NULStar的要求")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstar的职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar的职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstars的奖励"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstars的奖励","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStars的奖励")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"指导手册会不断更新,希望大使们和nuls一起成长!"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#指导手册会不断更新,希望大使们和nuls一起成长!","aria-hidden":"true"}},[this._v("#")]),this._v(" 指导手册会不断更新,希望大使们和NULS一起成长!")])}],!1,null,null,null);e.options.__file="ambassadorRules.md";r.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/172.d5c28bec.js b/docs/.vuepress/dist/assets/js/172.d5c28bec.js new file mode 100644 index 00000000..d36c8a3e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/172.d5c28bec.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[172],{815:function(t,s,e){"use strict";e.r(s);var r=e(0),_=Object(r.a)({},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),e("p",[t._v("NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。")]),t._v(" "),e("p",[t._v("**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(2),t._v(" "),e("p",[t._v("NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:")]),t._v(" "),e("p",[t._v("1、代码贡献")]),t._v(" "),e("p",[t._v("2、应用开发")]),t._v(" "),e("p",[t._v("3、运营推广")]),t._v(" "),e("p",[t._v("4、其他有利于NULS社区生态发展的具体事项")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。")]),t._v(" "),t._m(5),t._v(" "),e("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),e("p",[t._v("NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。")]),t._v(" "),e("p",[t._v("2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。")]),t._v(" "),e("p",[t._v("3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。")]),t._v(" "),e("p",[t._v("4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。")]),t._v(" "),e("p",[t._v("(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。")]),t._v(" "),t._m(12),t._v(" "),e("p",[t._v("(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(13),t._v(" "),e("p",[t._v("2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。")]),t._v(" "),e("p",[t._v("3、理事会成员的责任。")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。")]),t._v(" "),t._m(18),t._v(" "),e("p",[t._v("在技术社区里我们坚持以下的理念:")]),t._v(" "),e("p",[t._v("1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。")]),t._v(" "),e("p",[t._v("2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。")]),t._v(" "),e("p",[t._v("3、共享 (Sharing):")]),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。")]),t._v(" "),e("p",[t._v("5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。")]),t._v(" "),e("p",[t._v("加入流程如下:")]),t._v(" "),e("p",[t._v("1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。")]),t._v(" "),e("p",[t._v("2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。")]),t._v(" "),e("p",[t._v("3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),e("p",[t._v("4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。")]),t._v(" "),t._m(21),t._v(" "),e("p",[t._v("1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。")]),t._v(" "),e("p",[t._v("2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。")]),t._v(" "),e("p",[t._v("3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。")]),t._v(" "),e("p",[t._v("4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。")]),t._v(" "),e("p",[t._v("5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),e("p",[t._v("固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。")]),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),e("p",[t._v("1、理事会成员发起投票。只收取交易手续费。")]),t._v(" "),e("p",[t._v("2、普通成员投票。押金(目前设定是100NULS)+交易手续费。")]),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),e("p",[t._v("如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。")]),t._v(" "),e("p",[t._v("NULS社区网站:"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("建议反馈帖:"),e("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community/d/132-we-need-your-suggestions"),e("OutboundLink")],1)])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"一、nuls社区简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls社区简介","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("一、NULS社区简介")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"二、nuls基金会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls基金会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("二、NULS基金会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)nuls基金会宗旨"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)nuls基金会宗旨","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)NULS基金会宗旨")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)nuls社区基金的来源"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)nuls社区基金的来源","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)NULS社区基金的来源")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)nuls社区基金管理"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)nuls社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)NULS社区基金管理")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"三、理事会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#三、理事会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("三、理事会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)理事会介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)理事会介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)理事会介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)理事会成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)理事会成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)理事会成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员)"),s("strong",[this._v(",由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出")]),this._v("(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)-理事会成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)-理事会成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三) 理事会成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。")])]),this._v(" "),s("li",[s("p",[this._v("固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("节点下限代理手续费佣金调整。")])]),t._v(" "),e("li",[e("p",[t._v("转账手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("合约调用手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("理事会发起提案的手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("其他系统可调整的系统参数调整。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。")])]),this._v(" "),s("li",[s("p",[this._v("创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("理事会成员需要能够及时与社区进行沟通。")])]),this._v(" "),s("li",[s("p",[this._v("严格遵照社区章程。")])]),this._v(" "),s("li",[s("p",[this._v("与NULS的愿景和目标一致。")])]),this._v(" "),s("li",[s("p",[this._v("以全体社区成员利益为己任。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"四、code-craft-council-ccc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#四、code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("四、CODE CRAFT COUNCIL(CCC)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)ccc介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)ccc介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)CCC介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)ccc理念"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)ccc理念","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)CCC理念")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("社区共享NULS技术成果。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS发展红利。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS的影响力和名誉。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS带来的技术革新。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS推动行业发展的标准制定。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)ccc成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)ccc成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)CCC成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(四)ccc成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(四)ccc成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(四)CCC成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"五、贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#五、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("五、贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)竞选贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)竞选贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (一)竞选贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示"),s("strong",[this._v("nuls.community")]),this._v("。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)固定贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)固定贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (二)固定贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"六、项目预算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#六、项目预算","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("六、项目预算")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)对于贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)对于贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)对于贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)对于其他事务资金"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)对于其他事务资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)对于其他事务资金")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"七、其他投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#七、其他投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("七、其他投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)发起投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)发起投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)发起投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)代理投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)代理投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)代理投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。")])]),this._v(" "),s("li",[s("p",[this._v("任何的NULS用户都可以成为代理人。")])]),this._v(" "),s("li",[s("p",[this._v("代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。")])]),this._v(" "),s("li",[s("p",[this._v("代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"八、建议反馈"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#八、建议反馈","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("八、建议反馈")])])}],!1,null,null,null);_.options.__file="communityConstitution.md";s.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/173.2cfc6896.js b/docs/.vuepress/dist/assets/js/173.2cfc6896.js new file mode 100644 index 00000000..393f98f2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/173.2cfc6896.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[173],{813:function(t,e,s){"use strict";s.r(e);var r=s(0),_=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),s("p",[t._v("社区基金账户地址:")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[t._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("根据社区章程指导思想,提案执行基金会账户操作。")]),t._v(" "),s("p",[t._v("该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。")]),t._v(" "),s("p",[t._v("注:理事会发起的该部分成员的申请提案投票期为15天。")]),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。")]),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。")]),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;")]),t._v(" "),s("p",[t._v("(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;")]),t._v(" "),s("p",[t._v("(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;")]),t._v(" "),s("p",[t._v("(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;")]),t._v(" "),s("p",[t._v("(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;")]),t._v(" "),s("p",[t._v("(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;")]),t._v(" "),s("p",[t._v("(2)理事会和申请人都需要引导社区正确地进行投票;")]),t._v(" "),s("p",[t._v("(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;")]),t._v(" "),s("p",[t._v("(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;")]),t._v(" "),s("p",[t._v("(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("所有的社区讨论建议在"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("进行。")]),t._v(" "),s("p",[t._v("本流程根据社区章程思想进行管理,流程将会对全体社区公开。")]),t._v(" "),s("p",[t._v("流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。")]),t._v(" "),s("p",[t._v("具体节点产生收益参考NULS POC共识机制。")]),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),t._v(" "),s("p",[t._v("CCC 成员:")]),t._v(" "),s("p",[t._v("Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),t._v(" "),s("p",[t._v("Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),t._v(" "),s("p",[t._v("Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),t._v(" "),s("p",[t._v("Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),t._v(" "),s("p",[t._v("Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),t._v(" "),s("p",[t._v("Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),t._v(" "),s("p",[t._v("Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),t._v(" "),s("p",[t._v("Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),t._v(" "),s("p",[t._v("Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),t._v(" "),s("p",[t._v("Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),t._v(" "),t._m(19)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375408-182645-20181221145608.png",alt:"img"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、社区基金管理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("一、社区基金管理")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、发起申请的成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、发起申请的成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("二、发起申请的成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、普通成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、普通成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、普通成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、贡献者角色"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、贡献者角色")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、申请类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、申请类型","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("三、申请类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、提案支付资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、提案支付资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、提案支付资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、预算项目提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、预算项目提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、预算项目提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、提案创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、提案创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、提案创建节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4、提案委托资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、提案委托资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("4、提案委托资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、申请流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、申请流程","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("四、申请流程")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、方案公开讨论"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、方案公开讨论","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、方案公开讨论")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、理事会成员提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、理事会成员提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、理事会成员提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、基金会执行提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、基金会执行提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、基金会执行提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、流程解释"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、流程解释","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("五、流程解释")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"附:当前贡献者角色的委托和节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附:当前贡献者角色的委托和节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("附:当前贡献者角色的委托和节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);_.options.__file="communityFund.md";e.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/174.6ac11f1d.js b/docs/.vuepress/dist/assets/js/174.6ac11f1d.js new file mode 100644 index 00000000..9985c7ae --- /dev/null +++ b/docs/.vuepress/dist/assets/js/174.6ac11f1d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[174],{811:function(t,e,r){"use strict";r.r(e);var n=r(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("NULS 是一个区块链公链项目,其致力于打造由社区驱动的一个真正开源、自我革新的区块链平台。NULS期望通过构建灵活易用的区块链基础设施,最大限度降低企业/个人使用区块链底层技术的难度。\nNULS技术社区,是由来自NULS社区的一批对NULS充满激情与梦想的技术开发人员构建而成。技术社区将和NULS核心开发团队共同搭建NULS底层,通过实现模块化、多链并行、跨链等机制,让企业/个人都可以通过简单配置定制自己的区块链。")]),t._v(" "),r("p",[t._v("在社区里我们坚持以下的理念:")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),r("p",[t._v("NULS技术社区向所有开发者开放。\n如果你:\n对区块链世界充满期待,希望用代码创造出新的世界。")]),t._v(" "),r("p",[t._v("请加入我们的技术社区电报群:"),r("a",{attrs:{href:"https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ"),r("OutboundLink")],1),t._v("\n注意:我们不是寻求任务外包。任何你认为值得改进的地方,都是你可以发挥的空间。")]),t._v(" "),t._m(4),t._v(" "),r("p",[t._v("NULS团队会为技术社区的每一个为NULS项目作出贡献的开发者提供奖励,奖励的大小基于贡献的大小。\n目前,如果你能通过前期表现,加入技术社区核心开发团队(Code Craft Council),我们会为你创建一个节点,并委托20万NULS Token,节点奖励的50%部分将用于支持开发者(目前大约1500NULS/月),剩下50%会注入社区基金池。注:50%是初始值,后续调整由社区决定,我们会在社区进行公示。")]),t._v(" "),t._m(5),t._v(" "),r("p",[t._v("让造链变得容易!\n首先,我们希望建立一个涵盖80%区块链底层技术的模块仓库。\n通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更加融入到日常生活中。\n我们正和技术社区一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。\n其次,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),极大的缩短了目前公链开发少则半年多则1年的耗时。\n以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。\n现在NULS技术社区有中西方开发者200余人,我们欢迎更多的开发者加入。你们将协助核心团队进行NULS底层的开发工作。")]),t._v(" "),t._m(6),t._v(" "),r("p",[t._v("(1)我们一直认为NULS属于社区,NULS技术的长远发展离不开极具创造力的社区技术力量,在过去一年时间里我们很高兴能看到社区开发者自愿为NULS贡献自己的力量。其中来自英国的Josh为NULS开发了官网(nuls.io),来自法国的Moshe为NULS开发了区块链浏览器(nuls.world/)和轻钱包(nuls.world/wallet),来自玻利维亚的Berzeck正在参与NULS的底层开发工作。")]),t._v(" "),r("p",[t._v("(2)尽管如此,我们还有很多的工作尚待完成。我们会在本帖下方持续更新一个任务清单,该清单会包含NULS的设计、开发、改进等方面的工作。所有开发者都可以根据自己的能力和兴趣进行选择。")]),t._v(" "),t._m(7),t._v(" "),r("p",[t._v("(1)为方便沟通,请先加入技术社区的Telegram群(见上),并阅读群置顶消息;")]),t._v(" "),r("p",[t._v("(2)跟社区开发者Moshe进行初步沟通,简要介绍自己的经历、擅长的编程语言等,社区开发者会跟你交流一些技术相关信息,并了解你希望做些什么,这将决定你接下来的工作内容。\n同时我们强烈建议你通过下面的链接,去了解更多关于NULS的内容:")]),t._v(" "),r("ul",[r("li",[t._v("官网:"),r("a",{attrs:{href:"https://nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("代码:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("开发者文档:"),r("a",{attrs:{href:"https://dev.nuls.io/docs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://dev.nuls.io/docs/"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("社区论坛:"),r("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),r("OutboundLink")],1)])]),t._v(" "),r("p",[t._v("(3)你可以选择感兴趣并胜任的任务。届时,我们会让你加入各个开发小组,同其他开发人员一起工作。在这里,我们强烈建议你下载微信作为沟通交流工具:\n"),r("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("(4)在小组中,各小组leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),r("p",[t._v("技术社区和核心团队经过仔细审核后,如果申请被批准,我们将为你创建一个节点(这将是你获得奖励的基础)。")]),t._v(" "),t._m(8),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.community/d/90-nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("任务清单"),r("OutboundLink")],1),t._v("持续更新中")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"如何成为社区开发者"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#如何成为社区开发者","aria-hidden":"true"}},[this._v("#")]),this._v(" 如何成为社区开发者")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、nuls简介"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls简介","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、NULS简介")])},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ul",[r("li",[t._v("平等 (Equal):技术社区与核心团队是平等关系,一起合作开发;")]),t._v(" "),r("li",[t._v("共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态;")]),t._v(" "),r("li",[t._v("共享 (Sharing):\n"),r("ul",[r("li",[t._v("社区共享NULS技术成果")]),t._v(" "),r("li",[t._v("社区共享NULS发展红利")]),t._v(" "),r("li",[t._v("社区共享NULS的影响力和名誉")]),t._v(" "),r("li",[t._v("行业共享NULS带来的技术革新")]),t._v(" "),r("li",[t._v("行业共享NULS推动行业发展的标准制定")])])]),t._v(" "),r("li",[t._v("公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正;")]),t._v(" "),r("li",[t._v("创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、你是我们在寻找的ta吗?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、你是我们在寻找的ta吗?","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、你是我们在寻找的TA吗?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、我们能提供什么?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、我们能提供什么?","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、我们能提供什么?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、我们的计划"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、我们的计划","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、我们的计划")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、技术社区的现状:"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、技术社区的现状:","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、技术社区的现状:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、如何加入开发团队"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、如何加入开发团队","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、如何加入开发团队")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、查看任务清单"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、查看任务清单","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、查看任务清单")])}],!1,null,null,null);a.options.__file="joinCCC.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/175.ff16c02e.js b/docs/.vuepress/dist/assets/js/175.ff16c02e.js new file mode 100644 index 00000000..f1265b11 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/175.ff16c02e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[175],{807:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"api手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#api手册","aria-hidden":"true"}},[this._v("#")]),this._v(" API手册")])])}],!1,null,null,null);i.options.__file="APIManual.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/176.5d7156d4.js b/docs/.vuepress/dist/assets/js/176.5d7156d4.js new file mode 100644 index 00000000..8ab4c9a4 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/176.5d7156d4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[176],{805:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("hr"),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("​\t本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("Linux内核版本推荐使用 2.6.32及以上")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),a("ul",[t._m(15),t._v(" "),a("li",[a("p",[t._v("进入"),a("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS官网钱包下载"),a("OutboundLink")],1),t._v("界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。")]),t._v(" "),a("p",[t._v("Linux系统中下载v1.0.0版的钱包可以使用如下命令:")]),t._v(" "),t._m(16),a("p",[t._v("注:如果后续有其他版本,下载地址可能会不同。")])])]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("输出打印所有的命令,")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("返回信息 help")]),t._v(" "),t._m(30),a("p",[t._v("返回信息 help -a")]),t._v(" "),t._m(31),a("p",[t._v("示例")]),t._v(" "),t._m(32),t._m(33),t._v(" "),a("p",[t._v("创建账户,返回账户地址集合")]),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter;")]),t._v(" "),a("p",[t._v("返回账户集合")]),t._v(" "),t._m(36),a("p",[t._v("示例 创建2个没有密码的账户")]),t._v(" "),t._m(37),t._m(38),t._v(" "),a("p",[t._v("备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),a("p",[t._v("注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。")]),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(41),a("p",[t._v("示例 备份一个有密码的账户")]),t._v(" "),t._m(42),t._m(43),t._v(" "),a("p",[t._v("根据账户地址移除本地账户,如果账户已加密,则需要输入密码")]),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(46),a("p",[t._v("示例")]),t._v(" "),t._m(47),t._m(48),t._v(" "),a("p",[t._v("根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。")]),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(51),a("p",[t._v("示例")]),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(56),a("p",[t._v("示例")]),t._v(" "),t._m(57),t._m(58),t._v(" "),a("p",[t._v("给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示")]),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("返回信息 交易hash")]),t._v(" "),t._m(61),a("p",[t._v("示例")]),t._v(" "),t._m(62),t._m(63),t._v(" "),a("p",[t._v("导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),a("p",[t._v("注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(66),a("p",[t._v("示例")]),t._v(" "),t._m(67),t._m(68),t._v(" "),a("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。")]),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("p",[t._v("注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(71),a("p",[t._v("示例")]),t._v(" "),t._m(72),t._m(73),t._v(" "),a("p",[t._v("导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。")]),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),a("p",[t._v("注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。")]),t._v(" "),a("p",[t._v("覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。")]),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(76),a("p",[t._v("示例")]),t._v(" "),t._m(77),t._m(78),t._v(" "),a("p",[t._v("根据账户地址查询账户信息")]),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(81),a("p",[t._v("示例")]),t._v(" "),t._m(82),t._m(83),t._v(" "),a("p",[t._v("根据分页参数查询账户列表,所有账户以创建时间倒序输出。")]),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),a("p",[t._v("返回信息,将输出账户集合")]),t._v(" "),t._m(86),a("p",[t._v("示例 获取账户列表 显示第一页,每页显示2条")]),t._v(" "),t._m(87),t._m(88),t._v(" "),a("p",[t._v("根据账户地址查询账户私钥,如果账户已加密,则需要输入密码")]),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(91),a("p",[t._v("示例")]),t._v(" "),t._m(92),t._m(93),t._v(" "),a("p",[t._v("根据账户地址查询账户余额")]),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),a("p",[t._v("返回信息 导入的账户地址")]),t._v(" "),t._m(96),a("p",[t._v("示例")]),t._v(" "),t._m(97),t._m(98),t._v(" "),a("p",[t._v("根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。")]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),a("p",[t._v("返回信息 转账交易hash")]),t._v(" "),t._m(101),a("p",[t._v("示例")]),t._v(" "),t._m(102),t._m(103),t._v(" "),a("p",[t._v("根据交易hash查询交易详细信息")]),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),a("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(106),a("p",[t._v("示例 查询转账交易")]),t._v(" "),t._m(107),t._m(108),t._v(" "),a("p",[t._v("根据账户地址,查询该账户的交易列表")]),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),a("p",[t._v("返回信息 交易详细信息")]),t._v(" "),t._m(111),a("p",[t._v("示例")]),t._v(" "),t._m(112),t._m(113),t._v(" "),a("p",[t._v("根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。")]),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),a("p",[t._v("返回信息 返回节点的agent hash")]),t._v(" "),t._m(116),a("p",[t._v("示例 创建一个节点,佣金比例为10%,押金20000NULS。")]),t._v(" "),t._m(117),t._m(118),t._v(" "),a("p",[t._v("根据账户地址和节点agentHash,加入共识,至少需要2000NULS")]),t._v(" "),t._m(119),t._v(" "),t._m(120),t._v(" "),a("p",[t._v("返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。")]),t._v(" "),t._m(121),a("p",[t._v("示例")]),t._v(" "),t._m(122),t._m(123),t._v(" "),a("p",[t._v("根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。")]),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("返回信息 退出共识交易hash")]),t._v(" "),t._m(126),a("p",[t._v("示例")]),t._v(" "),t._m(127),t._m(128),t._v(" "),a("p",[t._v("停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。")]),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),a("p",[t._v("返回信息 停止节点交易hash")]),t._v(" "),t._m(131),a("p",[t._v("示例")]),t._v(" "),t._m(132),t._m(133),t._v(" "),a("p",[t._v("根据节点agentHash获取节点详情")]),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(136),a("p",[t._v("示例")]),t._v(" "),t._m(137),t._m(138),t._v(" "),a("p",[t._v("根据共识节点列表")]),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(141),a("p",[t._v("示例")]),t._v(" "),t._m(142),t._m(143),t._v(" "),a("p",[t._v("查询全网共识总体信息")]),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(145),a("p",[t._v("示例")]),t._v(" "),t._m(146),t._m(147),t._v(" "),a("p",[t._v("根据账户地址获取该账户参与的所有委托(共识)信息的总览")]),t._v(" "),t._m(148),t._v(" "),t._m(149),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(150),a("p",[t._v("示例")]),t._v(" "),t._m(151),t._m(152),t._v(" "),a("p",[t._v("根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表")]),t._v(" "),t._m(153),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(155),a("p",[t._v("示例")]),t._v(" "),t._m(156),t._m(157),t._v(" "),a("p",[t._v("根据地址查询该账户委托的节点列表(返回节点信息列表)")]),t._v(" "),t._m(158),t._v(" "),t._m(159),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(160),a("p",[t._v("示例 获取第一页,每页显示两条")]),t._v(" "),t._m(161),t._m(162),t._v(" "),a("p",[t._v("获取最新的区块头信息")]),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(164),a("p",[t._v("示例")]),t._v(" "),t._m(165),t._m(166),t._v(" "),a("p",[t._v("根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(169),a("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(170),t._m(171),t._v(" "),a("p",[t._v("根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(174),a("p",[t._v("示例 根据高度获取区块头")]),t._v(" "),t._m(175),t._m(176),t._v(" "),a("p",[t._v("查询网络基本信息")]),t._v(" "),t._m(177),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(178),a("p",[t._v("示例")]),t._v(" "),t._m(179),t._m(180),t._v(" "),a("p",[t._v("查询网络节点IP")]),t._v(" "),t._m(181),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(182),a("p",[t._v("示例 根据高度获取区块")]),t._v(" "),t._m(183),t._m(184),t._v(" "),a("p",[t._v("查询当前版本号")]),t._v(" "),t._m(185),t._v(" "),a("p",[t._v("返回信息")]),t._v(" "),t._m(186),a("p",[t._v("示例")]),t._v(" "),t._m(187),t._m(188),t._v(" "),a("p",[t._v("查询当前版本号")]),t._v(" "),t._m(189),t._v(" "),a("p",[t._v("示例")]),t._v(" "),t._m(190),t._m(191),t._v(" "),a("p",[t._v("退出操作钱包的命令行程序,不会退出已启动的钱包节点。")]),t._v(" "),t._m(192),t._v(" "),a("p",[t._v("示例")]),t._v(" "),t._m(193)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"cli-使用指南"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli-使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" CLI 使用指南")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"版本更新记录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内容")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-12")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("主网正式版全部功能")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"准备"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#准备","aria-hidden":"true"}},[this._v("#")]),this._v(" 准备")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"服务器硬件配置"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#服务器硬件配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 服务器硬件配置")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("建立NULS节点的服务器不低于如下配置:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("四核 3.0GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("128G硬盘")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20M上行")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("推荐配置:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("内存")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("硬盘")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("宽带")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("八核 3.0GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("256G硬盘")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("100M上行")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"系统及内核版本"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#系统及内核版本","aria-hidden":"true"}},[this._v("#")]),this._v(" 系统及内核版本")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("Linux系统")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("CentOS (推荐)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"开始"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 开始")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"下载"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#下载","aria-hidden":"true"}},[this._v("#")]),this._v(" 下载")])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"安装"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[this._v("#")]),this._v(" 安装")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("在Linux中解压已下载的文件")]),this._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"运行"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#运行","aria-hidden":"true"}},[this._v("#")]),this._v(" 运行")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("进入解压后的bin目录,并运行启动脚本,启动全节点钱包")]),this._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("$ cd bin\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"使用钱包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 使用钱包")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"快速入门"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。")]),t._v(" "),a("p",[t._v("进入bin目录,执行如下命令:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("$ ./cmd.sh\n")])])]),a("p",[t._v("将会出现NULS命名输入提示符"),a("code",[t._v("nuls>>>")]),t._v(" ,然后可直接输入NULS钱包操作命令,来进行操作。")]),t._v(" "),a("p",[t._v("例如,创建账户的示例如下:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),a("p",[t._v("执行"),a("code",[t._v("create")]),t._v("命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"约定"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("设置密码规则:密码长度在8至20位,必须同时包含字母和数字。")]),this._v(" "),s("li",[this._v('命令参数说明: 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。')])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"钱包命令"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#钱包命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 钱包命令")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"帮助命令"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#帮助命令","aria-hidden":"true"}},[this._v("#")]),this._v(" 帮助命令")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令: help [-a] **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[this._v("-a")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("格式化打印命令,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("getaccount
--get account information\n\tOPTIONS"),s("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> help\nnuls>>> help -a\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"创建账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令: create [number] **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("创建账户的数量,选填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> create 2\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:\n[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"备份账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:backup
[path]")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("[path]")]),t._v(" "),a("td",[t._v("文件生成备份文件的目标文件夹,默认为当前文件夹,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nThe path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"移除账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 移除账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:remove
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"设置账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#设置账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:setpwd
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"修改账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#修改账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:resetpwd
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nEnter your old password:**********\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"设置别名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:setalias
")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户的地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("别名名称,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias\n"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户keystore")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:importkeystore **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("待导入的keystore文件地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:import **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"导入账户私钥-覆盖导入"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#导入账户私钥-覆盖导入","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户私钥(覆盖导入)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:import **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("账户的私钥,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getaccount
")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",{staticStyle:{"text-align":"left"}},[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",{staticStyle:{"text-align":"left"}},[this._v("账户地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//别名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//公钥\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//私钥(如果账户设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加密后的私钥(如果账户没有设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//是否加密(是否设置了密码"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\n{\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getaccounts ")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//别名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//公钥\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//私钥(如果账户设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加密后的私钥(如果账户没有设置了密码,该项为空"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//是否加密(是否设置了密码"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:02:23"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getaccounts 1 2\n[ {\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}, {\n "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",\n "alias" : null,\n "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",\n "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",\n "encryptedPriKey" : "",\n "extend" : null,\n "createTime" : "2018-07-13 11:02:23",\n "encrypted" : false\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getprikey
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\n"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询账户余额"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询账户余额")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getbalance
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户的地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//已锁定余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//可用余额\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "balance" : "9999998.99",\n "locked" : "0",\n "usable" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"转账"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 转账")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:transfer
[remark] **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("转出地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("接收地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("转账数量,最多可以有8位小数(单位:NULS),必填")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("备注信息,选填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询交易详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:gettx ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("交易hash,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型(此示例为转账交易)\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包交易的区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//(转账)交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//备注\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//签名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易确认状态(已确认或者未确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("46")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("254")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易的输入\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979998.98"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易的输出\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"')]),t._v("//交易输出的目标地址(此数据相当于转出"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("给目标地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易输出的目标地址(此数据相当于找零给自己"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979898.979"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596\n{\n "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "type" : "transfer",\n "time" : "2018-07-16 11:21:46",\n "blockHeight" : 26269,\n "fee" : "0.001",\n "value" : "100",\n "remark" : "转账",\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",\n "status" : "confirm",\n "confirmCount" : 46,\n "size" : 254,\n "inputs" : [ {\n "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979998.98",\n "lockTime" : 0\n } ],\n "outputs" : [ {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 0,\n "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",\n "value" : "100",\n "lockTime" : 0,\n "status" : "usable"\n }, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979898.979",\n "lockTime" : 0,\n "status" : "usable"\n } ]\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询交易列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询交易列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询交易列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:gettxlist
")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26473")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:55:43"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("//信息\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10\n[ {\n "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",\n "blockHeight" : 26473,\n "time" : "2018-07-16 11:55:43",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n}, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "blockHeight" : 26269,\n "time" : "2018-07-16 11:21:46",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"创建节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建节点")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:createagent **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("创建节点的账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("代理佣金比例,范围:10~100,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("创建节点的保证金,不能低于20000NULS,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"加入共识(委托节点)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#加入共识(委托节点)","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入共识(委托节点)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:deposit
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("节点的agentHash,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("加入共识保证金,不能低于2000NULS,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"退出共识(退出委托)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#退出共识(退出委托)","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识(退出委托)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:withdraw
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("委托时的交易hash,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"停止节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#停止节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 停止节点")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:stopagent
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户地址,必填")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取节点详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取节点详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取节点详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getagent **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("")]),this._v(" "),s("td",[this._v("节点agentHash值,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6\n{\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.05,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取节点列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取节点列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取节点列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getagents **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getagents 1 2\n[ {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.18,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}, {\n "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",\n "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "deposit" : "20000",\n "commissionRate" : 10.0,\n "agentName" : null,\n "agentId" : "5CE291D8",\n "time" : "2018-07-16 16:31:12",\n "blockHeight" : 28126,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.16,\n "totalDeposit" : "208000",\n "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取全网共识总体信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取全网共识总体信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取全网共识总体信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getconsensus **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1758000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//总委托数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusAccountNumber"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识账户数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAgentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v("//打包地址数量\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getconsensus\n{\n "agentCount" : 6,\n "totalDeposit" : "1758000",\n "rewardOfDay" : "0",\n "consensusAccountNumber" : 6,\n "packingAgentCount" : 6\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托总览"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托总览","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托总览")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositedinfo
**")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("table",[s("thead",[s("tr",[s("th",[this._v("参数")]),this._v(" "),s("th",[this._v("说明")])])]),this._v(" "),s("tbody",[s("tr",[s("td",[this._v("
")]),this._v(" "),s("td",[this._v("账户地址,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建的节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1600000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//总共委托的数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"joinAgentCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//加入委托的节点数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usableBalance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8048998.869"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//可用余额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//得到的奖励总数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//一天得到的奖励数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"')]),t._v("//节点hash\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "agentCount" : 1,\n "totalDeposit" : "1600000",\n "joinAgentCount" : 6,\n "usableBalance" : "8048998.869",\n "reward" : "219.65910271",\n "rewardOfDay" : "219.65910271",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托信息列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托信息列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托信息列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositeds
[agentHash] **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])]),t._v(" "),a("tr",[a("td",[t._v("[agentHash]")]),t._v(" "),a("td",[t._v("节点Hash,选填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托金额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托者地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:38:25"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//委托交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28148")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),t._v("//节点地址\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "deposit" : "2000",\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:25",\n "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",\n "blockHeight" : 28148,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "35024DE6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"\n}, {\n "deposit" : "2000",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:43",\n "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",\n "blockHeight" : 28149,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "E09EB7FD",\n "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取单个账户的委托节点列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取单个账户的委托节点列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取单个账户的委托节点列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getdepositedagents
**")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("账户地址,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("页数,需要获取第几页的数据,必填")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("每一页显示的数据条数,必填")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的账户地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点打包(出块"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//奖励地址(默认为创建节点地址"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点的保证金\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("40.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//代理佣金比例\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点名称(来源"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0198ACAF"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点ID\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:32:52"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28136")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//创建节点交易的块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//状态\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.91")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//信用值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"204000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//节点当前委托总额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("//参与数\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",\n "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "deposit" : "20000",\n "commissionRate" : 40.0,\n "agentName" : null,\n "agentId" : "0198ACAF",\n "time" : "2018-07-16 16:32:52",\n "blockHeight" : 28136,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.91,\n "totalDeposit" : "204000",\n "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "memberCount" : 3\n}, {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.91,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"获取最新的区块头信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#获取最新的区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取最新的区块头信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:getbestblockheader")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:40"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33950")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("668413")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("204")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",\n "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",\n "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",\n "time" : "2018-07-17 10:25:40",\n "height" : 33950,\n "txCount" : 1,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 668413,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-17 10:25:30",\n "packingIndexOfRound" : 1,\n "reward" : "0",\n "fee" : "0",\n "confirmCount" : 0,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询区块信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询区块信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getblock | **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的hash值")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的高度")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//交易集合\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coinbase"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易类型\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易所在区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//交易的输入\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //交易的输出\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("29115")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6174,\n "size" : 507,\n "txList" : [ {\n "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",\n "type" : "coinbase",\n "time" : "2018-07-16 16:29:30",\n "blockHeight" : 28115,\n "fee" : "0",\n "value" : null,\n "remark" : null,\n "scriptSig" : null,\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 54,\n "inputs" : [ ],\n "outputs" : [ {\n "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "value" : 100000,\n "lockTime" : 29115\n } ]\n }, {\n "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",\n "type" : "transfer",\n "time" : "2018-07-16 16:29:27",\n "blockHeight" : 28115,\n "fee" : "0.001",\n "value" : null,\n "remark" : null,\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 249,\n "inputs" : [ {\n "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 972899896100000\n } ],\n "outputs" : [ {\n "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",\n "value" : 3000000000000,\n "lockTime" : 0\n }, {\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 969899896000000,\n "lockTime" : 0\n } ]\n } ],\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询区块头信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询区块头信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询区块头信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getblockheader | **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("参数")]),t._v(" "),a("th",[t._v("说明")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的hash值")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("区块的高度")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//前一区块hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//梅克尔hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块生成时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块打包交易数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//打包地址\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识轮次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//参与共识成员数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次开始时间\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//当前轮次打包出块的名次\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//共识奖励\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块的打包手续费\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//确认次数\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//区块大小\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//签名\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询网络信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询网络信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getnetinfo **")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//本地最新区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络最新区块高度\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//网络时间偏移值\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//被动连接节点数量\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//主动连接节点数量\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getnetinfo\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询网络节点ip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询网络节点ip","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询网络节点IP")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:getnetnodes **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> getnetnodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"查询当前版本信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#查询当前版本信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 查询当前版本信息")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:version **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('nuls>>> version\n{\n "myVersion" : "1.0.0",\n "newestVersion" : "0.9.11",\n "upgradable" : false,\n "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization"\n}\n')])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"版本更新"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("**命令:upgrade **")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> version 1.0.0\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"退出钱包命令程序"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#退出钱包命令程序","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出钱包命令程序")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("strong",[this._v("命令:exit")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="clientCLI.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/177.89dacd78.js b/docs/.vuepress/dist/assets/js/177.89dacd78.js new file mode 100644 index 00000000..7adf8cda --- /dev/null +++ b/docs/.vuepress/dist/assets/js/177.89dacd78.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[177],{803:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("使用构建工具导入jar包")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._m(10),t._v(" "),a("p",[t._v("首先添加SDK命名空间")]),t._v(" "),t._m(11),a("p",[t._v("引入后 使用下列代码生成一个实例client")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._m(14),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),a("p",[t._v("--")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._m(25),t._v(" "),t._m(26),a("hr"),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(28),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(31),t._v(" "),t._m(32),t._m(33),t._v(" "),t._m(34),a("hr"),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(36),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._m(41),t._v(" "),t._m(42),a("hr"),t._v(" "),t._m(43),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(44),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),a("hr"),t._v(" "),t._m(52),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(53),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(56),t._v(" "),t._m(57),t._m(58),t._v(" "),t._m(59),a("hr"),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(61),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(64),t._v(" "),t._m(65),t._m(66),t._v(" "),t._m(67),a("hr"),t._v(" "),t._m(68),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(69),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(72),t._v(" "),t._m(73),t._m(74),t._v(" "),t._m(75),a("hr"),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(77),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._m(82),t._v(" "),t._m(83),t._m(84),t._v(" "),t._m(85),t._m(86),t._v(" "),t._m(87),a("hr"),t._v(" "),t._m(88),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(89),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(92),t._v(" "),t._m(93),t._m(94),t._v(" "),t._m(95),a("hr"),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(97),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._m(102),t._v(" "),t._m(103),a("hr"),t._v(" "),t._m(104),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(105),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(108),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),a("hr"),t._v(" "),t._m(112),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(116),t._v(" "),t._m(117),t._m(118),t._v(" "),t._m(119),t._m(120),t._v(" "),t._m(121),t._m(122),t._v(" "),t._m(123),a("hr"),t._v(" "),t._m(124),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(128),t._v(" "),t._m(129),t._m(130),t._v(" "),t._m(131),t._m(132),t._v(" "),t._m(133),a("hr"),t._v(" "),t._m(134),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(135),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(138),t._v(" "),t._m(139),t._m(140),t._v(" "),t._m(141),t._m(142),t._v(" "),t._m(143),a("hr"),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(145),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(148),t._v(" "),t._m(149),t._m(150),t._v(" "),t._m(151),t._m(152),t._v(" "),t._m(153),a("hr"),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(155),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(156),t._v(" "),t._m(157),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(158),t._v(" "),t._m(159),t._m(160),t._v(" "),t._m(161),t._m(162),t._v(" "),t._m(163),a("hr"),t._v(" "),t._m(164),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(165),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(166),t._v(" "),t._m(167),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(168),t._v(" "),t._m(169),t._m(170),t._v(" "),t._m(171),a("hr"),t._v(" "),t._m(172),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(174),t._v(" "),t._m(175),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(176),t._v(" "),t._m(177),t._m(178),t._v(" "),t._m(179),a("hr"),t._v(" "),t._m(180),t._v(" "),t._m(181),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(182),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(183),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),a("hr"),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(189),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(190),t._v(" "),t._m(191),t._v(" "),t._m(192),t._v(" "),t._m(193),a("blockquote"),t._v(" "),a("hr"),t._v(" "),t._m(194),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(195),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(196),t._v(" "),t._m(197),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(198),t._v(" "),t._m(199),t._m(200),t._v(" "),t._m(201),a("hr"),t._v(" "),t._m(202),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(203),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(204),t._v(" "),t._m(205),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(206),t._v(" "),t._m(207),t._m(208),t._v(" "),t._m(209),a("hr"),t._v(" "),t._m(210),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(211),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(212),t._v(" "),t._m(213),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(214),t._v(" "),t._m(215),t._m(216),t._v(" "),t._m(217),a("hr"),t._v(" "),t._m(218),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(219),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(220),t._v(" "),t._m(221),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(222),t._v(" "),t._m(223),t._m(224),t._v(" "),t._m(225),a("hr"),t._v(" "),t._m(226),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(227),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(228),t._v(" "),t._m(229),t._v(" "),t._m(230),t._v(" "),t._m(231),a("hr"),t._v(" "),t._m(232),t._v(" "),t._m(233),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(234),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(235),t._v(" "),a("table",[t._m(236),t._v(" "),t._m(237),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privKeys")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("passwords")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥对应的密码(多个账户密码必须一样)")])])]),t._v(" "),t._m(238),t._v(" "),t._m(239),a("blockquote"),t._v(" "),t._m(240),t._v(" "),t._m(241),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(242),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(243),t._v(" "),t._m(244),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(245),t._v(" "),t._m(246),t._m(247),t._v(" "),t._m(248),a("hr"),t._v(" "),t._m(249),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(250),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(251),t._v(" "),t._m(252),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(253),t._v(" "),t._m(254),t._m(255),t._v(" "),t._m(256),a("hr"),t._v(" "),t._m(257),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(258),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(259),t._v(" "),t._m(260),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(261),t._v(" "),t._m(262),t._m(263),t._v(" "),t._m(264),a("hr"),t._v(" "),t._m(265),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(266),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(267),t._v(" "),t._m(268),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(269),t._v(" "),t._m(270),t._m(271),t._v(" "),t._m(272),a("hr"),t._v(" "),t._m(273),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(274),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(275),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(276),t._v(" "),t._m(277),t._m(278),t._v(" "),t._m(279),a("hr"),t._v(" "),t._m(280),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(281),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(282),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(283),t._v(" "),t._m(284),t._m(285),t._v(" "),t._m(286),a("hr"),t._v(" "),t._m(287),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(288),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(289),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(290),t._v(" "),t._m(291),t._m(292),t._v(" "),t._m(293),a("hr"),t._v(" "),t._m(294),t._v(" "),t._m(295),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(296),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(297),t._v(" "),t._m(298),t._v(" "),t._m(299),t._v(" "),t._m(300),a("hr"),t._v(" "),t._m(301),t._v(" "),t._m(302),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(303),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(304),t._v(" "),t._m(305),t._v(" "),t._m(306),t._v(" "),t._m(307),a("hr"),t._v(" "),t._m(308),t._v(" "),t._m(309),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(310),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(311),t._v(" "),t._m(312),t._v(" "),t._m(313),t._v(" "),t._m(314),t._m(315),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(316),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(317),t._v(" "),t._m(318),t._v(" "),t._m(319),t._v(" "),t._m(320),t._m(321),t._v(" "),a("p",[t._v("接口")]),t._v(" "),t._m(322),t._v(" "),a("p",[t._v("说明")]),t._v(" "),t._m(323),t._v(" "),t._m(324),t._v(" "),a("p",[t._v("返回结果")]),t._v(" "),t._m(325),t._v(" "),t._m(326),t._m(327),t._v(" "),t._m(328),t._m(329),t._v(" "),t._m(330),t._v(" "),t._m(331),t._v(" "),t._m(332),t._v(" "),t._m(333),t._m(334),t._v(" "),t._m(335),t._m(336),t._v(" "),t._m(337),t._m(338),t._v(" "),t._m(339),t._m(340),t._v(" "),t._m(341),a("hr"),t._v(" "),t._m(342),t._v(" "),t._m(343),a("hr"),t._v(" "),t._m(344),t._v(" "),t._m(345),a("hr"),t._v(" "),t._m(346),t._v(" "),t._m(347),a("hr"),t._v(" "),t._m(348),t._v(" "),t._m(349),a("hr"),t._v(" "),t._m(350),t._v(" "),t._m(351),a("hr"),t._v(" "),t._m(352),t._v(" "),t._m(353),a("hr"),t._v(" "),t._m(354),t._v(" "),t._m(355)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" 介绍")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"约定"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#约定","aria-hidden":"true"}},[this._v("#")]),this._v(" 约定")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("所有SDK接口统一返回Result(说明见文末附件数据解释)")]),t._v(" "),a("li",[t._v("每个接口描述的返回对象是指Result中data属性的内容")]),t._v(" "),a("li",[t._v("除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na")]),t._v(" "),a("li",[t._v("运行SDK前,需要确认NULS节点服务已经启动并工作正常")]),t._v(" "),a("li",[t._v("推荐使用JDK1.8+")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"版本更新记录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#版本更新记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 版本更新记录")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("版本")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新日期")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("更新内容")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-19")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("对接NULS服务各项基础功能的接口")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-22")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.14")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-04")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.15")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-07")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增4个共识接口,4.1——4.4")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.16")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-11")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增接口4.5")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.0.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-13")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增错误码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.1.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-09-28")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("新增多账户转账接口")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"快速入门"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#快速入门","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速入门")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-引入文件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-引入文件","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.引入文件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("maven方式")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-xml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-xml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("dependency")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("groupId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("io.nuls.sdk"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("artifactId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("sdk-all"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1.0.1"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-创建sdk实例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-创建sdk实例","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.创建SDK实例")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//SDK启动类命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//引入SDK调用工具的命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("初始化SDK")]),this._v(" "),s("li",[this._v("初始化方法不传参数时,默认PRC ip和端口分别为"),s("code",[this._v("127.0.0.1")]),this._v(","),s("code",[this._v("8001")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//默认 ")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//传入NULS服务的ip,port")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.88"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("使用工具类调用接口方法")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 创建一个带密码的账户的完整示例")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//根据需求引入对应模块的命名空间")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\tSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"账户-accountservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#账户-accountservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户 AccountService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-创建账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 创建账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAccount(int count, String password);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户;\n成功创建的账户信息将被持久化至NULS服务本地数据库中。")]),this._v(" "),s("p",[this._v("返回成功创建的账户地址集合")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建账户的数量(默认1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //返回创建账户的地址集合\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-2-创建离线账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-创建离线账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 创建离线账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createOfflineAccount(int count, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作\nCreate encrypted off-line accounts (Not saved to the database)")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建账户的数量(默认1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiBQg72BCLmLqttRpPfp8ECRCBwbdD"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529314943624")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"')]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个没有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建一个有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个没有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建3个有密码的离线账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-3-获取账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-获取账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.3 获取账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccount(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址获取一个账户的信息")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("AccountInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-4-获取设置别名的手续费"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-获取设置别名的手续费","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.4 获取设置别名的手续费")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAliasFee(String address, String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费)")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("double")]),this._v(", unit is "),s("code",[this._v("NULS")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意!")]),this._v(" 此接口返回的手续费单位为"),s("code",[this._v("NULS")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待设置的别名名称")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.01")]),t._v(" //(单位为NULS"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAliasFee")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-5-获取账户列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-获取账户列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.5 获取账户列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccountList(int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据分页参数获取账户列表")]),this._v(" "),s("p",[this._v("Result.data Page "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("页码,必须大于0 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("每页返回数据记录数量, 取值范围1~100")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cid96JrTGA2XaNG6zXrRKh18kLUbLP"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529311250627")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t...\n\t\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-6-根据账户别名获取账户地址"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-根据账户别名获取账户地址","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.6 根据账户别名获取账户地址")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAddressByAlias(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户别名获取账户地址字符串")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户别名 ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[this._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAddressByAlias")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-7-获取账户私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-获取账户私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.7 获取账户私钥")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getPrikey(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址和密码获取账户私钥,返回私钥字符串")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//有密码的账户调用方式")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//无密码的账户调用方式")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-8-验证别名是否可以使用"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-验证别名是否可以使用","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.8 验证别名是否可以使用")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isAliasUsable(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据别名名称验证别名是否可用(是否没有被使用)")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("别名名称")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示别名可以使用\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回 别名不可用的情况")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示别名不可以使用\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isAliasUsable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-9-备份账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.9 备份账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result backupAccount(String address, String path, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码")]),this._v(" "),s("p",[this._v("Result 返回生成的文件地址")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//备份一个没有密码的账户至当前目录")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//备份一个有密码的账户至/backup目录")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-10-导入账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-导入账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.10 导入账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByKeystore")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path/fileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String/FileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(".keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入一个有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入一个没有密码的账户")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-11-导入账户-私钥"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-导入账户-私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.11 导入账户(私钥)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByPriKey(String privateKey, String password, boolean overwrite)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据私钥导入账户")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privateKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户私钥 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入账户时设置密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//导入账户时不设置密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-12-验证账户是否加密"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-验证账户是否加密","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.12 验证账户是否加密")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isEncrypted(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("验证账户是否加密")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示已加密\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回 未加密")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isEncrypted")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-移除账户"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 移除账户")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result removeAccount(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("移除账户")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-设置密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-设置密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 设置密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPassword(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为未加密的账户设置密码,已加密账户不能调用此接口")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-14-修改密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-修改密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.14 修改密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPassword(String address, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为已加密的账户修改密码,未加密账户不能调用此接口")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户当前密码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示成功\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回不成功 以及错误的情况,例如参数错误")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-15-设置别名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.15 设置别名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setAlias(String address, String alias, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("为账户设置一个别名")]),this._v(" "),s("p",[this._v("Result 返回设置别名的交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("待设置的别名名称")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("密码")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户密码,如果账户没有加密则不填")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"')]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("错误示例")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT007"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The account already set an alias"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-16-设置离线账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-设置离线账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.16 设置离线账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPasswordOffline(String address, String priKey, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("设置离线账户密码, sdk中独立加密,不与NULS服务交互")]),this._v(" "),s("p",[this._v("Result 返回加密后的私钥(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-17-修改离线账户密码"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-修改离线账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.17 修改离线账户密码")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("修改离线账户密码, sdk中独立修改, 不与NULS服务交互")]),this._v(" "),s("p",[this._v("Result 返回新密码生成的加密后的私钥(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户的地址 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("encryptedPriKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("加密后的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("原密码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"交易-accountledgerservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#交易-accountledgerservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易 AccountLedgerService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-1-创建转账交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-创建转账交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 创建转账交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("通过用户传入的交易输入\\输出,组装交易。传入的参数为json对象,详见e.g示例。"),a("strong",[t._v("示例中input和output的属性都为必填项")]),t._v("。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。"),a("strong",[t._v("有关手续费的计算会在后面详细说明")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易引用的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易新生成的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的outputs,示例中的output属性均必填")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":100000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-交易签名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-交易签名","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 交易签名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signTransaction(String txHex, String priKey, String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("通过私钥,给交易签名")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 签名后的交易,16进制后的序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("十六进制的交易序列化数据")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的私钥")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥对应的地址,用于验证私钥合法性")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("私钥的密码,如果私钥未加密可不传")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString priKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS6352s!f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-根据交易hash查询交易详情"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-根据交易hash查询交易详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 根据交易hash查询交易详情")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getTxByHash(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据交易hash查询交易详情")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Transaction"}},[s("code",[this._v("Transaction")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易的hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getTxByHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-4-转账"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 转账")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result transfer(String address, String toAddress, String password, long amount, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("发起转账交易")]),this._v(" "),s("p",[this._v("Result 返回交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转出者账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("toAddress")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("接收者账户的地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转出者账户的密码,如果账户没有加密则不填")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("amount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("long")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("转账金额(单位:Na)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//账户有密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"备注1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//账户没有密码")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"备注1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-5-查询账户余额"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-查询账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.5 查询账户余额")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBalance(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取账户余额")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BalanceInfo"}},[s("code",[this._v("BalanceInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("账户地址")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-6-广播交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-6-广播交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.6 广播交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result broadcastTransaction(String txHex);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("广播交易")]),this._v(" "),s("p",[this._v("Result.data String 返回交易hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("十六进制交易序列化数据")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" service"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcastTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isSuccess")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n String txHash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-7-创建多地址转账交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-7-创建多地址转账交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.7 创建多地址转账交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("通过用户传入的交易输入\\输出,组装交易。传入的参数为json对象,详见e.g示例。"),a("strong",[t._v("示例中input和output的属性都为必填项")]),t._v("。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。"),a("strong",[t._v("有关手续费的计算会在后面详细说明")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易引用的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易新生成的未花费输出")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("nInputAccount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入账户数")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("非必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易备注")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" nInputAccount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的outputs,示例中的output属性均必填")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createMultipleInputAddressTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("nInputAccount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":100000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-8-多地址转账交易签名"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-8-多地址转账交易签名","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.8 多地址转账交易签名")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("通过私钥,给交易签名")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 签名后的交易,16进制后的序列化字符串")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("th",{attrs:{align:"center"}},[this._v("参数")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("类型")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("是否必填")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("说明")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",{attrs:{align:"center"}},[this._v("txHex")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("String")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("必填")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("十六进制的交易序列化数据")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" priKeys "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" passwords "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signMultiTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" passwords"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"区块-blockservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#区块-blockservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 区块 BlockService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-1-根据区块高度获取区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-根据区块高度获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 根据区块高度获取区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块高度获取区块头信息")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块高度")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-2-根据区块hash获取区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-根据区块hash获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 根据区块hash获取区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块hash获取区块头")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-3-根据区块高度获取区块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-根据区块高度获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 根据区块高度获取区块")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块高度获取区块")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块高度")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-4-根据区块hash获取区块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-根据区块hash获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 根据区块hash获取区块")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("根据区块hash获取区块")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("区块hash值")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"转账"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-5-获取最新区块头"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-获取最新区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 获取最新区块头")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新的区块头")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-6-获取最新区块的高度"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-6-获取最新区块的高度","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.6 获取最新区块的高度")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHight()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新区块的高度")]),this._v(" "),s("p",[this._v("Result.data 高度(Long)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5210")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-7-获取最新区块的块hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-7-获取最新区块的块hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.7 获取最新区块的块Hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取最新区块的块Hash")]),this._v(" "),s("p",[this._v("Result.data Hash值(String)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"共识-consensusservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#共识-consensusservice","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识 ConsensusService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-1-离线组装创建节点交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-离线组装创建节点交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 离线组装创建节点交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装创建节点交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("agentInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易手续费")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点信息,示例总AgentInfo的属性均必填")]),t._v("\nAgentInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AgentInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//申请共识节点的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//实际打包区块的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的保证金, 最低20000NULS,最高200000NULS ")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setCommissionRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//佣金比例 1-100")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的手续费")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("创建共识节点交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":1000000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(288 + 50 * inputs.length)/1024 ,\n其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-2-离线组装委托共识交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-离线组装委托共识交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 离线组装委托共识交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装委托共识交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("depositInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("输入信息")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("交易手续费")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//组装交易的inputs,示例中的input属性均必填")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托共识信息,示例中DepositInfo的属性均必填")]),t._v("\nDepositInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DepositInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托共识的地址")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//委托代币数量:2000NULS —— 500000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建共识节点的交易id")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点的手续费")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[a("strong",[t._v("创建委托交易手续费的计算")]),t._v(":手续费单价 * 交易大小")]),t._v(" "),a("p",[a("strong",[t._v("手续费单价(min)")]),t._v(":1000000 NA/1KB")]),t._v(" "),a("p",[a("strong",[t._v("交易大小的计算")]),t._v(":(288 + 50 * inputs.length)/1024 ,\n其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。\n出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-3-离线组装退出委托共识交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-离线组装退出委托共识交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.3 离线组装退出委托共识交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createCancelDepositTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装退出委托共识交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("参与共识时被锁定的那条output")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额,")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将output作为参数,生成退出委托共识交易")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCancelDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-4-离线组装删除共识节点交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-离线组装删除共识节点交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.4 离线组装删除共识节点交易")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createStopAgentTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("离线组装删除共识节点交易")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(" 16进制后的交易序列化字符串")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("创建节点时被锁定的那条output")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金,")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将output作为参数,生成退出委托共识交易")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createStopAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-5-获取委托共识列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-获取委托共识列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.5 获取委托共识列表")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getDeposits(String address, int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("获取地址的委托共识列表")]),this._v(" "),s("p",[this._v("Result.data List委托列表信息")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("参数")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("类型")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("是否必填")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("说明")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("委托地址")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("页码")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("必填")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("每页显示条数,1-100之间")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回结果为"),s("code",[this._v("Result")]),this._v("对象,格式如下:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000010000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("98")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g 示例代码")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDeposits")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"附录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#附录","aria-hidden":"true"}},[this._v("#")]),this._v(" 附录")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"接口返回result示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#接口返回result示例","aria-hidden":"true"}},[this._v("#")]),this._v(" 接口返回Result示例")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"result"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#result","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回具体的数据")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" data\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回true")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示接口访问正常,业务返回"),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" //接口业务功能的返回结果\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("表示接口访问正常,业务返回false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //接口执行的正确性\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" //接口业务功能的返回结果\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("返回错误的情况,例如参数错误,异常等")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//表示错误的情况\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("这是创建一个带密码的离线账户的完整返回结果")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n //data为List\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529041525794")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\t \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Account"}},[this._v(" Account ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 账户别名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 公钥\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 扩展\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 创建时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 是否加密\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 私钥(创建无密码离线账户时才会有值)\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 加密私钥(创建有密码离线账户时才会有值)\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"input"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#input","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Input"}},[this._v(" Input ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址 \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 锁定时间\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"output"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#output","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Output"}},[this._v(" Output ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 索引\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer 状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(未花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(高度锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(参与共识锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(已花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Transaction"}},[this._v(" Transaction ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易类型\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易发起时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易金额\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 备注\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(待确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(已确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 索引\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer 状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(未花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(高度锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(参与共识锁定"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(已花费"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"balanceinfo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceinfo","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BalanceInfo"}},[this._v(" BalanceInfo ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 余额\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(' 可用余额\n\tlocked"'),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long 锁定余额\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BlockHeader"}},[this._v(" BlockHeader")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 上一个区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 梅克尔hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块生成时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块打包交易数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 打包地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识轮次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 参与共识成员数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前共识轮开始时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前轮次打包出块的名次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识奖励\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 获取的打包手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#block","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Block"}},[this._v(" Block")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 上一个区块的hash值\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 梅克尔hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块生成时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块打包交易数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 打包地址\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识轮次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 参与共识成员数量\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前共识轮开始时间\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 当前轮次打包出块的名次\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 共识奖励\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 获取的打包手续费\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易的hash值\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易类型\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易发起时间\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 区块高度\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易手续费\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易金额\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 备注\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 签名\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 交易状态 "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(待确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(已确认"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 确认次数\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 大小\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" 输入\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的txHash\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 来源output的outIndex\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 转入地址\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long 转入金额\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" 输出\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 地址\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 数量\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 锁定时间\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])}],!1,null,null,null);e.options.__file="sdk.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/178.a59d32eb.js b/docs/.vuepress/dist/assets/js/178.a59d32eb.js new file mode 100644 index 00000000..e0a2f34e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/178.a59d32eb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[178],{799:function(e,t,r){"use strict";r.r(t);var n=r(0),s=Object(n.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432"),r("OutboundLink")],1)])]),e._v(" "),e._m(2),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/zh-cn/categories/115000056052"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/en-us/categories/115000056052"),r("OutboundLink")],1)])]),e._v(" "),e._m(3),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.okex.com/hc/zh-cn/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/zh-cn/categories/115000275231"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.okex.com/hc/en-us/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/en-us/categories/115000275231"),r("OutboundLink")],1)])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls交易指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls交易指南","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS交易指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"火币交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#火币交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 火币交易使用指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"币安交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#币安交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 币安交易使用指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"okex交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#okex交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" OKEx交易使用指南")])}],!1,null,null,null);s.options.__file="NULSTransaction.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/179.a6c468fe.js b/docs/.vuepress/dist/assets/js/179.a6c468fe.js new file mode 100644 index 00000000..76b79bf1 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/179.a6c468fe.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[179],{991:function(t,r,s){"use strict";s.r(r);var i=s(0),e=Object(i.a)({},function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("网页钱包地址:"),s("a",{attrs:{href:"https://wallet.nuls.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://wallet.nuls.io"),s("OutboundLink")],1)]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),s("p",[t._v("具体步骤与备份账户相同")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"网页钱包使用指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#网页钱包使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 网页钱包使用指南")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"访问钱包"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#访问钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 访问钱包")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"语言切换"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#语言切换","aria-hidden":"true"}},[this._v("#")]),this._v(" 语言切换")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击右上角,可以自由切换页面语言\n"),r("img",{attrs:{src:"https://i.imgur.com/FPnAva0.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击创建账户\n"),r("img",{attrs:{src:"https://i.imgur.com/c3K28m8.jpg",alt:""}}),this._v("\n2.设置钱包密码、仔细阅读并勾选同意服务协议、点击创建账户\n"),r("img",{attrs:{src:"https://i.imgur.com/s2iYP4P.jpg",alt:""}}),this._v(" "),r("strong",[this._v("注:创建好账户后,应立即进行备份,并将备份资料存放在安全的地方,否则有资产丢失的风险!")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"备份账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击Keystore备份"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/RWJIsW8.jpg",alt:""}}),r("br"),this._v("\n2.当您得到一个Keystore文件后,请点击备份完成\n"),r("img",{attrs:{src:"https://i.imgur.com/vuv56b1.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#导入账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击导入账户"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/wAgIdr8.jpg",alt:""}}),r("br"),this._v("\n2.点击导入Keystore"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/AUpa10l.jpg",alt:""}}),r("br"),this._v("\n3.选择你的Keystore文件后,点击打开"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/E2qvUSq.jpg",alt:""}}),r("br"),this._v("\n4.输入账户密码,点击确认\n"),r("img",{attrs:{src:"https://i.imgur.com/wM1KNqI.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"设置"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击菜单栏的设置,您可以根据需求,对当前账户进行备份、修改密码、设置别名"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/LiBaeqx.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"账户备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户备份","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户备份")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#修改密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改密码")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("输入原密码及新密码,点击确认\n"),r("img",{attrs:{src:"https://i.imgur.com/RaYCuBn.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"设置别名"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("输入别名,并确保有足够的余额,点击确定\n"),r("img",{attrs:{src:"https://i.imgur.com/9HW0ZCE.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"交易"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击转账"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/a01jlHa.jpg",alt:""}}),r("br"),this._v("\n2.输入收款地址、转账金额,手续费根据全网交易情况增减,一般默认即可"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/V9kwcHp.jpg",alt:""}}),r("br"),this._v("\n3.输入账户密码,点击确认"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/zz4sO0r.jpg",alt:""}}),r("br"),this._v("\n4.查看交易记录,状态为“已确认”则表示交易成功\n"),r("img",{attrs:{src:"https://i.imgur.com/TtZHe22.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击菜单栏的“共识”可以查看共识信息,参与共识、追加共识、退出共识等操作\n"),r("img",{attrs:{src:"https://i.imgur.com/Xg1VR2v.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"参与共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参与共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 参与共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击“加入委托”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/vXBiL9X.jpg",alt:""}}),r("br"),this._v("\n2.选择节点,也可以通过搜索节点名称,找到节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/zz28Xe6.jpg",alt:""}}),r("br"),this._v("\n3.输入委托金额,点击“确定委托”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/u2u9cNR.jpg",alt:""}}),r("br"),this._v("\n4.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"追加共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#追加共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 追加共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击我参与的共识节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/VYBcQhR.jpg",alt:""}}),r("br"),this._v("\n2.点击“追加”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/MaQ7rsg.jpg",alt:""}}),r("br"),this._v("\n3.输入委托金额,点击“确定委托”"),r("br"),this._v("\n4.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"退出共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#退出共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击我参与的共识节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/VYBcQhR.jpg",alt:""}}),r("br"),this._v("\n2.点击“退出”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/TyKOfub.jpg",alt:""}}),this._v("\n3.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#投票","aria-hidden":"true"}},[this._v("#")]),this._v(" 投票")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击“投票”进入投票页面"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/2m9ZTHT.jpg",alt:""}}),this._v("\n2.点击标题"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/fWEVFrV.jpg",alt:""}}),this._v("\n3.根据投票规则,选择您支持的事项,点击“投票”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/v9wFGqz.jpg",alt:""}}),this._v("\n4.输入账户密码,点击确认")])}],!1,null,null,null);e.options.__file="lightWalletGuide.md";r.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/18.f6c2f0b8.js b/docs/.vuepress/dist/assets/js/18.f6c2f0b8.js new file mode 100644 index 00000000..098dad38 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/18.f6c2f0b8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{392:function(e,t,n){e.exports=n.p+"assets/img/network-context.8f5dc235.png"},393:function(e,t,n){e.exports=n.p+"assets/img/network-functions.51710572.png"},394:function(e,t,n){e.exports=n.p+"assets/img/recMessage2.74b8d584.png"},395:function(e,t,n){e.exports=n.p+"assets/img/sendMsg1.46198729.png"},396:function(e,t,n){e.exports=n.p+"assets/img/sendMsg2.e2d2bd96.png"},397:function(e,t,n){e.exports=n.p+"assets/img/createNodeGroup.02a8f18e.png"},398:function(e,t,n){e.exports=n.p+"assets/img/deleteNodeGroup.1bb694b1.png"},399:function(e,t,n){e.exports=n.p+"assets/img/start.1e9dac99.png"},400:function(e,t,n){e.exports=n.p+"assets/img/shutdown.c5afd6a1.png"},401:function(e,t,n){e.exports=n.p+"assets/img/discoverPeer.bc23a3c9.png"},402:function(e,t,n){e.exports=n.p+"assets/img/connection.18465077.png"},403:function(e,t,n){e.exports=n.p+"assets/img/pingpong.4acdca1b.png"},404:function(e,t,n){e.exports=n.p+"assets/img/connet-validate.a03bf001.png"},405:function(e,t,n){e.exports=n.p+"assets/img/saveNodeIp.bc667171.png"},406:function(e,t,n){e.exports=n.p+"assets/img/connectSelf.f95af1ba.png"},407:function(e,t,n){e.exports=n.p+"assets/img/connectSelf-recieve.b38cf567.png"},965:function(e,t,n){"use strict";n.r(t);var a=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"network-module-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#network-module-design-document","aria-hidden":"true"}},[e._v("#")]),e._v(" Network module design document")]),e._v(" "),a("p",[e._v("[TOC]")]),e._v(" "),a("h2",{attrs:{id:"_1、general-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[e._v("#")]),e._v(" 1、General description")]),e._v(" "),a("h3",{attrs:{id:"_1-1-module-overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1 Module overview")]),e._v(" "),a("h4",{attrs:{id:"_1-1-1-why-have-a-network-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-have-a-network-module","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1.1 Why have a Network Module")]),e._v(" "),a("p",[e._v("The network module guarantees the communication between the decentralized nodes and\nprovides the lowest level of network communication and node discovery services for one of the NULS basic modules. The network foundation of the blockchain is Peer to Peer, or P2P. All participants in the P2P network can be either a server or a client. Features of P2P networks: decentralization, scalability, robustness, cost-effectiveness, privacy protection, and load balancing.")]),e._v(" "),a("h4",{attrs:{id:"_1-1-2-what-to-do-with-network-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-to-do-with-network-module","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1.2 What to do with Network Module")]),e._v(" "),a("p",[e._v("The network module is the basic module of the entire system, which is used to manage the connection between nodes, nodes and connections, and the transmission and reception of data. Network modules do not involve complex business logic.")]),e._v(" "),a("ul",[a("li",[e._v("The received network message is pushed in the corresponding processing module according to the instruction service mapping relationship in the kernel module.")]),e._v(" "),a("li",[e._v("The open interface is used to push the message encapsulation of other modules to the specified peer node and broadcast to the specified network group.")])]),e._v(" "),a("h4",{attrs:{id:"_1-1-3-the-positioning-of-network-module-in-the-system"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-positioning-of-network-module-in-the-system","aria-hidden":"true"}},[e._v("#")]),e._v(' 1.1.3 The positioning of "Network Module" in the system')]),e._v(" "),a("ul",[a("li",[e._v("The network module is the underlying application module. Any module that needs network communication must send and receive messages through the network module.")]),e._v(" "),a("li",[e._v("Network modules rely on kernelmodules for service interface governance。")]),e._v(" "),a("li",[e._v("The network module builds different networks by network id (magic parameter).")]),e._v(" "),a("li",[e._v("When the nodes of the network module in the satellite chain are configured for cross-chain networking, a chain management module is required to provide cross-chain configuration information.")]),e._v(" "),a("li",[e._v("The nodes of the network module in the sub-chain need to provide cross-chain configuration information when the cross-chain network is built.")])]),e._v(" "),a("h3",{attrs:{id:"_1-2-architecture-diagram"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.2 Architecture diagram")]),e._v(" "),a("p",[a("img",{attrs:{src:n(392),alt:""}})]),e._v(" "),a("h2",{attrs:{id:"_2、function-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2、function-design","aria-hidden":"true"}},[e._v("#")]),e._v(" 2、function design")]),e._v(" "),a("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.1 Functional architecture diagram")]),e._v(" "),a("p",[e._v("​ The network module has functions in the business: node management, node group management, p2p network connection management, and message transmission and management.")]),e._v(" "),a("p",[e._v("​ The internal infrastructure functions include: state management of the module (including startup and shutdown management), and management of external interfaces. Thread task management, data storage management, etc. 。")]),e._v(" "),a("p",[a("img",{attrs:{src:n(393),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Peer Nodes Management")]),e._v(" "),a("p",[e._v("Manage all connectable, connected node information, status, and provide node operation interfaces")]),e._v(" "),a("ul",[a("li",[e._v("Node discovery")]),e._v(" "),a("li",[e._v("Node storage")])])]),e._v(" "),a("li",[a("p",[e._v("Node Groups Management")]),e._v(" "),a("p",[e._v("Manage different network nodes, divide nodes into different collections, and manage each collection separately. The magic parameters of the nodes connected in each set are the same and are different from the magic parameters of other sets.")]),e._v(" "),a("p",[e._v("Each NodeGroup is initialized according to the information registered in the chain or the network information configured by itself (magic parameters, number of nodes, etc.) .Every time a NodeGroup is initialized, the network service listens for more than one MagicNumber.")])]),e._v(" "),a("li",[a("p",[e._v("Connection Management")]),e._v(" "),a("ul",[a("li",[e._v("Initialize the connection\n"),a("ul",[a("li",[e._v("Satellite chain node: random connection")]),e._v(" "),a("li",[e._v("Cross-chain nodes: fixed algorithm connections, the goal is to spread and cross-link nodes across the chain")])])]),e._v(" "),a("li",[e._v("Connection Management: Heartbeat Maintenance")]),e._v(" "),a("li",[e._v("Disconnect")])])]),e._v(" "),a("li",[a("p",[e._v("Message Management")]),e._v(" "),a("ul",[a("li",[e._v("Message receiver")])]),e._v(" "),a("p",[e._v("Receiving the message sent by the network node, making a simple judgment on the message\n(judging command), and sending the message to the module service of interest\naccording to the message cmd field.")]),e._v(" "),a("p",[e._v("[^ps]: RPC API Service interface information (url) is periodically obtained and cached from the kernel module.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Message receiver")]),e._v(" "),a("ul",[a("li",[e._v("NodeGroup broadcast message")]),e._v(" "),a("li",[e._v("Send a message to a node")])])])])])]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Module Management")]),e._v(" "),a("ul",[a("li",[e._v("Start, turn off logic processing")]),e._v(" "),a("li",[e._v("Maintenance and management of the status of its own module: management module operation status, internal function status, etc.")])])]),e._v(" "),a("li",[a("p",[e._v("RPC Api Management")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Register your own interface into the kernel module")])]),e._v(" "),a("li",[a("p",[e._v("Synchronize module information and status to the kernel module")])]),e._v(" "),a("li",[a("p",[e._v("Get the list of RPC services to the local module")])]),e._v(" "),a("li",[a("p",[e._v("Open external interface call")])])])]),e._v(" "),a("li",[a("p",[e._v("Thread task management")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("heartbeat thread")])]),e._v(" "),a("li",[a("p",[e._v("Node discovery/elimination mechanism thread")])]),e._v(" "),a("li",[a("p",[e._v("Interface information synchronization thread")])])])])]),e._v(" "),a("h3",{attrs:{id:"_2-2-module-service"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2 Module service")]),e._v(" "),a("h4",{attrs:{id:"_2-2-1-network-message-recieve"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-network-message-recieve","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.1 Network message recieve")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Receiving the message sent by the (external) network node, making a simple judgment on\nthe message (determining the magic parameter), and sending the message to the module service of interest according to the command field contained in the message header.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(394),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Message verification :")])])]),e._v(" "),a("p",[e._v("​ payload validate :First 4 bytes of sha256(sha256(payload))")]),e._v(" "),a("p",[e._v("​ magicNumbe :Determine if the nodegroups collection contains the magicNumber")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("External module network message receiving interface constraint")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("method : *** //Same as the CMD instruction in the message header, constraining 12 bytes")]),e._v(" "),a("p",[e._v("Interface description: The network module transparently forwards the message to the external module.")])]),e._v(" "),a("li",[a("p",[e._v("params")])])])])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" 0:chainId \n 1:nodeId \n 2:messageBody\n ......\n")])])]),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("\n")])])]),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Parsing the command parameter in the message header, relying on the remote service interface data provided by the kernel module when calling the remote interface processing.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-2-network-messaging"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-network-messaging","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2 Network messaging")]),e._v(" "),a("p",[e._v("Forwards messages encapsulated by other or own modules, including broadcast messages and designated nodes to send messages.")]),e._v(" "),a("h5",{attrs:{id:"_2-2-2-1、broadcast-network-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-1、broadcast-network-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2.1、Broadcast network message")]),e._v(" "),a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Forwarding messages encapsulated by other or its own modules, and providing interfaces for forwarding calls to external modules have the following two cases:")]),e._v(" "),a("p",[e._v("a> Broadcast a message to a NodeGroup (specify a network).")]),e._v(" "),a("p",[e._v("b> Broadcast messages to the NodeGroup (specify a network) and exclude certain nodes.")]),e._v(" "),a("ul",[a("li",[e._v("Process description")])]),e._v(" "),a("p",[a("img",{attrs:{src:n(395),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ method : nw_broadcast")]),e._v(" "),a("p",[e._v("​ Other modules can broadcast messages through this interface")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_broadcast",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.13.25.36:5003,20.30.25.65:8009",\n "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",\n "getBlock"\n \n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("excludeNodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Exclude nodes, comma separated")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("message")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Object hexadecimal character")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("command")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("message command,12 byte")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ nothing")]),e._v(" "),a("h5",{attrs:{id:"_2-2-2-2、the-specified-node-sends-a-network-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-2、the-specified-node-sends-a-network-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.2.2、The specified node sends a network message")]),e._v(" "),a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Forwarding messages encapsulated by other or its own modules, you can specify that\ncertain nodes (which can be 1 node) send messages.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(396),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("External modules can broadcast messages through this interface")]),e._v(" "),a("p",[e._v("method : nw_sendPeersMsg")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_sendPeersMsg",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.13.25.36:5003,20.30.25.65:8009",\n "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3",\n "getBlock"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Send node, comma split")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("message")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Object hexadecimal character")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("command")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("message command,12 byte")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ nothing")]),e._v(" "),a("h4",{attrs:{id:"_2-2-3-create-a-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3 Create a node group")]),e._v(" "),a("p",[e._v("In addition to its own satellite network, the satellite chain also has n cross-chain networks. In addition to its own network, there is also a cross-chain network.")]),e._v(" "),a("p",[e._v("Node groups are used to manage different network information. The network module isolates and maintains different networks through node groups.")]),e._v(" "),a("p",[e._v("Node group type: 1> own network 2> cross-chain network (satellite chain cross-chain network & friend chain cross-chain network)")]),e._v(" "),a("p",[e._v("The network module is a call to receive an external module to create a node group. The basic network configuration information of the cross-chain is mainly obtained through two ways:")]),e._v(" "),a("p",[e._v("1> The own configuration file is loaded to create its own network group.")]),e._v(" "),a("p",[e._v("2> Cross-chain network:")]),e._v(" "),a("p",[e._v("As a satellite chain node, after the registration is registered by the chain management module, the system generates a transaction verification confirmation and then calls to generate a cross-chain network group.")]),e._v(" "),a("p",[e._v("As a friend chain node, when started by the cross-chain protocol module, the cross-chain protocol module obtains cross-chain configuration information from the module configuration, and notifies the network module,The network module triggers a cross-chain connection.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The actual creation of a NodeGroup also has two kinds of logic:")]),e._v(" "),a("p",[e._v("1> Generate your own network group (or data load call) by loading the configuration file.")]),e._v(" "),a("p",[e._v("2> Call by external module: Create a network group as confirmed by registering cross-chain transactions.")])])]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-1-create-a-node-group-with-its-own-network"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-1-create-a-node-group-with-its-own-network","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.1 Create a node group with its own network")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("​ The own network corresponds to its own chainId, and a magic parameter, through the configuration initialization to create a node group.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Create a node group by loading the configuration file")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")])])]),e._v(" "),a("p",[e._v("​ Created internally, no external interface。")]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-2-create-a-cross-chain-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-2-create-a-cross-chain-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.2 Create a cross-chain node group")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("1> The satellite chain is triggered by the chain management module to trigger the creation of a cross-link node group.")]),e._v(" "),a("p",[e._v("2> The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.")]),e._v(" "),a("p",[a("img",{attrs:{src:n(397),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive a call to an external module to create a node group")]),e._v(" "),a("p",[e._v("method : nw_createNodeGroup")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_createNodeGroup",\n "minVersion":1.1,\n "params":[\n 1234,\n 232342,\n 10,\n 100,\n 20,\n "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",\n 0\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("maxOut")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum active connections")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("maxIn")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum number of passive connections")])]),e._v(" "),a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("minAvailableCount")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Minimum number of links in the friend chain")])]),e._v(" "),a("tr",[a("td",[e._v("5")]),e._v(" "),a("td",[e._v("seedIps")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Seed section group comma segmentation")])]),e._v(" "),a("tr",[a("td",[e._v("6")]),e._v(" "),a("td",[e._v("isMoonNode")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Whether satellite chain node, default 0")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")]),e._v(" "),a("h5",{attrs:{id:"_2-2-3-3-friend-chain-activates-cross-chain-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-3-friend-chain-activates-cross-chain-connection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.3.3 Friend chain activates cross-chain connection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The cross-chain node group on the satellite chain is triggered by the cross-chain registration of the friend chain in the satellite chain. The friend chain obtains cross-chain configuration information, and the cross-chain status of the own network group is updated by the cross-chain protocol.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The friend chain updates the cross-chain status of its own network group through the cross-chain protocol module.")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive calls from cross-chain modules, activate friend chain cross-chain")]),e._v(" "),a("p",[e._v("method : nw_activeCross")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_activeCross",\n "minVersion":1.1,\n "params":[\n 1234,\n 10,\n 100,\n "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Chain identification")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("maxOut")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum active connections")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("maxIn")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Maximum number of passive connections")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("seedIps")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Seed node, comma segmentation")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("p",[e._v("​ Relies on remote service interface data provided by the kernel module.")]),e._v(" "),a("h4",{attrs:{id:"_2-2-4-delete-node-group"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-delete-node-group","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.4 delete node group")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Receive a call from an external module and unregister the cross-chain node group.")]),e._v(" "),a("p",[e._v("As a satellite chain node, the chain management module performs deregistration, and the system generates a transaction verification confirmation and then calls it.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[a("img",{attrs:{src:n(398),alt:""}})])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")])]),e._v(" "),a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Receive calls from external modules, delete node groups")]),e._v(" "),a("p",[e._v("method : nw_delNodeGroup")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_delNodeGroup",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-5-cross-chain-seed-node-provision"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-cross-chain-seed-node-provision","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.5 Cross-chain seed node provision")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The seed node is a node used to provide peer connection information when the network is initialized. When the chain management module performs chain registration, it needs to\nobtain the seed node information on the satellite chain for initializing\nthe connection.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("no")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Obtain satellite chain seed node")]),e._v(" "),a("p",[e._v("method : nw_getSeeds")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getSeeds",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("seedsIps")]),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("Relies on remote service interface data provided by the kernel module.")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-6-add-a-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-add-a-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.6 Add a connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Add a peer connection information to a network under the cmd command.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("The added node triggers the network connection process。")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Add network peer node")]),e._v(" "),a("p",[e._v("method : nw_addNodes")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_addNodes",\n "minVersion":1.1,\n "params":[\n 1234,\n 1,\n "10.20.23.02:5006,53.26.65.58:8003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("isCross")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("0 false 1 true")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("nodes")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")])])]),e._v(" "),a("tbody",[a("tr",[a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-7-delete-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-delete-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.7 Delete connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Under the cmd command, the peer connection information is deleted for a network.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Deleting a node triggers the disconnection of the network node。")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Delete network peer nodes")]),e._v(" "),a("p",[e._v("method : nw_delNodes")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_addNodes",\n "minVersion":1.1,\n "params":[\n 1234,\n "10.20.23.02:5006,53.26.65.58:8003"\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodes")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("peer nodes")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")])])]),e._v(" "),a("tbody",[a("tr",[a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-8-reconnect-to-the-specified-network"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-reconnect-to-the-specified-network","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.8 Reconnect to the specified network")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Network reconnection of the specified nodeGroup under the cmd command")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("After receiving the command, disconnect all the peers under the specified nodeGroup and reconnect to the network.")])])]),e._v(" "),a("p",[e._v("​ Refresh the peer connection under nodegroup and restart the network connection.")]),e._v(" "),a("p",[e._v("​ If the peer connection is owned by multiple network services, you only need to cancel the association. If only the service is used by itself, you can disconnect.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Obtain satellite chain seed node")]),e._v(" "),a("p",[e._v("method : nw_reconnect")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_reconnect",\n "minVersion":1.1,\n "params":[\n 1234\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("链标识")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service\nnone")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-9-get-the-list-of-nodegroup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-get-the-list-of-nodegroup","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.9 Get the list of nodeGroup")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Get a list of all networks managed by the node。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Interface Description")]),e._v(" "),a("p",[e._v("Get node group information")]),e._v(" "),a("p",[e._v("method : nw_getGroups")])]),e._v(" "),a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getGroups",\n "minVersion":1.1,\n "params":[\n 1,\n 10\n ]}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("startPage")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("page of starts")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("pageSize")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Number of records per page")])])])])]),e._v(" "),a("li",[a("p",[e._v("Return example")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n list:[{\n chainId:1212, \n magicNumber:324234, \n totalCount:2323, \n inCount:22, \n outCount:33, \n isActive:1, \n isCrossChain:1 \n },{}\n ]\n }\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Return field description")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("totalCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Total number of connections")])]),e._v(" "),a("tr",[a("td",[e._v("inCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Passive connection number")])]),e._v(" "),a("tr",[a("td",[e._v("outCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("ctive connections")])]),e._v(" "),a("tr",[a("td",[e._v("isActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not activated, 1 is activated")])]),e._v(" "),a("tr",[a("td",[e._v("isCrossChain")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not a cross-chain network, 1 cross-chain network")])])])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-10-get-the-connection-under-the-nodegroup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-get-the-connection-under-the-nodegroup","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.10 Get the connection under the nodeGroup")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Get information about all nodes under the specified network id")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ Get node information")]),e._v(" "),a("p",[e._v("​ method : nw_getNodes")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_reconnect",\n "minVersion":1.1,\n "params":[\n 1598,\n 0,\n 1,\n 50\n ]\n}\n\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("state")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("0 all connected, 1 working connected")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("startPage")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("page of starts")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("pageSize")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("Number of records per page")])])])]),e._v(" "),a("ul",[a("li",[e._v("Return example")])]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(' {\n "version": 1.2,\n "code":0,\n "result":{\n list:[{\n chainId:122,\n nodeId:"20.20.30.10:9902"\n magicNumber:134124,\n version:2,\n blockHeight:6000, //区块高度\n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", //区块Hash值\n ip:"200.25.36.41",\n port:54, \n state:"已连接",\n isOut:"1", \n time:"6449878789", \n\t },{}\n\t ]\n }\n}\n\n')])])]),a("ul",[a("li",[e._v("Return field description")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("nodeId")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("nodeId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("version")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("protocol version")])]),e._v(" "),a("tr",[a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("ip")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("peer Ip address")])]),e._v(" "),a("tr",[a("td",[e._v("port")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("Server port")])]),e._v(" "),a("tr",[a("td",[e._v("state")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("connect state")])]),e._v(" "),a("tr",[a("td",[e._v("isOut")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 passive connection, 1 active connection")])]),e._v(" "),a("tr",[a("td",[e._v("time")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("Recent connection time")])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-11-get-the-specified-chain-network-profile-information"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-get-the-specified-chain-network-profile-information","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.11 Get the specified chain network profile information")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Gets the network information of the specified chainId.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("none")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ Gets the network information of the specified chainId.")]),e._v(" "),a("p",[e._v("​ method : nw_getNodes")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_getGroupByChainId",\n "minVersion":1.1,\n "params":[\n 103\n ]}\n')])])]),a("ul",[a("li",[e._v("Request parameter description")])])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("chainId")])])])]),e._v(" "),a("ul",[a("li",[e._v("Return example")])]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "result":{\n \n chainId:1212, \n magicNumber:324234,\n totalCount:2323, \n inCount:22, \n outCount:33, \n blockHeight:6000, \n blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9\n ea1a960f207778150ffb9f2c173ff", \n isActive:1,\n isCrossActive:1,\n isMoonNet:0\n }\n}\n\n')])])]),a("ul",[a("li",[e._v("Return field description")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("chainId")])]),e._v(" "),a("tr",[a("td",[e._v("magicNumber")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("magicNumber")])]),e._v(" "),a("tr",[a("td",[e._v("totalCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("total connect")])]),e._v(" "),a("tr",[a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",[e._v("latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",[e._v("latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("isActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not activated, 1 is activated")])]),e._v(" "),a("tr",[a("td",[e._v("isCrossActive")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 is not a cross-chain network, 1 cross-chain network")])]),e._v(" "),a("tr",[a("td",[e._v("outCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("active connection count")])]),e._v(" "),a("tr",[a("td",[e._v("inCount")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("passive connection count")])]),e._v(" "),a("tr",[a("td",[e._v("isMoonNet")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",[e._v("0 not moon node,1 moon node")])])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-2-12-update-the-information-of-the-peer-connection-node"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-update-the-information-of-the-peer-connection-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.2.12 Update the information of the peer connection node")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("The network connection has the height and hash value of the peer node when the\nhandshake connection is made, and the height and hash value of the subsequent peer connection node are called and updated by the external module (block management module).")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("1> Wait for the block management interface after the node starts Initialization, and then call the block management interface to get the latest block height and hash value.")]),e._v(" "),a("p",[e._v("2> When the handshake is performed, the node related information is placed in the Verion information and sent to the peer.")]),e._v(" "),a("p",[e._v("3> After the connection is established, the block management module will call the interface to update the latest block height and hash value.")])]),e._v(" "),a("li",[a("p",[e._v("Interface definition")]),e._v(" "),a("ul",[a("li",[e._v("Interface Description")])]),e._v(" "),a("p",[e._v("​ The block management module calls to update the height of the node and the hash value.")]),e._v(" "),a("p",[e._v("​ method : nw_updateNodeInfo")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Request example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "method":"nw_updateNodeInfo",\n "minVersion":1.1,\n "params":[\n 1598,\n "10.20.30.20:8856",\n 10,\n "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"\n ]\n}\n')])])])]),e._v(" "),a("li",[a("p",[e._v("Request parameter description")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("index")]),e._v(" "),a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",{staticStyle:{"text-align":"center"}},[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("0")]),e._v(" "),a("td",[e._v("chainId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("int")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("网络id")])]),e._v(" "),a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("nodeId")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("String")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("网络节点id")])]),e._v(" "),a("tr",[a("td",[e._v("2")]),e._v(" "),a("td",[e._v("blockHeight")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("long")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("区块高度")])]),e._v(" "),a("tr",[a("td",[e._v("3")]),e._v(" "),a("td",[e._v("blockHash")]),e._v(" "),a("td",[e._v("true")]),e._v(" "),a("td",[e._v("Sting")]),e._v(" "),a("td",{staticStyle:{"text-align":"center"}},[e._v("区块最新hash")])])])]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("返回示例")]),e._v(" "),a("p",[e._v("Failed")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n\n')])])]),a("p",[e._v("Success")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "version": 1.2,\n "code":0,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{\n \n }\n}\n\n\n')])])])]),e._v(" "),a("li",[a("p",[e._v("返回字段说明")])])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("parameter")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td"),e._v(" "),a("td"),e._v(" "),a("td")])])])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h2",{attrs:{id:"_2-3-module-internal-function"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3 Module internal function")]),e._v(" "),a("h4",{attrs:{id:"_2-3-1module-start"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1module-start","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.1Module start")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When the module is started, the configuration information is initialized, the\nregistration service is initialized, and the initialization of each internal function management database information is performed.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("​ "),a("img",{attrs:{src:n(399),alt:""}})]),e._v(" "),a("p",[e._v("1> load local configuration data, database node group and node information data loading.")]),e._v(" "),a("p",[e._v("2 > When the status of the listening block management module is initialized and the interface is callable, the call obtains the block height and Hash value of the latest local node.")]),e._v(" "),a("p",[e._v("3> initialization completes and enters peer node connection.")]),e._v(" "),a("p",[e._v("4 > The network module notifies the block management module of the maximum block height and hash value after the connection is stable. The block management module provides interfaces for network module calls.")]),e._v(" "),a("p",[e._v("The criteria for the stability of network module start-up connection are: no new handshake connection occurs in X seconds, and no height increase in X seconds. X=10")]),e._v(" "),a("p",[e._v("5 > After network stabilization, the network is in a working state, and the business state of each chain is released to other modules in an event manner.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-2-module-off"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-module-off","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.2 Module off")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When the module is closed, the connection is closed, the thread management is\nclosed, the resources are released, and the status is notified to the core interface.。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(400),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-3-peer-node-discovery"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-peer-node-discovery","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.3 Peer node discovery")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("After the network module is started, the peer node is managed.")]),e._v(" "),a("p",[e._v("The ways for node acquisition are:")]),e._v(" "),a("p",[e._v("1> Connect to the seed node and request address acquisition.")]),e._v(" "),a("p",[e._v("2> Receive the broadcasted node message.")]),e._v(" "),a("p",[e._v("2> The connection of a cross-chain network, for example, as a connection between a node and a sub-chain on a satellite chain, or a connection between a node on a sub-chain and a satellite chain.")])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(401),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-4-connection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-connection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.4 connection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("A node acts as the client, actively connecting to a known peer node, and is also a server, waiting for the peer node to connect.")]),e._v(" "),a("p",[e._v("A connection can work normally, and it needs to send a version protocol message to each other through a handshake protocol. For the specific definition of the protocol, see the following.")]),e._v(" "),a("p",[e._v('"Protocol - Network Communication Protocol Part".')])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[e._v("​ After the TCP connection is complete with the server, the client needs to handshake through the rervice version protocol. Only the connection with successful handshake can forward the service. The state in the connection cannot be transitioned to connected after X minutes, and the connection is actively disconnected.")]),e._v(" "),a("p",[a("img",{attrs:{src:n(402),alt:""}})]),e._v(" "),a("p",[e._v("PS: In order to meet the requirements of one process carrying multiple-chain services at the same time, after a node peer connection is established, multiple NodeGroup services should be satisfied.")]),e._v(" "),a("p",[e._v("That is, the node peer connection and the nodeGroup object are many-to-many, n:n relationships.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-5heartbeat-detection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5heartbeat-detection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.5Heartbeat detection")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v('Check if the connection is still connected. Maintain the keep-alive by ping-pong message from client and server. Refer to the "Protocol - Network Communication Protocol" section for the definition of the ping-pong protocol involved.')])]),e._v(" "),a("li",[a("p",[e._v("Process description")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(403),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-6-connection-quantity-verification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-connection-quantity-verification","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.6 Connection quantity verification")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("When a node connection is established, the number of connections is made, and\nif the maximum is reached, the connection is actively disconnected.。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("​ "),a("img",{attrs:{src:n(404),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])])])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-7-node-external-network-ip-storage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-node-external-network-ip-storage","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.7 Node external network IP storage")]),e._v(" "),a("ul",[a("li",[e._v("Function Description:")])]),e._v(" "),a("p",[e._v("​ A node may have multiple network cards, or it may be in a local area network. Therefore, when establishing a connection, it does not know its own external network IP address.")]),e._v(" "),a("p",[e._v("The node needs to know its own external network IP address to broadcast its own address for the external network peers to connect. In our design, the external network of the node is carried by the version protocol message.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("When the client receives the version message, it can know its own IP address information.")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(405),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("​ none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-8-node-external-network-connection-detection"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-node-external-network-connection-detection","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.8 Node external network connection detection")]),e._v(" "),a("ul",[a("li",[e._v("Function Description:")])]),e._v(" "),a("p",[e._v("​ When a node establishes a connection, it can broadcast its own external network IP+port to other nodes. However, if a node is in a local area network, the IP address of the external network cannot be directly connected. Therefore,in order to detect whether the external network IP of the node is\navailable, you can connect to your own server through your own client. If the connection is successful, the IP can be used for broadcasting. If it is unsuccessful, the external network IP of the node cannot be\nbroadcast to other nodes.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Self-connection\nmay succeed or fail. If it is successful, the external network IP is reachable, and it can be broadcasted to other nodes in the network when the connection is established. If it is unreachable, the connection\ncannot be established.。")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(406),alt:""}})]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-9-peer-node-broadcast"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-peer-node-broadcast","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.9 Peer node broadcast")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Broadcast\nits own nodes to other nodes in the network. In the design, we will\nbroadcast through the self-connection established above。")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Constraint: The address broadcast is not carried out between peers in the cross-chain\nnetwork, that is, the nodes in the satellite chain are not broadcast to the sub-chain, and the nodes in the same sub-chain are found not to be broadcast to the satellite chain. The satellite chain and the sub-chain need to establish a connection. The initial peer node can send a getAdrr message to request the connection address.")])])]),e._v(" "),a("p",[a("img",{attrs:{src:n(407),alt:""}})]),e._v(" "),a("ul",[a("li",[e._v("Dependent service")])]),e._v(" "),a("p",[e._v("none")]),e._v(" "),a("h4",{attrs:{id:"_2-3-10-request-reply-getaddr-protocol-message"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-request-reply-getaddr-protocol-message","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.10 Request/reply getaddr protocol message")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Request an address protocol message for more network connections")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Request getaddr:")]),e._v(" "),a("p",[e._v("1> When a connection in a nodeGroup does not reach the network service required threshold minAvailableCount, the address list is requested from the seed node.")]),e._v(" "),a("p",[e._v("2> The cross-chain nodeGroup in the satellite chain node can directly request the obtained address from the connected peer node.")]),e._v(" "),a("p",[e._v("Reply getaddr:")]),e._v(" "),a("p",[e._v("1>peer cross-link connection, node reply address list (IP+cross-chain port)")]),e._v(" "),a("p",[e._v("2>peer own network connection, the node will reply to the address list (IP+ own chain port)")])]),e._v(" "),a("li",[a("p",[e._v("Dependent service")])])]),e._v(" "),a("h4",{attrs:{id:"_2-3-11-send-receive-address-logic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-send-receive-address-logic","aria-hidden":"true"}},[e._v("#")]),e._v(" 2.3.11 send/receive address logic")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Function Description:")]),e._v(" "),a("p",[e._v("Send & Receive network protocol addr protocol message processing logic")])]),e._v(" "),a("li",[a("p",[e._v("Process description")]),e._v(" "),a("p",[e._v("Send addr:")])])]),e._v(" "),a("p",[e._v("​ 1> When a new node is accessed, an addr message is broadcast to other peers of the same nodegroup.")]),e._v(" "),a("p",[e._v("​ 2> When the getaddr message is requested, the addr message will be replied.")]),e._v(" "),a("p",[e._v("​ Receive addr:")]),e._v(" "),a("p",[e._v("​ 1> Determine whether the address is already owned locally. If you do not forward it, get the new addr.")]),e._v(" "),a("p",[e._v("​ 2>PEER is not cross-chain network forwarding")]),e._v(" "),a("p",[e._v("​ 3> Own network, add addr>0, store and broadcast forwarding (except receiving peer)")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Dependent service")]),e._v(" "),a("p",[e._v("none")])])]),e._v(" "),a("h2",{attrs:{id:"_3、event-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[e._v("#")]),e._v(" 3、Event description")]),e._v(" "),a("h3",{attrs:{id:"_3-1-published-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1 Published event")]),e._v(" "),a("p",[e._v("[^remark]: Here is the topic of the event, the format protocol of the event (accurate to byte), and the occurrence of the event.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-1-nodegroup-reaches-the-lower-limit-of-the-number-of-nodes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-nodegroup-reaches-the-lower-limit-of-the-number-of-nodes","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.1 NodeGroup reaches the lower limit of the number of nodes")]),e._v(" "),a("p",[e._v("Description: The NodeGroup reaches the lower limit of the number of nodes and the event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_inNodeLimit",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-2-nodegroup-is-less-than-the-minimum-number-of-nodes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-nodegroup-is-less-than-the-minimum-number-of-nodes","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.2 NodeGroup is less than the minimum number of nodes")]),e._v(" "),a("p",[e._v("Description: The NodeGroup is less than the lower limit of the number of nodes. The event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_lessNodeLimit",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeCount\n nodeLimit\n time\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-3-node-handshake-succeeded"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-node-handshake-succeeded","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.3 Node handshake succeeded")]),e._v(" "),a("p",[e._v("Description: The node handshake is successful and the event is advertised.")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_connectSuccess",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeId\n time\n version\n }\n \n\n")])])]),a("h4",{attrs:{id:"_3-1-4-node-disconnected"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-node-disconnected","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1.4 Node disconnected")]),e._v(" "),a("p",[e._v("Description: The node is disconnected and the event is published")]),e._v(" "),a("pre",[a("code",[e._v(' event_topic : "evt_nw_nodeDisconnect",\n')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" data:{\n chainId\n magicNumber\n nodeId\n time\n version\n }\n \n\n")])])]),a("h3",{attrs:{id:"_3-2-subscribed-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.2 Subscribed event")]),e._v(" "),a("pre",[a("code",[e._v("​ none\n")])]),e._v(" "),a("ul",[a("li")]),e._v(" "),a("h2",{attrs:{id:"_4、protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[e._v("#")]),e._v(" 4、protocol")]),e._v(" "),a("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[e._v("#")]),e._v(" 4.1 Network communication protocol")]),e._v(" "),a("h4",{attrs:{id:"version"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#version","aria-hidden":"true"}},[e._v("#")]),e._v(" version")]),e._v(" "),a("p",[e._v("Used to establish a connection (handshake)")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("version")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("Protocol version identifier used by the node")])]),e._v(" "),a("tr",[a("td",[e._v("20")]),e._v(" "),a("td",[e._v("addr_you")]),e._v(" "),a("td",[e._v("byte[20]")]),e._v(" "),a("td",[e._v("The peer network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [10.32.12.25 8003 9003] 16byte+2byte+2byte")])]),e._v(" "),a("tr",[a("td",[e._v("20")]),e._v(" "),a("td",[e._v("addr_me")]),e._v(" "),a("td",[e._v("byte[20]")]),e._v(" "),a("td",[e._v("The self network address [IP+PORT1+PORT2] PORT2 is a cross-chain server port. For example: [20.32.12.25 8003 9003] 16byte+2byte+2byte")])]),e._v(" "),a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("block_height")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("node latest block height")])]),e._v(" "),a("tr",[a("td",[e._v("?")]),e._v(" "),a("td",[e._v("block_hash")]),e._v(" "),a("td",[e._v("varInt")]),e._v(" "),a("td",[e._v("node latest block hash")])]),e._v(" "),a("tr",[a("td",[e._v("6")]),e._v(" "),a("td",[e._v("network_time")]),e._v(" "),a("td",[e._v("uint48")]),e._v(" "),a("td",[e._v("Network time")])]),e._v(" "),a("tr",[a("td",[e._v("??")]),e._v(" "),a("td",[e._v("extend")]),e._v(" "),a("td",[e._v("VarByte")]),e._v(" "),a("td",[e._v("extended field, no more than 10 bytes")])])])]),e._v(" "),a("h4",{attrs:{id:"verack"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#verack","aria-hidden":"true"}},[e._v("#")]),e._v(" verack")]),e._v(" "),a("p",[e._v("Used to answer version")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("ack_code")]),e._v(" "),a("td",[e._v("uint8")]),e._v(" "),a("td",[e._v("Return code, 1 means normal, 2 means the connection is full")])])])]),e._v(" "),a("h4",{attrs:{id:"ping"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ping","aria-hidden":"true"}},[e._v("#")]),e._v(" ping")]),e._v(" "),a("pre",[a("code",[e._v("Used to maintain the connection. After receiving a message for a certain node for a \n")])]),e._v(" "),a("p",[e._v("period of time, the message is sent. If the pong message is received, the node remains connected. Otherwise, the connection is closed and the node is deleted.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("randomCode")]),e._v(" "),a("td",[e._v("uint32")]),e._v(" "),a("td",[e._v("random number")])])])]),e._v(" "),a("h4",{attrs:{id:"pong"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pong","aria-hidden":"true"}},[e._v("#")]),e._v(" pong")]),e._v(" "),a("pre",[a("code",[e._v("reply for ping\n")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("4")]),e._v(" "),a("td",[e._v("randomCode")]),e._v(" "),a("td",[e._v("uint32random number")]),e._v(" "),a("td")])])]),e._v(" "),a("h4",{attrs:{id:"getaddr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#getaddr","aria-hidden":"true"}},[e._v("#")]),e._v(" getaddr")]),e._v(" "),a("p",[e._v("Used to obtain connection information of available nodes in the network, no message body")]),e._v(" "),a("h4",{attrs:{id:"addr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#addr","aria-hidden":"true"}},[e._v("#")]),e._v(" addr")]),e._v(" "),a("p",[e._v("Used to reply getaddr, or announce the existence of itself to the network. After receiving the message, the node determines whether the node is known. If it is an unknown node, it propagates the message to the network.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("??")]),e._v(" "),a("td",[e._v("addr_list")]),e._v(" "),a("td",[e._v("network address")]),e._v(" "),a("td",[e._v("18 bytes per node (16 bytes IP + 2 bytes port)")])])])]),e._v(" "),a("h4",{attrs:{id:"bye"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#bye","aria-hidden":"true"}},[e._v("#")]),e._v(" Bye")]),e._v(" "),a("p",[e._v("Used for peer connection to disconnect actively, rejecting service message connection")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Length")]),e._v(" "),a("th",[e._v("Fields")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("1")]),e._v(" "),a("td",[e._v("byeCode")]),e._v(" "),a("td",[e._v("uint8")]),e._v(" "),a("td",[e._v("预留字段")])])])]),e._v(" "),a("h3",{attrs:{id:"_4-2-transaction-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[e._v("#")]),e._v(" 4.2 Transaction agreement")]),e._v(" "),a("pre",[a("code",[e._v("​ none\n")])]),e._v(" "),a("h2",{attrs:{id:"_5、module-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration","aria-hidden":"true"}},[e._v("#")]),e._v(" 5、Module configuration")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" [network]\n network.self.server.port=8003\n network.self.chainId=9861\n network.self.magic=68866996\n network.self.max.in=100\n network.self.max.out=10\n network.self.seed.ip=127.0.0.1:8003\n #Satellite chain configuration information\n network.moon.node=true\n network.moon.server.port=8004\n network.moon.max.in=100\n network.moon.max.out=10\n network.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003\n \n\n")])])]),a("h2",{attrs:{id:"_6、java-specific-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[e._v("#")]),e._v(" 6、Java-specific design")]),e._v(" "),a("p",[e._v("[^remark]: Core object class definition, storing data structures,......")]),e._v(" "),a("h2",{attrs:{id:"_7、-to-add-on"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7、-to-add-on","aria-hidden":"true"}},[e._v("#")]),e._v(" 7、 to add on")]),e._v(" "),a("p",[e._v("[^remark]: Required content not covered above")])])}],i=n(0),r=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);r.options.__file="networkModuleDesign.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/180.ebd647d5.js b/docs/.vuepress/dist/assets/js/180.ebd647d5.js new file mode 100644 index 00000000..f66222be --- /dev/null +++ b/docs/.vuepress/dist/assets/js/180.ebd647d5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[180],{845:function(t,e,s){"use strict";s.r(e);var i=s(0),_=Object(i.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),s("p",[t._v("NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("NIP当前有六种类型:")]),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("在开始撰写NIP之前,先审查你的想法,这将帮你节省时间。首先询问社区这个想法之前是否被提出过,可行性如何。以免浪费时间在一些肯定会被拒绝的提案上,并有助于确保该想法适用于整个社区而不仅仅是作者。 某个想法对作者有意义并不意味着它对各个地区使用NULS的人都有意义。我们建议可以通过发起投票的方式在社区收集意见,投票的结果也有助于NIP编辑更快做出判断是否合并该NIP。")]),t._v(" "),s("p",[t._v("完成一个最终生效的NIP需要经过以下阶段:")]),t._v(" "),t._m(10),s("p",[t._v("每次NIP状态的更改都是先由NIP的作者提出Pull Request(合并请求,简称PR),然后NIP的编辑会对该NIP进行审查。提出PR的时候最好包含一个可以持续讨论该NIP的链接。")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("其他非常规的状态如下:")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("每个NIP应该包含以下部分:")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("NIP应该用markdown的格式编写")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("每个NIP的必须以RFC 822的样式作为文档的头部前言,头部必须按照以下顺序进行排列,用*标注的头部为可选项,其他项为必填项")]),t._v(" "),t._m(18),t._m(19),t._v(" "),s("p",[t._v("NIPS文档可能包含一些附件,例如流程图。这样的文件必须以NIP-XXXX-Y.ext的格式来命名,“XXXX”指的是NIP的编号,“Y”指的是序列号(从1开始),“ext”指的是文件扩展名(例如:.png)")]),t._v(" "),t._m(20),t._v(" "),s("p",[t._v("有时需要将NIPS的所有权转让给新的作者。一般来说,我们希望保留原作者作为要转移的NIP的合著者,但这实际上取决于原作者。转让所有权的一个很好的理由是,原作者不再有时间或兴趣来更新它或跟进NIP的后续过程,或已经脱离了“网络”(即无法联系或没有回复电子邮件)。转让所有权的一个不好的原因是你不同意NIP的方向。我们努力围绕一个NIP去建立共识,如果你认为不可能达成,你可以提交一个更有说服力的NIP。")]),t._v(" "),s("p",[t._v("如果您对NIP的所有权感兴趣,请发送一封邮件要求接管,该邮件的收件人是原作者和NIP编辑。如果原作者没有及时回复邮件,NIP的编辑就会做出单方面的决定(这样的决定并不是不能逆转的)。")]),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("当前的NIP编辑如下:")]),t._v(" "),t._m(22),t._m(23),t._v(" "),s("p",[t._v("每次收到一个新的NIP, 一个编辑要做如下的事:")]),t._v(" "),t._m(24),t._v(" "),s("p",[t._v("如果NIP不够完备,编辑会把它发回给作者进行修改,并给出具体的说明。一旦NIP做好了合并到仓库的准备,NIP编辑就会这样做:")]),t._v(" "),t._m(25),t._v(" "),s("p",[t._v("许多NIP是由对NULS代码库具有写入权限的开发人员编写和维护的。NIP编辑要关注NIP的变化,并纠正我们看到的任何结构、语法、拼写或标记错误。NIP编辑不会主观地对NIP做出判断,只做管理和编辑这部分工作。")]),t._v(" "),t._m(26),t._v(" "),s("p",[t._v("这个文档主要引用了 "),s("a",{attrs:{href:"https://github.com/bitcoin/bips",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin's BIP-0001"),s("OutboundLink")],1),t._v(",由 Amir Taaki 所写,同时他所写的文本也主要来源于 "),s("a",{attrs:{href:"https://www.python.org/dev/peps/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Python's PEP-0001"),s("OutboundLink")],1),t._v("。NIP根据自身的实际情况,基于他们的文档做了一些修改,例如NIP流程中增加了理事会,修改了NIP类型等。后续与NIP相关的问题请直接联系NULS NIP的编辑。")]),t._v(" "),s("link",{attrs:{rel:"stylesheet",href:"https://use.fontawesome.com/releases/v5.0.13/css/all.css"}})])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-1-nip的目的和指导"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-1-nip的目的和指导","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-1 NIP的目的和指导")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("NIP:1\n标题: NIP的目的和指导\n状态: 公示\n类型: 流程\n作者: 杨霖 \n创建日期:2018/12/27\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip产生的理由"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip产生的理由","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP产生的理由")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录")])]),this._v(" "),e("li",[e("p",[this._v("对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的类型","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的类型")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[t._v("核心:NULS核心代码的改善,例如共识机制,网络协议等。")]),t._v(" "),s("li",[t._v("模块:模块的提交和评审要求的改善,例如符合何种标准的模块会被接受并被纳入模块仓库。")]),t._v(" "),s("li",[t._v("接口:NULS客户端API/RPC的规范和标准的改善,例如API名称、方法名称。")]),t._v(" "),s("li",[t._v("NRC标准:应用级别的标准的改善,例如合约标准,通证标准等。")]),t._v(" "),s("li",[t._v("信息:描述NULS设计问题,或向NULS社区提供一般性指导或信息,但不提出新功能。 信息NIP不一定代表NULS社区的共识或推荐,因此用户和实施者可以自由选择忽略信息NIP或遵循他们的建议")]),t._v(" "),s("li",[t._v("流程:所有NULS相关的操作流程的改善,例如社区中竞选大使的流程的改善。流程类NIP不仅仅是建议,是社区成员完成某些特定的事需要遵守的规范,但该类NIP不涉及代码层面的规范。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的工作流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的工作流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的工作流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("涉及流程的各方包括以下部分或全部角色:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("社区的大部分成员")]),t._v(" "),s("p",[t._v("主要职责为参与NIP的讨论和投票,提出建设性意见。")])]),t._v(" "),s("li",[s("p",[t._v("NIP作者")]),t._v(" "),s("p",[t._v("提出和完善NIP,并负责引导社区展开讨论。")])]),t._v(" "),s("li",[s("p",[t._v("NIP编辑")]),t._v(" "),s("p",[t._v("管理和编辑NIP。")])]),t._v(" "),s("li",[s("p",[t._v("NULS理事会")]),t._v(" "),s("p",[t._v("对即将进入接受或完结状态的NIP做最后把关,理事会有权通过内部投票拒绝NIP。")])]),t._v(" "),s("li",[s("p",[t._v("NULS核心开发者")]),t._v(" "),s("p",[t._v("负责核心,模块,NRC标准和接口这四个类型的NIP的审核和代码实现。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("[ 草稿 ]->[ 公示 ]->[ 接受 ]->[ 完结 ]\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("完整的NIP处理流程如下:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("NIP的作者按照规定的格式和样式编写NIP,然后在社区中进行讨论和调研,确定可行性后,则将NIP通过提PR的方式提交到NIP仓库,并在PR中包含社区讨论的链接。NIP编辑会根据实际情况来处理这些请求。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("草稿:")]),t._v(" 如果同意合并,NIP编辑将为该NIP分配一个编号并合并PR。 NIP编辑不会无理由拒绝某个NIP")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("草稿:")]),t._v(" 拒绝合并为草稿的原因包括专注度不够、过于宽泛、重复劳动、技术上不健全、没有提供合理的动机或解决向后兼容性,或者不符合NULS理念。")])])]),t._v(" "),s("li",[s("p",[t._v("合并成为草稿状态后,作者可以继续提PR对草稿做进一步更改,直至认为该NIP已经足够成熟并准备好进入下一个状态为止。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 如果获得同意,NIP编辑将会把该NIP的状态从草稿更改为公示,并设置公示结束日期,通常为15天后。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 如果进入公示阶段后,还要对该NIP进行更改,那这个NIP会被退回草稿状态。我们希望一个NIP只进入一次公示状态,避免在社区引起不必要的争论。")])])]),t._v(" "),s("li",[s("p",[t._v("公示状态的NIP会置顶在https://nuls.community/")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("接受(核心,模块,NRC标准和接口的NIP才涉及):")]),t._v(" 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为接受。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("完结(信息和流程才涉及):")]),t._v(" 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为完结。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 公示期有材料变更或无法解决社区提出的技术问题,则该NIP将会被退回草稿状态。除此之外,如果理事会对该NIP有不同的看法,可以在理事会成员内部发起投票,超过70%的理事会成员否决该NIP(需给出原因)则该NIP将根据实际原因被退回草稿状态或直接改为拒绝状态。")])])]),t._v(" "),s("li",[s("p",[t._v("当核心、模块、NRC标准和接口的NIP成为接受状态后,何时能成为完结状态取决于相关的NULS核心开发者,由他们决定如何将该NIP通过编码来实现。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("完结(核心,模块,NRC标准和接口的NIP涉及):")]),t._v(" NIP已通过编码实现,并在主网稳定运行一段时间或得到了有效验证且改动也得到了社区的认可,则状态可变为完结。")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("strong",[t._v("延期:")]),t._v(" 核心、模块、NRC标准和接口相关的NIP成为接受状态后,开发者未按照预定的时间完成开发。")]),t._v(" "),s("li",[s("strong",[t._v("拒绝:")]),t._v(" 某个NIP被核心开发者拒绝实现或被理事会认定为不可实现。")]),t._v(" "),s("li",[s("strong",[t._v("被取代:")]),t._v(" NIP以前是完结状态,但不再被认为是最先进的。出现另一个更好的NIP,参考了这个NIP并成为了最终状态。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一个有效的nip文档应该包含哪些内容?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一个有效的nip文档应该包含哪些内容?","aria-hidden":"true"}},[this._v("#")]),this._v(" 一个有效的NIP文档应该包含哪些内容?")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("strong",[t._v("前言:")]),t._v(" 与NIP相关的元数据,以RFC 822样式展示。内容包括NIP编号,简短描述性标题(限制为最多44个字符)和作者详细信息。可"),s("a",{attrs:{href:"#NIP%E7%9A%84%E5%89%8D%E8%A8%80"}},[t._v("参阅下文")]),t._v("了解详情。")]),t._v(" "),s("li",[s("strong",[t._v("简单总结:")]),t._v(" NIP作者需要给这个NIP提供一个简单且普通人可以理解的总结,如果你不能很简单地解释它,说明你自己对它的理解还不够深入。")]),t._v(" "),s("li",[s("strong",[t._v("摘要 :")]),t._v(" 对正在解决的技术问题进行简短(约200字)描述。")]),t._v(" "),s("li",[s("strong",[t._v("动机:")]),t._v(" 对于想要改善NULS协议的NIP,动机至关重要。 它应该清楚地解释为什么现有的协议规范存在不足。没有足够动机的NIP可能会被彻底拒绝。")]),t._v(" "),s("li",[s("strong",[t._v("规范:")]),t._v(" 技术规范应描述清楚任何新功能的语法和语义。规范应该足够详细,以允许当前任何基于NULS平台的应用拥有竞争性、可互操作性(例如NULS客户端,浏览器)。")]),t._v(" "),s("li",[s("strong",[t._v("论据 :")]),t._v(" 论据通过描述什么驱动了这样的设计以及为什么要做出这样的设计决策来充实规范。它应该阐述考虑过的替代性设计和相关工作,例如如何在其他语言中支持该特性。论据也可以提供证据证明社区的意见是一致的,并应讨论提出的重要反对意见或大家关注的事项。")]),t._v(" "),s("li",[s("strong",[t._v("向后兼容性:")]),t._v(" 所有引入向后不兼容的NIP必须描述存在哪些不兼容及其严重性。NIP中必须解释作者如何处理这些不兼容性。如果没有足够的向后兼容性论述,提交的NIP可能会被直接拒绝。")]),t._v(" "),s("li",[s("strong",[t._v("测试用例:")]),t._v(" 对于影响共识机制的NIP,其实现方法的测试用例是强制性的。")]),t._v(" "),s("li",[s("strong",[t._v("实现 :")]),t._v(" 代码的实现必须在任何NIP被赋予完结状态之前完成,但是它不需要在NIP被合并为草稿之前完成。")]),t._v(" "),s("li",[s("strong",[t._v("历史记录:")]),t._v(" 历史记录是展示了该NIP从提出到成为完结状态的整个过程,可以通过附加链接形式展示。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的格式和模版"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的格式和模版","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的格式和模版")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的前言"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的前言","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的前言")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" NIP: \n 标题: \n 作者: <列出作者的真实名字和电子邮件地址>\n*讨论渠道: <指向官方讨论渠道的链接>\n 状态: <草稿| 接受 | 完结 | 被取代 | 延期 | 拒绝>\n 类型: <核心 | 模块 | 接口 | NRC标准 | 信息 | 流程>\n 创建日期: < 用 ISO 8601 (yyyy-mm-dd) 格式>\n*取代: \n*被取代: \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"附件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附件","aria-hidden":"true"}},[this._v("#")]),this._v(" 附件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"转移nip的所有权"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#转移nip的所有权","aria-hidden":"true"}},[this._v("#")]),this._v(" 转移NIP的所有权")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip编辑"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip编辑","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP编辑")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Niels \nPen \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip编辑的职责"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip编辑的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP编辑的职责")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("阅读NIP来检查它是否较为完备,NIP中的想法必须具有技术意义,即使它们看起来不太可能达到最终状态。")]),this._v(" "),e("li",[this._v("标题和内容要相符。")]),this._v(" "),e("li",[this._v("检查NIP的语言(拼写、语法、句子结构等)、标记(Github风格的标记)、代码风格 。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("分配一个NIP编号(通常是PR编号)")])]),this._v(" "),e("li",[e("p",[this._v("合并相应的PR")])]),this._v(" "),e("li",[e("p",[this._v("将消息发送回NIP作者")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"history"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#history","aria-hidden":"true"}},[this._v("#")]),this._v(" History")])}],!1,null,null,null);_.options.__file="NIP-1.md";e.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/181.872ce38a.js b/docs/.vuepress/dist/assets/js/181.872ce38a.js new file mode 100644 index 00000000..960c025b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/181.872ce38a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[181],{843:function(t,s,e){"use strict";e.r(s);var r=e(0),i=Object(r.a)({},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),e("p",[t._v("根据NULS项目的发展需要,为了更好地促进NULS社区良性运转,达成NULS让区块链技术更简单的愿景。NULS社区将不断探索和实施NULS社区自治,实现NULS项目自治和自进化。基于NULS社区文化和社区理念,特此制定社区发展章程。")]),t._v(" "),e("p",[t._v("NULS社区文化:开放、自由、自治、进化")]),t._v(" "),e("p",[t._v("NULS社区理念:分享、传承、成长、创新")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("NULS基金会")]),t._v(" "),e("p",[t._v("2018年12月")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(5),t._v(" "),e("p",[t._v("为了构建一个良好的社区运行机制,促进社区自治,推动NULS项目能够让社区自主进化和自主驱动。")]),t._v(" "),t._m(6),t._v(" "),e("p",[t._v("以下内容属于NULS社区章程的规范。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),e("p",[t._v("NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。")]),t._v(" "),e("p",[t._v("**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:")]),t._v(" "),e("p",[t._v("1、代码贡献")]),t._v(" "),e("p",[t._v("2、应用开发")]),t._v(" "),e("p",[t._v("3、运营推广")]),t._v(" "),e("p",[t._v("4、其他有利于NULS社区生态发展的具体事项")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。")]),t._v(" "),t._m(12),t._v(" "),e("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),e("p",[t._v("NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),e("p",[t._v("1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。")]),t._v(" "),e("p",[t._v("2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。")]),t._v(" "),e("p",[t._v("3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。")]),t._v(" "),e("p",[t._v("4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。")]),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。")]),t._v(" "),e("p",[t._v("(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(18),t._v(" "),e("p",[t._v("(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。")]),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。")]),t._v(" "),e("p",[t._v("3、理事会成员的责任。")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),e("p",[t._v("CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。")]),t._v(" "),t._m(25),t._v(" "),e("p",[t._v("在技术社区里我们坚持以下的理念:")]),t._v(" "),e("p",[t._v("1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。")]),t._v(" "),e("p",[t._v("2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。")]),t._v(" "),e("p",[t._v("3、共享 (Sharing):")]),t._v(" "),t._m(26),t._v(" "),e("p",[t._v("4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。")]),t._v(" "),e("p",[t._v("5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")]),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。")]),t._v(" "),e("p",[t._v("加入流程如下:")]),t._v(" "),e("p",[t._v("1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。")]),t._v(" "),e("p",[t._v("2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。")]),t._v(" "),e("p",[t._v("3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),e("p",[t._v("4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。")]),t._v(" "),e("p",[t._v("2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。")]),t._v(" "),e("p",[t._v("3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。")]),t._v(" "),e("p",[t._v("4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。")]),t._v(" "),e("p",[t._v("5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),e("p",[t._v("固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。")]),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),e("p",[t._v("对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。")]),t._v(" "),t._m(35),t._v(" "),e("p",[t._v("理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。")]),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),e("p",[t._v("1、理事会成员发起投票。只收取交易手续费。")]),t._v(" "),e("p",[t._v("2、普通成员投票。押金(目前设定是100NULS)+交易手续费。")]),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),e("p",[t._v("如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。")]),t._v(" "),e("p",[t._v("NULS社区网站:"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("建议反馈帖:"),e("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community/d/132-we-need-your-suggestions"),e("OutboundLink")],1)])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nip-2-nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nip-2-nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-2 NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v(" NIP: 2\n 标题: NULS社区章程\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207\n 状态: 公示\n 类型: 流程\n 创建日期: 2018/12/28\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"前言"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("前言")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("以下规则将会基于NULS开发共识治理模块,在共识治理模块上线前,理事会和大使将由NULS核心团队发起投票来执行。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"摘要"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"动机"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"规范"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"一、nuls社区简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls社区简介","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("一、NULS社区简介")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"二、nuls基金会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls基金会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("二、NULS基金会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)nuls基金会宗旨"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)nuls基金会宗旨","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)NULS基金会宗旨")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)nuls社区基金的来源"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)nuls社区基金的来源","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)NULS社区基金的来源")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)nuls社区基金管理"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)nuls社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)NULS社区基金管理")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"三、理事会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#三、理事会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("三、理事会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)理事会介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)理事会介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)理事会介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)理事会成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)理事会成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)理事会成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员)"),s("strong",[this._v(",由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出")]),this._v("(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)-理事会成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)-理事会成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三) 理事会成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。")])]),this._v(" "),s("li",[s("p",[this._v("固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("节点下限代理手续费佣金调整。")])]),t._v(" "),e("li",[e("p",[t._v("转账手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("合约调用手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("理事会发起提案的手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("其他系统可调整的系统参数调整。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。")])]),this._v(" "),s("li",[s("p",[this._v("创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("理事会成员需要能够及时与社区进行沟通。")])]),this._v(" "),s("li",[s("p",[this._v("严格遵照社区章程。")])]),this._v(" "),s("li",[s("p",[this._v("与NULS的愿景和目标一致。")])]),this._v(" "),s("li",[s("p",[this._v("以全体社区成员利益为己任。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"四、code-craft-council-ccc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#四、code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("四、CODE CRAFT COUNCIL(CCC)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)ccc介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)ccc介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)CCC介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)ccc理念"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)ccc理念","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)CCC理念")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("社区共享NULS技术成果。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS发展红利。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS的影响力和名誉。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS带来的技术革新。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS推动行业发展的标准制定。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)ccc成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)ccc成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)CCC成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(四)ccc成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(四)ccc成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(四)CCC成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"五、贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#五、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("五、贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)竞选贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)竞选贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (一)竞选贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示"),s("strong",[this._v("nuls.community")]),this._v("。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)固定贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)固定贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (二)固定贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"六、项目预算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#六、项目预算","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("六、项目预算")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)对于贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)对于贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)对于贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)对于其他事务资金"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)对于其他事务资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)对于其他事务资金")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"七、其他投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#七、其他投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("七、其他投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)发起投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)发起投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)发起投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)代理投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)代理投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)代理投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。")])]),this._v(" "),s("li",[s("p",[this._v("任何的NULS用户都可以成为代理人。")])]),this._v(" "),s("li",[s("p",[this._v("代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。")])]),this._v(" "),s("li",[s("p",[this._v("代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"八、建议反馈"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#八、建议反馈","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("八、建议反馈")])])}],!1,null,null,null);i.options.__file="NIP-2.md";s.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/182.0db6d70c.js b/docs/.vuepress/dist/assets/js/182.0db6d70c.js new file mode 100644 index 00000000..c36de14f --- /dev/null +++ b/docs/.vuepress/dist/assets/js/182.0db6d70c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[182],{841:function(t,e,s){"use strict";s.r(e);var r=s(0),a=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("为了让社区能够有更多的人才加入,所以将社区基金开放给社区来共同管理和使用。")]),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("以下内容属于NULS社区基金管理和使用流程的规范。")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),s("p",[t._v("社区基金账户地址:")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[t._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("根据社区章程指导思想,提案执行基金会账户操作。")]),t._v(" "),s("p",[t._v("该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。")]),t._v(" "),s("p",[t._v("注:理事会发起的该部分成员的申请提案投票期为15天。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),s("p",[t._v("(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;")]),t._v(" "),s("p",[t._v("(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;")]),t._v(" "),s("p",[t._v("(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;")]),t._v(" "),s("p",[t._v("(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;")]),t._v(" "),s("p",[t._v("(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;")]),t._v(" "),s("p",[t._v("(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;")]),t._v(" "),t._m(20),t._v(" "),s("p",[t._v("(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;")]),t._v(" "),s("p",[t._v("(2)理事会和申请人都需要引导社区正确地进行投票;")]),t._v(" "),s("p",[t._v("(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;")]),t._v(" "),s("p",[t._v("(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。")]),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;")]),t._v(" "),s("p",[t._v("(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。")]),t._v(" "),t._m(22),t._v(" "),s("p",[t._v("所有的社区讨论建议在"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("进行。")]),t._v(" "),s("p",[t._v("本流程根据社区章程思想进行管理,流程将会对全体社区公开。")]),t._v(" "),s("p",[t._v("流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。")]),t._v(" "),s("p",[t._v("具体节点产生收益参考NULS POC共识机制。")]),t._v(" "),t._m(23),t._v(" "),s("p",[t._v("大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),t._v(" "),s("p",[t._v("CCC 成员:")]),t._v(" "),s("p",[t._v("Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),t._v(" "),s("p",[t._v("Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),t._v(" "),s("p",[t._v("Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),t._v(" "),s("p",[t._v("Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),t._v(" "),s("p",[t._v("Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),t._v(" "),s("p",[t._v("Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),t._v(" "),s("p",[t._v("Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),t._v(" "),s("p",[t._v("Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),t._v(" "),s("p",[t._v("Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),t._v(" "),s("p",[t._v("Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),t._v(" "),t._m(24)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-3-nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-3-nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-3 NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" NIP: 3\n 标题: NULS社区基金管理和使用流程\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/263-ngc20181221\n 状态: 公示\n 类型: 流程\n 创建日期: 2018/12/28\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"摘要"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"动机"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"规范"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375408-182645-20181221145608.png",alt:"img"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、社区基金管理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("一、社区基金管理")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、发起申请的成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、发起申请的成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("二、发起申请的成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、普通成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、普通成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、普通成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、贡献者角色"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、贡献者角色")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、申请类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、申请类型","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("三、申请类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、提案支付资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、提案支付资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、提案支付资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、预算项目提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、预算项目提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、预算项目提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、提案创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、提案创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、提案创建节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4、提案委托资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、提案委托资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("4、提案委托资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、申请流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、申请流程","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("四、申请流程")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、方案公开讨论"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、方案公开讨论","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、方案公开讨论")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、理事会成员提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、理事会成员提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、理事会成员提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、基金会执行提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、基金会执行提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、基金会执行提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、流程解释"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、流程解释","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("五、流程解释")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"附:当前贡献者角色的委托和节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附:当前贡献者角色的委托和节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("附:当前贡献者角色的委托和节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);a.options.__file="NIP-3.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/183.963128a1.js b/docs/.vuepress/dist/assets/js/183.963128a1.js new file mode 100644 index 00000000..71cd78df --- /dev/null +++ b/docs/.vuepress/dist/assets/js/183.963128a1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[183],{840:function(t,r,e){"use strict";e.r(r);var s=e(0),_=Object(s.a)({},function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),e("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("从9月-10月期间,我们已经有9位大使,大家都在积极的为NULS社区贡献,发展更多的成员,以及做一些力所能及的事情。NULS在主网智能合约上线后,将会开启一个社区投票工具。大使的竞选本身应该由社区来选择,另一方面由于在大使开展工作的过程中,社区的其他伙伴也提供了很多的建议,在广大社区成员的建议下,我们准备更新NULS大使的竞选规则。这将是NULS开启社区自治道路的第一步,NULS社区自治是未来的重要目标,这需要非常多的基础工具和人才支持。")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("以下内容属于NULS大使竞选参与规则的规范。")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),e("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(7),t._v(" "),e("p",[t._v("1、参与NULS大使的选举需要具有创建NULS节点的基本条件。")]),t._v(" "),e("p",[t._v("2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员,参选之前请确保能够坚持在任一个季度。")]),t._v(" "),e("p",[t._v("3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。")]),t._v(" "),e("p",[t._v("4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。")]),t._v(" "),e("p",[t._v("5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。")]),t._v(" "),e("p",[t._v("6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。")]),t._v(" "),e("p",[t._v("7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。")]),t._v(" "),e("p",[t._v("8、大使获得的节点的所有奖励一半作为大使的报酬(由于大使的节点服务器需要支出和自己抵押的20000NULS也会产生收益),另外一半必须作为大使发展基金,用于社区发展。")]),t._v(" "),e("p",[t._v("9、大使的离职,如果大使主动离职或者被罢免,请将剩余的大使发展基金返回到社区基金。")]),t._v(" "),e("p",[t._v("10、大使属于社区贡献者角色,如需要发起其他的社区基金申请,按照"),e("a",{attrs:{href:"https://nuls.community/d/274-nip3-nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区基金使用和管理流程"),e("OutboundLink")],1),t._v("执行。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("发布上月的工作情况报告和下月的工作计划:")]),t._v(" "),e("p",[t._v("请发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;")]),t._v(" "),e("p",[t._v("NULS基金会将会委托200000NULS在您的节点上。")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),e("p",[t._v("所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),e("p",[t._v("欢迎大家加入NULS社区,共同创造NULS美好未来!")]),t._v(" "),t._m(14),t._v(" "),e("p",[t._v("1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),e("p",[t._v("2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),e("p",[t._v("3、分享NULS的故事给社区。")]),t._v(" "),e("p",[t._v("3、分享NULS的故事给社区;")]),t._v(" "),e("p",[t._v("4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),e("p",[t._v("6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),e("p",[t._v("7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),e("p",[t._v("8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),e("p",[t._v("欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。")]),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;")]),t._v(" "),e("p",[t._v("2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;")]),t._v(" "),e("p",[t._v("3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;")]),t._v(" "),e("p",[t._v("4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("(1)通过互联网或者线下交流的方式让其他人了解NULS。")]),t._v(" "),e("p",[t._v("(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。")]),t._v(" "),e("p",[t._v("(3)将NULS社区其他地区的发展情况分享到当地社区。")]),t._v(" "),e("p",[t._v("(4)持续分享NULS项目的进展、规划、新闻等到当地社区。")]),t._v(" "),e("p",[t._v("(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。")]),t._v(" "),e("p",[t._v("(6)分享NULS的故事给社区。")]),t._v(" "),e("p",[t._v("(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),e("p",[t._v("(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),e("p",[t._v("(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),e("p",[t._v("(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),e("p",[t._v("(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),e("p",[t._v("(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。")]),t._v(" "),e("p",[t._v("(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。")]),t._v(" "),e("p",[t._v("(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。")]),t._v(" "),t._m(21),t._v(" "),e("p",[t._v("1、NULS大使工作看板("),e("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击进入"),e("OutboundLink")],1),t._v("),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。")]),t._v(" "),e("p",[t._v("2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。")]),t._v(" "),e("p",[t._v("3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。")]),t._v(" "),e("p",[t._v("4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。")]),t._v(" "),e("p",[t._v("5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。")]),t._v(" "),e("p",[t._v("6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。")]),t._v(" "),e("p",[t._v("7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注"),e("a",{attrs:{href:"https://github.com/nuls-io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Github"),e("OutboundLink")],1),t._v("和"),e("a",{attrs:{href:"https://dev.nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev.nuls.io"),e("OutboundLink")],1),t._v("。")]),t._v(" "),e("p",[t._v("7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),e("OutboundLink")],1),t._v("上面发帖。")]),t._v(" "),t._m(22),t._v(" "),e("p",[t._v("1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。")]),t._v(" "),e("p",[t._v("2、组织开展一些线下见面会活动。")]),t._v(" "),e("p",[t._v("3、让更多的区块链投资人了解NULS,引导他们对NULS投资。")]),t._v(" "),e("p",[t._v("4、帮助NULS寻找更多的区块链技术爱好者加入。")]),t._v(" "),t._m(23),t._v(" "),e("p",[t._v("1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;")]),t._v(" "),e("p",[t._v("2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。")]),t._v(" "),e("p",[t._v("3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。")]),t._v(" "),t._m(24),t._v(" "),e("p",[t._v("1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。")]),t._v(" "),e("p",[t._v("2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。")]),t._v(" "),e("p",[t._v("3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),e("p",[t._v("1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。")]),t._v(" "),e("p",[t._v("2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。")]),t._v(" "),e("p",[t._v("3、必须住在人口超过35万的城市。")]),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。")]),t._v(" "),e("p",[t._v("2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。")]),t._v(" "),e("p",[t._v("2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。")]),t._v(" "),t._m(29)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nip-4-nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nip-4-nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-4 NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("div",{staticClass:"language- extra-class"},[r("pre",{pre:!0,attrs:{class:"language-text"}},[r("code",[this._v(" NIP: 4\n 标题: NULS大使竞选参与规则\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/205-ncg-20181114\n 状态: 公示\n 类型: 流程\n 创建日期: 2019/2/15\n")])])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"摘要"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"动机"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"规范"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"一、nuls大使介绍"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls大使介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("一、NULS大使介绍")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"二、nuls大使职责和权益"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls大使职责和权益","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("二、NULS大使职责和权益")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"三、如何参与竞选"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#三、如何参与竞选","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("三、如何参与竞选")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第一步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第二步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第三步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[r("strong",[this._v("最后祝愿:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。")]),this._v(" "),r("li",[this._v("开始社区建设和拓展工作。")]),this._v(" "),r("li",[this._v("帮助NULS对接更多的DApp接入。")]),this._v(" "),r("li",[this._v("请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"如果您能够奉献更多,对您的期望:"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#如果您能够奉献更多,对您的期望:","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("如果您能够奉献更多,对您的期望:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"大使指导手册"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#大使指导手册","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("大使指导手册")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"前言"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("前言")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你将获得"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你将获得","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你将获得")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你可以从这些方面来开展工作"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你可以从这些方面来开展工作","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你可以从这些方面来开展工作")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_1、社区拓展"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1、社区拓展","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、社区拓展")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_2、社区活动"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2、社区活动","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、社区活动")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"了解nuls可以从这里开始"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#了解nuls可以从这里开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 了解NULS可以从这里开始")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"招募志愿者组织当地的社群"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#招募志愿者组织当地的社群","aria-hidden":"true"}},[this._v("#")]),this._v(" 招募志愿者组织当地的社群")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"发展当地的nuls生态"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#发展当地的nuls生态","aria-hidden":"true"}},[this._v("#")]),this._v(" 发展当地的NULS生态")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"将nuls的理念和技术传播到当地"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#将nuls的理念和技术传播到当地","aria-hidden":"true"}},[this._v("#")]),this._v(" 将NULS的理念和技术传播到当地")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"nulstar指南和职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar指南和职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar指南和职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"成为nulstar的要求"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#成为nulstar的要求","aria-hidden":"true"}},[this._v("#")]),this._v(" 成为NULStar的要求")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstar的职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar的职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstars的奖励"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstars的奖励","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStars的奖励")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"指导手册会不断更新,希望大使们和nuls一起成长!"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#指导手册会不断更新,希望大使们和nuls一起成长!","aria-hidden":"true"}},[this._v("#")]),this._v(" 指导手册会不断更新,希望大使们和NULS一起成长!")])}],!1,null,null,null);_.options.__file="NIP-4.md";r.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/184.b537b1fa.js b/docs/.vuepress/dist/assets/js/184.b537b1fa.js new file mode 100644 index 00000000..313d8a47 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/184.b537b1fa.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[184],{838:function(t,e,i){"use strict";i.r(e);var r=i(0),s=Object(r.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("p",[t._v("NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),i("p",[t._v("通过NULS的github可以获取所有的NIP,github地址为:"),i("a",{attrs:{href:"https://github.com/nuls-io/NIPs",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/NIPs"),i("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip产生的理由"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip产生的理由","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP产生的理由")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录")])]),this._v(" "),e("li",[e("p",[this._v("对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"获取所有nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取所有nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取所有NIP")])}],!1,null,null,null);s.options.__file="NIPIntroduction.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/185.30696c6b.js b/docs/.vuepress/dist/assets/js/185.30696c6b.js new file mode 100644 index 00000000..8d771c87 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/185.30696c6b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[185],{836:function(t,s,e){"use strict";e.r(s);var n=e(0),a=Object(n.a)({},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"content"},[this._m(0),this._v(" "),s("NavBar")],1)},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls-导航"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls-导航","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 导航")])}],!1,null,null,null);a.options.__file="NULSNav.md";s.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/186.0ad2973d.js b/docs/.vuepress/dist/assets/js/186.0ad2973d.js new file mode 100644 index 00000000..490fb24e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/186.0ad2973d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[186],{830:function(e,t,r){"use strict";r.r(t);var n=r(0),s=Object(n.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432"),r("OutboundLink")],1)])]),e._v(" "),e._m(2),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/zh-cn/categories/115000056052"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.binance.com/hc/zh-cn/categories/115000056052",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.binance.com/hc/en-us/categories/115000056052"),r("OutboundLink")],1)])]),e._v(" "),e._m(3),e._v(" "),r("ul",[r("li",[e._v("中文:"),r("a",{attrs:{href:"https://support.okex.com/hc/zh-cn/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/zh-cn/categories/115000275231"),r("OutboundLink")],1)]),e._v(" "),r("li",[e._v("English:"),r("a",{attrs:{href:"https://support.okex.com/hc/en-us/categories/115000275231",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://support.okex.com/hc/en-us/categories/115000275231"),r("OutboundLink")],1)])])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls交易指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls交易指南","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS交易指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"火币交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#火币交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 火币交易使用指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"币安交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#币安交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 币安交易使用指南")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"okex交易使用指南"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#okex交易使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" OKEx交易使用指南")])}],!1,null,null,null);s.options.__file="NULSTransaction.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/187.ada551ca.js b/docs/.vuepress/dist/assets/js/187.ada551ca.js new file mode 100644 index 00000000..c7fc6997 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/187.ada551ca.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[187],{828:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等")]),t._v(" "),t._m(2),t._v(" "),s("p",[s("router-link",{attrs:{to:"/zh/NULS2.0/"}},[t._v("前往体验")])],1)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"欢迎来到nuls"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#欢迎来到nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" 欢迎来到NULS")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nuls2-0-alpha版本已发布"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha版本已发布","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha版本已发布")])}],!1,null,null,null);n.options.__file="README.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/188.0bf963be.js b/docs/.vuepress/dist/assets/js/188.0bf963be.js new file mode 100644 index 00000000..afcb40c9 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/188.0bf963be.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[188],{826:function(t,r,s){"use strict";s.r(r);var _=s(0),e=Object(_.a)({},function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("1、参与NULS大使的选举需要具有创建NULS节点的基本条件。")]),t._v(" "),s("p",[t._v("2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员。")]),t._v(" "),s("p",[t._v("3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。")]),t._v(" "),s("p",[t._v("4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。")]),t._v(" "),s("p",[t._v("5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。")]),t._v(" "),s("p",[t._v("6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。")]),t._v(" "),s("p",[t._v("7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。")]),t._v(" "),s("p",[t._v("8、NULS大使可以向NULS基金会提报预算,申请重大事项发展的经费,该预算面向全体社区公开,发起预算投票,投票期为15天,投票量超过1000W NULS且支持率达到70%以上,基金会可以向该预算发放资金。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("发布上月的工作情况报告和下月的工作计划:")]),t._v(" "),s("p",[t._v("请发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。")]),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;")]),t._v(" "),s("p",[t._v("NULS基金会将会委托200000NULS在您的节点上。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),s("p",[t._v("欢迎大家加入NULS社区,共同创造NULS美好未来!")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),s("p",[t._v("2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),s("p",[t._v("3、分享NULS的故事给社区。")]),t._v(" "),s("p",[t._v("3、分享NULS的故事给社区;")]),t._v(" "),s("p",[t._v("4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),s("p",[t._v("6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),s("p",[t._v("7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),s("p",[t._v("8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。")]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;")]),t._v(" "),s("p",[t._v("2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;")]),t._v(" "),s("p",[t._v("3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;")]),t._v(" "),s("p",[t._v("4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("(1)通过互联网或者线下交流的方式让其他人了解NULS。")]),t._v(" "),s("p",[t._v("(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。")]),t._v(" "),s("p",[t._v("(3)将NULS社区其他地区的发展情况分享到当地社区。")]),t._v(" "),s("p",[t._v("(4)持续分享NULS项目的进展、规划、新闻等到当地社区。")]),t._v(" "),s("p",[t._v("(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。")]),t._v(" "),s("p",[t._v("(6)分享NULS的故事给社区。")]),t._v(" "),s("p",[t._v("(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),s("p",[t._v("(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),s("p",[t._v("(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),s("p",[t._v("(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),s("p",[t._v("(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),s("p",[t._v("(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。")]),t._v(" "),s("p",[t._v("(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。")]),t._v(" "),s("p",[t._v("(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("1、NULS大使工作看板("),s("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击进入"),s("OutboundLink")],1),t._v("),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。")]),t._v(" "),s("p",[t._v("2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。")]),t._v(" "),s("p",[t._v("3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。")]),t._v(" "),s("p",[t._v("4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。")]),t._v(" "),s("p",[t._v("5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。")]),t._v(" "),s("p",[t._v("6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。")]),t._v(" "),s("p",[t._v("7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注"),s("a",{attrs:{href:"https://github.com/nuls-io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Github"),s("OutboundLink")],1),t._v("和"),s("a",{attrs:{href:"https://dev.nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev.nuls.io"),s("OutboundLink")],1),t._v("。")]),t._v(" "),s("p",[t._v("7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("上面发帖。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。")]),t._v(" "),s("p",[t._v("2、组织开展一些线下见面会活动。")]),t._v(" "),s("p",[t._v("3、让更多的区块链投资人了解NULS,引导他们对NULS投资。")]),t._v(" "),s("p",[t._v("4、帮助NULS寻找更多的区块链技术爱好者加入。")]),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;")]),t._v(" "),s("p",[t._v("2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。")]),t._v(" "),s("p",[t._v("3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。")]),t._v(" "),t._m(19),t._v(" "),s("p",[t._v("1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。")]),t._v(" "),s("p",[t._v("2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。")]),t._v(" "),s("p",[t._v("3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。")]),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。")]),t._v(" "),s("p",[t._v("2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。")]),t._v(" "),s("p",[t._v("3、必须住在人口超过35万的城市。")]),t._v(" "),t._m(22),t._v(" "),s("p",[t._v("1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。")]),t._v(" "),s("p",[t._v("2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。")]),t._v(" "),t._m(23),t._v(" "),s("p",[t._v("1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。")]),t._v(" "),s("p",[t._v("2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。")]),t._v(" "),t._m(24)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"一、nuls大使介绍"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls大使介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("一、NULS大使介绍")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"二、nuls大使职责和权益"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls大使职责和权益","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("二、NULS大使职责和权益")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"三、如何参与竞选"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#三、如何参与竞选","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("三、如何参与竞选")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第一步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第二步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第三步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[r("strong",[this._v("最后祝愿:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。")]),this._v(" "),r("li",[this._v("开始社区建设和拓展工作。")]),this._v(" "),r("li",[this._v("帮助NULS对接更多的DApp接入。")]),this._v(" "),r("li",[this._v("请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"如果您能够奉献更多,对您的期望:"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#如果您能够奉献更多,对您的期望:","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("如果您能够奉献更多,对您的期望:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"大使指导手册"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#大使指导手册","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("大使指导手册")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"前言"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("前言")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你将获得"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你将获得","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你将获得")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你可以从这些方面来开展工作"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你可以从这些方面来开展工作","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你可以从这些方面来开展工作")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_1、社区拓展"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1、社区拓展","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、社区拓展")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_2、社区活动"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2、社区活动","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、社区活动")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"了解nuls可以从这里开始"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#了解nuls可以从这里开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 了解NULS可以从这里开始")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"招募志愿者组织当地的社群"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#招募志愿者组织当地的社群","aria-hidden":"true"}},[this._v("#")]),this._v(" 招募志愿者组织当地的社群")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"发展当地的nuls生态"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#发展当地的nuls生态","aria-hidden":"true"}},[this._v("#")]),this._v(" 发展当地的NULS生态")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"将nuls的理念和技术传播到当地"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#将nuls的理念和技术传播到当地","aria-hidden":"true"}},[this._v("#")]),this._v(" 将NULS的理念和技术传播到当地")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"nulstar指南和职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar指南和职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar指南和职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"成为nulstar的要求"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#成为nulstar的要求","aria-hidden":"true"}},[this._v("#")]),this._v(" 成为NULStar的要求")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstar的职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar的职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstars的奖励"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstars的奖励","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStars的奖励")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"指导手册会不断更新,希望大使们和nuls一起成长!"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#指导手册会不断更新,希望大使们和nuls一起成长!","aria-hidden":"true"}},[this._v("#")]),this._v(" 指导手册会不断更新,希望大使们和NULS一起成长!")])}],!1,null,null,null);e.options.__file="ambassadorRules.md";r.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/189.39991fc7.js b/docs/.vuepress/dist/assets/js/189.39991fc7.js new file mode 100644 index 00000000..ec6e209b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/189.39991fc7.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[189],{822:function(t,s,e){"use strict";e.r(s);var r=e(0),_=Object(r.a)({},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),e("p",[t._v("NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。")]),t._v(" "),e("p",[t._v("**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(2),t._v(" "),e("p",[t._v("NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:")]),t._v(" "),e("p",[t._v("1、代码贡献")]),t._v(" "),e("p",[t._v("2、应用开发")]),t._v(" "),e("p",[t._v("3、运营推广")]),t._v(" "),e("p",[t._v("4、其他有利于NULS社区生态发展的具体事项")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。")]),t._v(" "),t._m(5),t._v(" "),e("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),e("p",[t._v("NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。")]),t._v(" "),e("p",[t._v("2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。")]),t._v(" "),e("p",[t._v("3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。")]),t._v(" "),e("p",[t._v("4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。")]),t._v(" "),e("p",[t._v("(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。")]),t._v(" "),t._m(12),t._v(" "),e("p",[t._v("(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(13),t._v(" "),e("p",[t._v("2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。")]),t._v(" "),e("p",[t._v("3、理事会成员的责任。")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。")]),t._v(" "),t._m(18),t._v(" "),e("p",[t._v("在技术社区里我们坚持以下的理念:")]),t._v(" "),e("p",[t._v("1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。")]),t._v(" "),e("p",[t._v("2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。")]),t._v(" "),e("p",[t._v("3、共享 (Sharing):")]),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。")]),t._v(" "),e("p",[t._v("5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。")]),t._v(" "),e("p",[t._v("加入流程如下:")]),t._v(" "),e("p",[t._v("1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。")]),t._v(" "),e("p",[t._v("2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。")]),t._v(" "),e("p",[t._v("3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),e("p",[t._v("4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。")]),t._v(" "),t._m(21),t._v(" "),e("p",[t._v("1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。")]),t._v(" "),e("p",[t._v("2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。")]),t._v(" "),e("p",[t._v("3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。")]),t._v(" "),e("p",[t._v("4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。")]),t._v(" "),e("p",[t._v("5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),e("p",[t._v("固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。")]),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),e("p",[t._v("1、理事会成员发起投票。只收取交易手续费。")]),t._v(" "),e("p",[t._v("2、普通成员投票。押金(目前设定是100NULS)+交易手续费。")]),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),e("p",[t._v("如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。")]),t._v(" "),e("p",[t._v("NULS社区网站:"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("建议反馈帖:"),e("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community/d/132-we-need-your-suggestions"),e("OutboundLink")],1)])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"一、nuls社区简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls社区简介","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("一、NULS社区简介")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"二、nuls基金会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls基金会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("二、NULS基金会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)nuls基金会宗旨"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)nuls基金会宗旨","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)NULS基金会宗旨")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)nuls社区基金的来源"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)nuls社区基金的来源","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)NULS社区基金的来源")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)nuls社区基金管理"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)nuls社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)NULS社区基金管理")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"三、理事会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#三、理事会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("三、理事会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)理事会介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)理事会介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)理事会介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)理事会成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)理事会成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)理事会成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员)"),s("strong",[this._v(",由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出")]),this._v("(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)-理事会成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)-理事会成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三) 理事会成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。")])]),this._v(" "),s("li",[s("p",[this._v("固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("节点下限代理手续费佣金调整。")])]),t._v(" "),e("li",[e("p",[t._v("转账手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("合约调用手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("理事会发起提案的手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("其他系统可调整的系统参数调整。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。")])]),this._v(" "),s("li",[s("p",[this._v("创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("理事会成员需要能够及时与社区进行沟通。")])]),this._v(" "),s("li",[s("p",[this._v("严格遵照社区章程。")])]),this._v(" "),s("li",[s("p",[this._v("与NULS的愿景和目标一致。")])]),this._v(" "),s("li",[s("p",[this._v("以全体社区成员利益为己任。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"四、code-craft-council-ccc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#四、code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("四、CODE CRAFT COUNCIL(CCC)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)ccc介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)ccc介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)CCC介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)ccc理念"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)ccc理念","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)CCC理念")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("社区共享NULS技术成果。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS发展红利。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS的影响力和名誉。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS带来的技术革新。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS推动行业发展的标准制定。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)ccc成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)ccc成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)CCC成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(四)ccc成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(四)ccc成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(四)CCC成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"五、贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#五、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("五、贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)竞选贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)竞选贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (一)竞选贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示"),s("strong",[this._v("nuls.community")]),this._v("。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)固定贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)固定贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (二)固定贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"六、项目预算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#六、项目预算","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("六、项目预算")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)对于贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)对于贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)对于贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)对于其他事务资金"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)对于其他事务资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)对于其他事务资金")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"七、其他投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#七、其他投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("七、其他投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)发起投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)发起投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)发起投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)代理投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)代理投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)代理投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。")])]),this._v(" "),s("li",[s("p",[this._v("任何的NULS用户都可以成为代理人。")])]),this._v(" "),s("li",[s("p",[this._v("代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。")])]),this._v(" "),s("li",[s("p",[this._v("代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"八、建议反馈"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#八、建议反馈","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("八、建议反馈")])])}],!1,null,null,null);_.options.__file="communityConstitution.md";s.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/19.c066ca9d.js b/docs/.vuepress/dist/assets/js/19.c066ca9d.js new file mode 100644 index 00000000..9543b6bc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/19.c066ca9d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{304:function(e,t,n){e.exports=n.p+"assets/img/1.6f2046a8.png"},305:function(e,t,n){e.exports=n.p+"assets/img/2.e042a947.png"},306:function(e,t,n){e.exports=n.p+"assets/img/3.2a598d4a.png"},307:function(e,t,n){e.exports=n.p+"assets/img/4.ab76dd1b.png"},308:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUkAAACQCAYAAACFzJn7AAAVGklEQVR4nO3deXyU1b3H8c+ZJZkJCYGwhB0CgUSCUFwABURBRRCRRXDBWlu73d5ql2ulm0u1Wq+1t62tvV6vrWuvda+KUhEXFgURymrCKltYAmRPyITMzLl/DMmQJnlmIpEJL7/vf/Ka55w55zdPMt85zzyTeUxeXp5FRESa5Up0ASIi7ZlCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIEnkZOnpVqumhUmdwjU1BgWvQMfrozm9qhzLNOmhAF4/U3Dx2vaZ6Z/77shfv9Hd4vtHo9l6mTLgP6Wh/7Ucj8RaX8SFpIul+VbN4VZvdbw7N8M2dlw9ZwwFZWWTZ8YMjMtl04K8/CjLkJBuOnGMDt3WY4Um0SV3KIdO2LXlOK3DBzQ/moXEWcJW5pNGAe79xg+WGH43s1hrpxmeWOhYfz5FoAx51qWLDMUFRmOFBtWrjKMOtcmqlxHCxY678Zg0PDcS+1zFSwizhL2zD3zzDBr1hlGnwObtxgqq2HrNkPvXpH2nCGwdXt05bV1m2FoTvsKSa/Xkp5uGX1uOGZfa7WKFDkdJexwu0d3OHAALrrAsvxD6NQJysrB748EYcc0KC6J9i+vgPT06O3fPRAJpvzNkRXnv30jsv37t0Vy3xjLpIssY8dYvF7DmrXw6gJDOGyYMzNMVhZkdLL8+A43Uy4NM2GcZX8RPPSwO2Z7vR/9IExqB0jxGz76uPHjM8Yy+WLLmFEWtwfeW2KatLdUn4i0HwlbSSYlQaAW+vaG6ipDScnxbYFIu89nCYWi/QMB8Pujt+++3xAIWP78pIst21ys+Age/F00YCaMh6z+lj8+4uK+XxuSkiInTwA+Wg2LFht8PsP488PUBAx33edizT9NXO317nvAzc9/0fwuvGiC5YxcePhRF/c/6CK1Q+N2p/pEpP1IWEhWH4VkL3RItXiSoLgYevaAkuOrx5oa8Hqj/T0eCAWjIVVSYtix0zA01+J2WwK1ULg/2n7+mDDPveSiuMRw9KjhtQUuRgyPhNCevS7WbYj0PVIM7y81BAKGD1a44mo/UUsrv/NGwcuvwuHDhupqw2tvNL6vU30i0n4k7HC7tBQyMy3hMGRnQ3kZTLrQsnptJHTKKyCjs+VgUeR2p3QoKWscIhs2wahzIh+x2fFp4/E7pcPdP7dA9D7BEE0UbHF+nYjV3pL0dMu+/S3fN976RCSxEhaS6zYYRo6AnbsMyV7LVTPgk82w7INIKBZsNuQMhoNFkf7Zgyw7dzVetW3YaJg13ZKcDI881ritvMLwhz8ZKioT8x5fVSV07gSHj0Rue72NAz7R9YlIfBJ2uL1ylWH4sMhnIt9abLj7V4b8fJg+1R5vh/FjLT0yw3TrZrnwAsvS5Y3HqAkYdu2G8vKmh72rVsPc2Zbu3SKH4337hLlqZvQstM8Xmcfva/4QN1Z7tF9kzJSUxv3WbjBMv9zSsaMlNdUy5dJI+4xp4bjqE5H2weTl5SXsjbAemZY5sy39+liOHoW16wyvLzSEQpHA+9Jwy8zpYYyB1xYYVq9tmunjzrMUl9gmh8Uul+WSiZbR51g6pMLevfDsC4biEhfz/yNMz8xo30Agcha7Xqz2enf9NEynTtHbZWVw132ROjwey6zplhHDLTU1kbnnzIq8KCxY6HKsT0Taj4SGpIhIe6dli4iIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaRIG0jy+bl42pyG2xdPm0OSz+9wj9bpN3AwN33vZ8y/9w9tNqbERyEpcpLcbjfT536Fj5Yubtj20bLFXDHnBlyutrnO+uWzv8yubQX8/p7b2mQ8id9pGZLXnOHmZ2O9MfvNHOzmpuFufjPJue/tY9v2u4fjre9kxfv4Es3ndfGjOYN4Zv7IuO+T6ndz7405LPuvcSz/7Tj+++YzmT930OdY5Wd30ZRZfLJuNZUVpQ3bKstLyV//TyZOmdkmc2R07c6StxcQCNS0yXgSv9MyJH0eGJIRX+l1Ieia4tx3S3Hbfltca+o7WfE8vvagY4qHL2V3jrv/ndcPoby6jmm3r+SK21ey82A1l5ydGfuOp1iXbj3oM2AgBRtWN2kr2PAxfbIG0aVbj5Oex+12E6w7dtLjSOu1/2dXM57YGN/FYF7ZFuKpT2L3fX5z215cJt76Tla8jy/RAnVh7nhqc6vuM2F4Nx5+fTfl1UFKq4I88MKn5O8pb9Lvp9dmt1WZzYo1/sgxF7B5w5oW2zdv/CcjR49v67LkFDotQ7KtJLktGT7DhL5f6N1wSljbumv5lFbVMfmcbo22/ewv0aB1GcO5Q9KZOurkV2nNiXf87Jw8dmzNb7H90y0FZOcOO7laXG7CYV3aI1ESciGw28Z46ZUKD30c5Ftne0jzwoYiy5Mb66gJGf7nsiR8XsNXXq9tuE9z2zJTDN8c6aZPRxfbS8I8ujZE+bH4D53vuSCJtCTokORiyd7aJu3n9XJx+WA33VMMZbWWF/NDrDoY/x9rrPquPsPNhH4uDIZle0M8+0kQa0zc7U6MtUzLdjMxy43XZVhZGOLZgiCh42E1uqeL6TlueqQYqo5Z3twR5q2dkVXp7WM9dPUbbl8a5Gsj3OR1dVFdBy9tDrKsML7H7zKG71zRn1njeuH1uHjird1N+tx61UBmje+NAf7+4X4eeH57Q5g++Pw2fvm1oYzO6cQfX93F3iMBKmuiq+a37z+PzAwfAJv+dyIAw77xbkP7Zed249vTsujXPYXyqmM88dYenlxcCMCd1w/mS9md6ZXhY/QtS7nlygHMm9SP7fsqmfefa+Mav156p86Ul5U22V6vrKyY9E7xv83QnNwzz+bAvj0nNYZ8dglZQr23K0Rnv4vzert4cMUx5r8bxOOBq4dGMvvWd+qa3OeHi5uG2NRBbh5fH+IHb9dSWQvXDG3dmcT579Vx86Lm3+cZ28vFNUPdvFIQ5JZFtfxmZZDrhrXuNcWpvov7uzijq4tfLAty57JasjNcXJwVf3sslw70MLiLi/s+DDL/3VqS3DA7J1r/nKFu/rI2yLcW1vLI2iCzc6N/Cgu2henkdzFjsIuFO0J8561ans8PNvx+4vHVS/swblgXbvrNWq68YyUZHZMatc+b2ItzczK47t7VXP3LjxkxsBPXT+zd0P722iPM/sUqwPDyXaP4wawsjIm+wEya/2FDaA37xrtNAuwHs7K588kCRn93CT957BO+O2NgQ9vLyw/w6Bs76eD3MG9iL8qrg0ya/wELPjoY9/gN4nzROhmXXDGbxQte/NznkeYlJCQ/Pr4ae7YgyOEaQ2Wd5fn8ECMyIyFQWdd0NVgdbPrH+Nr2EIVVlqNBw8tb6xjatfV/sKEWDgMvH+Lm8Q0h1hyyBEKGoqOWB1Y2DW8nTvVNynLz1PogRUcth44ant4QZNIJIRirPZaJA1w8vqGOw0ct1UHD3wqCnNMr+uu+9Z06dlaEye7son9HQ7In2rb2UOT380x+kC0llrqwYcW+EGnJ8e/f2Rf05ld/28rOohpKqoL8+oUdjdqvubAPv/zrZnYdqmHP4QD3PbuFuRP6NupTeCTA/D8XcMMDa5h8TibfnzmQeE3+yQo27api5KA0cvul4U+OBvzGXVUs/PhwZI5DAZ5cXEhVTYhn3z8Q9/j1yktLSE9veaUYa6UZjzdf+iuzr//mSY0hn13CrrsNED4hoEoDYVJb+UmW4ppomJbUQIektntV7+o3bC4OAdEx91e17iy4U31d/Ya9VeGG8QurwmT44m+PJcNn+N0lvkbbguFoPUM6G751lpeSABSWN38IfeLvJ97D/HqZnZLZsre6xfZeXfxs23e04fb2fUfp2SW54fbUUd14c1UkyAr2VPOjRzfx8M0j+O3LO+Oa/+zsjvzq63kUlQbYvq+qxX5LNpXENV5Ldu3YQtbgMzhctL/Z9oGDh7Jze+tOWv2r7Zs3kprW8aTGkM8uoSF5or6pLkprG4eQy9iGJ6rHNA2oE9u7d3BRGmi7j/KU11q6pbjYWxkds3+aYXdl/HM41VdSa8lMcVF4PHh7pLSuPZbSWsuv3qml9Fjz4XbjcA+Prw+x6UgkICdmte2fQnHlMXp0TmbXocjn+vxJjQ9aispq6dvNx7b9kaDs181HUWn0LZWZY3uyaM0RgqHIY959qAavx/nAp0ual+LKyGr/ji/ncvdTm1meH1nFzfmXVepnceL49f65YilTZs9j1fJ3mr1P7vCzefOlp09qXmt1QdNESuhp3SsGufC7Lb1SDTeM8PDB3uiKpiJguaifG4/L0j3FMn1w5El83fH39WqDlmmD3PiPn6G+eqibVfuarohSPJE/sFRv839ofndkewdP4/aPCsPcMNxDn1RDktsysruLC/rFv7ti1bd0d5h5w9x09Ru6+A3XDXPz/u5Q3O2xHt/yPSFuHOGlZweDx1iyOhpuGBY9XO/iNwTDlhSPZUxPg7WW2UPcjcZMOWGf1O+nNG98K8pFq4u4de4gMjsn0SXNy3evzAJg/tWRD4S/vGw/P7l2ML26+OiZkcT8a7J5cWl0NZbkdfHA18+gT1cf6R08/MdVg1i28UiTecqrj3FebjppfjdfnRwNwh6dfdSFwqT53Uwd1Q0bttxy5YCG9lR/5LGm+Z3fwmhp/HqHDhZStH8vucOaflA+98yzKdq/l8MHm19ltlZb/feOtI67e/fudyVi4pk5Ht7dFeaHo71c0M/NuoNhXtkWpv5Fs7oOZg5xM3OIh0Gd3SzYHmJoV8O+Ckt+saVjEhRWwA9He5k4wM324jAvbA4SPuHw+Mkrkpl2PFwvz/YwM8fD37dGg+a3FycxZ2jkGP/ywR4m9HPz1qeR9i0lYXp2MMwd6mH6EA8dkuCZTUHqwvGFRKz6dpSFyUp3c+NwD+P6uFh30LJgRwgbZ3usx7etNExmiotr89zMyvHQu6Ph+YIgR4+/txuos3xluIeJ/d2sKwqTlmzI8Bs+KAzz2OWRw/Tz+0T3x68nJeP3GqZmuxvtw5as3lrG2YM78dNrhzBtTA+eeGs3wwd2ZMf+o6woKGX9pxXk9U/jjnk5zBjbiyXri3n0zT3Ux3Lfrn6SPC5umTGIr07ux5GKY9z9163U1jV+IQyHwvx8Xi4zx/Xk8X/sZl9xZDVaU1vHz6/PZe6E3ry//ggZaR56dvHx6ooiXv3FKG6bOwSAr08ZwFcu6ctjC5uefXca/0S7tm/mwskz2P3pVo4di7SndezMuIlTeOPFp9vk4zsjR4/Hm5TMgf17CQWDJz2exM/k5eWd8rW83215ZKqPm986RkUrPrIj0l75fH7GXTyNxQteACJfcLF8cdv9G2HOsJFcdNkMOmV05f6f/nubjCnxSUhI1n/mEeA7CwPNnrkWEWkPEhKSIiKnC/0/noiIA4WkiIgDT3JycuxenxOv10tdXev+i0VE5FTSSlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFC8iRdk9O+v0Spvdcn0t4pJD8jl7Fkp1tG90x0Jc1r7/WJnC7MWWedlbClRqK+4GJeriW7M3TxwS3vGa4caJnUH/ZXw/2rIl8AbKxlShZM6AseF6w6AC9ui16C9v7xlgx/4y8L/uaiyM+HLrL4vKbh9r9uizX/j0dZMnxwzwq4IQ/OyIhczuLV7fDhgfi+oNipvljzx6o/nv1T79FLaTSOyOnG3bNnz4Rc4wbA7Xa3yfU/WquyFvZVwehehspaSzAMf94UadtdEXmST+oHOV3gkfXw9m44sysMTIeCkkj74j2G13fAFYMiIfD6CZeVXlYIk7NMo21LC+Gy49tizV8ZgAv6GZJcsGwfPLcFymphTg4s2h1fSDrVF2v+WPXHs3/q7Si1HK7RN8/L6esLebi9q9KwuijyxC2ugXf2GmpDhiWF0Sfzhf3g6XwoDhiqg4YXt8FZPeIbv6qZy1GceImKWPOvL478fG4rbCsz1IUNqw5AWnLbhE2s+WPVD/Hvn/wSBaSc3trNdbcTZWNx80/izsnwwIQT2yKXYD1V8wMN1+wGsObzCRun+Z2cqv0jkmhf+JBsSdkxeHC5pexY4yBwkua1VNZF+7iMbQg6j7Ex7/95+9f6YnGq/7PsH5HT0RfycBsg2R1Z9aR4ml/9rNgH1w+FHikWj7H0T7Ncl9u0b/UxS25nS4rHcumA6PaKgGV8b/C4LN1TLFOzItvnDrEx56/fdmKb73j/1BbqbUlL9cV6/LHqj3f/DM3Q6lJOb1/Is9t3nW/plRpd9QTqLLe813gV5DKWqQNgbB9I9cKuCnhqExwONO53ST/LtEFQE4S/bIStZZH283taZgyGFA/sroBnCuDbI2BdEYzIxHH+Ry+N/Cypsfx4WdOz6a05W9xcffE8fqf6X9lh4t4/Orstp7svZEjKqfPgBMutS3QYLqevL+zhtpwamw4nugKRk6OQlM/VE/laRcrpTSEpIuJAISki4sBTW1ubsMkTObeISDy0khQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGQkK9Km3/vHzhSdIC3X3+BPTu3JaIEEZG4JGQl+dt7bmNb/gYuv+r6REwvIhK3hITksUANH7z/DzK6ZiZiehGRuCXsPclQMIjb7U7U9CIicdGJGxERBwkNyVAohMul1aSItF8JDcntmzcxdMS5iSxBRMRRQkNy09pVXDxtViJLEBFxlNCQnDbnyyx8+f8SWYKIiKOEhmRyso+t+esTWYKIiKOEn922VtdlFpH2K2Ehqc9IisjpICH/u53k8zN63ETKy0sTMb2ISNwSEpI/vONBykqO8A+dtBGRds7k5eXpTUERkRYk/MSNiEh7ppAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcfD/WYIrhH7kiPgAAAAASUVORK5CYII="},309:function(e,t,n){e.exports=n.p+"assets/img/6.b4a2a10c.png"},310:function(e,t,n){e.exports=n.p+"assets/img/7.71c33714.png"},311:function(e,t,n){e.exports=n.p+"assets/img/8.33bf5b49.png"},312:function(e,t,n){e.exports=n.p+"assets/img/9.ae82c2b9.png"},313:function(e,t,n){e.exports=n.p+"assets/img/10.a44ca8c2.png"},314:function(e,t,n){e.exports=n.p+"assets/img/11.144a1b5d.png"},315:function(e,t,n){e.exports=n.p+"assets/img/12.2924df38.png"},925:function(e,t,n){"use strict";n.r(t);var a=[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"develop-business-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#develop-business-modules","aria-hidden":"true"}},[this._v("#")]),this._v(" Develop Business Modules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"only-add-modules"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#only-add-modules","aria-hidden":"true"}},[this._v("#")]),this._v(" Only add modules")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[this._v("Add a new module to the ModuleE enumeration class")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(304),alt:"1553663833553"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",{attrs:{start:"2"}},[t("li",[this._v("Create a module's Bootstrap startup class")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(305),alt:"1553663980380"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(306),alt:"1553664139545"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(307),alt:"1553670103524"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(308),alt:"1553672430011"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(309),alt:"1553673258491"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"add-new-protocols"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#add-new-protocols","aria-hidden":"true"}},[this._v("#")]),this._v(" Add new protocols")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(310),alt:"1553678236166"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(311),alt:"1553678379934"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(312),alt:"1553680391073"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(313),alt:"1553680314226"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(314),alt:"1553680677761"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:n(315),alt:"1553680686807"}})])}],s=n(0),o=Object(s.a)({},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[e._m(0),e._v(" "),n("p",[e._v("Before reading this article, please read "),n("router-link",{attrs:{to:"/NULS2.0/packageGeneration.html"}},[e._v("Package Generation")])],1),e._v(" "),n("p",[e._v("NULS 2.0 is a blockchain project based on modular development. According to the characteristics of the blockchain and the unique NULS POC consensus mechanism, we have built-in accounts, ledger, network, block management, transaction management, consensus, and intelligent contract modules. These modules can meet the normality of the NULS2.0 blockchain node. run. But the underlying module is unlikely to meet all of the business needs. This article will guide developers on how to add their own modules and how to add their own protocols.")]),e._v(" "),n("p",[e._v("Before adding modules, we should first analyze the requirements of the business. We need to know clearly that the added modules only encapsulate and process the existing protocols, or that the existing protocols do not meet the needs of the business and must be added. The logic of the protocol and protocol handles the function.")]),e._v(" "),n("p",[e._v("This article uses api-module and account two developed modules to illustrate how to add their own modules (both modules are JAVA development, can be downloaded at "),n("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls_2.0"),n("OutboundLink")],1),e._v(" Source code reading).")]),e._v(" "),e._m(1),e._v(" "),n("p",[e._v("The api-module module is responsible for secondary parsing of the stored block data in the wallet, providing the wallet page and the browser with information that can be displayed. Therefore the module does not require an additional protocol.")]),e._v(" "),e._m(2),e._v(" "),e._m(3),e._v(" "),e._m(4),e._v(" "),n("p",[e._v("The startup class needs to inherit the RpcModule class for easy management of the mykernel core module. After inheritance, you need to implement a unique method, as shown below:")]),e._v(" "),e._m(5),e._v(" "),n("p",[e._v("Add dependent modules: If your module needs to call other modules' interfaces to query related data, or if you need other modules to run, your module can run normally, you need to add the dependent modules here. As shown below:")]),e._v(" "),e._m(6),e._v(" "),n("p",[e._v("Module initialization: If the module has data that needs to be initialized, it can be implemented here. The init method must call super.init() to ensure that the dependency injection is successful. As shown below:")]),e._v(" "),e._m(7),e._v(" "),n("p",[e._v("Start running: Start the running process to start your own service process, return true after the startup succeeds, if the startup fails, the program will return false after catching the exception, and inform the mykernel core module. As shown below:")]),e._v(" "),e._m(8),e._v(" "),n("p",[e._v("The dependent module has been started: Going to this step, the modules you depend on have been successfully started, and you can call the interfaces of other modules at this time.")]),e._v(" "),n("p",[e._v("The main function of the api-module module is to query the interfaces of other modules, and then parse the data and return it to the wallet page display. Therefore, the real operation of the module is done in the scheduleManager.start() step. The internal implementation is detailed in the source code.")]),e._v(" "),e._m(9),e._v(" "),n("p",[e._v("At this point, the api-module module has successfully joined nusl2.0. Since there is no new protocol, the module only needs to write the business functions of the module itself.")]),e._v(" "),e._m(10),e._v(" "),n("p",[e._v("​We use the alias trading of the account module to illustrate how to add a new protocol. Alias ​​trading, as its name implies, is that the account sends a transaction with the alias information that the account wants to set. Once the transaction is successfully packaged into the block by the consensus node, it indicates that the account setting alias is successful. The page displays the account alias when the account information is displayed.")]),e._v(" "),n("p",[e._v("Step 1: Add a transaction type")]),e._v(" "),n("p",[e._v("Each transaction requires a separate set of its own transaction type. The transaction type cannot be duplicated with the transaction type of other modules. See the RPC documentation for the transaction types of other modules.")]),e._v(" "),n("p",[e._v("Step 2: Create a transaction logic object")]),e._v(" "),n("p",[e._v("The transaction logic object belongs to the business logic data stored in the transaction, such as the alias information stored in the alias transaction, and the object needs to inherit the TransactionLogicData class. As shown below:")]),e._v(" "),e._m(11),e._v(" "),n("p",[e._v("Since the logical data is eventually serialized as a byte array to be broadcast over the network, methods for serialization and deserialization are also needed. As shown below:")]),e._v(" "),e._m(12),e._v(" "),n("p",[e._v("Step 3: Create a transaction-related RPC interface. The interface should include creating transactions, verifying transactions, processing transactions, and rolling back transactions.")]),e._v(" "),n("p",[e._v("Users can successfully assemble transactions and broadcast to the entire network by creating a trading interface;")]),e._v(" "),n("p",[e._v("The verification transaction interface will be uniformly called by the transaction management module, and the transaction that fails verification will be discarded;")]),e._v(" "),n("p",[e._v("The verified transaction will be uniformly called by the consensus module to process the transaction interface and stored in the local database;")]),e._v(" "),n("p",[e._v("When there is a block rollback, the block management module uniformly calls the rollback transaction interface to clear the transaction related data stored locally;")]),e._v(" "),n("p",[e._v("For details on the implementation of the code, see: io.nuls.account.rpc.cmd.AliasCmd")]),e._v(" "),n("p",[e._v("Step 4: Start the module registration transaction")]),e._v(" "),n("p",[e._v("When the module is started, you need to register the new transaction of the module with the transaction management module in doStart(), and the corresponding validator and processor, as shown below:")]),e._v(" "),e._m(13),e._v(" "),e._m(14),e._v(" "),n("p",[e._v("Then, just like api-module, add code related to other business logic in your own module.")]),e._v(" "),n("p",[e._v("Finally, remember to add the module.ncf configuration file under the module's class, as shown below:")]),e._v(" "),e._m(15),e._v(" "),e._m(16)])},a,!1,null,null,null);o.options.__file="developModule.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/190.7453b0ea.js b/docs/.vuepress/dist/assets/js/190.7453b0ea.js new file mode 100644 index 00000000..70e5146d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/190.7453b0ea.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[190],{820:function(t,e,s){"use strict";s.r(e);var r=s(0),_=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),s("p",[t._v("社区基金账户地址:")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[t._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("根据社区章程指导思想,提案执行基金会账户操作。")]),t._v(" "),s("p",[t._v("该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。")]),t._v(" "),s("p",[t._v("注:理事会发起的该部分成员的申请提案投票期为15天。")]),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。")]),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。")]),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;")]),t._v(" "),s("p",[t._v("(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;")]),t._v(" "),s("p",[t._v("(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;")]),t._v(" "),s("p",[t._v("(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;")]),t._v(" "),s("p",[t._v("(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;")]),t._v(" "),s("p",[t._v("(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;")]),t._v(" "),s("p",[t._v("(2)理事会和申请人都需要引导社区正确地进行投票;")]),t._v(" "),s("p",[t._v("(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;")]),t._v(" "),s("p",[t._v("(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;")]),t._v(" "),s("p",[t._v("(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("所有的社区讨论建议在"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("进行。")]),t._v(" "),s("p",[t._v("本流程根据社区章程思想进行管理,流程将会对全体社区公开。")]),t._v(" "),s("p",[t._v("流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。")]),t._v(" "),s("p",[t._v("具体节点产生收益参考NULS POC共识机制。")]),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),t._v(" "),s("p",[t._v("CCC 成员:")]),t._v(" "),s("p",[t._v("Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),t._v(" "),s("p",[t._v("Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),t._v(" "),s("p",[t._v("Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),t._v(" "),s("p",[t._v("Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),t._v(" "),s("p",[t._v("Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),t._v(" "),s("p",[t._v("Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),t._v(" "),s("p",[t._v("Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),t._v(" "),s("p",[t._v("Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),t._v(" "),s("p",[t._v("Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),t._v(" "),s("p",[t._v("Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),t._v(" "),t._m(19)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375408-182645-20181221145608.png",alt:"img"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、社区基金管理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("一、社区基金管理")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、发起申请的成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、发起申请的成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("二、发起申请的成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、普通成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、普通成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、普通成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、贡献者角色"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、贡献者角色")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、申请类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、申请类型","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("三、申请类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、提案支付资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、提案支付资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、提案支付资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、预算项目提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、预算项目提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、预算项目提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、提案创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、提案创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、提案创建节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4、提案委托资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、提案委托资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("4、提案委托资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、申请流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、申请流程","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("四、申请流程")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、方案公开讨论"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、方案公开讨论","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、方案公开讨论")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、理事会成员提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、理事会成员提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、理事会成员提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、基金会执行提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、基金会执行提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、基金会执行提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、流程解释"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、流程解释","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("五、流程解释")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"附:当前贡献者角色的委托和节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附:当前贡献者角色的委托和节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("附:当前贡献者角色的委托和节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);_.options.__file="communityFund.md";e.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/191.6f8d2b48.js b/docs/.vuepress/dist/assets/js/191.6f8d2b48.js new file mode 100644 index 00000000..d9bbc1cc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/191.6f8d2b48.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[191],{818:function(t,e,i){"use strict";i.r(e);var l=i(0),a=Object(l.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),i("p",[t._v("虽然主网现在处于稳定运行的状态,但为了应对变化,主网开发仍然在进行中。我们需要社区的帮助来解决主网开发中面临的挑战,一起完善NULS这个区块链基础设施。我们呼吁社区的开发者能够加入我们,贡献自己的一份力量,同时你的付出也会得到应有的奖励。")]),t._v(" "),i("ul",[i("li",[t._v("如何加入技术社区:"),i("a",{attrs:{href:"https://nuls.io/developer",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/developer"),i("OutboundLink")],1)]),t._v(" "),i("li",[t._v("NULS Github:"),i("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io"),i("OutboundLink")],1)])]),t._v(" "),t._m(3),t._v(" "),i("p",[t._v("在软件开发过程中,尽管有严格的测试,但我们还是无法避免程序中出现bug,因此如果你在使用我们应用或者进行开发的过程中发现了bug,请及时反馈给我们,我们会积极进行处理。反馈bug的方式有三种:")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("通过在"),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区论坛"),i("OutboundLink")],1),t._v("回帖进行反馈")]),t._v(" "),t._m(4)]),t._v(" "),t._m(5),t._v(" "),t._m(6)]),t._v(" "),t._m(7),t._v(" "),i("p",[t._v("NULS制定了文档编写激励计划,邀请社区一起编写NULS相关文档,并会根据社区成员的付出给予相应的奖励。")]),t._v(" "),t._m(8),t._v(" "),i("p",[t._v("NULS作为一个全球性区块链开源社区项目,需要大量的中英双语文档,如果你是这方面的专业人士,那么我们十分需要你的帮助。")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"如何做贡献"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#如何做贡献","aria-hidden":"true"}},[this._v("#")]),this._v(" 如何做贡献")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("NULS的发展是与社区分不开的,需要社区成员一起参与进来。我们提供了不同的方式让社区成员参与,大家可以选择自己擅长的方式来为NULS做贡献。对每位贡献者,在征得其同意之后,会公示贡献者名字(若拥有节点,我们也会附上其节点名)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"加入主网开发"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#加入主网开发","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入主网开发")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"报告错误"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#报告错误","aria-hidden":"true"}},[this._v("#")]),this._v(" 报告错误")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("主网:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs")]),this._v(" "),e("li",[this._v("测试网:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("发送邮件到support@nuls.io")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("直接反馈给社区经理或运营人员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"编写文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#编写文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 编写文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"翻译文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#翻译文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 翻译文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"贡献者名单"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#贡献者名单","aria-hidden":"true"}},[this._v("#")]),this._v(" 贡献者名单")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("排名不分先后,仅按照字母排序")])])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("名字")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("邮箱")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("节点别名/ID")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Angang Tang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("tangangang@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Albert")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("albert@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Charlie Li")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lichao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Cody Lan")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lanjinsheng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Davi Yang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("davi@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yuanchen Jiang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("jiangyuanchen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yifeng Qin")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("qinyifeng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Niels")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pierre Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("luohao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pen Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("pen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Siwei")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("13809668344@139.com")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("siwei")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Vivi Zhou")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("zhouwei@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])])])])}],!1,null,null,null);a.options.__file="howToContribute.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/192.ffa7a0ae.js b/docs/.vuepress/dist/assets/js/192.ffa7a0ae.js new file mode 100644 index 00000000..fe1c4e43 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/192.ffa7a0ae.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[192],{816:function(t,e,r){"use strict";r.r(e);var s=r(0),a=Object(s.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程以及链之间的交互")]),t._v(" "),r("p",[t._v("NULS于创立之初,即已提出模块化思维与多链并行基本架构,NULS秉承以“链”为核心的发展理念,着力打造核心产品“链工厂”。同时,NULS将通过跨链模块实现链之间的价值流通,打造区块链大生态")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),r("p",[t._v("NULS白皮书是一个权威性的报告,它指出了NULS的目标是什么,以及我们打算如何实现它")]),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NULS_whitepaper_zh_V1.0.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("查看白皮书了解更多"),r("OutboundLink")],1)]),t._v(" "),t._m(5),t._v(" "),r("p",[t._v("NULS黄皮书是白皮书的技术详解版本,它深入研究了NULS的各个方面")]),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("查看黄皮书了解更多"),r("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls是什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls是什么","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS是什么")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"nuls是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1-nuls的愿景"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-nuls的愿景","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 NULS的愿景")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("为企业级应用提供灵活易用的区块链技术支持")]),this._v(" "),e("li",[this._v("突破区块链技术瓶颈,提供稳定、高效、高性能的网络运行环境")]),this._v(" "),e("li",[this._v("通过降低开发和使用成本,推动区块链商业应用进程")]),this._v(" "),e("li",[this._v("通过分布式网络布局,构建强大信用体系")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_2-白皮书"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-白皮书","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.白皮书")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_3-黄皮书"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-黄皮书","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.黄皮书")])}],!1,null,null,null);a.options.__file="introduction.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/193.6b5187de.js b/docs/.vuepress/dist/assets/js/193.6b5187de.js new file mode 100644 index 00000000..6913f6e2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/193.6b5187de.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[193],{814:function(t,e,r){"use strict";r.r(e);var n=r(0),a=Object(n.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("NULS 是一个区块链公链项目,其致力于打造由社区驱动的一个真正开源、自我革新的区块链平台。NULS期望通过构建灵活易用的区块链基础设施,最大限度降低企业/个人使用区块链底层技术的难度。\nNULS技术社区,是由来自NULS社区的一批对NULS充满激情与梦想的技术开发人员构建而成。技术社区将和NULS核心开发团队共同搭建NULS底层,通过实现模块化、多链并行、跨链等机制,让企业/个人都可以通过简单配置定制自己的区块链。")]),t._v(" "),r("p",[t._v("在社区里我们坚持以下的理念:")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),r("p",[t._v("NULS技术社区向所有开发者开放。\n如果你:\n对区块链世界充满期待,希望用代码创造出新的世界。")]),t._v(" "),r("p",[t._v("请加入我们的技术社区电报群:"),r("a",{attrs:{href:"https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ"),r("OutboundLink")],1),t._v("\n注意:我们不是寻求任务外包。任何你认为值得改进的地方,都是你可以发挥的空间。")]),t._v(" "),t._m(4),t._v(" "),r("p",[t._v("NULS团队会为技术社区的每一个为NULS项目作出贡献的开发者提供奖励,奖励的大小基于贡献的大小。\n目前,如果你能通过前期表现,加入技术社区核心开发团队(Code Craft Council),我们会为你创建一个节点,并委托20万NULS Token,节点奖励的50%部分将用于支持开发者(目前大约1500NULS/月),剩下50%会注入社区基金池。注:50%是初始值,后续调整由社区决定,我们会在社区进行公示。")]),t._v(" "),t._m(5),t._v(" "),r("p",[t._v("让造链变得容易!\n首先,我们希望建立一个涵盖80%区块链底层技术的模块仓库。\n通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更加融入到日常生活中。\n我们正和技术社区一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。\n其次,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),极大的缩短了目前公链开发少则半年多则1年的耗时。\n以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。\n现在NULS技术社区有中西方开发者200余人,我们欢迎更多的开发者加入。你们将协助核心团队进行NULS底层的开发工作。")]),t._v(" "),t._m(6),t._v(" "),r("p",[t._v("(1)我们一直认为NULS属于社区,NULS技术的长远发展离不开极具创造力的社区技术力量,在过去一年时间里我们很高兴能看到社区开发者自愿为NULS贡献自己的力量。其中来自英国的Josh为NULS开发了官网(nuls.io),来自法国的Moshe为NULS开发了区块链浏览器(nuls.world/)和轻钱包(nuls.world/wallet),来自玻利维亚的Berzeck正在参与NULS的底层开发工作。")]),t._v(" "),r("p",[t._v("(2)尽管如此,我们还有很多的工作尚待完成。我们会在本帖下方持续更新一个任务清单,该清单会包含NULS的设计、开发、改进等方面的工作。所有开发者都可以根据自己的能力和兴趣进行选择。")]),t._v(" "),t._m(7),t._v(" "),r("p",[t._v("(1)为方便沟通,请先加入技术社区的Telegram群(见上),并阅读群置顶消息;")]),t._v(" "),r("p",[t._v("(2)跟社区开发者Moshe进行初步沟通,简要介绍自己的经历、擅长的编程语言等,社区开发者会跟你交流一些技术相关信息,并了解你希望做些什么,这将决定你接下来的工作内容。\n同时我们强烈建议你通过下面的链接,去了解更多关于NULS的内容:")]),t._v(" "),r("ul",[r("li",[t._v("官网:"),r("a",{attrs:{href:"https://nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("代码:"),r("a",{attrs:{href:"https://github.com/nuls-io/nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/nuls"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("开发者文档:"),r("a",{attrs:{href:"https://dev.nuls.io/docs/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://dev.nuls.io/docs/"),r("OutboundLink")],1)]),t._v(" "),r("li",[t._v("社区论坛:"),r("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),r("OutboundLink")],1)])]),t._v(" "),r("p",[t._v("(3)你可以选择感兴趣并胜任的任务。届时,我们会让你加入各个开发小组,同其他开发人员一起工作。在这里,我们强烈建议你下载微信作为沟通交流工具:\n"),r("a",{attrs:{href:"https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh"),r("OutboundLink")],1)]),t._v(" "),r("p",[t._v("(4)在小组中,各小组leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),r("p",[t._v("技术社区和核心团队经过仔细审核后,如果申请被批准,我们将为你创建一个节点(这将是你获得奖励的基础)。")]),t._v(" "),t._m(8),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.community/d/90-nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("任务清单"),r("OutboundLink")],1),t._v("持续更新中")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"如何成为社区开发者"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#如何成为社区开发者","aria-hidden":"true"}},[this._v("#")]),this._v(" 如何成为社区开发者")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、nuls简介"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls简介","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、NULS简介")])},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("ul",[r("li",[t._v("平等 (Equal):技术社区与核心团队是平等关系,一起合作开发;")]),t._v(" "),r("li",[t._v("共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态;")]),t._v(" "),r("li",[t._v("共享 (Sharing):\n"),r("ul",[r("li",[t._v("社区共享NULS技术成果")]),t._v(" "),r("li",[t._v("社区共享NULS发展红利")]),t._v(" "),r("li",[t._v("社区共享NULS的影响力和名誉")]),t._v(" "),r("li",[t._v("行业共享NULS带来的技术革新")]),t._v(" "),r("li",[t._v("行业共享NULS推动行业发展的标准制定")])])]),t._v(" "),r("li",[t._v("公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正;")]),t._v(" "),r("li",[t._v("创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、你是我们在寻找的ta吗?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、你是我们在寻找的ta吗?","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、你是我们在寻找的TA吗?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、我们能提供什么?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、我们能提供什么?","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、我们能提供什么?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、我们的计划"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、我们的计划","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、我们的计划")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、技术社区的现状:"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、技术社区的现状:","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、技术社区的现状:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、如何加入开发团队"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、如何加入开发团队","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、如何加入开发团队")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、查看任务清单"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、查看任务清单","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、查看任务清单")])}],!1,null,null,null);a.options.__file="joinCCC.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/194.33c85b12.js b/docs/.vuepress/dist/assets/js/194.33c85b12.js new file mode 100644 index 00000000..8e91c8ba --- /dev/null +++ b/docs/.vuepress/dist/assets/js/194.33c85b12.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[194],{812:function(t,r,s){"use strict";s.r(r);var i=s(0),e=Object(i.a)({},function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("网页钱包地址:"),s("a",{attrs:{href:"https://wallet.nuls.io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://wallet.nuls.io"),s("OutboundLink")],1)]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),s("p",[t._v("具体步骤与备份账户相同")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"网页钱包使用指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#网页钱包使用指南","aria-hidden":"true"}},[this._v("#")]),this._v(" 网页钱包使用指南")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"访问钱包"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#访问钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 访问钱包")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"语言切换"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#语言切换","aria-hidden":"true"}},[this._v("#")]),this._v(" 语言切换")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击右上角,可以自由切换页面语言\n"),r("img",{attrs:{src:"https://i.imgur.com/FPnAva0.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击创建账户\n"),r("img",{attrs:{src:"https://i.imgur.com/c3K28m8.jpg",alt:""}}),this._v("\n2.设置钱包密码、仔细阅读并勾选同意服务协议、点击创建账户\n"),r("img",{attrs:{src:"https://i.imgur.com/s2iYP4P.jpg",alt:""}}),this._v(" "),r("strong",[this._v("注:创建好账户后,应立即进行备份,并将备份资料存放在安全的地方,否则有资产丢失的风险!")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"备份账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 备份账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击Keystore备份"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/RWJIsW8.jpg",alt:""}}),r("br"),this._v("\n2.当您得到一个Keystore文件后,请点击备份完成\n"),r("img",{attrs:{src:"https://i.imgur.com/vuv56b1.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#导入账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 导入账户")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击导入账户"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/wAgIdr8.jpg",alt:""}}),r("br"),this._v("\n2.点击导入Keystore"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/AUpa10l.jpg",alt:""}}),r("br"),this._v("\n3.选择你的Keystore文件后,点击打开"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/E2qvUSq.jpg",alt:""}}),r("br"),this._v("\n4.输入账户密码,点击确认\n"),r("img",{attrs:{src:"https://i.imgur.com/wM1KNqI.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"设置"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击菜单栏的设置,您可以根据需求,对当前账户进行备份、修改密码、设置别名"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/LiBaeqx.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"账户备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户备份","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户备份")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#修改密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 修改密码")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("输入原密码及新密码,点击确认\n"),r("img",{attrs:{src:"https://i.imgur.com/RaYCuBn.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"设置别名"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置别名","aria-hidden":"true"}},[this._v("#")]),this._v(" 设置别名")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("输入别名,并确保有足够的余额,点击确定\n"),r("img",{attrs:{src:"https://i.imgur.com/9HW0ZCE.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"交易"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击转账"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/a01jlHa.jpg",alt:""}}),r("br"),this._v("\n2.输入收款地址、转账金额,手续费根据全网交易情况增减,一般默认即可"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/V9kwcHp.jpg",alt:""}}),r("br"),this._v("\n3.输入账户密码,点击确认"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/zz4sO0r.jpg",alt:""}}),r("br"),this._v("\n4.查看交易记录,状态为“已确认”则表示交易成功\n"),r("img",{attrs:{src:"https://i.imgur.com/TtZHe22.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("点击菜单栏的“共识”可以查看共识信息,参与共识、追加共识、退出共识等操作\n"),r("img",{attrs:{src:"https://i.imgur.com/Xg1VR2v.jpg",alt:""}})])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"参与共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参与共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 参与共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击“加入委托”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/vXBiL9X.jpg",alt:""}}),r("br"),this._v("\n2.选择节点,也可以通过搜索节点名称,找到节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/zz28Xe6.jpg",alt:""}}),r("br"),this._v("\n3.输入委托金额,点击“确定委托”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/u2u9cNR.jpg",alt:""}}),r("br"),this._v("\n4.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"追加共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#追加共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 追加共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击我参与的共识节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/VYBcQhR.jpg",alt:""}}),r("br"),this._v("\n2.点击“追加”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/MaQ7rsg.jpg",alt:""}}),r("br"),this._v("\n3.输入委托金额,点击“确定委托”"),r("br"),this._v("\n4.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"退出共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#退出共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 退出共识")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击我参与的共识节点"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/VYBcQhR.jpg",alt:""}}),r("br"),this._v("\n2.点击“退出”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/TyKOfub.jpg",alt:""}}),this._v("\n3.输入账户密码,点击确认")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#投票","aria-hidden":"true"}},[this._v("#")]),this._v(" 投票")])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[this._v("1.点击“投票”进入投票页面"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/2m9ZTHT.jpg",alt:""}}),this._v("\n2.点击标题"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/fWEVFrV.jpg",alt:""}}),this._v("\n3.根据投票规则,选择您支持的事项,点击“投票”"),r("br"),this._v(" "),r("img",{attrs:{src:"https://i.imgur.com/v9wFGqz.jpg",alt:""}}),this._v("\n4.输入账户密码,点击确认")])}],!1,null,null,null);e.options.__file="lightWalletGuide.md";r.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/195.6ce6baa9.js b/docs/.vuepress/dist/assets/js/195.6ce6baa9.js new file mode 100644 index 00000000..53e4a13c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/195.6ce6baa9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[195],{810:function(t,r,i){"use strict";i.r(r);var e=i(0),a=Object(e.a)({},function(){var t=this,r=t.$createElement,i=t._self._c||r;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("ul",[i("li",[i("p",[i("router-link",{attrs:{to:"/zh/overview/introduction.html"}},[t._v("总览")])],1),t._v(" "),i("p",[t._v("通过该部分文档可帮助对NULS不熟悉的读者了解NULS是什么,可以做什么")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/guide/NULSTransaction.html"}},[t._v("用户操作指南")])],1),t._v(" "),i("p",[t._v("如果你是一个新用户,那这里有你需要的东西,进来看看吧")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/community/toolsGuide.html"}},[t._v("社区")])],1),t._v(" "),i("p",[t._v("区块链项目总是以社区为基础的,从这里你可以了解到关于NULS社区各个方面的知识")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/startNULS/sourceCodeStartNULS.html"}},[t._v("启动NULS")])],1),t._v(" "),i("p",[t._v("想开始使用NULS吗,那就从这里开始吧,该部分文档介绍了如何通过源码启动NULS,如何连接主网和测试网,如何使用节点GUI和节点CLI")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/buildChain/buildPrivateChain.html"}},[t._v("快速搭链")])],1),t._v(" "),i("p",[t._v("如何你想搭建一条私链,那这部分文档应该可以帮助到你")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/NULSInfrastructure/NULS2.0Introduction.html"}},[t._v("NULS2.0")])],1),t._v(" "),i("p",[t._v("模块化设计是什么?NULS2.0是什么?该部分会一一帮你解答这些问题,会详细阐述NULS的设计理念,各个模块的设计细节")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/smartContract/startSmartContract.html"}},[t._v("智能合约")])],1),t._v(" "),i("p",[t._v("想要基于智能合约做DAPP或者其他很酷的事情吗,该部分文档会是你想要的,文档中包含开发者文档,NRC标准,插件,还有一些有趣的合约示例")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/developerTools/sdk.html"}},[t._v("开发者工具")])],1),t._v(" "),i("p",[t._v("NULS一直秉承对开发者友好的理念,因此我们也在不断提供一些工具给到开发者。开发者们都到这里面看看有些什么吧")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/nips/NIPIntroduction.html"}},[t._v("NIPs")])],1),t._v(" "),i("p",[t._v("所有与NULS 相关的提案都在这里,通过该部分你可以详细了解NULS的协议,章程,标准等等。")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/nulsNav/NULSNav.html"}},[t._v("NULS导航")])],1),t._v(" "),i("p",[t._v("NULS文档库只是NULS的一部分,想要获取更多NULS相关的信息和产品,就到这里面找找入口吧")])])])])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"本文档的结构"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#本文档的结构","aria-hidden":"true"}},[this._v("#")]),this._v(" 本文档的结构")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h4",{attrs:{id:"本文档分为八个部分"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#本文档分为八个部分","aria-hidden":"true"}},[this._v("#")]),this._v(" 本文档分为八个部分")])}],!1,null,null,null);a.options.__file="structure.md";r.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/196.b7f7795d.js b/docs/.vuepress/dist/assets/js/196.b7f7795d.js new file mode 100644 index 00000000..54cc1711 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/196.b7f7795d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[196],{806:function(t,e,s){"use strict";s.r(e);var i=s(0),_=Object(i.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),s("p",[t._v("NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("NIP当前有六种类型:")]),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("在开始撰写NIP之前,先审查你的想法,这将帮你节省时间。首先询问社区这个想法之前是否被提出过,可行性如何。以免浪费时间在一些肯定会被拒绝的提案上,并有助于确保该想法适用于整个社区而不仅仅是作者。 某个想法对作者有意义并不意味着它对各个地区使用NULS的人都有意义。我们建议可以通过发起投票的方式在社区收集意见,投票的结果也有助于NIP编辑更快做出判断是否合并该NIP。")]),t._v(" "),s("p",[t._v("完成一个最终生效的NIP需要经过以下阶段:")]),t._v(" "),t._m(10),s("p",[t._v("每次NIP状态的更改都是先由NIP的作者提出Pull Request(合并请求,简称PR),然后NIP的编辑会对该NIP进行审查。提出PR的时候最好包含一个可以持续讨论该NIP的链接。")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("其他非常规的状态如下:")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("每个NIP应该包含以下部分:")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("NIP应该用markdown的格式编写")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("每个NIP的必须以RFC 822的样式作为文档的头部前言,头部必须按照以下顺序进行排列,用*标注的头部为可选项,其他项为必填项")]),t._v(" "),t._m(18),t._m(19),t._v(" "),s("p",[t._v("NIPS文档可能包含一些附件,例如流程图。这样的文件必须以NIP-XXXX-Y.ext的格式来命名,“XXXX”指的是NIP的编号,“Y”指的是序列号(从1开始),“ext”指的是文件扩展名(例如:.png)")]),t._v(" "),t._m(20),t._v(" "),s("p",[t._v("有时需要将NIPS的所有权转让给新的作者。一般来说,我们希望保留原作者作为要转移的NIP的合著者,但这实际上取决于原作者。转让所有权的一个很好的理由是,原作者不再有时间或兴趣来更新它或跟进NIP的后续过程,或已经脱离了“网络”(即无法联系或没有回复电子邮件)。转让所有权的一个不好的原因是你不同意NIP的方向。我们努力围绕一个NIP去建立共识,如果你认为不可能达成,你可以提交一个更有说服力的NIP。")]),t._v(" "),s("p",[t._v("如果您对NIP的所有权感兴趣,请发送一封邮件要求接管,该邮件的收件人是原作者和NIP编辑。如果原作者没有及时回复邮件,NIP的编辑就会做出单方面的决定(这样的决定并不是不能逆转的)。")]),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("当前的NIP编辑如下:")]),t._v(" "),t._m(22),t._m(23),t._v(" "),s("p",[t._v("每次收到一个新的NIP, 一个编辑要做如下的事:")]),t._v(" "),t._m(24),t._v(" "),s("p",[t._v("如果NIP不够完备,编辑会把它发回给作者进行修改,并给出具体的说明。一旦NIP做好了合并到仓库的准备,NIP编辑就会这样做:")]),t._v(" "),t._m(25),t._v(" "),s("p",[t._v("许多NIP是由对NULS代码库具有写入权限的开发人员编写和维护的。NIP编辑要关注NIP的变化,并纠正我们看到的任何结构、语法、拼写或标记错误。NIP编辑不会主观地对NIP做出判断,只做管理和编辑这部分工作。")]),t._v(" "),t._m(26),t._v(" "),s("p",[t._v("这个文档主要引用了 "),s("a",{attrs:{href:"https://github.com/bitcoin/bips",target:"_blank",rel:"noopener noreferrer"}},[t._v("Bitcoin's BIP-0001"),s("OutboundLink")],1),t._v(",由 Amir Taaki 所写,同时他所写的文本也主要来源于 "),s("a",{attrs:{href:"https://www.python.org/dev/peps/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Python's PEP-0001"),s("OutboundLink")],1),t._v("。NIP根据自身的实际情况,基于他们的文档做了一些修改,例如NIP流程中增加了理事会,修改了NIP类型等。后续与NIP相关的问题请直接联系NULS NIP的编辑。")]),t._v(" "),s("link",{attrs:{rel:"stylesheet",href:"https://use.fontawesome.com/releases/v5.0.13/css/all.css"}})])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-1-nip的目的和指导"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-1-nip的目的和指导","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-1 NIP的目的和指导")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("NIP:1\n标题: NIP的目的和指导\n状态: 公示\n类型: 流程\n作者: 杨霖 \n创建日期:2018/12/27\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip产生的理由"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip产生的理由","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP产生的理由")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录")])]),this._v(" "),e("li",[e("p",[this._v("对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的类型","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的类型")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[t._v("核心:NULS核心代码的改善,例如共识机制,网络协议等。")]),t._v(" "),s("li",[t._v("模块:模块的提交和评审要求的改善,例如符合何种标准的模块会被接受并被纳入模块仓库。")]),t._v(" "),s("li",[t._v("接口:NULS客户端API/RPC的规范和标准的改善,例如API名称、方法名称。")]),t._v(" "),s("li",[t._v("NRC标准:应用级别的标准的改善,例如合约标准,通证标准等。")]),t._v(" "),s("li",[t._v("信息:描述NULS设计问题,或向NULS社区提供一般性指导或信息,但不提出新功能。 信息NIP不一定代表NULS社区的共识或推荐,因此用户和实施者可以自由选择忽略信息NIP或遵循他们的建议")]),t._v(" "),s("li",[t._v("流程:所有NULS相关的操作流程的改善,例如社区中竞选大使的流程的改善。流程类NIP不仅仅是建议,是社区成员完成某些特定的事需要遵守的规范,但该类NIP不涉及代码层面的规范。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的工作流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的工作流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的工作流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("涉及流程的各方包括以下部分或全部角色:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("社区的大部分成员")]),t._v(" "),s("p",[t._v("主要职责为参与NIP的讨论和投票,提出建设性意见。")])]),t._v(" "),s("li",[s("p",[t._v("NIP作者")]),t._v(" "),s("p",[t._v("提出和完善NIP,并负责引导社区展开讨论。")])]),t._v(" "),s("li",[s("p",[t._v("NIP编辑")]),t._v(" "),s("p",[t._v("管理和编辑NIP。")])]),t._v(" "),s("li",[s("p",[t._v("NULS理事会")]),t._v(" "),s("p",[t._v("对即将进入接受或完结状态的NIP做最后把关,理事会有权通过内部投票拒绝NIP。")])]),t._v(" "),s("li",[s("p",[t._v("NULS核心开发者")]),t._v(" "),s("p",[t._v("负责核心,模块,NRC标准和接口这四个类型的NIP的审核和代码实现。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("[ 草稿 ]->[ 公示 ]->[ 接受 ]->[ 完结 ]\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("完整的NIP处理流程如下:")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("NIP的作者按照规定的格式和样式编写NIP,然后在社区中进行讨论和调研,确定可行性后,则将NIP通过提PR的方式提交到NIP仓库,并在PR中包含社区讨论的链接。NIP编辑会根据实际情况来处理这些请求。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("草稿:")]),t._v(" 如果同意合并,NIP编辑将为该NIP分配一个编号并合并PR。 NIP编辑不会无理由拒绝某个NIP")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("草稿:")]),t._v(" 拒绝合并为草稿的原因包括专注度不够、过于宽泛、重复劳动、技术上不健全、没有提供合理的动机或解决向后兼容性,或者不符合NULS理念。")])])]),t._v(" "),s("li",[s("p",[t._v("合并成为草稿状态后,作者可以继续提PR对草稿做进一步更改,直至认为该NIP已经足够成熟并准备好进入下一个状态为止。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 如果获得同意,NIP编辑将会把该NIP的状态从草稿更改为公示,并设置公示结束日期,通常为15天后。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 如果进入公示阶段后,还要对该NIP进行更改,那这个NIP会被退回草稿状态。我们希望一个NIP只进入一次公示状态,避免在社区引起不必要的争论。")])])]),t._v(" "),s("li",[s("p",[t._v("公示状态的NIP会置顶在https://nuls.community/")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("接受(核心,模块,NRC标准和接口的NIP才涉及):")]),t._v(" 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为接受。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("完结(信息和流程才涉及):")]),t._v(" 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为完结。")]),t._v(" "),s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Tomato"}},[s("i",{staticClass:"fas fa-times-circle"})]),t._v(" "),s("strong",[t._v("公示:")]),t._v(" 公示期有材料变更或无法解决社区提出的技术问题,则该NIP将会被退回草稿状态。除此之外,如果理事会对该NIP有不同的看法,可以在理事会成员内部发起投票,超过70%的理事会成员否决该NIP(需给出原因)则该NIP将根据实际原因被退回草稿状态或直接改为拒绝状态。")])])]),t._v(" "),s("li",[s("p",[t._v("当核心、模块、NRC标准和接口的NIP成为接受状态后,何时能成为完结状态取决于相关的NULS核心开发者,由他们决定如何将该NIP通过编码来实现。")]),t._v(" "),s("ul",[s("li",[s("span",{staticStyle:{"font-size":"18px",color:"Dodgerblue"}},[s("i",{staticClass:"fas fa-check-circle"})]),t._v(" "),s("strong",[t._v("完结(核心,模块,NRC标准和接口的NIP涉及):")]),t._v(" NIP已通过编码实现,并在主网稳定运行一段时间或得到了有效验证且改动也得到了社区的认可,则状态可变为完结。")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("strong",[t._v("延期:")]),t._v(" 核心、模块、NRC标准和接口相关的NIP成为接受状态后,开发者未按照预定的时间完成开发。")]),t._v(" "),s("li",[s("strong",[t._v("拒绝:")]),t._v(" 某个NIP被核心开发者拒绝实现或被理事会认定为不可实现。")]),t._v(" "),s("li",[s("strong",[t._v("被取代:")]),t._v(" NIP以前是完结状态,但不再被认为是最先进的。出现另一个更好的NIP,参考了这个NIP并成为了最终状态。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一个有效的nip文档应该包含哪些内容?"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一个有效的nip文档应该包含哪些内容?","aria-hidden":"true"}},[this._v("#")]),this._v(" 一个有效的NIP文档应该包含哪些内容?")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("strong",[t._v("前言:")]),t._v(" 与NIP相关的元数据,以RFC 822样式展示。内容包括NIP编号,简短描述性标题(限制为最多44个字符)和作者详细信息。可"),s("a",{attrs:{href:"#NIP%E7%9A%84%E5%89%8D%E8%A8%80"}},[t._v("参阅下文")]),t._v("了解详情。")]),t._v(" "),s("li",[s("strong",[t._v("简单总结:")]),t._v(" NIP作者需要给这个NIP提供一个简单且普通人可以理解的总结,如果你不能很简单地解释它,说明你自己对它的理解还不够深入。")]),t._v(" "),s("li",[s("strong",[t._v("摘要 :")]),t._v(" 对正在解决的技术问题进行简短(约200字)描述。")]),t._v(" "),s("li",[s("strong",[t._v("动机:")]),t._v(" 对于想要改善NULS协议的NIP,动机至关重要。 它应该清楚地解释为什么现有的协议规范存在不足。没有足够动机的NIP可能会被彻底拒绝。")]),t._v(" "),s("li",[s("strong",[t._v("规范:")]),t._v(" 技术规范应描述清楚任何新功能的语法和语义。规范应该足够详细,以允许当前任何基于NULS平台的应用拥有竞争性、可互操作性(例如NULS客户端,浏览器)。")]),t._v(" "),s("li",[s("strong",[t._v("论据 :")]),t._v(" 论据通过描述什么驱动了这样的设计以及为什么要做出这样的设计决策来充实规范。它应该阐述考虑过的替代性设计和相关工作,例如如何在其他语言中支持该特性。论据也可以提供证据证明社区的意见是一致的,并应讨论提出的重要反对意见或大家关注的事项。")]),t._v(" "),s("li",[s("strong",[t._v("向后兼容性:")]),t._v(" 所有引入向后不兼容的NIP必须描述存在哪些不兼容及其严重性。NIP中必须解释作者如何处理这些不兼容性。如果没有足够的向后兼容性论述,提交的NIP可能会被直接拒绝。")]),t._v(" "),s("li",[s("strong",[t._v("测试用例:")]),t._v(" 对于影响共识机制的NIP,其实现方法的测试用例是强制性的。")]),t._v(" "),s("li",[s("strong",[t._v("实现 :")]),t._v(" 代码的实现必须在任何NIP被赋予完结状态之前完成,但是它不需要在NIP被合并为草稿之前完成。")]),t._v(" "),s("li",[s("strong",[t._v("历史记录:")]),t._v(" 历史记录是展示了该NIP从提出到成为完结状态的整个过程,可以通过附加链接形式展示。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的格式和模版"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的格式和模版","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的格式和模版")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip的前言"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip的前言","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP的前言")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" NIP: \n 标题: \n 作者: <列出作者的真实名字和电子邮件地址>\n*讨论渠道: <指向官方讨论渠道的链接>\n 状态: <草稿| 接受 | 完结 | 被取代 | 延期 | 拒绝>\n 类型: <核心 | 模块 | 接口 | NRC标准 | 信息 | 流程>\n 创建日期: < 用 ISO 8601 (yyyy-mm-dd) 格式>\n*取代: \n*被取代: \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"附件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附件","aria-hidden":"true"}},[this._v("#")]),this._v(" 附件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"转移nip的所有权"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#转移nip的所有权","aria-hidden":"true"}},[this._v("#")]),this._v(" 转移NIP的所有权")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip编辑"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip编辑","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP编辑")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Niels \nPen \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip编辑的职责"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip编辑的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP编辑的职责")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("阅读NIP来检查它是否较为完备,NIP中的想法必须具有技术意义,即使它们看起来不太可能达到最终状态。")]),this._v(" "),e("li",[this._v("标题和内容要相符。")]),this._v(" "),e("li",[this._v("检查NIP的语言(拼写、语法、句子结构等)、标记(Github风格的标记)、代码风格 。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("分配一个NIP编号(通常是PR编号)")])]),this._v(" "),e("li",[e("p",[this._v("合并相应的PR")])]),this._v(" "),e("li",[e("p",[this._v("将消息发送回NIP作者")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"history"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#history","aria-hidden":"true"}},[this._v("#")]),this._v(" History")])}],!1,null,null,null);_.options.__file="NIP-1.md";e.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/197.56c70085.js b/docs/.vuepress/dist/assets/js/197.56c70085.js new file mode 100644 index 00000000..08b312ee --- /dev/null +++ b/docs/.vuepress/dist/assets/js/197.56c70085.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[197],{804:function(t,s,e){"use strict";e.r(s);var r=e(0),i=Object(r.a)({},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),e("p",[t._v("根据NULS项目的发展需要,为了更好地促进NULS社区良性运转,达成NULS让区块链技术更简单的愿景。NULS社区将不断探索和实施NULS社区自治,实现NULS项目自治和自进化。基于NULS社区文化和社区理念,特此制定社区发展章程。")]),t._v(" "),e("p",[t._v("NULS社区文化:开放、自由、自治、进化")]),t._v(" "),e("p",[t._v("NULS社区理念:分享、传承、成长、创新")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("NULS基金会")]),t._v(" "),e("p",[t._v("2018年12月")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(5),t._v(" "),e("p",[t._v("为了构建一个良好的社区运行机制,促进社区自治,推动NULS项目能够让社区自主进化和自主驱动。")]),t._v(" "),t._m(6),t._v(" "),e("p",[t._v("以下内容属于NULS社区章程的规范。")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),e("p",[t._v("NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。")]),t._v(" "),e("p",[t._v("**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。")]),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:")]),t._v(" "),e("p",[t._v("1、代码贡献")]),t._v(" "),e("p",[t._v("2、应用开发")]),t._v(" "),e("p",[t._v("3、运营推广")]),t._v(" "),e("p",[t._v("4、其他有利于NULS社区生态发展的具体事项")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。")]),t._v(" "),t._m(12),t._v(" "),e("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),e("p",[t._v("NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),e("p",[t._v("1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。")]),t._v(" "),e("p",[t._v("2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。")]),t._v(" "),e("p",[t._v("3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。")]),t._v(" "),e("p",[t._v("4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。")]),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。")]),t._v(" "),e("p",[t._v("(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(18),t._v(" "),e("p",[t._v("(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。")]),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。")]),t._v(" "),e("p",[t._v("3、理事会成员的责任。")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),e("p",[t._v("CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。")]),t._v(" "),t._m(25),t._v(" "),e("p",[t._v("在技术社区里我们坚持以下的理念:")]),t._v(" "),e("p",[t._v("1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。")]),t._v(" "),e("p",[t._v("2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。")]),t._v(" "),e("p",[t._v("3、共享 (Sharing):")]),t._v(" "),t._m(26),t._v(" "),e("p",[t._v("4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。")]),t._v(" "),e("p",[t._v("5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。")]),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。")]),t._v(" "),e("p",[t._v("加入流程如下:")]),t._v(" "),e("p",[t._v("1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。")]),t._v(" "),e("p",[t._v("2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。")]),t._v(" "),e("p",[t._v("3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。")]),t._v(" "),e("p",[t._v("4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。")]),t._v(" "),e("p",[t._v("2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。")]),t._v(" "),e("p",[t._v("3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。")]),t._v(" "),e("p",[t._v("4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。")]),t._v(" "),e("p",[t._v("5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),e("p",[t._v("固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。")]),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),e("p",[t._v("对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。")]),t._v(" "),t._m(35),t._v(" "),e("p",[t._v("理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。")]),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),e("p",[t._v("1、理事会成员发起投票。只收取交易手续费。")]),t._v(" "),e("p",[t._v("2、普通成员投票。押金(目前设定是100NULS)+交易手续费。")]),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),e("p",[t._v("如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。")]),t._v(" "),e("p",[t._v("NULS社区网站:"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community"),e("OutboundLink")],1)]),t._v(" "),e("p",[t._v("建议反馈帖:"),e("a",{attrs:{href:"https://nuls.community/d/132-we-need-your-suggestions",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.community/d/132-we-need-your-suggestions"),e("OutboundLink")],1)])])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nip-2-nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nip-2-nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-2 NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v(" NIP: 2\n 标题: NULS社区章程\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207\n 状态: 公示\n 类型: 流程\n 创建日期: 2018/12/28\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"前言"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("前言")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("以下规则将会基于NULS开发共识治理模块,在共识治理模块上线前,理事会和大使将由NULS核心团队发起投票来执行。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"摘要"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"动机"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"规范"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls社区章程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区章程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区章程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"一、nuls社区简介"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls社区简介","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("一、NULS社区简介")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"二、nuls基金会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls基金会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("二、NULS基金会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)nuls基金会宗旨"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)nuls基金会宗旨","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)NULS基金会宗旨")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)nuls社区基金的来源"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)nuls社区基金的来源","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)NULS社区基金的来源")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)nuls社区基金管理"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)nuls社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)NULS社区基金管理")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"三、理事会"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#三、理事会","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("三、理事会")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)理事会介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)理事会介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)理事会介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)理事会成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)理事会成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)理事会成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员)"),s("strong",[this._v(",由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出")]),this._v("(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)-理事会成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)-理事会成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三) 理事会成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。")])]),this._v(" "),s("li",[s("p",[this._v("固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。")])])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("节点下限代理手续费佣金调整。")])]),t._v(" "),e("li",[e("p",[t._v("转账手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("合约调用手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("理事会发起提案的手续费调整。")])]),t._v(" "),e("li",[e("p",[t._v("其他系统可调整的系统参数调整。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。")])]),this._v(" "),s("li",[s("p",[this._v("创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。")])]),this._v(" "),s("li",[s("p",[this._v("调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("理事会成员需要能够及时与社区进行沟通。")])]),this._v(" "),s("li",[s("p",[this._v("严格遵照社区章程。")])]),this._v(" "),s("li",[s("p",[this._v("与NULS的愿景和目标一致。")])]),this._v(" "),s("li",[s("p",[this._v("以全体社区成员利益为己任。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"四、code-craft-council-ccc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#四、code-craft-council-ccc","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("四、CODE CRAFT COUNCIL(CCC)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)ccc介绍"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)ccc介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)CCC介绍")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)ccc理念"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)ccc理念","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)CCC理念")])])},function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ul",[e("li",[e("p",[t._v("社区共享NULS技术成果。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS发展红利。")])]),t._v(" "),e("li",[e("p",[t._v("社区共享NULS的影响力和名誉。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS带来的技术革新。")])]),t._v(" "),e("li",[e("p",[t._v("行业共享NULS推动行业发展的标准制定。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(三)ccc成员产生"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(三)ccc成员产生","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(三)CCC成员产生")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(四)ccc成员权责"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(四)ccc成员权责","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(四)CCC成员权责")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"五、贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#五、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("五、贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)竞选贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)竞选贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (一)竞选贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示"),s("strong",[this._v("nuls.community")]),this._v("。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)固定贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)固定贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" (二)固定贡献者角色")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"六、项目预算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#六、项目预算","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("六、项目预算")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)对于贡献者角色"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)对于贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)对于贡献者角色")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)对于其他事务资金"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)对于其他事务资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)对于其他事务资金")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"七、其他投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#七、其他投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("七、其他投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(一)发起投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(一)发起投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(一)发起投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"(二)代理投票"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#(二)代理投票","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("(二)代理投票")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。")])]),this._v(" "),s("li",[s("p",[this._v("任何的NULS用户都可以成为代理人。")])]),this._v(" "),s("li",[s("p",[this._v("代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。")])]),this._v(" "),s("li",[s("p",[this._v("代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"八、建议反馈"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#八、建议反馈","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("strong",[this._v("八、建议反馈")])])}],!1,null,null,null);i.options.__file="NIP-2.md";s.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/198.2b4a23bb.js b/docs/.vuepress/dist/assets/js/198.2b4a23bb.js new file mode 100644 index 00000000..2d4ffc4e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/198.2b4a23bb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[198],{802:function(t,e,s){"use strict";s.r(e);var r=s(0),a=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("为了让社区能够有更多的人才加入,所以将社区基金开放给社区来共同管理和使用。")]),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("以下内容属于NULS社区基金管理和使用流程的规范。")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。")]),t._v(" "),s("p",[t._v("社区基金账户地址:")]),t._v(" "),s("p",[s("a",{attrs:{href:"https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u",target:"_blank",rel:"noopener noreferrer"}},[t._v("Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("根据社区章程指导思想,提案执行基金会账户操作。")]),t._v(" "),s("p",[t._v("该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。")]),t._v(" "),s("p",[t._v("注:理事会发起的该部分成员的申请提案投票期为15天。")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("p",[t._v("申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。")]),t._v(" "),t._m(15),t._v(" "),s("p",[t._v("申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。")]),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。")]),t._v(" "),t._m(17),t._v(" "),s("p",[t._v("申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),s("p",[t._v("(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;")]),t._v(" "),s("p",[t._v("(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;")]),t._v(" "),s("p",[t._v("(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;")]),t._v(" "),s("p",[t._v("(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;")]),t._v(" "),s("p",[t._v("(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;")]),t._v(" "),s("p",[t._v("(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;")]),t._v(" "),s("p",[t._v("(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;")]),t._v(" "),t._m(20),t._v(" "),s("p",[t._v("(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;")]),t._v(" "),s("p",[t._v("(2)理事会和申请人都需要引导社区正确地进行投票;")]),t._v(" "),s("p",[t._v("(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;")]),t._v(" "),s("p",[t._v("(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。")]),t._v(" "),t._m(21),t._v(" "),s("p",[t._v("(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;")]),t._v(" "),s("p",[t._v("(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。")]),t._v(" "),t._m(22),t._v(" "),s("p",[t._v("所有的社区讨论建议在"),s("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),s("OutboundLink")],1),t._v("进行。")]),t._v(" "),s("p",[t._v("本流程根据社区章程思想进行管理,流程将会对全体社区公开。")]),t._v(" "),s("p",[t._v("流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。")]),t._v(" "),s("p",[t._v("具体节点产生收益参考NULS POC共识机制。")]),t._v(" "),t._m(23),t._v(" "),s("p",[t._v("大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR")]),t._v(" "),s("p",[t._v("CCC 成员:")]),t._v(" "),s("p",[t._v("Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q")]),t._v(" "),s("p",[t._v("Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx")]),t._v(" "),s("p",[t._v("Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4")]),t._v(" "),s("p",[t._v("Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH")]),t._v(" "),s("p",[t._v("Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg")]),t._v(" "),s("p",[t._v("Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa")]),t._v(" "),s("p",[t._v("Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G")]),t._v(" "),s("p",[t._v("Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs")]),t._v(" "),s("p",[t._v("Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR")]),t._v(" "),s("p",[t._v("Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW")]),t._v(" "),s("p",[t._v("Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4")]),t._v(" "),s("p",[t._v("Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN")]),t._v(" "),t._m(24)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip-3-nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip-3-nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-3 NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" NIP: 3\n 标题: NULS社区基金管理和使用流程\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/263-ngc20181221\n 状态: 公示\n 类型: 流程\n 创建日期: 2018/12/28\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"摘要"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"动机"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"规范"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls社区基金管理和使用流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls社区基金管理和使用流程","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS社区基金管理和使用流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"https://nuls.community/assets/files/2018-12-21/1545375408-182645-20181221145608.png",alt:"img"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、社区基金管理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、社区基金管理","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("一、社区基金管理")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、发起申请的成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、发起申请的成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("二、发起申请的成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、普通成员"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、普通成员","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、普通成员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、贡献者角色"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、贡献者角色","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、贡献者角色")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、申请类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、申请类型","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("三、申请类型")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、提案支付资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、提案支付资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、提案支付资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、预算项目提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、预算项目提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、预算项目提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、提案创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、提案创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、提案创建节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4、提案委托资金"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、提案委托资金","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("4、提案委托资金")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、申请流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、申请流程","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("四、申请流程")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、方案公开讨论"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、方案公开讨论","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("1、方案公开讨论")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、理事会成员提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、理事会成员提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("2、理事会成员提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、基金会执行提案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、基金会执行提案","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("3、基金会执行提案")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、流程解释"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、流程解释","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("五、流程解释")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"附:当前贡献者角色的委托和节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#附:当前贡献者角色的委托和节点","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("strong",[this._v("附:当前贡献者角色的委托和节点")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])}],!1,null,null,null);a.options.__file="NIP-3.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/199.07618bd4.js b/docs/.vuepress/dist/assets/js/199.07618bd4.js new file mode 100644 index 00000000..ceb66e06 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/199.07618bd4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[199],{800:function(t,r,e){"use strict";e.r(r);var s=e(0),_=Object(s.a)({},function(){var t=this,r=t.$createElement,e=t._self._c||r;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._m(2),t._v(" "),e("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("从9月-10月期间,我们已经有9位大使,大家都在积极的为NULS社区贡献,发展更多的成员,以及做一些力所能及的事情。NULS在主网智能合约上线后,将会开启一个社区投票工具。大使的竞选本身应该由社区来选择,另一方面由于在大使开展工作的过程中,社区的其他伙伴也提供了很多的建议,在广大社区成员的建议下,我们准备更新NULS大使的竞选规则。这将是NULS开启社区自治道路的第一步,NULS社区自治是未来的重要目标,这需要非常多的基础工具和人才支持。")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("以下内容属于NULS大使竞选参与规则的规范。")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),e("p",[t._v("NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。")]),t._v(" "),t._m(7),t._v(" "),e("p",[t._v("1、参与NULS大使的选举需要具有创建NULS节点的基本条件。")]),t._v(" "),e("p",[t._v("2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员,参选之前请确保能够坚持在任一个季度。")]),t._v(" "),e("p",[t._v("3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。")]),t._v(" "),e("p",[t._v("4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。")]),t._v(" "),e("p",[t._v("5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。")]),t._v(" "),e("p",[t._v("6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。")]),t._v(" "),e("p",[t._v("7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。")]),t._v(" "),e("p",[t._v("8、大使获得的节点的所有奖励一半作为大使的报酬(由于大使的节点服务器需要支出和自己抵押的20000NULS也会产生收益),另外一半必须作为大使发展基金,用于社区发展。")]),t._v(" "),e("p",[t._v("9、大使的离职,如果大使主动离职或者被罢免,请将剩余的大使发展基金返回到社区基金。")]),t._v(" "),e("p",[t._v("10、大使属于社区贡献者角色,如需要发起其他的社区基金申请,按照"),e("a",{attrs:{href:"https://nuls.community/d/274-nip3-nuls",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区基金使用和管理流程"),e("OutboundLink")],1),t._v("执行。")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),e("p",[t._v("发布上月的工作情况报告和下月的工作计划:")]),t._v(" "),e("p",[t._v("请发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),t._m(10),t._v(" "),e("p",[t._v("NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。")]),t._v(" "),t._m(11),t._v(" "),e("p",[t._v("如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;")]),t._v(" "),e("p",[t._v("NULS基金会将会委托200000NULS在您的节点上。")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),e("p",[t._v("所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections")]),t._v(" "),e("p",[t._v("欢迎大家加入NULS社区,共同创造NULS美好未来!")]),t._v(" "),t._m(14),t._v(" "),e("p",[t._v("1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),e("p",[t._v("2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),e("p",[t._v("3、分享NULS的故事给社区。")]),t._v(" "),e("p",[t._v("3、分享NULS的故事给社区;")]),t._v(" "),e("p",[t._v("4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),e("p",[t._v("6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),e("p",[t._v("7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),e("p",[t._v("8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。")]),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),e("p",[t._v("欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。")]),t._v(" "),t._m(17),t._v(" "),e("p",[t._v("1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;")]),t._v(" "),e("p",[t._v("2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;")]),t._v(" "),e("p",[t._v("3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;")]),t._v(" "),e("p",[t._v("4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),e("p",[t._v("(1)通过互联网或者线下交流的方式让其他人了解NULS。")]),t._v(" "),e("p",[t._v("(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。")]),t._v(" "),e("p",[t._v("(3)将NULS社区其他地区的发展情况分享到当地社区。")]),t._v(" "),e("p",[t._v("(4)持续分享NULS项目的进展、规划、新闻等到当地社区。")]),t._v(" "),e("p",[t._v("(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。")]),t._v(" "),e("p",[t._v("(6)分享NULS的故事给社区。")]),t._v(" "),e("p",[t._v("(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。")]),t._v(" "),e("p",[t._v("(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。")]),t._v(" "),e("p",[t._v("(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。")]),t._v(" "),e("p",[t._v("(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。")]),t._v(" "),t._m(20),t._v(" "),e("p",[t._v("(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。")]),t._v(" "),e("p",[t._v("(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。")]),t._v(" "),e("p",[t._v("(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。")]),t._v(" "),e("p",[t._v("(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。")]),t._v(" "),e("p",[t._v("(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。")]),t._v(" "),t._m(21),t._v(" "),e("p",[t._v("1、NULS大使工作看板("),e("a",{attrs:{href:"https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador",target:"_blank",rel:"noopener noreferrer"}},[t._v("点击进入"),e("OutboundLink")],1),t._v("),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。")]),t._v(" "),e("p",[t._v("2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。")]),t._v(" "),e("p",[t._v("3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。")]),t._v(" "),e("p",[t._v("4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。")]),t._v(" "),e("p",[t._v("5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。")]),t._v(" "),e("p",[t._v("6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。")]),t._v(" "),e("p",[t._v("7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注"),e("a",{attrs:{href:"https://github.com/nuls-io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Github"),e("OutboundLink")],1),t._v("和"),e("a",{attrs:{href:"https://dev.nuls.io/",target:"_blank",rel:"noopener noreferrer"}},[t._v("dev.nuls.io"),e("OutboundLink")],1),t._v("。")]),t._v(" "),e("p",[t._v("7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛"),e("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls.community"),e("OutboundLink")],1),t._v("上面发帖。")]),t._v(" "),t._m(22),t._v(" "),e("p",[t._v("1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。")]),t._v(" "),e("p",[t._v("2、组织开展一些线下见面会活动。")]),t._v(" "),e("p",[t._v("3、让更多的区块链投资人了解NULS,引导他们对NULS投资。")]),t._v(" "),e("p",[t._v("4、帮助NULS寻找更多的区块链技术爱好者加入。")]),t._v(" "),t._m(23),t._v(" "),e("p",[t._v("1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;")]),t._v(" "),e("p",[t._v("2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。")]),t._v(" "),e("p",[t._v("3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。")]),t._v(" "),t._m(24),t._v(" "),e("p",[t._v("1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。")]),t._v(" "),e("p",[t._v("2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。")]),t._v(" "),e("p",[t._v("3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),e("p",[t._v("1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。")]),t._v(" "),e("p",[t._v("2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。")]),t._v(" "),e("p",[t._v("3、必须住在人口超过35万的城市。")]),t._v(" "),t._m(27),t._v(" "),e("p",[t._v("1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。")]),t._v(" "),e("p",[t._v("2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。")]),t._v(" "),t._m(28),t._v(" "),e("p",[t._v("1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。")]),t._v(" "),e("p",[t._v("2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。")]),t._v(" "),t._m(29)])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nip-4-nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nip-4-nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP-4 NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("div",{staticClass:"language- extra-class"},[r("pre",{pre:!0,attrs:{class:"language-text"}},[r("code",[this._v(" NIP: 4\n 标题: NULS大使竞选参与规则\n 作者: Reaper Ran \n 讨论渠道: https://nuls.community/d/205-ncg-20181114\n 状态: 公示\n 类型: 流程\n 创建日期: 2019/2/15\n")])])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"摘要"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#摘要","aria-hidden":"true"}},[this._v("#")]),this._v(" 摘要")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"动机"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#动机","aria-hidden":"true"}},[this._v("#")]),this._v(" 动机")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"规范"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 规范")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"nuls大使竞选参与规则"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nuls大使竞选参与规则","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS大使竞选参与规则")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"一、nuls大使介绍"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#一、nuls大使介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("一、NULS大使介绍")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"二、nuls大使职责和权益"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#二、nuls大使职责和权益","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("二、NULS大使职责和权益")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"三、如何参与竞选"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#三、如何参与竞选","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("三、如何参与竞选")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第一步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第二步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("第三步:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("p",[r("strong",[this._v("最后祝愿:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("ul",[r("li",[this._v("恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。")]),this._v(" "),r("li",[this._v("开始社区建设和拓展工作。")]),this._v(" "),r("li",[this._v("帮助NULS对接更多的DApp接入。")]),this._v(" "),r("li",[this._v("请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"如果您能够奉献更多,对您的期望:"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#如果您能够奉献更多,对您的期望:","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("如果您能够奉献更多,对您的期望:")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"大使指导手册"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#大使指导手册","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("大使指导手册")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"前言"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#前言","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("前言")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你将获得"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你将获得","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你将获得")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"作为nuls的大使,你可以从这些方面来开展工作"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#作为nuls的大使,你可以从这些方面来开展工作","aria-hidden":"true"}},[this._v("#")]),this._v(" "),r("strong",[this._v("作为NULS的大使,你可以从这些方面来开展工作")])])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_1、社区拓展"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1、社区拓展","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、社区拓展")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"_2、社区活动"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2、社区活动","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、社区活动")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"了解nuls可以从这里开始"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#了解nuls可以从这里开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 了解NULS可以从这里开始")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"招募志愿者组织当地的社群"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#招募志愿者组织当地的社群","aria-hidden":"true"}},[this._v("#")]),this._v(" 招募志愿者组织当地的社群")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"发展当地的nuls生态"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#发展当地的nuls生态","aria-hidden":"true"}},[this._v("#")]),this._v(" 发展当地的NULS生态")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"将nuls的理念和技术传播到当地"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#将nuls的理念和技术传播到当地","aria-hidden":"true"}},[this._v("#")]),this._v(" 将NULS的理念和技术传播到当地")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"nulstar指南和职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar指南和职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar指南和职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"成为nulstar的要求"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#成为nulstar的要求","aria-hidden":"true"}},[this._v("#")]),this._v(" 成为NULStar的要求")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstar的职责"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstar的职责","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStar的职责")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h3",{attrs:{id:"nulstars的奖励"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#nulstars的奖励","aria-hidden":"true"}},[this._v("#")]),this._v(" NULStars的奖励")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h2",{attrs:{id:"指导手册会不断更新,希望大使们和nuls一起成长!"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#指导手册会不断更新,希望大使们和nuls一起成长!","aria-hidden":"true"}},[this._v("#")]),this._v(" 指导手册会不断更新,希望大使们和NULS一起成长!")])}],!1,null,null,null);_.options.__file="NIP-4.md";r.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/2.434158f1.js b/docs/.vuepress/dist/assets/js/2.434158f1.js new file mode 100644 index 00000000..0ea86cd0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/2.434158f1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{689:function(t,a,s){t.exports=s.p+"assets/img/1547434994872.92dbbc1e.png"},690:function(t,a,s){t.exports=s.p+"assets/img/1547458467571.a14a4e0b.png"},691:function(t,a,s){t.exports=s.p+"assets/img/1547458489793.f9af2155.png"},692:function(t,a,s){t.exports=s.p+"assets/img/1547436510741.06607801.png"},693:function(t,a,s){t.exports=s.p+"assets/img/1547436748834.fe0f9423.png"},694:function(t,a,s){t.exports=s.p+"assets/img/1547436768246.f101c590.png"},695:function(t,a,s){t.exports=s.p+"assets/img/1547437357998.b682db26.png"},696:function(t,a,s){t.exports=s.p+"assets/img/1547437427946.7b123720.png"},697:function(t,a,s){t.exports=s.p+"assets/img/1547445305902.570917cf.png"},698:function(t,a,s){t.exports=s.p+"assets/img/1547445221113.c3f48bb9.png"},699:function(t,a,s){t.exports=s.p+"assets/img/1547437842317.019395e0.png"},700:function(t,a,s){t.exports=s.p+"assets/img/1547437878443.667d71a0.png"},701:function(t,a,s){t.exports=s.p+"assets/img/1547458691614.21c0d621.png"},702:function(t,a,s){t.exports=s.p+"assets/img/1547458844211.915e83ae.png"},703:function(t,a,s){t.exports=s.p+"assets/img/1547459086013.698b1bc6.png"},704:function(t,a,s){t.exports=s.p+"assets/img/1547459110975.8cb3878e.png"},705:function(t,a,s){t.exports=s.p+"assets/img/1547459677163.2aac5dcb.png"},706:function(t,a,s){t.exports=s.p+"assets/img/1547459708942.564adc16.png"},707:function(t,a,s){t.exports=s.p+"assets/img/1547459737912.24ee8a80.png"},708:function(t,a,s){t.exports=s.p+"assets/img/1547459824098.05b8ba9b.png"},709:function(t,a,s){t.exports=s.p+"assets/img/1547461252921.f60612aa.png"},710:function(t,a,s){t.exports=s.p+"assets/img/1547461277501.70b4b430.png"},711:function(t,a,s){t.exports=s.p+"assets/img/1547461383782.e376e971.png"},712:function(t,a,s){t.exports=s.p+"assets/img/1547460181242.914f1175.png"},713:function(t,a,s){t.exports=s.p+"assets/img/1547460237710.d8e664ca.png"},714:function(t,a,s){t.exports=s.p+"assets/img/1547460590047.38d13fda.png"},715:function(t,a,s){t.exports=s.p+"assets/img/1547460865338.ace153bf.png"},716:function(t,a,s){t.exports=s.p+"assets/img/20190115102249.d551ecec.png"},717:function(t,a,s){t.exports=s.p+"assets/img/20190115103504.342076cb.png"},718:function(t,a,s){t.exports=s.p+"assets/img/20190115104427.1df39c02.png"},719:function(t,a,s){t.exports=s.p+"assets/img/20190115104911.71222bc1.png"},720:function(t,a,s){t.exports=s.p+"assets/img/20190115110413.617e8ffb.png"},721:function(t,a,s){t.exports=s.p+"assets/img/20190115110806.ad21b29f.png"},722:function(t,a,s){t.exports=s.p+"assets/img/20190115111229.1227e59a.png"},723:function(t,a,s){t.exports=s.p+"assets/img/20190115111447.ddf1ea31.png"},724:function(t,a,s){t.exports=s.p+"assets/img/20190115111721.cb32c823.png"},725:function(t,a,s){t.exports=s.p+"assets/img/20190115112217.f8239e8a.png"},726:function(t,a,s){t.exports=s.p+"assets/img/20190115112121.0f04e108.png"},727:function(t,a,s){t.exports=s.p+"assets/img/20190115112741.272fc0b7.png"},797:function(t,a,s){"use strict";s.r(a);var r=[function(){var t=this,a=t.$createElement,r=t._self._c||a;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"客户端钱包使用指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#客户端钱包使用指南","aria-hidden":"true"}},[t._v("#")]),t._v(" 客户端钱包使用指南")]),t._v(" "),r("h2",{attrs:{id:"客户端"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#客户端","aria-hidden":"true"}},[t._v("#")]),t._v(" 客户端")]),t._v(" "),r("h3",{attrs:{id:"获取"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#获取","aria-hidden":"true"}},[t._v("#")]),t._v(" 获取")]),t._v(" "),r("p",[t._v("​\t在NULS官网(nuls.io)下载钱包客户端后运行程序。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(689),alt:"1547434994872"}})]),t._v(" "),r("h3",{attrs:{id:"安装"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[t._v("#")]),t._v(" 安装")]),t._v(" "),r("p",[t._v("​\tNULS钱包客户端是绿色免安装的,文件解压之后直接点击文件夹里的exe应用程序就可以进入客户端界面。")]),t._v(" "),r("h2",{attrs:{id:"账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 账户")]),t._v(" "),r("h3",{attrs:{id:"创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建账户")]),t._v(" "),r("h4",{attrs:{id:"钱包无账户时创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包无账户时创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包无账户时创建账户")]),t._v(" "),r("p",[t._v("​\t钱包语言已切换为中文,开始创建自己的账户。点击顶部菜单的“钱包”开始“创建账户”,界面如图1:")]),t._v(" "),r("p",[r("img",{attrs:{src:s(690),alt:"1547458467571"}})]),t._v(" "),r("h5",{attrs:{id:"创建有密码的账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建有密码的账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建有密码的账户")]),t._v(" "),r("p",[t._v("​\t点击“创建账户”之后,首先设置密码,输入两次密码一致,注意密码规则:8-20位字符,需包含字母和数字。")]),t._v(" "),r("p",[t._v("然后点击“确定”,界面如图2:")]),t._v(" "),r("p",[r("img",{attrs:{src:s(691),alt:"1547458489793"}})]),t._v(" "),r("p",[t._v("​\t"),r("strong",[t._v("PS:账户密码一定要认真保存,丢失后将无法进行转账和共识等关键操作。")])]),t._v(" "),r("h5",{attrs:{id:"创建不带密码的账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建不带密码的账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建不带密码的账户")]),t._v(" "),r("p",[t._v("​\t点击“创建账户”后,弹出设置密码窗口,直接点击“此账户不需要密码”即可创建无密码账户。")]),t._v(" "),r("h4",{attrs:{id:"钱包有账户时创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包有账户时创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包有账户时创建账户")]),t._v(" "),r("p",[t._v("​\t点击顶部菜单的钱包,进入钱包页面后,点击“账户管理”图标(见图3):")]),t._v(" "),r("p",[r("img",{attrs:{src:s(692),alt:"1547436510741"}})]),t._v(" "),r("p",[t._v("​\t进入账户管理界面之后,点击账户列表右上方的“+”(见图4),进入创建或导入账户界面(见下图5)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(693),alt:"1547436748834"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(694),alt:"1547436768246"}})]),t._v(" "),r("p",[t._v("​\t选择“创建账户”,之后的操作请参照“"),r("strong",[t._v("创建有密码账户")]),t._v("”和“"),r("strong",[t._v("创建不带密码账户")]),t._v("”。")]),t._v(" "),r("h3",{attrs:{id:"备份账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 备份账户")]),t._v(" "),r("h4",{attrs:{id:"备份入口"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份入口","aria-hidden":"true"}},[t._v("#")]),t._v(" 备份入口")]),t._v(" "),r("p",[t._v("​\t账户创建成功之后,此时需要立即进行账户备份,以保证账户资产安全。")]),t._v(" "),r("ul",[r("li",[t._v("方式一:点击顶部菜单中的“设置”,进入设置页面之后,点击“账户备份”按钮(见图6),进入账户管理界面(如图7)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(695),alt:"1547437357998"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(696),alt:"1547437427946"}})]),t._v(" "),r("ul",[r("li",[t._v("方式二:点击顶部菜单“钱包”,再点击“账户管理”图标,进入账户管理界面(图7)。")]),t._v(" "),r("li",[t._v("方式三:钱包地址创建成功后,直接在完成界面进行备份,设置密码的地址备份界面(图8),没有设置密码的地址备份界面(图9)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(697),alt:"1547445305902"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(698),alt:"1547445221113"}})]),t._v(" "),r("ul",[r("li",[t._v("当账户已经设置密码,点击“备份”,弹出密码确认框,输入正确账户密码之后进入钱包备份界面(图10),可进行Keystore备份和私钥备份;")]),t._v(" "),r("li",[t._v("当账户未设置密码,点击“备份”,直接跳转至账户备份界面(图11),只能进行Keystore备份。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(699),alt:"1547437842317"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(700),alt:"1547437878443"}})]),t._v(" "),r("h4",{attrs:{id:"明文私钥备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#明文私钥备份","aria-hidden":"true"}},[t._v("#")]),t._v(" 明文私钥备份")]),t._v(" "),r("p",[t._v("​\t进入已经设置密码账户备份界面,点击“明文私钥备份”,弹出私钥备份窗口,然后点击“复制”按钮(图12),提示复制成功。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(701),alt:"1547458691614"}})]),t._v(" "),r("h4",{attrs:{id:"keystore备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#keystore备份","aria-hidden":"true"}},[t._v("#")]),t._v(" Keystore备份")]),t._v(" "),r("p",[t._v("​\t点击“Keystore备份”,直接显示Keystore保存路径(图13),在该路径下可以查看Keystore备份文件。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(702),alt:"1547458844211"}})]),t._v(" "),r("h3",{attrs:{id:"导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 导入账户")]),t._v(" "),r("h4",{attrs:{id:"钱包中无账户时导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包中无账户时导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包中无账户时导入账户")]),t._v(" "),r("ul",[r("li",[t._v("点击顶部菜单的“钱包”,选择“导入账户”(图14);")]),t._v(" "),r("li",[t._v("进入导入账户页面(图15);")]),t._v(" "),r("li",[t._v("选择备份时的明文私钥或者Keystore文件进行导入,将备份账户导入钱包。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(703),alt:"1547459086013"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(704),alt:"1547459110975"}})]),t._v(" "),r("h4",{attrs:{id:"钱包中已有账户时导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包中已有账户时导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包中已有账户时导入账户")]),t._v(" "),r("ul",[r("li",[t._v("如果钱包中已有账户地址,点击顶部菜单的“钱包”进入钱包界面;")]),t._v(" "),r("li",[t._v("点击钱包页面的“账户管理”图标(图16)进入账户管理界面(图17);")]),t._v(" "),r("li",[t._v("点击账户管理界面右上角的“+”进入创建或导入账户界面(图18),选择导入账户进入导入账户界面(图19)")]),t._v(" "),r("li",[t._v("选择明文私钥(导入时可以设置密码,也可以不设置密码)或者Keystore文件(如果备份Keystore文件是账户已经设置了密码,则导入的时候需要进行密码确认才能成功导入)进行导入,将已有的账户导入钱包。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(705),alt:"1547459677163"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(706),alt:"1547459708942"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(707),alt:"1547459737912"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(708),alt:"1547459824098"}})]),t._v(" "),r("h3",{attrs:{id:"管理账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#管理账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 管理账户")]),t._v(" "),r("ul",[r("li",[t._v("在钱包界面,点击账户管理图标进入账户管理界面,此界面展示了钱包的所有账户信息,可花费NULS对账户设置别名(图20),一旦设置便不可更改。")]),t._v(" "),r("li",[t._v("该界面也可以移除和备份账户,备份流程见“备份账户”。")]),t._v(" "),r("li",[t._v("该界面可以进入创建或导入账户界面,其流程与“创建账户”、“导入账户”一致。")]),t._v(" "),r("li",[t._v("该界面可以对没有密码的账户进行密码设置,对已有密码的账户可以进行密码修改(具体流程见“修改密码”、“设置密码”),账户管理界面如图21。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(709),alt:"1547461252921"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(710),alt:"1547461277501"}})]),t._v(" "),r("p",[t._v("​\t账户管理界面还可以对已有账户设置备注(图22)")]),t._v(" "),r("p",[r("img",{attrs:{src:s(711),alt:"1547461383782"}})]),t._v(" "),r("h3",{attrs:{id:"交易"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[t._v("#")]),t._v(" 交易")]),t._v(" "),r("ul",[r("li",[t._v("钱包首页展示了当前账户的资产情况,包括总额、可用和冻结;")]),t._v(" "),r("li",[t._v("可以通过账户地址的下拉框切换不同账户查看账户信息")]),t._v(" "),r("li",[t._v("在账户资产页面,点击资产后面的“转账”(图23)进入转账界面(图24)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(712),alt:"1547460181242"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(713),alt:"1547460237710"}})]),t._v(" "),r("ul",[r("li",[t._v("进入转账界面之后,转出地址可以通过下拉列表进行选择;")]),t._v(" "),r("li",[t._v("输入收款地址(可以点击收款地址输入框后面的头像图标选择通讯录中已经保存的联系人,选择之后地址自动填入收款地址输入框);")]),t._v(" "),r("li",[t._v("输入正确的转账金额(备注可选填);")]),t._v(" "),r("li",[t._v("点击确认转账即可进行转账(若转出地址有密码,需要输入正确的密码发起转账交易);")]),t._v(" "),r("li",[t._v("转账完成之后进入转出地址交易记录界面,可以查看该交易进度(图25)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(714),alt:"1547460590047"}})]),t._v(" "),r("p",[t._v("​\t点击txid可以查看转账详情,界面如图26。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(715),alt:"1547460865338"}})]),t._v(" "),r("p",[t._v("​")]),t._v(" "),r("h2",{attrs:{id:"共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 共识")]),t._v(" "),r("h3",{attrs:{id:"创建共识节点"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建共识节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建共识节点")]),t._v(" "),r("p",[t._v("​\t点击钱包顶部菜单的“共识”,进入共识界面,该界面展示了共识的总览信息,包括全网的委托总额和节点总数以及自己的参与共识情况,界面下方展示了全网所有的共识节点和自己创建、委托的共识节点信息(图27)")]),t._v(" "),r("p",[r("img",{attrs:{src:s(716),alt:"20190115102249"}})]),t._v(" "),r("ul",[r("li",[t._v("当前账户(未受红牌惩罚)还未创建节点,点击我的总体情况中的创建(图27中红框标识),便可进入创建节点界面(图28)")]),t._v(" "),r("li",[t._v("输入正确的必填信息,考虑到安全问题,出块地址必须使用自己创建的其他账户地址,创建节点的保证金范围:20000-200000NULS,代理佣金比例(10%-100%)一旦确定便不可更改")]),t._v(" "),r("li",[t._v("点击确定经过密码确认之后便成功创建节点,节点创建成功后返回共识页面(图27)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(717),alt:"20190115103504"}})]),t._v(" "),r("p",[r("strong",[t._v("PS:创建节点时,出块地址不能设置密码,节点正常出块过程中,出块地址不能设置密码,否则无法正常出块并影响节点信用值")])]),t._v(" "),r("h3",{attrs:{id:"注销共识节点"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#注销共识节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 注销共识节点")]),t._v(" "),r("p",[t._v("​\t账户自己创建的节点可以进行注销(节点注销之后,创建节点时的保证金会被冻结3天),点击钱包顶端菜单“共识”进入共识界面(图29),点击我的总体情况中创建节点后面的查看(图29红框标识)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(718),alt:"20190115104427"}})]),t._v(" "),r("p",[t._v("​\t进入节点详情页面(图30),点击“注销节点”按钮,确认密码之后则节点注销成功。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(719),alt:"20190115104911"}})]),t._v(" "),r("h3",{attrs:{id:"参与共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参与共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 参与共识")]),t._v(" "),r("ul",[r("li",[t._v("在共识界面中,我的总体情况点击委托节点后面的“委托”入口(也可以直接点击节点列表中的某个未委托节点进入);")]),t._v(" "),r("li",[t._v("在参与共识界面(图31)显示节点的信息(节点ID、节点来源、佣金比例、保证金、参与人数、信用值、委托数量);")]),t._v(" "),r("li",[t._v("可以在该界面直接选择委托地址,输入保证金参与委托(需要确认密码)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(720),alt:"20190115110413"}})]),t._v(" "),r("h3",{attrs:{id:"追加和退出共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#追加和退出共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 追加和退出共识")]),t._v(" "),r("p",[t._v("​\t在共识界面中,我的共识table页中点击某个节点进入节点详情(图32),此页面可以进行追加委托保证金和选择退出共识。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(721),alt:"20190115110806"}})]),t._v(" "),r("h2",{attrs:{id:"设置"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置")]),t._v(" "),r("p",[t._v("​\t点击顶部菜单的“设置”,进入系统设置界面(图33),可以对系统语言、通讯录、密码进行设置和账户备份、版本升级、退出系统。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(722),alt:"20190115111229"}})]),t._v(" "),r("h3",{attrs:{id:"语言切换"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#语言切换","aria-hidden":"true"}},[t._v("#")]),t._v(" 语言切换")]),t._v(" "),r("p",[t._v("​\t系统设置界面中可以对系统语言进行中英文切换(图34)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(723),alt:"20190115111447"}})]),t._v(" "),r("h3",{attrs:{id:"查看通讯录"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#查看通讯录","aria-hidden":"true"}},[t._v("#")]),t._v(" 查看通讯录")]),t._v(" "),r("p",[t._v("​\t系统设置界面可以查看通讯录,在通讯录界面(图35)可以对通讯录进行新增、编辑和删除操作。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(724),alt:"20190115111721"}})]),t._v(" "),r("h3",{attrs:{id:"设置-修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置-修改密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置/修改密码")]),t._v(" "),r("h4",{attrs:{id:"设置密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置密码")]),t._v(" "),r("p",[t._v("​\t在系统设置中,对为设置密码的账户地址可以进行密码设置(图36),设置密码需要符合密码规则。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(725),alt:"20190115112217"}})]),t._v(" "),r("h4",{attrs:{id:"修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#修改密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 修改密码")]),t._v(" "),r("p",[t._v("​\t在系统设置中,对已经设置密码的账户地址可以进行密码修改(图37),修改密码时,需要输入账户地址当前的正确密码,修改的密码需要符合密码规则。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(726),alt:"20190115112121"}})]),t._v(" "),r("h3",{attrs:{id:"版本升级"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#版本升级","aria-hidden":"true"}},[t._v("#")]),t._v(" 版本升级")]),t._v(" "),r("p",[t._v("​\t在系统设置中,当最新版本号高于当前版本号时,可以直接点击“最新版本”(图38),对系统进行升级。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(727),alt:"20190115112741"}})]),t._v(" "),r("h3",{attrs:{id:"退出系统"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#退出系统","aria-hidden":"true"}},[t._v("#")]),t._v(" 退出系统")]),t._v(" "),r("p",[t._v("​\t在系统设置界面进行退出操作,直接点击“退出系统”按钮(图38)即可。")])])}],e=s(0),i=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},r,!1,null,null,null);i.options.__file="clientWalletGuide.md";a.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/20.5171c565.js b/docs/.vuepress/dist/assets/js/20.5171c565.js new file mode 100644 index 00000000..fb8381ac --- /dev/null +++ b/docs/.vuepress/dist/assets/js/20.5171c565.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{551:function(t,e,s){t.exports=s.p+"assets/img/1.6f2046a8.png"},552:function(t,e,s){t.exports=s.p+"assets/img/2.e042a947.png"},553:function(t,e,s){t.exports=s.p+"assets/img/3.2a598d4a.png"},554:function(t,e,s){t.exports=s.p+"assets/img/4.ab76dd1b.png"},555:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUkAAACQCAYAAACFzJn7AAAVGklEQVR4nO3deXyU1b3H8c+ZJZkJCYGwhB0CgUSCUFwABURBRRCRRXDBWlu73d5ql2ulm0u1Wq+1t62tvV6vrWuvda+KUhEXFgURymrCKltYAmRPyITMzLl/DMmQJnlmIpEJL7/vf/Ka55w55zdPMt85zzyTeUxeXp5FRESa5Up0ASIi7ZlCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIEnkZOnpVqumhUmdwjU1BgWvQMfrozm9qhzLNOmhAF4/U3Dx2vaZ6Z/77shfv9Hd4vtHo9l6mTLgP6Wh/7Ucj8RaX8SFpIul+VbN4VZvdbw7N8M2dlw9ZwwFZWWTZ8YMjMtl04K8/CjLkJBuOnGMDt3WY4Um0SV3KIdO2LXlOK3DBzQ/moXEWcJW5pNGAe79xg+WGH43s1hrpxmeWOhYfz5FoAx51qWLDMUFRmOFBtWrjKMOtcmqlxHCxY678Zg0PDcS+1zFSwizhL2zD3zzDBr1hlGnwObtxgqq2HrNkPvXpH2nCGwdXt05bV1m2FoTvsKSa/Xkp5uGX1uOGZfa7WKFDkdJexwu0d3OHAALrrAsvxD6NQJysrB748EYcc0KC6J9i+vgPT06O3fPRAJpvzNkRXnv30jsv37t0Vy3xjLpIssY8dYvF7DmrXw6gJDOGyYMzNMVhZkdLL8+A43Uy4NM2GcZX8RPPSwO2Z7vR/9IExqB0jxGz76uPHjM8Yy+WLLmFEWtwfeW2KatLdUn4i0HwlbSSYlQaAW+vaG6ipDScnxbYFIu89nCYWi/QMB8Pujt+++3xAIWP78pIst21ys+Age/F00YCaMh6z+lj8+4uK+XxuSkiInTwA+Wg2LFht8PsP488PUBAx33edizT9NXO317nvAzc9/0fwuvGiC5YxcePhRF/c/6CK1Q+N2p/pEpP1IWEhWH4VkL3RItXiSoLgYevaAkuOrx5oa8Hqj/T0eCAWjIVVSYtix0zA01+J2WwK1ULg/2n7+mDDPveSiuMRw9KjhtQUuRgyPhNCevS7WbYj0PVIM7y81BAKGD1a44mo/UUsrv/NGwcuvwuHDhupqw2tvNL6vU30i0n4k7HC7tBQyMy3hMGRnQ3kZTLrQsnptJHTKKyCjs+VgUeR2p3QoKWscIhs2wahzIh+x2fFp4/E7pcPdP7dA9D7BEE0UbHF+nYjV3pL0dMu+/S3fN976RCSxEhaS6zYYRo6AnbsMyV7LVTPgk82w7INIKBZsNuQMhoNFkf7Zgyw7dzVetW3YaJg13ZKcDI881ritvMLwhz8ZKioT8x5fVSV07gSHj0Rue72NAz7R9YlIfBJ2uL1ylWH4sMhnIt9abLj7V4b8fJg+1R5vh/FjLT0yw3TrZrnwAsvS5Y3HqAkYdu2G8vKmh72rVsPc2Zbu3SKH4337hLlqZvQstM8Xmcfva/4QN1Z7tF9kzJSUxv3WbjBMv9zSsaMlNdUy5dJI+4xp4bjqE5H2weTl5SXsjbAemZY5sy39+liOHoW16wyvLzSEQpHA+9Jwy8zpYYyB1xYYVq9tmunjzrMUl9gmh8Uul+WSiZbR51g6pMLevfDsC4biEhfz/yNMz8xo30Agcha7Xqz2enf9NEynTtHbZWVw132ROjwey6zplhHDLTU1kbnnzIq8KCxY6HKsT0Taj4SGpIhIe6dli4iIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaSIiAOFpIiIA4WkiIgDhaRIG0jy+bl42pyG2xdPm0OSz+9wj9bpN3AwN33vZ8y/9w9tNqbERyEpcpLcbjfT536Fj5Yubtj20bLFXDHnBlyutrnO+uWzv8yubQX8/p7b2mQ8id9pGZLXnOHmZ2O9MfvNHOzmpuFufjPJue/tY9v2u4fjre9kxfv4Es3ndfGjOYN4Zv7IuO+T6ndz7405LPuvcSz/7Tj+++YzmT930OdY5Wd30ZRZfLJuNZUVpQ3bKstLyV//TyZOmdkmc2R07c6StxcQCNS0yXgSv9MyJH0eGJIRX+l1Ieia4tx3S3Hbfltca+o7WfE8vvagY4qHL2V3jrv/ndcPoby6jmm3r+SK21ey82A1l5ydGfuOp1iXbj3oM2AgBRtWN2kr2PAxfbIG0aVbj5Oex+12E6w7dtLjSOu1/2dXM57YGN/FYF7ZFuKpT2L3fX5z215cJt76Tla8jy/RAnVh7nhqc6vuM2F4Nx5+fTfl1UFKq4I88MKn5O8pb9Lvp9dmt1WZzYo1/sgxF7B5w5oW2zdv/CcjR49v67LkFDotQ7KtJLktGT7DhL5f6N1wSljbumv5lFbVMfmcbo22/ewv0aB1GcO5Q9KZOurkV2nNiXf87Jw8dmzNb7H90y0FZOcOO7laXG7CYV3aI1ESciGw28Z46ZUKD30c5Ftne0jzwoYiy5Mb66gJGf7nsiR8XsNXXq9tuE9z2zJTDN8c6aZPRxfbS8I8ujZE+bH4D53vuSCJtCTokORiyd7aJu3n9XJx+WA33VMMZbWWF/NDrDoY/x9rrPquPsPNhH4uDIZle0M8+0kQa0zc7U6MtUzLdjMxy43XZVhZGOLZgiCh42E1uqeL6TlueqQYqo5Z3twR5q2dkVXp7WM9dPUbbl8a5Gsj3OR1dVFdBy9tDrKsML7H7zKG71zRn1njeuH1uHjird1N+tx61UBmje+NAf7+4X4eeH57Q5g++Pw2fvm1oYzO6cQfX93F3iMBKmuiq+a37z+PzAwfAJv+dyIAw77xbkP7Zed249vTsujXPYXyqmM88dYenlxcCMCd1w/mS9md6ZXhY/QtS7nlygHMm9SP7fsqmfefa+Mav156p86Ul5U22V6vrKyY9E7xv83QnNwzz+bAvj0nNYZ8dglZQr23K0Rnv4vzert4cMUx5r8bxOOBq4dGMvvWd+qa3OeHi5uG2NRBbh5fH+IHb9dSWQvXDG3dmcT579Vx86Lm3+cZ28vFNUPdvFIQ5JZFtfxmZZDrhrXuNcWpvov7uzijq4tfLAty57JasjNcXJwVf3sslw70MLiLi/s+DDL/3VqS3DA7J1r/nKFu/rI2yLcW1vLI2iCzc6N/Cgu2henkdzFjsIuFO0J8561ans8PNvx+4vHVS/swblgXbvrNWq68YyUZHZMatc+b2ItzczK47t7VXP3LjxkxsBPXT+zd0P722iPM/sUqwPDyXaP4wawsjIm+wEya/2FDaA37xrtNAuwHs7K588kCRn93CT957BO+O2NgQ9vLyw/w6Bs76eD3MG9iL8qrg0ya/wELPjoY9/gN4nzROhmXXDGbxQte/NznkeYlJCQ/Pr4ae7YgyOEaQ2Wd5fn8ECMyIyFQWdd0NVgdbPrH+Nr2EIVVlqNBw8tb6xjatfV/sKEWDgMvH+Lm8Q0h1hyyBEKGoqOWB1Y2DW8nTvVNynLz1PogRUcth44ant4QZNIJIRirPZaJA1w8vqGOw0ct1UHD3wqCnNMr+uu+9Z06dlaEye7son9HQ7In2rb2UOT380x+kC0llrqwYcW+EGnJ8e/f2Rf05ld/28rOohpKqoL8+oUdjdqvubAPv/zrZnYdqmHP4QD3PbuFuRP6NupTeCTA/D8XcMMDa5h8TibfnzmQeE3+yQo27api5KA0cvul4U+OBvzGXVUs/PhwZI5DAZ5cXEhVTYhn3z8Q9/j1yktLSE9veaUYa6UZjzdf+iuzr//mSY0hn13CrrsNED4hoEoDYVJb+UmW4ppomJbUQIektntV7+o3bC4OAdEx91e17iy4U31d/Ya9VeGG8QurwmT44m+PJcNn+N0lvkbbguFoPUM6G751lpeSABSWN38IfeLvJ97D/HqZnZLZsre6xfZeXfxs23e04fb2fUfp2SW54fbUUd14c1UkyAr2VPOjRzfx8M0j+O3LO+Oa/+zsjvzq63kUlQbYvq+qxX5LNpXENV5Ldu3YQtbgMzhctL/Z9oGDh7Jze+tOWv2r7Zs3kprW8aTGkM8uoSF5or6pLkprG4eQy9iGJ6rHNA2oE9u7d3BRGmi7j/KU11q6pbjYWxkds3+aYXdl/HM41VdSa8lMcVF4PHh7pLSuPZbSWsuv3qml9Fjz4XbjcA+Prw+x6UgkICdmte2fQnHlMXp0TmbXocjn+vxJjQ9aispq6dvNx7b9kaDs181HUWn0LZWZY3uyaM0RgqHIY959qAavx/nAp0ual+LKyGr/ji/ncvdTm1meH1nFzfmXVepnceL49f65YilTZs9j1fJ3mr1P7vCzefOlp09qXmt1QdNESuhp3SsGufC7Lb1SDTeM8PDB3uiKpiJguaifG4/L0j3FMn1w5El83fH39WqDlmmD3PiPn6G+eqibVfuarohSPJE/sFRv839ofndkewdP4/aPCsPcMNxDn1RDktsysruLC/rFv7ti1bd0d5h5w9x09Ru6+A3XDXPz/u5Q3O2xHt/yPSFuHOGlZweDx1iyOhpuGBY9XO/iNwTDlhSPZUxPg7WW2UPcjcZMOWGf1O+nNG98K8pFq4u4de4gMjsn0SXNy3evzAJg/tWRD4S/vGw/P7l2ML26+OiZkcT8a7J5cWl0NZbkdfHA18+gT1cf6R08/MdVg1i28UiTecqrj3FebjppfjdfnRwNwh6dfdSFwqT53Uwd1Q0bttxy5YCG9lR/5LGm+Z3fwmhp/HqHDhZStH8vucOaflA+98yzKdq/l8MHm19ltlZb/feOtI67e/fudyVi4pk5Ht7dFeaHo71c0M/NuoNhXtkWpv5Fs7oOZg5xM3OIh0Gd3SzYHmJoV8O+Ckt+saVjEhRWwA9He5k4wM324jAvbA4SPuHw+Mkrkpl2PFwvz/YwM8fD37dGg+a3FycxZ2jkGP/ywR4m9HPz1qeR9i0lYXp2MMwd6mH6EA8dkuCZTUHqwvGFRKz6dpSFyUp3c+NwD+P6uFh30LJgRwgbZ3usx7etNExmiotr89zMyvHQu6Ph+YIgR4+/txuos3xluIeJ/d2sKwqTlmzI8Bs+KAzz2OWRw/Tz+0T3x68nJeP3GqZmuxvtw5as3lrG2YM78dNrhzBtTA+eeGs3wwd2ZMf+o6woKGX9pxXk9U/jjnk5zBjbiyXri3n0zT3Ux3Lfrn6SPC5umTGIr07ux5GKY9z9163U1jV+IQyHwvx8Xi4zx/Xk8X/sZl9xZDVaU1vHz6/PZe6E3ry//ggZaR56dvHx6ooiXv3FKG6bOwSAr08ZwFcu6ctjC5uefXca/0S7tm/mwskz2P3pVo4di7SndezMuIlTeOPFp9vk4zsjR4/Hm5TMgf17CQWDJz2exM/k5eWd8rW83215ZKqPm986RkUrPrIj0l75fH7GXTyNxQteACJfcLF8cdv9G2HOsJFcdNkMOmV05f6f/nubjCnxSUhI1n/mEeA7CwPNnrkWEWkPEhKSIiKnC/0/noiIA4WkiIgDT3JycuxenxOv10tdXev+i0VE5FTSSlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFCUkTEgUJSRMSBQlJExIFC8iRdk9O+v0Spvdcn0t4pJD8jl7Fkp1tG90x0Jc1r7/WJnC7MWWedlbClRqK+4GJeriW7M3TxwS3vGa4caJnUH/ZXw/2rIl8AbKxlShZM6AseF6w6AC9ui16C9v7xlgx/4y8L/uaiyM+HLrL4vKbh9r9uizX/j0dZMnxwzwq4IQ/OyIhczuLV7fDhgfi+oNipvljzx6o/nv1T79FLaTSOyOnG3bNnz4Rc4wbA7Xa3yfU/WquyFvZVwehehspaSzAMf94UadtdEXmST+oHOV3gkfXw9m44sysMTIeCkkj74j2G13fAFYMiIfD6CZeVXlYIk7NMo21LC+Gy49tizV8ZgAv6GZJcsGwfPLcFymphTg4s2h1fSDrVF2v+WPXHs3/q7Si1HK7RN8/L6esLebi9q9KwuijyxC2ugXf2GmpDhiWF0Sfzhf3g6XwoDhiqg4YXt8FZPeIbv6qZy1GceImKWPOvL478fG4rbCsz1IUNqw5AWnLbhE2s+WPVD/Hvn/wSBaSc3trNdbcTZWNx80/izsnwwIQT2yKXYD1V8wMN1+wGsObzCRun+Z2cqv0jkmhf+JBsSdkxeHC5pexY4yBwkua1VNZF+7iMbQg6j7Ex7/95+9f6YnGq/7PsH5HT0RfycBsg2R1Z9aR4ml/9rNgH1w+FHikWj7H0T7Ncl9u0b/UxS25nS4rHcumA6PaKgGV8b/C4LN1TLFOzItvnDrEx56/fdmKb73j/1BbqbUlL9cV6/LHqj3f/DM3Q6lJOb1/Is9t3nW/plRpd9QTqLLe813gV5DKWqQNgbB9I9cKuCnhqExwONO53ST/LtEFQE4S/bIStZZH283taZgyGFA/sroBnCuDbI2BdEYzIxHH+Ry+N/Cypsfx4WdOz6a05W9xcffE8fqf6X9lh4t4/Orstp7svZEjKqfPgBMutS3QYLqevL+zhtpwamw4nugKRk6OQlM/VE/laRcrpTSEpIuJAISki4sBTW1ubsMkTObeISDy0khQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGQkK9Km3/vHzhSdIC3X3+BPTu3JaIEEZG4JGQl+dt7bmNb/gYuv+r6REwvIhK3hITksUANH7z/DzK6ZiZiehGRuCXsPclQMIjb7U7U9CIicdGJGxERBwkNyVAohMul1aSItF8JDcntmzcxdMS5iSxBRMRRQkNy09pVXDxtViJLEBFxlNCQnDbnyyx8+f8SWYKIiKOEhmRyso+t+esTWYKIiKOEn922VtdlFpH2K2Ehqc9IisjpICH/u53k8zN63ETKy0sTMb2ISNwSEpI/vONBykqO8A+dtBGRds7k5eXpTUERkRYk/MSNiEh7ppAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcaCQFBFxoJAUEXGgkBQRcfD/WYIrhH7kiPgAAAAASUVORK5CYII="},556:function(t,e,s){t.exports=s.p+"assets/img/6.b4a2a10c.png"},557:function(t,e,s){t.exports=s.p+"assets/img/7.71c33714.png"},558:function(t,e,s){t.exports=s.p+"assets/img/8.33bf5b49.png"},559:function(t,e,s){t.exports=s.p+"assets/img/9.ae82c2b9.png"},560:function(t,e,s){t.exports=s.p+"assets/img/10.a44ca8c2.png"},561:function(t,e,s){t.exports=s.p+"assets/img/11.144a1b5d.png"},562:function(t,e,s){t.exports=s.p+"assets/img/12.2924df38.png"},870:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"开发业务模块"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开发业务模块","aria-hidden":"true"}},[this._v("#")]),this._v(" 开发业务模块")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"​添加模块但不增加协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#​添加模块但不增加协议","aria-hidden":"true"}},[this._v("#")]),this._v(" ​添加模块但不增加协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("在ModuleE枚举类里添加新模块")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(551),alt:"1553663833553"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"2"}},[e("li",[e("p",[this._v("创建模块的Bootstrap启动类")]),this._v(" "),e("p",[this._v("启动类需继承RpcModule类,便于mykernel核心模块管理。继承之后需要实现特有方法,如下图所示:")]),this._v(" "),e("p",[e("img",{attrs:{src:s(552),alt:"1553663980380"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(553),alt:"1553664139545"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(554),alt:"1553670103524"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(555),alt:"1553672430011"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(556),alt:"1553673258491"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"添加新协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#添加新协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 添加新协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(557),alt:"1553678236166"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(558),alt:"1553678379934"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(559),alt:"1553680391073"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(560),alt:"1553680314226"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(561),alt:"1553680677761"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(562),alt:"1553680686807"}})])}],a=s(0),i=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("p",[t._v("​\t阅读本文之前,请先阅读"),s("router-link",{attrs:{to:"/zh/NULS2.0/packageGeneration.html"}},[t._v("生成程序包")])],1),t._v(" "),s("p",[t._v("​\tNULS2.0是基于模块化开发的区块链项目。根据区块链的特点以及NULS特有的POC共识机制,我们已内置账户、账本、网络、区块管理、交易管理、共识、智能合约模块,这些模块已经可以满足NULS2.0区块链节点的正常运行。但基础模块不可能满足所有的业务需求,本文会引导开发者如何添加自己的模块以及如何添加自己的协议。")]),t._v(" "),s("p",[t._v("​\t在添加模块之前,我们首先应该对业务做需求分析,需要明确的知道,添加的模块只是对现有协议的封装与加工处理,还是说现有的协议不满足业务的需求,必须要新增加协议与协议的逻辑处理来实现功能。")]),t._v(" "),s("p",[t._v("​\t本文用api-module和account两个已开发的模块来举例说明如何添加自己的模块(两个模块均为JAVA开发,可到https://github.com/nuls-io/nuls_2.0上下载源码阅读)。")]),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("​\tapi-module模块负责对钱包内已存储的区块数据做二次解析,给钱包页面和浏览器提供可展示的信息。因此模块不需要额外增加协议。")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("添加依赖模块:如果你的模块需要调用其他模块的接口查询相关数据,或者是需要其他模块运行之后,你的模块才能正常运行,就需要在这里添加所依赖的模块。如下图所示:")]),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("模块初始化:如果模块有需要初始化的数据,可以在这里实现,init方法里必须调用super.init(),确保依赖注入成功。如下图所示:")]),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("启动运行:启动运行里可以启动自己的服务进程,启动成功后返回true,若启动失败,程序捕获异常后返回false,告知mykernel核心模块。如下图所示:")]),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("依赖模块已启动: 走到这一步表面你所依赖的模块都已经成功启动,这个时候就可以调用其他模块的接口了。")]),t._v(" "),s("p",[t._v("api-module模块主要功能就是查询其他模块的接口,然后解析数据返回给钱包页面展示,因此模块真正的运行是在scheduleManager.start()这一步做的,内部的实现详见源码。")]),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("到此为止,api-module模块已经成功加入nusl2.0。由于没有新增的协议,模块内部只需要编写模块本身的业务功能即可。")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("​\t我们用账户模块的别名交易来举例说明如何新增协议。别名交易顾名思义就是账户发送一个交易,交易里带有账户想要设置的别名信息,一旦交易被共识节点成功打包到区块中,就表明账户设置别名成功。页面在显示该账户信息的时候都会显示账户别名。")]),t._v(" "),s("p",[t._v("​\t第一步:添加交易类型")]),t._v(" "),s("p",[t._v("​\t 每一种交易都需要单独设置自己的交易类型。交易类型不能与其他模块的交易类型重复。有关其他模块的交易类型,详见RPC文档。")]),t._v(" "),s("p",[t._v("​\t第二步:创建交易逻辑对象")]),t._v(" "),s("p",[t._v("​\t交易逻辑对象属于交易里存储的业务逻辑数据,例如别名交易里就存的别名信息,对象需继承TransactionLogicData类。如下图:")]),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("​\t由于逻辑数据最终会序列化为byte数组在网络中广播,因此还需要实现序列化和反序列化的方法。如下图:")]),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("​")]),t._v(" "),s("p",[t._v("第三步:创建交易相关RPC接口。接口应包括创建交易、验证交易、处理交易、回滚处理交易。")]),t._v(" "),s("p",[t._v("用户通过创建交易接口能顺利组装交易并广播到全网;")]),t._v(" "),s("p",[t._v("验证交易接口会由交易管理模块统一调用,验证失败的交易会丢弃;")]),t._v(" "),s("p",[t._v("验证通过的交易会由共识模块统一调用处理交易接口,存储到本地数据库中;")]),t._v(" "),s("p",[t._v("当有区块回滚时,由区块管理模块统一调用回滚交易接口,将存储在本地的交易相关数据清除;")]),t._v(" "),s("p",[t._v("有关代码的实现详见:io.nuls.account.rpc.cmd.AliasCmd")]),t._v(" "),s("p",[t._v("第四步:启动模块注册交易")]),t._v(" "),s("p",[t._v("模块在启动的时候,需要在doStart()里向交易管理模块注册自己模块新增的交易,以及对应的验证器和处理器,如下图:")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),s("p",[t._v("之后就和api-module一样,在自己的模块里添加其他业务逻辑相关的代码实现即可。")]),t._v(" "),s("p",[t._v("最后,记得在模块的类下添加module.ncf配置文件,如下图:")]),t._v(" "),t._m(14),t._v(" "),t._m(15)])},n,!1,null,null,null);i.options.__file="developModule.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/200.cd38ef32.js b/docs/.vuepress/dist/assets/js/200.cd38ef32.js new file mode 100644 index 00000000..139d9753 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/200.cd38ef32.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[200],{798:function(t,e,i){"use strict";i.r(e);var r=i(0),s=Object(r.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("p",[t._v("NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),i("p",[t._v("通过NULS的github可以获取所有的NIP,github地址为:"),i("a",{attrs:{href:"https://github.com/nuls-io/NIPs",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io/NIPs"),i("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nip介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"什么是nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#什么是nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 什么是NIP?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nip产生的理由"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nip产生的理由","aria-hidden":"true"}},[this._v("#")]),this._v(" NIP产生的理由")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录")])]),this._v(" "),e("li",[e("p",[this._v("对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"获取所有nip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取所有nip","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取所有NIP")])}],!1,null,null,null);s.options.__file="NIPIntroduction.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/201.63a35536.js b/docs/.vuepress/dist/assets/js/201.63a35536.js new file mode 100644 index 00000000..47218651 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/201.63a35536.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[201],{850:function(t,s,e){"use strict";e.r(s);var n=e(0),a=Object(n.a)({},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"content"},[this._m(0),this._v(" "),s("NavBar")],1)},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"nuls-导航"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nuls-导航","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 导航")])}],!1,null,null,null);a.options.__file="NULSNav.md";s.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/202.8463e76c.js b/docs/.vuepress/dist/assets/js/202.8463e76c.js new file mode 100644 index 00000000..1e43f46d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/202.8463e76c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[202],{978:function(t,e,i){"use strict";i.r(e);var l=i(0),a=Object(l.a)({},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),i("p",[t._v("虽然主网现在处于稳定运行的状态,但为了应对变化,主网开发仍然在进行中。我们需要社区的帮助来解决主网开发中面临的挑战,一起完善NULS这个区块链基础设施。我们呼吁社区的开发者能够加入我们,贡献自己的一份力量,同时你的付出也会得到应有的奖励。")]),t._v(" "),i("ul",[i("li",[t._v("如何加入技术社区:"),i("a",{attrs:{href:"https://nuls.io/developer",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://nuls.io/developer"),i("OutboundLink")],1)]),t._v(" "),i("li",[t._v("NULS Github:"),i("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://github.com/nuls-io"),i("OutboundLink")],1)])]),t._v(" "),t._m(3),t._v(" "),i("p",[t._v("在软件开发过程中,尽管有严格的测试,但我们还是无法避免程序中出现bug,因此如果你在使用我们应用或者进行开发的过程中发现了bug,请及时反馈给我们,我们会积极进行处理。反馈bug的方式有三种:")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("通过在"),i("a",{attrs:{href:"https://nuls.community/",target:"_blank",rel:"noopener noreferrer"}},[t._v("社区论坛"),i("OutboundLink")],1),t._v("回帖进行反馈")]),t._v(" "),t._m(4)]),t._v(" "),t._m(5),t._v(" "),t._m(6)]),t._v(" "),t._m(7),t._v(" "),i("p",[t._v("NULS制定了文档编写激励计划,邀请社区一起编写NULS相关文档,并会根据社区成员的付出给予相应的奖励。")]),t._v(" "),t._m(8),t._v(" "),i("p",[t._v("NULS作为一个全球性区块链开源社区项目,需要大量的中英双语文档,如果你是这方面的专业人士,那么我们十分需要你的帮助。")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"如何做贡献"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#如何做贡献","aria-hidden":"true"}},[this._v("#")]),this._v(" 如何做贡献")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("NULS的发展是与社区分不开的,需要社区成员一起参与进来。我们提供了不同的方式让社区成员参与,大家可以选择自己擅长的方式来为NULS做贡献。对每位贡献者,在征得其同意之后,会公示贡献者名字(若拥有节点,我们也会附上其节点名)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"加入主网开发"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#加入主网开发","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入主网开发")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"报告错误"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#报告错误","aria-hidden":"true"}},[this._v("#")]),this._v(" 报告错误")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("主网:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs")]),this._v(" "),e("li",[this._v("测试网:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("发送邮件到support@nuls.io")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("直接反馈给社区经理或运营人员")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"编写文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#编写文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 编写文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"翻译文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#翻译文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 翻译文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"贡献者名单"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#贡献者名单","aria-hidden":"true"}},[this._v("#")]),this._v(" 贡献者名单")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("排名不分先后,仅按照字母排序")])])},function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("名字")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("邮箱")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("节点别名/ID")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Angang Tang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("tangangang@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Albert")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("albert@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Charlie Li")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lichao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Cody Lan")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("lanjinsheng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Davi Yang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("davi@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yuanchen Jiang")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("jiangyuanchen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Yifeng Qin")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("qinyifeng@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("--")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Niels")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("niels")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pierre Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("luohao@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Pen Luo")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("pen@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Siwei")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("13809668344@139.com")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("siwei")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("Vivi Zhou")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("zhouwei@nuls.io")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("---")])])])])}],!1,null,null,null);a.options.__file="howToContribute.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/203.c2eff4d8.js b/docs/.vuepress/dist/assets/js/203.c2eff4d8.js new file mode 100644 index 00000000..b687d31e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/203.c2eff4d8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[203],{844:function(t,e,r){"use strict";r.r(e);var s=r(0),a=Object(s.a)({},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),r("p",[t._v("NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程以及链之间的交互")]),t._v(" "),r("p",[t._v("NULS于创立之初,即已提出模块化思维与多链并行基本架构,NULS秉承以“链”为核心的发展理念,着力打造核心产品“链工厂”。同时,NULS将通过跨链模块实现链之间的价值流通,打造区块链大生态")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),r("p",[t._v("NULS白皮书是一个权威性的报告,它指出了NULS的目标是什么,以及我们打算如何实现它")]),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NULS_whitepaper_zh_V1.0.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("查看白皮书了解更多"),r("OutboundLink")],1)]),t._v(" "),t._m(5),t._v(" "),r("p",[t._v("NULS黄皮书是白皮书的技术详解版本,它深入研究了NULS的各个方面")]),t._v(" "),r("p",[r("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("查看黄皮书了解更多"),r("OutboundLink")],1)])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls是什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls是什么","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS是什么")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"nuls是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1-nuls的愿景"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-nuls的愿景","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 NULS的愿景")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("为企业级应用提供灵活易用的区块链技术支持")]),this._v(" "),e("li",[this._v("突破区块链技术瓶颈,提供稳定、高效、高性能的网络运行环境")]),this._v(" "),e("li",[this._v("通过降低开发和使用成本,推动区块链商业应用进程")]),this._v(" "),e("li",[this._v("通过分布式网络布局,构建强大信用体系")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_2-白皮书"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-白皮书","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.白皮书")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_3-黄皮书"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-黄皮书","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.黄皮书")])}],!1,null,null,null);a.options.__file="introduction.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/204.1b6a7ee2.js b/docs/.vuepress/dist/assets/js/204.1b6a7ee2.js new file mode 100644 index 00000000..26581ae1 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/204.1b6a7ee2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[204],{842:function(t,r,i){"use strict";i.r(r);var e=i(0),a=Object(e.a)({},function(){var t=this,r=t.$createElement,i=t._self._c||r;return i("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),i("ul",[i("li",[i("p",[i("router-link",{attrs:{to:"/zh/overview/introduction.html"}},[t._v("总览")])],1),t._v(" "),i("p",[t._v("通过该部分文档可帮助对NULS不熟悉的读者了解NULS是什么,可以做什么")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/guide/NULSTransaction.html"}},[t._v("用户操作指南")])],1),t._v(" "),i("p",[t._v("如果你是一个新用户,那这里有你需要的东西,进来看看吧")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/community/toolsGuide.html"}},[t._v("社区")])],1),t._v(" "),i("p",[t._v("区块链项目总是以社区为基础的,从这里你可以了解到关于NULS社区各个方面的知识")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/startNULS/sourceCodeStartNULS.html"}},[t._v("启动NULS")])],1),t._v(" "),i("p",[t._v("想开始使用NULS吗,那就从这里开始吧,该部分文档介绍了如何通过源码启动NULS,如何连接主网和测试网,如何使用节点GUI和节点CLI")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/buildChain/buildPrivateChain.html"}},[t._v("快速搭链")])],1),t._v(" "),i("p",[t._v("如何你想搭建一条私链,那这部分文档应该可以帮助到你")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/NULSInfrastructure/NULS2.0Introduction.html"}},[t._v("NULS2.0")])],1),t._v(" "),i("p",[t._v("模块化设计是什么?NULS2.0是什么?该部分会一一帮你解答这些问题,会详细阐述NULS的设计理念,各个模块的设计细节")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/smartContract/startSmartContract.html"}},[t._v("智能合约")])],1),t._v(" "),i("p",[t._v("想要基于智能合约做DAPP或者其他很酷的事情吗,该部分文档会是你想要的,文档中包含开发者文档,NRC标准,插件,还有一些有趣的合约示例")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/developerTools/sdk.html"}},[t._v("开发者工具")])],1),t._v(" "),i("p",[t._v("NULS一直秉承对开发者友好的理念,因此我们也在不断提供一些工具给到开发者。开发者们都到这里面看看有些什么吧")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/nips/NIPIntroduction.html"}},[t._v("NIPs")])],1),t._v(" "),i("p",[t._v("所有与NULS 相关的提案都在这里,通过该部分你可以详细了解NULS的协议,章程,标准等等。")])]),t._v(" "),i("li",[i("p",[i("router-link",{attrs:{to:"/zh/nulsNav/NULSNav.html"}},[t._v("NULS导航")])],1),t._v(" "),i("p",[t._v("NULS文档库只是NULS的一部分,想要获取更多NULS相关的信息和产品,就到这里面找找入口吧")])])])])},[function(){var t=this.$createElement,r=this._self._c||t;return r("h1",{attrs:{id:"本文档的结构"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#本文档的结构","aria-hidden":"true"}},[this._v("#")]),this._v(" 本文档的结构")])},function(){var t=this.$createElement,r=this._self._c||t;return r("h4",{attrs:{id:"本文档分为八个部分"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#本文档分为八个部分","aria-hidden":"true"}},[this._v("#")]),this._v(" 本文档分为八个部分")])}],!1,null,null,null);a.options.__file="structure.md";r.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/205.84d64836.js b/docs/.vuepress/dist/assets/js/205.84d64836.js new file mode 100644 index 00000000..feddbef2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/205.84d64836.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[205],{794:function(n,w,o){}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/21.db5c56e6.js b/docs/.vuepress/dist/assets/js/21.db5c56e6.js new file mode 100644 index 00000000..98f63354 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/21.db5c56e6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{242:function(t,e,a){t.exports=a.p+"assets/img/account-context.aaa5f026.png"},243:function(t,e,a){t.exports=a.p+"assets/img/account-module.ab4c1b38.png"},244:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApYAAAEPCAIAAAB3ERNLAAAX1ElEQVR4nO3d3W8cZ6HAYf4d0uuqUu/5J3ITCW4CR9WRctubJBKgcpGboIhAdRKilrbHF6mCelqJqomR6QeoYBrapkqNqSFRILRu7Gwat8g6u157PTtf73p2331n7Cd6LuzZ2dnZsePfvrMzs9/a/qYHAHTOt5KvAQDQgIQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDUO7YE08mXwdqSDgA5SS85SQc4DDo53YkOyX7RW7O0rsXl1Y/JwlJOEDn5Qqd/boY4OLXNXef8IFIQsIBOq+qpqUNnnx4faC7M38SDtB5B0p4/ZyTj8JJTsIBOm/KPeHBu08YeOZMwgEOg9Ld4JMfj1a1h9zhbG0m4QDQSRIOAJ0k4QDQSRIOAJ0k4QDQSRIOAJ0k4QDp/XDhxZMXz1c5dfliza0td+7aQvLNe1hJOEB6/dQlXwc6R8IB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCC9WSU8+DGgPir0MJFwgPRmOAqfJM8TJlzpW07CAdKTcBqQcID0pk/4aA95trtVu81Lp2TnzC4tN7Nd8e0h4QDpTZnwXLZrJga/rblX8FbmTMIB0ouU8JqRdO7bqkF88YGqlsn8SThAerFH4TXz18w5yR54EpJwgPRaviN9kmUyfxIOkN5sD2cr7kuvn610zuz00gdKvtGQcID0XJ2NBiQcID0JpwEJB0hPwmlAwgHSk3AakHCA9CScBiQcID0JpwEJB0jv+xfPn6x26vLFmltb7ty1heSb97CScID0jMJpQMIB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCA9CZ+n4qesJl+lZiQcID0JT0jCAWhOwhOScACak/DGhnvCR3LTt8d3lRdn295LeNUSSu9bupz5k3CA9CR8GrnuZr8urWxpwuuXUz9DKhIOkJ6ETyOY3pr5tzOj8NzEqsF9zZLnTMIB0pPwaUyf8Kq961X3lXAAdkn4NGYyCp98OS3p97aEA7SBhE+j5nC2monFA9PqD2fLTk/+lIckHCA9CZ/GnJsq4QDsk/DG5nZ+V0tOJMuScID0ZpLwVtWlxoPNR/e/6H25kX5Nuk7CAdLr0Ch8mhcKX248Wrq5eX154+0PNxc/2LixvPH5lw+TP6PuknCA9I5CwtcfPOrH+1/rj7/e+7e+sbV0c+P+FyrekIQDpDdlwic59LpqYv0Sil80e0v4m8e9/vj78wf7/R7+2+xtvfXHB//ZSv8j6CIJB0gvxnvh2YuQ1J/6fKALlDYbha8/6C1+sPF12b8/3Nq4e39zONvKndWfvXHt2Rcv9zfIyKnLF7Pfdsu5awvxfm0kHCC91iY8+CgT+uvdh39e6fWD/errH164/O5Q/+v+lI8/2/zks43+PG8uv/fc1Vf+9OlH99fvJf+JdIKEA6R36BN+/4uHb3+4WToKX769uXZv89baStQB66Ek4QDpdTHhB2r51uPejeWNzd5Wrt9bjwfvhX/1qHf+tas3Vz9J/oPoFgmHgLUrJ0bH73z79PUGM0DQrA5nKz0GLfftgQ5nq3o7vMFY/B//fPjux5u9r7ay/V6+vbFyZ7AX/dSli73eevIfRLdIOEfZ7ReOP3lmcaKZh52uKXRwBqgxt5PK0l7+Ze3eZn8s/sHKw1ufbf5ltf/1g2G/57kFDhMJ5whbvXK8H93jV9Ymn7mm0MEZ6J7rZ+b1M51PwNpwidCvHvVW7w6OX+vHu9fbPyNcwhuQcI6u3XHzEydeWJ1gfgk/imIlvHiFUQGzBRqQcI6s62eOX3nh9MRvYEv4UTT7hFddYVTAGm+B5PsVEpJwjqrFs8ev3N7t7hNnl8rmWTq9fzjPt4+fKBa6cobFs7sTB0seZGD8hcLgPfi9GXL7APZvGsq8VV9z09jzyjx05oF23y/YXZnSFy5jx+Vlt0nVMgvbrXIJhVsz2230RkbFZpniGR14mfvrnN/afYNfmOl+62quMCrh02yBSAlv/ysDCedo6v+BHv5B3/1LXcjhzvBr/49+McOhGXZeHGQrvpuH8cH68EXA6NH73+aWMMlNefsPvbt6e4fanT2zl6jh42abNFj+KGA7hRs7SqBymdcnXMJw/t11Lh6FULtZmj2jpsu8nl/ChEdLhNRfYfS/fn4h9X+KxCS8AQnnSOr/aR79pS7mqvjn/ptQDwozDF8c7CVt5+vBQ2QnFu81KP1YhIa7CgI3FRUeJfsaonptM89ouITsHoKKZRbG0BVLyM087P3o1vrN0vwZNVlm8YXFjBJef4XR0y+/WnORzk5fYXTClf/BL37aeNvmzpfLTs9OKZ50V7zpWOHUu2OTnX23XdilP4eDByWco6g/3srUNzee7pXvXc8GIDjDQLEQpUnIpmh3KF82vK65qWgGcRpPbPUyK96DKCwhP/PYrYHN0ugZNV5msfozSnj9FUbPvboY9Xe+/WYyCj8WukbN5BO3y0bhNXMWS1+znFmRcI6g/XdPx96UrR2XjxU6OMNAWcL33oLNP/T4/ueS927rb8qbLuGFPcx1yyxNeNkS6nakBzdLg2fUeJnREl5/hdEf/u//pf5/kdj0Ca8aLhcHx1Uzly62akow9lXj+BmScI6e4i7o3Kg6csKDScgeJZdb1ZqbMpolfHdP+HBio1F4/RLGX4Vk33IOb5aGCW+yzGgJr7/C6H//z/NRftu7Y8qE14+Di9NLbw0uodl4PR4J56gZHciWm5jZTV36h7u4I71BwhtcTKZ6oFy9nAYJz7+bcPCEB5dw/UzVXvfwZpnJjvTJlhkt4du1Vxh1RPp8dqQHv63f0z79LvfZknCOmP4f5bK/yLtHI+/eVDyYK1fo4Ay98oRXHADfr91gSmH3QH+tdpdQc1OJGYxZD5zw0BKCK1y5WZo9o8bLjJnw7eorjEr4lOeFj8bWxbeog0Pkmj3epYP7qkcJzjlzEs6RUvi7P7L39u1uKfMHrO2dM5Yb5NXMUPVW8e4dx9q2+6DDCo6/CAjfVPU06w/QKx2z7s1Qdt26wjJzTzC4hLI3p/efQs1mafaMGiyz5EcWOGSvmdIrjEr4PLfAfPZyz4GEc1TkritSeqGVY1XXDOn/Ed9rfGZgVz3D6bNlCxwZO55uLGM714c5ln+g2ptyxkvZny33xHNTcmdF76/S6JC0/soXlll8lMASRs+ipuJVm6XpMzrQMkuf0fYcP4ZOwuewBeYwLJ4zCQfmoHT/R/VOkaNHwp95/sLW443kq9EtEg5Et/NGePlRhK4qPyThz119ZeXOavLV6BYJB+IrO8WroutHlITfuPn+rxZ/k3w1ukXCgbkoHM5mF3qWhPedf+3q1XcWe7315GvSFRIOkJ6ED73+/junLuWvqd7pS8RP7ty1hYNuLgkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmnAQkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmfp+JHhSZfpWYknA5LfikGCJr8lzn5f6gjS8LhYNb++ffffbT8698vTSP5X2cImvB/xORzMnMSDhO5+++7P3vjWvHP3A8XXvzlW29IOIfPuWsLE835cwlvKHft/dz07fFd5aUfGZ6drbiE0vu25KPHJZz56Q+7n3n+QvbP1umXr/zp048aLzD5X2cImvyXOfn/0O7KdTf7dWllSxNev5z6GVKRcObkxs33c3/a+sPurccbyVcM2kDCpxFMb83825lReG5i1eC+ZslzJuHMw91/382Nv30wMGRJ+DSmT3jV3vWq+0o4R0ju7cDTL18x/oYsCZ/GTEbhky+nJf3elnDmoF/r3C70W2srydcKWkXCp1FzOFvNxOKBafWHs2WnJ3/KQxJOdCt3VrP9fub5C8lXCdpGwqcx56ZKOEfIm8vvZRP+3NVXkq8StI2ENza387taciJZloQTXe4E7oWl68lXCdrmSCX8weaj+1/0vtxIvyZdJ+FEl0t4/9vkqwRt06GETzMM/XLj0dLNzevLG29/uLn4wcaN5Y3Pv3yY/Bl1l4QTnYRD0FFI+PqDR/14/2v98dd7/9Y3tpZubtz/QsUbknCik3AImj7hwauBbpcdj1119+K96u8e9M3jXn/8/fmD/X4P/232tt7644P/bKX/EXSRhBOdhEPQlAmvvxpo4+uGzvCUqvUHvcUPNr4u+/eHWxt3728OZ1u5s/qzN649++Ll7B+NU5cvJr9QbmPnri3E+7WRcKKTcAiaPuE1p0Hn5ix+faBLozRL+F/vPvzzSq8f7Fdf//DC5XeH+l/3p3z82eYnnw2u9fTm8nvPXX3lT59+dH/9XvKfSCdIONFJOATNcBSem96ShN//4uHbH26WjsKXb2+u3du8tbYSdcB6KEk40Uk4BLV2R3rNYx2o5VuPezeWNzZ7W7l+bz0evBf+1aPe+deu3lz9JPkPolsknOgkHIIiHc5WNX3yw9mq3g5vMBb/xz8fvvvxZu+rrWy/l29vrNwZ7EU/delir7ee/AfRLRJOdBIOQXM7qSztxcXW7m32x+IfrDy89dnmX1b7Xz8Y9nueW+AwkXCik3AImk/A2nCJ0K8e9VbvDo5f68e719s/I1zCG5BwopNwCBIwW6ABCSc6CYcgAWu8BZLvV0hIwolOwiFIwqfZApES3v5XBhJOdBIOQRIu4Q10POFLP3nq6e+//LfUq0EtCYeg+ot0dvoKoxOu/A9+8dPGW6/09LnilOJ146vOtZvyYvJVc85ctxP+9o++89TT3/nuS58mXxNqSDgEGYXPZBTe7CI2k1/ZZvKLyQevkDMTXU7431767tODhD/1vZf+nnxlqCbhECTh0ye8arhcHBxXzVy62KopwdjXXBtnVjqc8L+/9P2nhgl/+js/Xkq/Pkl9+vL32vtqRsIhSMKnTHj9OLg4fZLLv0+Z8DlstO4mfBCt735vr+I/+m3q9Um/NSQcukvC57MjPfjtlFebn/DWWelswgd70X/y9mhfev/r5KuUkoRDt0l44y1QPAyt9KbcXUqXMMnV4Ce/mLzD2SoNDmQbjLz30nXU96VLOHSbhM9zC7T/bLEJdTThv/3xqNmD88omq9dozvr5m81Wcm7b/suL8eWMTx8/on54jH3+Pf6xxxp/oPxqTLDmcyfhECThc9gCbbhE/Gx1M+H9bu33aZDzioiO7M6zH8vdPfC5u0w2297e+0x6qwfB1a8wRrUunBQ3ekb9hOd7H3i50JpsZ0k4BEn4M89f2Hq8kXw1uqWTCe/Hr3TkWnGCeCHM32ROSNs/Dm6K2QaqIhque3G1swfblw/f84fvSTh0m4Q/d/WVlTuryVejWzqY8EFWK3YmlwVsL/Bjx7vtN3LvLtPMlluN8Xflp0p45QB98hcKLSDhECThN26+/6vF3yRfjW7pXsIHeasKWPGgtpJh9Nj03UZOOduu0r5OlfDCMXoHH+u3gIRDkIT3nX/t6tV3Fnu99eRr0hWdS/jO6eA1e55zca3OZITZRq8ksmN0CZdwCJPwodfff+fUpfw11Tt9ifjJnbu2cNDN1bWE758IXqV8T3h9m2c02yjh2f38Ei7hECbhNNCxhO+dDl5xUyF7Et4GEg5BEk4D3Up45nTwotKD2uxIbwEJhyAJp4FOJXzQvJoLqZadIB44AG2ms5XfKuESDmESTgMdSvhOpWoTW3aCeOnO7X2DWI5dqLV+tgYnle3dZT4Jb+W14iUcgiScBrqT8J3gTbije6xkNUPn7LB+wtkqL+2ytw+gcPe9HudfHNRckebgCQ9e3yYlCYcgCaeBjiS8tM11s5W/I56duJPJ8aVNOFvNBVYnPV985039l/ZeNFT3uLDAyqvJjl3QrWKeVCQcgiScBtqf8P0LhmeV76wu2k9g3YeLZEw4W/HzRer3YOeexc7M4yfIDR+orMTDJ1t6sfSxBx3fCC3aoy7hENSGhJd+/sch+1yQQ6b9CafzJByC2pDwolG8VbydJJzoJByCWp5w2knCiU7CIWiahOf2dWe/LX5C9ujbSWbLTc9+e/g+e7uLJJzoJByCphyF5+pbM3G7+u3t4sT6KfqdnIQTnYRDUKSEF0fS29XpnSTho4n63QYSTnQSDkHTvxdeLOvkqa6aLuEtJ+FEJ+EQFDvhMxyF10xnziSc6CQcgmZyRHppg2uOUyudWLofPvhAJCHhRCfhENTOk8qqSHhLSDjRSTgEdSLhTiRrGwknOgmHoE4knLaRcKKTcAiScBqQcKKTcAiScBqQcKKTcAiScBqQcKKTcAjK/h8pOnX5Yv0MbXbu2kLyzXtYSTjRSTgEGYXTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTQMOE5/4ow1BpniUcgk5KOAcn4cyShEMzJyWcg5NwZunZX10KziPhUHRy6oSPPsx7+Hne2Q/2zn3Id/Fjv4v3Ki7Kx4S3kIQzS0bh0MzJ6RKe6/FBJ24XMl8zJ+0h4cyShEMzJ+eY8Nx4vThzbqJ+t5Yj0olOwiFongkPLiE3UcJbS8KJTsIhKGrCc++L19+rZsm0jYQTnYRD0JQJ3y4czpaduF2oeNUBbsVgS3ibSTjRSTgETZ/wkdlGV8LbTMKJTsIhaFYJn9UJYE4k6wQJJzoJh6AZjsI5OiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgk5dulhz3cNTl+tubY9z1xaSb8kjRcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOi6lvDrZ5548tiObx+/spZ+fQDKSTjRtTjht184/uSZxbKbFs/mE7565Xh/yhMnXlhNvtoAAxJOdO1N+LDK5UPtwVh87KZh1J84u5R8tQF2SDjRtTbha1dOHKscWBcSDtAyEk50bU349TPHr7xweuc979PXS26VcKDdJJzoWprwxbPHr9zee4e7uHt8LOFLp/cOcBufcziOL71p+Eb76Na+8jfdAZqScKJrZcL7fR3uP98NbaGvhVF4Ifb9ru9/Wzj8bXDraHC/c18JB2ZLwomujQnvN3XU1+LB5wPFHemD2GcSnmv/8NbR2+qDuw9G+aO7Dwf9yZ84cIhIONG1MOFrV05kxsQ7tc4f1BZMeN7OoHws4XaeA1FJONG1L+H7F2/JGj+o7SAJ39lPnj+4fWdwf6w4HWBGJJzoWpfw4j7tkoPaJkn47r704Wzjo/Bdo+PgjuX2qwNMTcKJrmUJHx3IlpuY2+8dTHh+93tpwnfVXUMGoCEJJ7p2Jbxf07KU7l7mZf+mUMJLD0EfJbww0O8v35XdgNmScKJrU8KrL9iy9372XnqHg+zCrvVRpMf3vecv9DYM/P6b64P825EOzJaEE11LEp69DEuxr8Wj28YuyZI5Nm20vz27wNFVYnaH5oOx/onjrusCxCThRNeShAMcMhJOdBIOEIOEE52EA8Qg4UQn4QAxSDjRSThADBJOdBIOEIOEE10u4VffWUy+SgCHgIQT3evvv5NN+PnXriZfJYBDQMKJ7ubqJ9mEn7p0MfkqARwCEk50vd56NuF999fvJV8rgK6TcObh2Rcv25cOMFsSzjzk9qX3/e6j5eRrBdBpEs6c/PKtN3LviPe7nnytALpLwpmTXm/9/GtXc2Pxftf70xsvM7e0wyr5zw5oJwlnrn730XJ//J1L1LlrCwtL13/9+6WDSh5XCQcSknASuLW28ubyew2aLeEAIxJOhyWPq4QDCUk4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHTS/wMENPtauFzXDwAAAABJRU5ErkJggg=="},245:function(t,e,a){t.exports=a.p+"assets/img/account-create-address.23098bf5.png"},246:function(t,e,a){t.exports=a.p+"assets/img/account-create-offline.71a206b9.png"},247:function(t,e,a){t.exports=a.p+"assets/img/account-remove-address.e8b7a30d.png"},248:function(t,e,a){t.exports=a.p+"assets/img/account-import-prikey.e1a987ac.png"},249:function(t,e,a){t.exports=a.p+"assets/img/account-import-keystore.5886df1e.png"},250:function(t,e,a){t.exports=a.p+"assets/img/account-export-prikey.49b3d4d1.png"},251:function(t,e,a){t.exports=a.p+"assets/img/account-export-keystore.a0ab3ab5.png"},897:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"account-module-design-document"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Account module design document")]),t._v(" "),s("p",[t._v("[TOC]")]),t._v(" "),s("h2",{attrs:{id:"_1、general-description"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1、General description")]),t._v(" "),s("h3",{attrs:{id:"_1-1-module-overview"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module overview")]),t._v(" "),s("h4",{attrs:{id:"_1-1-1-why-have-a-account-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-have-a-account-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why have a Account Module")]),t._v(" "),s("ul",[s("li",[t._v("Used to manage account generation, security and storage, and access to information.")]),t._v(" "),s("li",[t._v("User saves account address, public and private key pair, and verification data signature.")])]),t._v(" "),s("h4",{attrs:{id:"_1-1-2-what-to-do-with-account-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-to-do-with-account-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 What to do with Account Module")]),t._v(" "),s("p",[t._v("The Account Module is a basic module that provides information about the various functions of the account.It mainly supports the functions of account generation, security and storage, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on RPC. The interface makes the account more practical and personalized. The account is the basic module and the carrier of the user data.")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Account generation")]),t._v(" "),s("p",[t._v("Create an account, import an account.")])]),t._v(" "),s("li",[s("p",[t._v("Account security and storage")]),t._v(" "),s("p",[t._v("Backup of account, setting account password, modifying account password, removing account.")])]),t._v(" "),s("li",[s("p",[t._v("Access to account information")]),t._v(" "),s("p",[t._v("Query singel account information, query multiple account information, query account address, query account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Other usability and personalization features")]),t._v(" "),s("p",[t._v("Set account alias, set account remark, verify account encryption, sign, verify account address format, verify account password is correct, etc.")])])]),t._v(" "),s("h4",{attrs:{id:"_1-1-3-positioning-of-the-account-module-in-the-system"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-the-account-module-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 Positioning of the account module in the system")]),t._v(" "),s("p",[s("img",{attrs:{src:a(242),alt:""}})]),t._v(" "),s("p",[t._v("The account is the underlying module that is dependent on the ledger, consensus, transaction, kernel, event bus, and community governance modules.")]),t._v(" "),s("p",[t._v("1、Account module depends on the ledger module")]),t._v(" "),s("pre",[s("code",[t._v("The ledger module needs to handle local transactions and relies on account information.\n\nThe account module needs to create an alias transaction, which requires the ledger module to pay the fee.\n\nAccount balance inquiry, need to rely on ledger module.\n")])]),t._v(" "),s("p",[t._v("2、Account module depends on kernel module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Report module information and share data operations.\n")])])]),s("p",[t._v("3、Account module depends on network module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Receive and send data through a network module.\n")])])]),s("p",[t._v("4、Account module depends on event bus module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Create an account, delete an account,change a password event,send a message through the event bus module.\nThe account module is not strongly dependent on the event bus module,because even if the event fails to send,it does not affect the normal business process.\n")])])]),s("p",[t._v("5、Consensus module depends on account module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Consensus requires account information for packaging blocks.\n")])])]),s("p",[t._v("6、Transaction management module depends on account module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("The transaction management module needs to verify the transaction,relying on the address function in the account to verify whether the address is legal.\n")])])]),s("p",[t._v("7、Community Governance Module depends on account Module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Community governance requires account signature\n")])])]),s("h3",{attrs:{id:"_1-2-architecture-diagram"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Architecture diagram")]),t._v(" "),s("p",[s("img",{attrs:{src:a(243),alt:""}})]),t._v(" "),s("p",[t._v("1.API: Provides an interface layer externally, providing operations such as creating, backing up, and setting aliases for accounts.")]),t._v(" "),s("p",[t._v("2.Business logic layer: the function of defining accounts, account addresses, and aliases.")]),t._v(" "),s("p",[t._v("3.Data persistence layer: save account, alias data.")]),t._v(" "),s("h2",{attrs:{id:"_2、function-design"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2、function-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2、Function design")]),t._v(" "),s("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional architecture diagram")]),t._v(" "),s("p",[s("img",{attrs:{src:a(244),alt:""}})]),t._v(" "),s("h3",{attrs:{id:"_2-2-module-service"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module service")]),t._v(" "),s("h4",{attrs:{id:"_2-2-1-create-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-create-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 create account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a user's account, including the account's address, public key, private key creation, account information saved to the database, and create an account to notify other nodes through the event.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(245),alt:""}})]),t._v(" "),s("p",[t._v("Create Address: Create a satellite chain standard account address")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1.Generate a random public-private key pair\n2.Get chainId and account type\n3.Calculate hash160 based on public key\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): address=original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)\n7.Encrypt the private key according to the password and delete the plaintext of the private key\n8.Store account information\n9.Add account to cache\n10.Send Create Account Event\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates one or more accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_createAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])]),s("ul",[s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("count")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("To create an account number, constraints:1-100.")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account initial password, Can be empty")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["address","",""]\n }\n}\n')])])]),s("ul",[s("li",[t._v("Return field description")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address list")])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus: Send Create Account Event")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-2-create-an-offline-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-create-an-offline-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 Create an offline account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a user's offline account, including the account's address, public key, private key creation, account information is not saved to the database")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(246),alt:""}})]),t._v(" "),s("p",[t._v("Create Address: Create a satellite chain standard account address")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1.Generate a random public-private key pair\n2.Get chainId and account type\n3.Calculate hash160 based on public key\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): address=original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)\n7.Encrypt the private key according to the password and delete the plaintext of the private key\n8.Return account information, not saved to the database\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createOfflineAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates one or more offline accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_createOfflineAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("count")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("To create an account number, constraints:1-100.")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account initial password, Can be empty")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["address","",""]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address list")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-3-create-a-multi-sign-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-multi-sign-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 Create a multi-sign account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a multi-signature account, including the address of the account, the creation of the script, and save the multi-signed account information to the database.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify the signature public key list, and verify that the minimum number of signatures is correct.\n2. create a multi-signature script.\n3. create a multi-signature type account address according to the multi-sign script.\n4. save the multi-signature account.\n5. return multi-signed account information.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates a multi-signature account.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "createMultiAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("pubKeys")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("jsonArray")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Minimum number of signatures, at least a few public key verifications are required")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "minSigns":"",\n "pubKeys":[{\n "pubKey":"",\n "address":""\n },{}\n ]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("minSigns")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Minimum signature number")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKeys")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key list")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("--pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("--address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("no")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-4-remove-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-remove-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 Remove account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Remove the user's local account, including deleting the address of the local account, and notifying the other nodes through the event")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(247),alt:""}})]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account address format is correct.\n2. Verify that the account exists\n3. Verify that the account is encrypted. If the account is encrypted and the account is unlocked, you need to verify the password.\n3.1. Obtain an unencrypted private key according to the account's encrypted private key and password.\n3.2, get the public key according to the unencrypted private key\n3.3. Compare the decrypted public key with the queried public key\n4, delete the data\n4.1. Delete local account information\n4.2. Delete account cache information\n5. send remove account events\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_removeAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to remove the account.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_removeAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Account address to delete")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("删除是否成功")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Remove Account Event.")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-5-import-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-import-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 Import account - private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Import accounts based on private keys, generate accounts based on private keys, and import account book data.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(248),alt:""}})]),t._v(" "),s("p",[t._v("Import account information based on private key")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Generate a public-private key pair based on the private key.\n2. get the chainId and account type.\n3. calculate hash160 according to Public key.\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Base58(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Base58(chainId)\n7. Encrypt the private key according to the password and delete the plaintext of the private key.\n8. storage account information.\n9. add the account to the cache.\n10. If you send an import account event: If the account already exists, the new event will not be released, only the update will be made.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importAccountByPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("The interface is imported into the account based on the account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importAccountByPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account private key")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("overwrite")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("Whether to overwrite when the account exists")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Import Account Event when the account does not exist.")]),t._v(" "),s("p",[t._v("Account Book: Import Account leger(confirmed transaction)")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-6-import-account-keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-import-account-keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 Import account-keystore")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("According to the keystore import account, according to the keystore parsing and decrypting to get the private key and generate an account, and import the account book data")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(249),alt:""}})]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the keystore and password match.\n2. decrypt the private key in the keystore according to the password.\n3. Generate public and private based on the private key.\n4. get the chainId and account type.\n5. spliced byte array to form an address.\n6. generate an address string.\n7. Verify that the address string and the address in the keystore are consistent.\n8. storage account information.\n9. send import account event: the account already exists, do not post new events, only do the coverage update.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importAccountByKeystore interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to import accounts keystore")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importAccountByKeystore",\n "minVersion":1.0,\n "params": [\n 1234,\n "HEX",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("keyStore")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Imported keyStore hex code")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("overwrite")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("Whether to overwrite when the account exists")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Import Account Event when the account does not exist")]),t._v(" "),s("p",[t._v("Account Book: Import Account leger(confirmed transaction)")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-7-import-multi-signed-accounts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-import-multi-signed-accounts","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 Import multi-signed accounts")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Import a multi-signed account related to the local address, including the address of the account, the creation of the script, and save the multi-signed account information to the database.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the multi-sign address, the signature public key list, and the minimum number of verified signatures are correct.\n2. create a multi-signature script.\n3. Create an account address of multiple signature types according to the multi-signed script.\n4. Determine whether the imported multi-sign address is the same as the address generated by the script. If it is not the same, it prompts an import error.\n5. save multi-signed account information, including: address, public key list, minimum number of verification signatures.\n6. return to multi-signal address.\n\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to import multi-signature accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importMultiSigAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("pubkeys")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("jsonArray")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Minimum signature number, At least a few Public key verifications are required")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-sign address")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-8-export-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-export-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 Export Account private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Export Account private key hex code")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(250),alt:""}})]),t._v(" "),s("p",[t._v("Export Account private key")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the password is correct.\n2. decrypt the private key, generate a Hex string\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_exportAccountPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to export the Account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importMultiSigAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n \t"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-9-export-account-keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-export-account-keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 Export account KeyStore")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Export account keystore")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(251),alt:""}})]),t._v(" "),s("p",[t._v("Export account keystore")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the password is correct.\n2. generate a keystore file.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_exportAccountKeyStore interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to export the account keystore.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_exportAccountKeyStore",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "encryptedPrivateKey":"",\n "pubKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrivateKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-10-query-all-accounts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-query-all-accounts","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.10 Query all accounts")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query all accounts")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. query all account information\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAccountList interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query all accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_getAccountList",\n "minVersion":1.0,\n "params":[\n 1234\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":[{\n \t"address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n },{}]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("List")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account list collection")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex code")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key hex code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-11-get-an-account-based-on-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-get-an-account-based-on-address","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.11 Get an account based on address")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get an account based on address")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address exists.\n2. get an account based on the address\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAccountByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get an account based on the address.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAccountByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex code")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key hex code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-12-query-the-list-of-account-addresses"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-query-the-list-of-account-addresses","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.12 Query the list of Account addresses")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query the list of Account addresses")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Check whether the paging parameter is legal. The number of pages and the size of the page cannot be less than 0, and must be an integer.\n2. Query all accounts.\n3. Filter accounts that meet the paging conditions.\n4. Return only the address list of the account.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAddressList interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query the list of Account addresses.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAddressList",\n "minVersion":1.0,\n "params": [\n 1234,\n 0,\n 10\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("pageNumber")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("pageNumber")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("pageSize")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("pageSize")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["","",""]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Address list collection")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-13-get-an-address-based-on-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-get-an-address-based-on-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.13 Get an address based on alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get an address based on alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. query whether the existence of alias\n2. return the Account address used to set the alias, and use Base58 to encode the Account address\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAddressByAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get the address based on alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAddressList",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address, Base58 code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-14-query-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-query-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.14 Query Account private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query Account private key")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Check whether the address is correct, use Base58 decoding, and check the Chain ID, address type, and check digit respectively.\n2. Verify that the account exists.\n3. If the account is over-densified (with password) and is not unlocked, decrypt it by AES and verify that the password is correct, and obtain the unencrypted private key.\n4. use hexadecimal encoding, and return to Account private key.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getPriKeyByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query the Account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getPriKeyByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-15query-all-account-private-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15query-all-account-private-keys","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.15Query all Account private keys")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query all Account private keys")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the password format is correct and the password can be empty.\n2. get all local accounts.\n3. The encryption information of the local account must be the same. If the parameter password is not empty, the passwords of all accounts must be the same. If the parameter password is empty, all accounts cannot be set. Otherwise, the error is displayed.\n4. If the account is encrypted, the unencrypted private key is reversed by the password, otherwise the private key is obtained without encryption.\n5. Add all private keys to the collection and return.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAllPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query all Account private keys.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAllPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "list":["",""]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key collection")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-16-set-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-set-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.16 set password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("set password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. Verify that the password has been set.\n3. set Account password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object, password setting is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-17-set-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-set-offline-account-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.17 Set offline Account password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set offline Account password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address is correct.\n2. Verify that the private key is correct.\n3. create according to the private key.\n4. set offline Account password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setOfflineAccountPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the offline Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account private key")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-18-change-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-change-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.18 change Password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Request Body")])]),t._v(" "),s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("change Password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. verify the correctness of the old password.\n2. Update the private key ciphertext.\n3. send a password change event.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_updatePassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to modify the Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_updatePassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "111111"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("newPassword")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account new password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the password modification is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-19-modify-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-modify-offline-account-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.19 Modify offline Account password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Modify offline Account password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address is correct.\n2. Generate an offline account based on address, private key, and new password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_updateOfflineAccountPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to modify the offline Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_updateOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n "111111"\n ]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Private key")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("4")]),t._v(" "),s("td",[t._v("newPassword")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account new password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-20-verify-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-verify-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.20 verify password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("verify password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the password is correct.\n2. return verification results.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_validationPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify the password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_validationPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the password correct")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-21-verify-that-the-account-is-encrypted"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-verify-that-the-account-is-encrypted","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.21 Verify that the account is encrypted")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Verify that the account is encrypted")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. Verify that the account is encrypted.\n3. return verification results.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_isEncrypted interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify that the account is encrypted.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_isEncrypted",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the account is encrypted")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-22-set-up-an-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-set-up-an-account-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.22 Set up an account alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set up an account alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that alias is legal\n2. generate settings alias transaction\n3. call ledger to fill transaction fee information\n4. broadcast transactions\n5. After the transaction is confirmed, the alias will be saved to the database, and address and alias will be stored as keys respectively. That is, the alias data will store two data, mainly for the convenience of querying according to address and alias.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Alias transaction hash")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Account module: setting an alias requires a fee")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-23-get-set-alias-fee"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-get-set-alias-fee","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.23 Get set alias fee")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get set alias fee")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the alias is correct.\n2. calculate the fees required for the alias setting.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAliasFee interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get the set alias fee.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAliasFee",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "fee":"100",\n "maxAmount":"10000"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("fee")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Alias transaction fee")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("maxAmount")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Maximum transaction fee")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-3-24-query-alias-based-on-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-query-alias-based-on-address","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.24 Query alias based on address")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query alias based on address")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. query the account corresponding alias from the database\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAliasByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query aliases based on the address.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAliasByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "alias":""\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account alias")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-25-verify-that-alias-is-available"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-verify-that-alias-is-available","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.25 Verify that alias is available")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Verify that alias is available")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Query whether the alias already exists. If it exists, it is not available. Otherwise, it is available.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_isAliasUsable interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify if alias is available.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_isAliasUsable",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is alias available")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-26-set-account-remark"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-set-account-remark","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.26 Set account remark")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set account remark")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. modify the remarks information and save\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setRemark interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set account remark.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setRemark",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n "remark1"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account remark")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the setting is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-27-set-up-multi-sign-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-set-up-multi-sign-account-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.27 Set up multi-sign account alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set up multi-sign account alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the Account address, alias, Account password, and signature address parameters are legal.\n2. Query whether the Account address and the signature address exist.\n3. generate a set of multi-sign account alias trading.\n4, call ledger to fill transaction fee information.\n5. Sign the transaction using a signed account.\n6. Save the unconfirmed transaction to the local account when the signed number is equal to the minimum number of signatures.\n7. Broadcast the transaction.\n8. return the transaction hash.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setMultiSigAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the multi-sign account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setMultiSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("signAddress")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature address")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("4")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-signalias alias transactionhash")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Account module: setting a multi-signal alias requires a fee.")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-28-remove-multi-signed-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-remove-multi-signed-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.28 Remove multi-signed account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Remove multi-signed account")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the Account address is correct.\n2. delete the multi-signed account in the database.\n3. return to delete is successful.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_removeMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to remove multi-signed accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setMutilSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the removal was successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-29-account-all-transaction-verification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-account-all-transaction-verification","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.29 Account all transaction verification")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("account module all transaction verification interface, currently only alias transaction")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Is the transaction list empty\n2. loop through all transaction lists, processing for alias transactions\n3. Check if the same alias is set in the current transaction list.\n4. Check whether there is an account duplicate setting alias in the current transaction list.\n5. If there is no conflict in the transaction list, the verification is passed.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_accountTxValidate interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to batch verify all transactions in the account module.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_accountTxValidate",\n "minVersion":1.0,\n "params": [chianId, ["txHex","txHex","txHex", ...]]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("Alias transaction serialization data array")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "list":["txHex", "txHex", "txHex", ...]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Illegal transaction serialization data array")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-30-alias-transaction-verification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-30-alias-transaction-verification","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.30 Alias transaction verification")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("alias transaction verification interface")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. verify the alias format\n3. Verify that the alias is already occupied.\n4. Verify that the account has an alias set.\n5. verify the coinData input and output\n6. verify the script signature format\n7. Verify that the signature contains the address of the alias. \nIf it is not included, it is a malicious foul. \nOtherwise, the verification is passed.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxValidate interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used for a single alias transaction.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxValidate",\n "minVersion":1.0,\n "params": [chainId,"txHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias transaction serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the verification is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-31-alias-transaction-submit"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-31-alias-transaction-submit","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.31 Alias transaction submit")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Alias transaction submit, save alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. save the alias alias to the database\n3. set the alias to account and save to the database\n4. Re-cache the modified account\n5. return the alias save is successful\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxCommit interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to save aliases.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxCommit",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Alias transaction serialization data")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("secondaryDataHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block header serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),s("p",[t._v("secondaryDataHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the alias transaction saved successfully")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-32-alias-transaction-rollback"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-32-alias-transaction-rollback","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.32 Alias transaction rollback")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Alias transaction rollback interface")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. delete the alias object data from the database\n3. take the corresponding account to clear the alias, re-sent the database\n4. re-cache account\n5. return the alias rollback is successful\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxRollback interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to roll back an alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxRollback",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Alias transaction serialization data")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("secondaryDataHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block header serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),s("p",[t._v("secondaryDataHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the alias transaction rollback successful")])])])])])])])]),t._v(" "),s("h3",{attrs:{id:"_2-3-module-internal-function"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 Module internal function")]),t._v(" "),s("h2",{attrs:{id:"_3、event-description"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 3、Event description")]),t._v(" "),s("h3",{attrs:{id:"_3-1-published-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 Published event")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("create Account")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_createAccount"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n address:''\n isEncrypted:true //Is the password set\n}\n")])])])]),t._v(" "),s("li",[s("p",[t._v("remove account")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_removeAccount"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n\taddress:''\n}\n")])])])]),t._v(" "),s("li",[s("p",[t._v("change password")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_updatePassword"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n\taddress:''\n}\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"_3-2-subscribed-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 Subscribed event")]),t._v(" "),s("p",[t._v("no")]),t._v(" "),s("h2",{attrs:{id:"_4、protocol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4、protocol")]),t._v(" "),s("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 Network communication protocol")]),t._v(" "),s("ul",[s("li",[t._v("no")])]),t._v(" "),s("h3",{attrs:{id:"_4-2-transaction-agreement"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 Transaction agreement")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Set alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("protocol")]),t._v(" "),s("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("type: n //Set the type of alias transaction\ntxData:{\n address: //VarByte Set the address of alias\n alias: //VarByte Array of bytes converted into an alias string, decoded with UTF-8\n}\n")])])]),s("ul",[s("li",[t._v("Alias transaction parameters")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Len")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Data Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("24")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Set the address of alias")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Array of bytes converted into an alias string, decoded with UTF-8")])])])]),t._v(" "),s("ul",[s("li",[t._v("Validator")])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. alias format legality verification.\n2. the address must be the satellite chain address, and an address can only be set to an alias.\n3. burn a token unit.\n4. Transaction fee.\n5. signature: set address, input, signature verification.\n")])])]),s("ul",[s("li",[t._v("processor")])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. the asset processor.\n2. store alias data.\n3. Update local account information.\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"_5、module-configuration-item"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration-item","aria-hidden":"true"}},[t._v("#")]),t._v(" 5、Module configuration item")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("server.ip:0.0.0.0 //Native ip, used to provide services to other modules\nserver.port:8080 //Service port\n")])])]),s("h2",{attrs:{id:"_6、java-specific-design"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 6、Java-specific design")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Account Object design")]),t._v(" "),s("p",[t._v("The key used when the table is stored:")]),t._v(" "),s("p",[t._v("NULS system:chainId+type+hash160")]),t._v(" "),s("p",[t._v("non-NULS system:chainId+length+address")])])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("Field name")])]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("type")])]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("short")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address(Base58(address)+Base58(chainId))")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("status")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account Status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key - not encrypted")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("extend")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Extended data")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("remark")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("ramark")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("create time")])])])]),t._v(" "),s("ul",[s("li",[t._v("Address object design (not persistent storage)")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("addressType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Address type")])]),t._v(" "),s("tr",[s("td",[t._v("hash160")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Public key hash")])]),t._v(" "),s("tr",[s("td",[t._v("addressBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Address byte array")])])])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Alias object design")]),t._v(" "),s("p",[t._v("The key used when the table is stored:")]),t._v(" "),s("p",[t._v("Address and alias are stored as keys respectively, and alias data is stored in two copies.")]),t._v(" "),s("p",[t._v("Need to create different alias tables according to different chains.")])])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("address")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account alias")])])])]),t._v(" "),s("ul",[s("li",[t._v("MultiSigAccount object design")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("address")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("pubKeyList")]),t._v(" "),s("td",[t._v("List")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("Minimum number of signatures")])])])]),t._v(" "),s("h2",{attrs:{id:""}},[s("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[t._v("#")])]),t._v(" "),s("h2",{attrs:{id:"_7、to-add-on"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7、to-add-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 7、to add on")])])}],i=a(0),n=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},s,!1,null,null,null);n.options.__file="accountModuleDesign.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/22.498863f8.js b/docs/.vuepress/dist/assets/js/22.498863f8.js new file mode 100644 index 00000000..9bb19fde --- /dev/null +++ b/docs/.vuepress/dist/assets/js/22.498863f8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{351:function(t,e,a){t.exports=a.p+"assets/img/account-context.aaa5f026.png"},352:function(t,e,a){t.exports=a.p+"assets/img/account-module.ab4c1b38.png"},353:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApYAAAEPCAIAAAB3ERNLAAAX1ElEQVR4nO3d3W8cZ6HAYf4d0uuqUu/5J3ITCW4CR9WRctubJBKgcpGboIhAdRKilrbHF6mCelqJqomR6QeoYBrapkqNqSFRILRu7Gwat8g6u157PTtf73p2331n7Cd6LuzZ2dnZsePfvrMzs9/a/qYHAHTOt5KvAQDQgIQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDUO7YE08mXwdqSDgA5SS85SQc4DDo53YkOyX7RW7O0rsXl1Y/JwlJOEDn5Qqd/boY4OLXNXef8IFIQsIBOq+qpqUNnnx4faC7M38SDtB5B0p4/ZyTj8JJTsIBOm/KPeHBu08YeOZMwgEOg9Ld4JMfj1a1h9zhbG0m4QDQSRIOAJ0k4QDQSRIOAJ0k4QDQSRIOAJ0k4QDp/XDhxZMXz1c5dfliza0td+7aQvLNe1hJOEB6/dQlXwc6R8IB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCC9WSU8+DGgPir0MJFwgPRmOAqfJM8TJlzpW07CAdKTcBqQcID0pk/4aA95trtVu81Lp2TnzC4tN7Nd8e0h4QDpTZnwXLZrJga/rblX8FbmTMIB0ouU8JqRdO7bqkF88YGqlsn8SThAerFH4TXz18w5yR54EpJwgPRaviN9kmUyfxIOkN5sD2cr7kuvn610zuz00gdKvtGQcID0XJ2NBiQcID0JpwEJB0hPwmlAwgHSk3AakHCA9CScBiQcID0JpwEJB0jv+xfPn6x26vLFmltb7ty1heSb97CScID0jMJpQMIB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCA9CZ+n4qesJl+lZiQcID0JT0jCAWhOwhOScACak/DGhnvCR3LTt8d3lRdn295LeNUSSu9bupz5k3CA9CR8GrnuZr8urWxpwuuXUz9DKhIOkJ6ETyOY3pr5tzOj8NzEqsF9zZLnTMIB0pPwaUyf8Kq961X3lXAAdkn4NGYyCp98OS3p97aEA7SBhE+j5nC2monFA9PqD2fLTk/+lIckHCA9CZ/GnJsq4QDsk/DG5nZ+V0tOJMuScID0ZpLwVtWlxoPNR/e/6H25kX5Nuk7CAdLr0Ch8mhcKX248Wrq5eX154+0PNxc/2LixvPH5lw+TP6PuknCA9I5CwtcfPOrH+1/rj7/e+7e+sbV0c+P+FyrekIQDpDdlwic59LpqYv0Sil80e0v4m8e9/vj78wf7/R7+2+xtvfXHB//ZSv8j6CIJB0gvxnvh2YuQ1J/6fKALlDYbha8/6C1+sPF12b8/3Nq4e39zONvKndWfvXHt2Rcv9zfIyKnLF7Pfdsu5awvxfm0kHCC91iY8+CgT+uvdh39e6fWD/errH164/O5Q/+v+lI8/2/zks43+PG8uv/fc1Vf+9OlH99fvJf+JdIKEA6R36BN+/4uHb3+4WToKX769uXZv89baStQB66Ek4QDpdTHhB2r51uPejeWNzd5Wrt9bjwfvhX/1qHf+tas3Vz9J/oPoFgmHgLUrJ0bH73z79PUGM0DQrA5nKz0GLfftgQ5nq3o7vMFY/B//fPjux5u9r7ay/V6+vbFyZ7AX/dSli73eevIfRLdIOEfZ7ReOP3lmcaKZh52uKXRwBqgxt5PK0l7+Ze3eZn8s/sHKw1ufbf5ltf/1g2G/57kFDhMJ5whbvXK8H93jV9Ymn7mm0MEZ6J7rZ+b1M51PwNpwidCvHvVW7w6OX+vHu9fbPyNcwhuQcI6u3XHzEydeWJ1gfgk/imIlvHiFUQGzBRqQcI6s62eOX3nh9MRvYEv4UTT7hFddYVTAGm+B5PsVEpJwjqrFs8ev3N7t7hNnl8rmWTq9fzjPt4+fKBa6cobFs7sTB0seZGD8hcLgPfi9GXL7APZvGsq8VV9z09jzyjx05oF23y/YXZnSFy5jx+Vlt0nVMgvbrXIJhVsz2230RkbFZpniGR14mfvrnN/afYNfmOl+62quMCrh02yBSAlv/ysDCedo6v+BHv5B3/1LXcjhzvBr/49+McOhGXZeHGQrvpuH8cH68EXA6NH73+aWMMlNefsPvbt6e4fanT2zl6jh42abNFj+KGA7hRs7SqBymdcnXMJw/t11Lh6FULtZmj2jpsu8nl/ChEdLhNRfYfS/fn4h9X+KxCS8AQnnSOr/aR79pS7mqvjn/ptQDwozDF8c7CVt5+vBQ2QnFu81KP1YhIa7CgI3FRUeJfsaonptM89ouITsHoKKZRbG0BVLyM087P3o1vrN0vwZNVlm8YXFjBJef4XR0y+/WnORzk5fYXTClf/BL37aeNvmzpfLTs9OKZ50V7zpWOHUu2OTnX23XdilP4eDByWco6g/3srUNzee7pXvXc8GIDjDQLEQpUnIpmh3KF82vK65qWgGcRpPbPUyK96DKCwhP/PYrYHN0ugZNV5msfozSnj9FUbPvboY9Xe+/WYyCj8WukbN5BO3y0bhNXMWS1+znFmRcI6g/XdPx96UrR2XjxU6OMNAWcL33oLNP/T4/ueS927rb8qbLuGFPcx1yyxNeNkS6nakBzdLg2fUeJnREl5/hdEf/u//pf5/kdj0Ca8aLhcHx1Uzly62akow9lXj+BmScI6e4i7o3Kg6csKDScgeJZdb1ZqbMpolfHdP+HBio1F4/RLGX4Vk33IOb5aGCW+yzGgJr7/C6H//z/NRftu7Y8qE14+Di9NLbw0uodl4PR4J56gZHciWm5jZTV36h7u4I71BwhtcTKZ6oFy9nAYJz7+bcPCEB5dw/UzVXvfwZpnJjvTJlhkt4du1Vxh1RPp8dqQHv63f0z79LvfZknCOmP4f5bK/yLtHI+/eVDyYK1fo4Ay98oRXHADfr91gSmH3QH+tdpdQc1OJGYxZD5zw0BKCK1y5WZo9o8bLjJnw7eorjEr4lOeFj8bWxbeog0Pkmj3epYP7qkcJzjlzEs6RUvi7P7L39u1uKfMHrO2dM5Yb5NXMUPVW8e4dx9q2+6DDCo6/CAjfVPU06w/QKx2z7s1Qdt26wjJzTzC4hLI3p/efQs1mafaMGiyz5EcWOGSvmdIrjEr4PLfAfPZyz4GEc1TkritSeqGVY1XXDOn/Ed9rfGZgVz3D6bNlCxwZO55uLGM714c5ln+g2ptyxkvZny33xHNTcmdF76/S6JC0/soXlll8lMASRs+ipuJVm6XpMzrQMkuf0fYcP4ZOwuewBeYwLJ4zCQfmoHT/R/VOkaNHwp95/sLW443kq9EtEg5Et/NGePlRhK4qPyThz119ZeXOavLV6BYJB+IrO8WroutHlITfuPn+rxZ/k3w1ukXCgbkoHM5mF3qWhPedf+3q1XcWe7315GvSFRIOkJ6ED73+/junLuWvqd7pS8RP7ty1hYNuLgkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmnAQkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmfp+JHhSZfpWYknA5LfikGCJr8lzn5f6gjS8LhYNb++ffffbT8698vTSP5X2cImvB/xORzMnMSDhO5+++7P3vjWvHP3A8XXvzlW29IOIfPuWsLE835cwlvKHft/dz07fFd5aUfGZ6drbiE0vu25KPHJZz56Q+7n3n+QvbP1umXr/zp048aLzD5X2cImvyXOfn/0O7KdTf7dWllSxNev5z6GVKRcObkxs33c3/a+sPurccbyVcM2kDCpxFMb83825lReG5i1eC+ZslzJuHMw91/382Nv30wMGRJ+DSmT3jV3vWq+0o4R0ju7cDTL18x/oYsCZ/GTEbhky+nJf3elnDmoF/r3C70W2srydcKWkXCp1FzOFvNxOKBafWHs2WnJ3/KQxJOdCt3VrP9fub5C8lXCdpGwqcx56ZKOEfIm8vvZRP+3NVXkq8StI2ENza387taciJZloQTXe4E7oWl68lXCdrmSCX8weaj+1/0vtxIvyZdJ+FEl0t4/9vkqwRt06GETzMM/XLj0dLNzevLG29/uLn4wcaN5Y3Pv3yY/Bl1l4QTnYRD0FFI+PqDR/14/2v98dd7/9Y3tpZubtz/QsUbknCik3AImj7hwauBbpcdj1119+K96u8e9M3jXn/8/fmD/X4P/232tt7644P/bKX/EXSRhBOdhEPQlAmvvxpo4+uGzvCUqvUHvcUPNr4u+/eHWxt3728OZ1u5s/qzN649++Ll7B+NU5cvJr9QbmPnri3E+7WRcKKTcAiaPuE1p0Hn5ix+faBLozRL+F/vPvzzSq8f7Fdf//DC5XeH+l/3p3z82eYnnw2u9fTm8nvPXX3lT59+dH/9XvKfSCdIONFJOATNcBSem96ShN//4uHbH26WjsKXb2+u3du8tbYSdcB6KEk40Uk4BLV2R3rNYx2o5VuPezeWNzZ7W7l+bz0evBf+1aPe+deu3lz9JPkPolsknOgkHIIiHc5WNX3yw9mq3g5vMBb/xz8fvvvxZu+rrWy/l29vrNwZ7EU/delir7ee/AfRLRJOdBIOQXM7qSztxcXW7m32x+IfrDy89dnmX1b7Xz8Y9nueW+AwkXCik3AImk/A2nCJ0K8e9VbvDo5f68e719s/I1zCG5BwopNwCBIwW6ABCSc6CYcgAWu8BZLvV0hIwolOwiFIwqfZApES3v5XBhJOdBIOQRIu4Q10POFLP3nq6e+//LfUq0EtCYeg+ot0dvoKoxOu/A9+8dPGW6/09LnilOJ146vOtZvyYvJVc85ctxP+9o++89TT3/nuS58mXxNqSDgEGYXPZBTe7CI2k1/ZZvKLyQevkDMTXU7431767tODhD/1vZf+nnxlqCbhECTh0ye8arhcHBxXzVy62KopwdjXXBtnVjqc8L+/9P2nhgl/+js/Xkq/Pkl9+vL32vtqRsIhSMKnTHj9OLg4fZLLv0+Z8DlstO4mfBCt735vr+I/+m3q9Um/NSQcukvC57MjPfjtlFebn/DWWelswgd70X/y9mhfev/r5KuUkoRDt0l44y1QPAyt9KbcXUqXMMnV4Ce/mLzD2SoNDmQbjLz30nXU96VLOHSbhM9zC7T/bLEJdTThv/3xqNmD88omq9dozvr5m81Wcm7b/suL8eWMTx8/on54jH3+Pf6xxxp/oPxqTLDmcyfhECThc9gCbbhE/Gx1M+H9bu33aZDzioiO7M6zH8vdPfC5u0w2297e+0x6qwfB1a8wRrUunBQ3ekb9hOd7H3i50JpsZ0k4BEn4M89f2Hq8kXw1uqWTCe/Hr3TkWnGCeCHM32ROSNs/Dm6K2QaqIhque3G1swfblw/f84fvSTh0m4Q/d/WVlTuryVejWzqY8EFWK3YmlwVsL/Bjx7vtN3LvLtPMlluN8Xflp0p45QB98hcKLSDhECThN26+/6vF3yRfjW7pXsIHeasKWPGgtpJh9Nj03UZOOduu0r5OlfDCMXoHH+u3gIRDkIT3nX/t6tV3Fnu99eRr0hWdS/jO6eA1e55zca3OZITZRq8ksmN0CZdwCJPwodfff+fUpfw11Tt9ifjJnbu2cNDN1bWE758IXqV8T3h9m2c02yjh2f38Ei7hECbhNNCxhO+dDl5xUyF7Et4GEg5BEk4D3Up45nTwotKD2uxIbwEJhyAJp4FOJXzQvJoLqZadIB44AG2ms5XfKuESDmESTgMdSvhOpWoTW3aCeOnO7X2DWI5dqLV+tgYnle3dZT4Jb+W14iUcgiScBrqT8J3gTbije6xkNUPn7LB+wtkqL+2ytw+gcPe9HudfHNRckebgCQ9e3yYlCYcgCaeBjiS8tM11s5W/I56duJPJ8aVNOFvNBVYnPV985039l/ZeNFT3uLDAyqvJjl3QrWKeVCQcgiScBtqf8P0LhmeV76wu2k9g3YeLZEw4W/HzRer3YOeexc7M4yfIDR+orMTDJ1t6sfSxBx3fCC3aoy7hENSGhJd+/sch+1yQQ6b9CafzJByC2pDwolG8VbydJJzoJByCWp5w2knCiU7CIWiahOf2dWe/LX5C9ujbSWbLTc9+e/g+e7uLJJzoJByCphyF5+pbM3G7+u3t4sT6KfqdnIQTnYRDUKSEF0fS29XpnSTho4n63QYSTnQSDkHTvxdeLOvkqa6aLuEtJ+FEJ+EQFDvhMxyF10xnziSc6CQcgmZyRHppg2uOUyudWLofPvhAJCHhRCfhENTOk8qqSHhLSDjRSTgEdSLhTiRrGwknOgmHoE4knLaRcKKTcAiScBqQcKKTcAiScBqQcKKTcAiScBqQcKKTcAjK/h8pOnX5Yv0MbXbu2kLyzXtYSTjRSTgEGYXTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTQMOE5/4ow1BpniUcgk5KOAcn4cyShEMzJyWcg5NwZunZX10KziPhUHRy6oSPPsx7+Hne2Q/2zn3Id/Fjv4v3Ki7Kx4S3kIQzS0bh0MzJ6RKe6/FBJ24XMl8zJ+0h4cyShEMzJ+eY8Nx4vThzbqJ+t5Yj0olOwiFongkPLiE3UcJbS8KJTsIhKGrCc++L19+rZsm0jYQTnYRD0JQJ3y4czpaduF2oeNUBbsVgS3ibSTjRSTgETZ/wkdlGV8LbTMKJTsIhaFYJn9UJYE4k6wQJJzoJh6AZjsI5OiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgk5dulhz3cNTl+tubY9z1xaSb8kjRcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOi6lvDrZ5548tiObx+/spZ+fQDKSTjRtTjht184/uSZxbKbFs/mE7565Xh/yhMnXlhNvtoAAxJOdO1N+LDK5UPtwVh87KZh1J84u5R8tQF2SDjRtTbha1dOHKscWBcSDtAyEk50bU349TPHr7xweuc979PXS26VcKDdJJzoWprwxbPHr9zee4e7uHt8LOFLp/cOcBufcziOL71p+Eb76Na+8jfdAZqScKJrZcL7fR3uP98NbaGvhVF4Ifb9ru9/Wzj8bXDraHC/c18JB2ZLwomujQnvN3XU1+LB5wPFHemD2GcSnmv/8NbR2+qDuw9G+aO7Dwf9yZ84cIhIONG1MOFrV05kxsQ7tc4f1BZMeN7OoHws4XaeA1FJONG1L+H7F2/JGj+o7SAJ39lPnj+4fWdwf6w4HWBGJJzoWpfw4j7tkoPaJkn47r704Wzjo/Bdo+PgjuX2qwNMTcKJrmUJHx3IlpuY2+8dTHh+93tpwnfVXUMGoCEJJ7p2Jbxf07KU7l7mZf+mUMJLD0EfJbww0O8v35XdgNmScKJrU8KrL9iy9372XnqHg+zCrvVRpMf3vecv9DYM/P6b64P825EOzJaEE11LEp69DEuxr8Wj28YuyZI5Nm20vz27wNFVYnaH5oOx/onjrusCxCThRNeShAMcMhJOdBIOEIOEE52EA8Qg4UQn4QAxSDjRSThADBJOdBIOEIOEE10u4VffWUy+SgCHgIQT3evvv5NN+PnXriZfJYBDQMKJ7ubqJ9mEn7p0MfkqARwCEk50vd56NuF999fvJV8rgK6TcObh2Rcv25cOMFsSzjzk9qX3/e6j5eRrBdBpEs6c/PKtN3LviPe7nnytALpLwpmTXm/9/GtXc2Pxftf70xsvM7e0wyr5zw5oJwlnrn730XJ//J1L1LlrCwtL13/9+6WDSh5XCQcSknASuLW28ubyew2aLeEAIxJOhyWPq4QDCUk4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHTS/wMENPtauFzXDwAAAABJRU5ErkJggg=="},354:function(t,e,a){t.exports=a.p+"assets/img/account-create-address.23098bf5.png"},355:function(t,e,a){t.exports=a.p+"assets/img/account-create-offline.71a206b9.png"},356:function(t,e,a){t.exports=a.p+"assets/img/account-remove-address.e8b7a30d.png"},357:function(t,e,a){t.exports=a.p+"assets/img/account-import-prikey.e1a987ac.png"},358:function(t,e,a){t.exports=a.p+"assets/img/account-import-keystore.5886df1e.png"},359:function(t,e,a){t.exports=a.p+"assets/img/account-export-prikey.49b3d4d1.png"},360:function(t,e,a){t.exports=a.p+"assets/img/account-export-keystore.a0ab3ab5.png"},945:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"account-module-design-document"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Account module design document")]),t._v(" "),s("p",[t._v("[TOC]")]),t._v(" "),s("h2",{attrs:{id:"_1、general-description"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1、General description")]),t._v(" "),s("h3",{attrs:{id:"_1-1-module-overview"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module overview")]),t._v(" "),s("h4",{attrs:{id:"_1-1-1-why-have-a-account-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-have-a-account-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why have a Account Module")]),t._v(" "),s("ul",[s("li",[t._v("Used to manage account generation, security and storage, and access to information.")]),t._v(" "),s("li",[t._v("User saves account address, public and private key pair, and verification data signature.")])]),t._v(" "),s("h4",{attrs:{id:"_1-1-2-what-to-do-with-account-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-to-do-with-account-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 What to do with Account Module")]),t._v(" "),s("p",[t._v("The Account Module is a basic module that provides information about the various functions of the account.It mainly supports the functions of account generation, security and storage, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on RPC. The interface makes the account more practical and personalized. The account is the basic module and the carrier of the user data.")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Account generation")]),t._v(" "),s("p",[t._v("Create an account, import an account.")])]),t._v(" "),s("li",[s("p",[t._v("Account security and storage")]),t._v(" "),s("p",[t._v("Backup of account, setting account password, modifying account password, removing account.")])]),t._v(" "),s("li",[s("p",[t._v("Access to account information")]),t._v(" "),s("p",[t._v("Query singel account information, query multiple account information, query account address, query account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Other usability and personalization features")]),t._v(" "),s("p",[t._v("Set account alias, set account remark, verify account encryption, sign, verify account address format, verify account password is correct, etc.")])])]),t._v(" "),s("h4",{attrs:{id:"_1-1-3-positioning-of-the-account-module-in-the-system"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-the-account-module-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 Positioning of the account module in the system")]),t._v(" "),s("p",[s("img",{attrs:{src:a(351),alt:""}})]),t._v(" "),s("p",[t._v("The account is the underlying module that is dependent on the ledger, consensus, transaction, kernel, event bus, and community governance modules.")]),t._v(" "),s("p",[t._v("1、Account module depends on the ledger module")]),t._v(" "),s("pre",[s("code",[t._v("The ledger module needs to handle local transactions and relies on account information.\n\nThe account module needs to create an alias transaction, which requires the ledger module to pay the fee.\n\nAccount balance inquiry, need to rely on ledger module.\n")])]),t._v(" "),s("p",[t._v("2、Account module depends on kernel module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Report module information and share data operations.\n")])])]),s("p",[t._v("3、Account module depends on network module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Receive and send data through a network module.\n")])])]),s("p",[t._v("4、Account module depends on event bus module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Create an account, delete an account,change a password event,send a message through the event bus module.\nThe account module is not strongly dependent on the event bus module,because even if the event fails to send,it does not affect the normal business process.\n")])])]),s("p",[t._v("5、Consensus module depends on account module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Consensus requires account information for packaging blocks.\n")])])]),s("p",[t._v("6、Transaction management module depends on account module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("The transaction management module needs to verify the transaction,relying on the address function in the account to verify whether the address is legal.\n")])])]),s("p",[t._v("7、Community Governance Module depends on account Module")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("Community governance requires account signature\n")])])]),s("h3",{attrs:{id:"_1-2-architecture-diagram"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Architecture diagram")]),t._v(" "),s("p",[s("img",{attrs:{src:a(352),alt:""}})]),t._v(" "),s("p",[t._v("1.API: Provides an interface layer externally, providing operations such as creating, backing up, and setting aliases for accounts.")]),t._v(" "),s("p",[t._v("2.Business logic layer: the function of defining accounts, account addresses, and aliases.")]),t._v(" "),s("p",[t._v("3.Data persistence layer: save account, alias data.")]),t._v(" "),s("h2",{attrs:{id:"_2、function-design"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2、function-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2、Function design")]),t._v(" "),s("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional architecture diagram")]),t._v(" "),s("p",[s("img",{attrs:{src:a(353),alt:""}})]),t._v(" "),s("h3",{attrs:{id:"_2-2-module-service"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module service")]),t._v(" "),s("h4",{attrs:{id:"_2-2-1-create-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-create-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 create account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a user's account, including the account's address, public key, private key creation, account information saved to the database, and create an account to notify other nodes through the event.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(354),alt:""}})]),t._v(" "),s("p",[t._v("Create Address: Create a satellite chain standard account address")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1.Generate a random public-private key pair\n2.Get chainId and account type\n3.Calculate hash160 based on public key\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): address=original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)\n7.Encrypt the private key according to the password and delete the plaintext of the private key\n8.Store account information\n9.Add account to cache\n10.Send Create Account Event\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates one or more accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_createAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])]),s("ul",[s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("count")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("To create an account number, constraints:1-100.")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account initial password, Can be empty")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["address","",""]\n }\n}\n')])])]),s("ul",[s("li",[t._v("Return field description")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address list")])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus: Send Create Account Event")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-2-create-an-offline-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-create-an-offline-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 Create an offline account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a user's offline account, including the account's address, public key, private key creation, account information is not saved to the database")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(355),alt:""}})]),t._v(" "),s("p",[t._v("Create Address: Create a satellite chain standard account address")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1.Generate a random public-private key pair\n2.Get chainId and account type\n3.Calculate hash160 based on public key\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): address=original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Hex(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Hex(chainId)\n7.Encrypt the private key according to the password and delete the plaintext of the private key\n8.Return account information, not saved to the database\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createOfflineAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates one or more offline accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_createOfflineAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("count")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("To create an account number, constraints:1-100.")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account initial password, Can be empty")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["address","",""]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address list")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-3-create-a-multi-sign-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-multi-sign-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 Create a multi-sign account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Create a multi-signature account, including the address of the account, the creation of the script, and save the multi-signed account information to the database.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify the signature public key list, and verify that the minimum number of signatures is correct.\n2. create a multi-signature script.\n3. create a multi-signature type account address according to the multi-sign script.\n4. save the multi-signature account.\n5. return multi-signed account information.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_createMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface creates a multi-signature account.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "createMultiAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID, indicating which chain the account belongs to")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("pubKeys")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("jsonArray")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Minimum number of signatures, at least a few public key verifications are required")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "minSigns":"",\n "pubKeys":[{\n "pubKey":"",\n "address":""\n },{}\n ]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("minSigns")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Minimum signature number")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKeys")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key list")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("--pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("--address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("no")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-4-remove-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-remove-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 Remove account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Remove the user's local account, including deleting the address of the local account, and notifying the other nodes through the event")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(356),alt:""}})]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account address format is correct.\n2. Verify that the account exists\n3. Verify that the account is encrypted. If the account is encrypted and the account is unlocked, you need to verify the password.\n3.1. Obtain an unencrypted private key according to the account's encrypted private key and password.\n3.2, get the public key according to the unencrypted private key\n3.3. Compare the decrypted public key with the queried public key\n4, delete the data\n4.1. Delete local account information\n4.2. Delete account cache information\n5. send remove account events\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_removeAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to remove the account.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_removeAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Account address to delete")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("删除是否成功")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Remove Account Event.")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-5-import-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-import-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 Import account - private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Import accounts based on private keys, generate accounts based on private keys, and import account book data.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(357),alt:""}})]),t._v(" "),s("p",[t._v("Import account information based on private key")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Generate a public-private key pair based on the private key.\n2. get the chainId and account type.\n3. calculate hash160 according to Public key.\n4.Stitching byte arrays to form addresses\n4.1.If it is the NULS system address: address=type+hash160\n4.2、If non-NULS system address (bitcoin): original address length + original address\n5、Generate address string: address byte[] + check digit, then perform base58 calculation to generate string\n5.1.If it is the NULS system check digit: xor=XOR(addressType+pkh)\n5.2.If non-NULS system check digit: xor=XOR(length+address)\n6. base58 calculation generates the address string:\n    NULS system address: Base58 (type+hash160+xor)+Base58(chainId)\n    Non-NULS system address: Base58 (length+address+xor)+Base58(chainId)\n7. Encrypt the private key according to the password and delete the plaintext of the private key.\n8. storage account information.\n9. add the account to the cache.\n10. If you send an import account event: If the account already exists, the new event will not be released, only the update will be made.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importAccountByPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("The interface is imported into the account based on the account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importAccountByPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account private key")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("overwrite")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("Whether to overwrite when the account exists")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Import Account Event when the account does not exist.")]),t._v(" "),s("p",[t._v("Account Book: Import Account leger(confirmed transaction)")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-6-import-account-keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-import-account-keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 Import account-keystore")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("According to the keystore import account, according to the keystore parsing and decrypting to get the private key and generate an account, and import the account book data")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(358),alt:""}})]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the keystore and password match.\n2. decrypt the private key in the keystore according to the password.\n3. Generate public and private based on the private key.\n4. get the chainId and account type.\n5. spliced byte array to form an address.\n6. generate an address string.\n7. Verify that the address string and the address in the keystore are consistent.\n8. storage account information.\n9. send import account event: the account already exists, do not post new events, only do the coverage update.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importAccountByKeystore interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to import accounts keystore")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importAccountByKeystore",\n "minVersion":1.0,\n "params": [\n 1234,\n "HEX",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("keyStore")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Imported keyStore hex code")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("overwrite")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Boolean")]),t._v(" "),s("td",[t._v("Whether to overwrite when the account exists")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Event Bus Module: Send Import Account Event when the account does not exist")]),t._v(" "),s("p",[t._v("Account Book: Import Account leger(confirmed transaction)")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-7-import-multi-signed-accounts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-import-multi-signed-accounts","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 Import multi-signed accounts")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Import a multi-signed account related to the local address, including the address of the account, the creation of the script, and save the multi-signed account information to the database.")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the multi-sign address, the signature public key list, and the minimum number of verified signatures are correct.\n2. create a multi-signature script.\n3. Create an account address of multiple signature types according to the multi-signed script.\n4. Determine whether the imported multi-sign address is the same as the address generated by the script. If it is not the same, it prompts an import error.\n5. save multi-signed account information, including: address, public key list, minimum number of verification signatures.\n6. return to multi-signal address.\n\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_importMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to import multi-signature accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importMultiSigAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("pubkeys")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("jsonArray")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("Minimum signature number, At least a few Public key verifications are required")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-sign address")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-8-export-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-export-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 Export Account private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Export Account private key hex code")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(359),alt:""}})]),t._v(" "),s("p",[t._v("Export Account private key")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the password is correct.\n2. decrypt the private key, generate a Hex string\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_exportAccountPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to export the Account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_importMultiSigAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n \t"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-9-export-account-keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-export-account-keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 Export account KeyStore")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Export account keystore")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("p",[s("img",{attrs:{src:a(360),alt:""}})]),t._v(" "),s("p",[t._v("Export account keystore")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the password is correct.\n2. generate a keystore file.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_exportAccountKeyStore interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to export the account keystore.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_exportAccountKeyStore",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "encryptedPrivateKey":"",\n "pubKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrivateKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-10-query-all-accounts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-query-all-accounts","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.10 Query all accounts")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query all accounts")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. query all account information\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAccountList interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query all accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd":"ac_getAccountList",\n "minVersion":1.0,\n "params":[\n 1234\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":[{\n \t"address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n },{}]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("List")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account list collection")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex code")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key hex code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-11-get-an-account-based-on-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-get-an-account-based-on-address","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.11 Get an account based on address")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get an account based on address")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address exists.\n2. get an account based on the address\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAccountByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get an account based on the address.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAccountByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key hex code")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key hex code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-12-query-the-list-of-account-addresses"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-query-the-list-of-account-addresses","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.12 Query the list of Account addresses")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query the list of Account addresses")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Check whether the paging parameter is legal. The number of pages and the size of the page cannot be less than 0, and must be an integer.\n2. Query all accounts.\n3. Filter accounts that meet the paging conditions.\n4. Return only the address list of the account.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAddressList interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query the list of Account addresses.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAddressList",\n "minVersion":1.0,\n "params": [\n 1234,\n 0,\n 10\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("pageNumber")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("pageNumber")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("pageSize")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("pageSize")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"list":["","",""]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Address list collection")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-13-get-an-address-based-on-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-get-an-address-based-on-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.13 Get an address based on alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get an address based on alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. query whether the existence of alias\n2. return the Account address used to set the alias, and use Base58 to encode the Account address\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAddressByAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get the address based on alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAddressList",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address, Base58 code")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-14-query-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-query-account-private-key","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.14 Query Account private key")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query Account private key")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Check whether the address is correct, use Base58 decoding, and check the Chain ID, address type, and check digit respectively.\n2. Verify that the account exists.\n3. If the account is over-densified (with password) and is not unlocked, decrypt it by AES and verify that the password is correct, and obtain the unencrypted private key.\n4. use hexadecimal encoding, and return to Account private key.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getPriKeyByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query the Account private key.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getPriKeyByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key hex")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-15query-all-account-private-keys"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15query-all-account-private-keys","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.15Query all Account private keys")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query all Account private keys")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the password format is correct and the password can be empty.\n2. get all local accounts.\n3. The encryption information of the local account must be the same. If the parameter password is not empty, the passwords of all accounts must be the same. If the parameter password is empty, all accounts cannot be set. Otherwise, the error is displayed.\n4. If the account is encrypted, the unencrypted private key is reversed by the password, otherwise the private key is obtained without encryption.\n5. Add all private keys to the collection and return.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAllPriKey interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query all Account private keys.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAllPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "list":["",""]\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key collection")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-16-set-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-set-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.16 set password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("set password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. Verify that the password has been set.\n3. set Account password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object, password setting is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-17-set-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-set-offline-account-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.17 Set offline Account password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set offline Account password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address is correct.\n2. Verify that the private key is correct.\n3. create according to the private key.\n4. set offline Account password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setOfflineAccountPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the offline Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account private key")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-18-change-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-change-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.18 change Password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Request Body")])]),t._v(" "),s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("change Password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. verify the correctness of the old password.\n2. Update the private key ciphertext.\n3. send a password change event.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_updatePassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to modify the Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_updatePassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "111111"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("newPassword")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account new password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the password modification is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-19-modify-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-modify-offline-account-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.19 Modify offline Account password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Modify offline Account password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the address is correct.\n2. Generate an offline account based on address, private key, and new password.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_updateOfflineAccountPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to modify the offline Account password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_updateOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n "111111"\n ]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("priKey")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Private key")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("4")]),t._v(" "),s("td",[t._v("newPassword")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account new password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-20-verify-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-verify-password","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.20 verify password")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("verify password")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the password is correct.\n2. return verification results.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_validationPassword interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify the password.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_validationPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the password correct")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-21-verify-that-the-account-is-encrypted"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-verify-that-the-account-is-encrypted","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.21 Verify that the account is encrypted")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Verify that the account is encrypted")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. Verify that the account is encrypted.\n3. return verification results.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_isEncrypted interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify that the account is encrypted.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_isEncrypted",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the account is encrypted")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-22-set-up-an-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-set-up-an-account-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.22 Set up an account alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set up an account alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that alias is legal\n2. generate settings alias transaction\n3. call ledger to fill transaction fee information\n4. broadcast transactions\n5. After the transaction is confirmed, the alias will be saved to the database, and address and alias will be stored as keys respectively. That is, the alias data will store two data, mainly for the convenience of querying according to address and alias.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Alias transaction hash")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Account module: setting an alias requires a fee")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-23-get-set-alias-fee"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-get-set-alias-fee","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.23 Get set alias fee")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Get set alias fee")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists and verify that the alias is correct.\n2. calculate the fees required for the alias setting.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAliasFee interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to get the set alias fee.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAliasFee",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "fee":"100",\n "maxAmount":"10000"\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("fee")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Alias transaction fee")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("maxAmount")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Maximum transaction fee")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-3-24-query-alias-based-on-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-query-alias-based-on-address","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.24 Query alias based on address")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Query alias based on address")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. query the account corresponding alias from the database\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_getAliasByAddress interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to query aliases based on the address.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_getAliasByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "alias":""\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account alias")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-25-verify-that-alias-is-available"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-verify-that-alias-is-available","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.25 Verify that alias is available")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Verify that alias is available")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Query whether the alias already exists. If it exists, it is not available. Otherwise, it is available.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_isAliasUsable interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to verify if alias is available.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_isAliasUsable",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is alias available")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-26-set-account-remark"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-set-account-remark","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.26 Set account remark")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set account remark")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the account exists.\n2. modify the remarks information and save\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setRemark interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set account remark.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setRemark",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n "remark1"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account remark")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("pre",[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the setting is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-27-set-up-multi-sign-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-set-up-multi-sign-account-alias","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.27 Set up multi-sign account alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Set up multi-sign account alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the Account address, alias, Account password, and signature address parameters are legal.\n2. Query whether the Account address and the signature address exist.\n3. generate a set of multi-sign account alias trading.\n4, call ledger to fill transaction fee information.\n5. Sign the transaction using a signed account.\n6. Save the unconfirmed transaction to the local account when the signed number is equal to the minimum number of signatures.\n7. Broadcast the transaction.\n8. return the transaction hash.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_setMultiSigAlias interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to set the multi-sign account alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setMultiSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("signAddress")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature address")])]),t._v(" "),s("tr",[s("td",[t._v("3")]),t._v(" "),s("td",[t._v("password")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account password")])]),t._v(" "),s("tr",[s("td",[t._v("4")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Multi-signalias alias transactionhash")])])])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Account module: setting a multi-signal alias requires a fee.")])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-28-remove-multi-signed-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-remove-multi-signed-account","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.28 Remove multi-signed account")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Remove multi-signed account")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Verify that the Account address is correct.\n2. delete the multi-signed account in the database.\n3. return to delete is successful.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_removeMultiSigAccount interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to remove multi-signed accounts.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_setMutilSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Multi-sign account address")])])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the removal was successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-29-account-all-transaction-verification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-account-all-transaction-verification","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.29 Account all transaction verification")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("account module all transaction verification interface, currently only alias transaction")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. Is the transaction list empty\n2. loop through all transaction lists, processing for alias transactions\n3. Check if the same alias is set in the current transaction list.\n4. Check whether there is an account duplicate setting alias in the current transaction list.\n5. If there is no conflict in the transaction list, the verification is passed.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_accountTxValidate interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to batch verify all transactions in the account module.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_accountTxValidate",\n "minVersion":1.0,\n "params": [chianId, ["txHex","txHex","txHex", ...]]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("Alias transaction serialization data array")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "list":["txHex", "txHex", "txHex", ...]\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Illegal transaction serialization data array")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-30-alias-transaction-verification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-30-alias-transaction-verification","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.30 Alias transaction verification")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("alias transaction verification interface")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. verify the alias format\n3. Verify that the alias is already occupied.\n4. Verify that the account has an alias set.\n5. verify the coinData input and output\n6. verify the script signature format\n7. Verify that the signature contains the address of the alias. \nIf it is not included, it is a malicious foul. \nOtherwise, the verification is passed.\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxValidate interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used for a single alias transaction.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxValidate",\n "minVersion":1.0,\n "params": [chainId,"txHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("alias transaction serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Whether the verification is successful")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-31-alias-transaction-submit"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-31-alias-transaction-submit","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.31 Alias transaction submit")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Alias transaction submit, save alias")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. save the alias alias to the database\n3. set the alias to account and save to the database\n4. Re-cache the modified account\n5. return the alias save is successful\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxCommit interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to save aliases.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxCommit",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Alias transaction serialization data")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("secondaryDataHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block header serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),s("p",[t._v("secondaryDataHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the alias transaction saved successfully")])])])])])])])]),t._v(" "),s("h4",{attrs:{id:"_2-2-32-alias-transaction-rollback"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-32-alias-transaction-rollback","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.32 Alias transaction rollback")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Function Description")]),t._v(" "),s("p",[t._v("Alias transaction rollback interface")])]),t._v(" "),s("li",[s("p",[t._v("Process description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. deserialize txHex alias transaction data\n2. delete the alias object data from the database\n3. take the corresponding account to clear the alias, re-sent the database\n4. re-cache account\n5. return the alias rollback is successful\n")])])])]),t._v(" "),s("li",[s("p",[t._v("ac_aliasTxRollback interface")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Interface Description")]),t._v(" "),s("p",[t._v("This interface is used to roll back an alias.")])]),t._v(" "),s("li",[s("p",[t._v("Request example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "ac_aliasTxRollback",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Request parameter description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("txHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Alias transaction serialization data")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("secondaryDataHex")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block header serialization data")])])])]),t._v(" "),s("p",[t._v("txHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":10000,\n "nonce":"123",\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":1\n }]\n },\n "txData":\n {\n "chainId":"12345",\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),s("p",[t._v("secondaryDataHex description")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return example")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Return field description")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Return result status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Failure message")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Data return object")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Is the alias transaction rollback successful")])])])])])])])]),t._v(" "),s("h3",{attrs:{id:"_2-3-module-internal-function"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 Module internal function")]),t._v(" "),s("h2",{attrs:{id:"_3、event-description"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 3、Event description")]),t._v(" "),s("h3",{attrs:{id:"_3-1-published-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 Published event")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("create Account")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_createAccount"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n address:''\n isEncrypted:true //Is the password set\n}\n")])])])]),t._v(" "),s("li",[s("p",[t._v("remove account")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_removeAccount"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n\taddress:''\n}\n")])])])]),t._v(" "),s("li",[s("p",[t._v("change password")]),t._v(" "),s("p",[t._v('event_topic : "evt_ac_updatePassword"')]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("data:{\n\taddress:''\n}\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"_3-2-subscribed-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 Subscribed event")]),t._v(" "),s("p",[t._v("no")]),t._v(" "),s("h2",{attrs:{id:"_4、protocol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4、protocol")]),t._v(" "),s("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 Network communication protocol")]),t._v(" "),s("ul",[s("li",[t._v("no")])]),t._v(" "),s("h3",{attrs:{id:"_4-2-transaction-agreement"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 Transaction agreement")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Set alias")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("protocol")]),t._v(" "),s("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("type: n //Set the type of alias transaction\ntxData:{\n address: //VarByte Set the address of alias\n alias: //VarByte Array of bytes converted into an alias string, decoded with UTF-8\n}\n")])])]),s("ul",[s("li",[t._v("Alias transaction parameters")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Len")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Data Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("24")]),t._v(" "),s("td",[t._v("address")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Set the address of alias")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Array of bytes converted into an alias string, decoded with UTF-8")])])])]),t._v(" "),s("ul",[s("li",[t._v("Validator")])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. alias format legality verification.\n2. the address must be the satellite chain address, and an address can only be set to an alias.\n3. burn a token unit.\n4. Transaction fee.\n5. signature: set address, input, signature verification.\n")])])]),s("ul",[s("li",[t._v("processor")])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("1. the asset processor.\n2. store alias data.\n3. Update local account information.\n")])])])])]),t._v(" "),s("h2",{attrs:{id:"_5、module-configuration-item"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration-item","aria-hidden":"true"}},[t._v("#")]),t._v(" 5、Module configuration item")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("server.ip:0.0.0.0 //Native ip, used to provide services to other modules\nserver.port:8080 //Service port\n")])])]),s("h2",{attrs:{id:"_6、java-specific-design"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 6、Java-specific design")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Account Object design")]),t._v(" "),s("p",[t._v("The key used when the table is stored:")]),t._v(" "),s("p",[t._v("NULS system:chainId+type+hash160")]),t._v(" "),s("p",[t._v("non-NULS system:chainId+length+address")])])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("Field name")])]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("type")])]),t._v(" "),s("th",{staticStyle:{"text-align":"left"}},[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("short")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account address(Base58(address)+Base58(chainId))")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account alias")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("status")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Account Status")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Public key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Private key - not encrypted")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Encrypted private key")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("extend")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("Extended data")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("remark")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("ramark")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),s("td",{staticStyle:{"text-align":"left"}},[t._v("create time")])])])]),t._v(" "),s("ul",[s("li",[t._v("Address object design (not persistent storage)")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("Chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("addressType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Address type")])]),t._v(" "),s("tr",[s("td",[t._v("hash160")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Public key hash")])]),t._v(" "),s("tr",[s("td",[t._v("addressBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Address byte array")])])])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Alias object design")]),t._v(" "),s("p",[t._v("The key used when the table is stored:")]),t._v(" "),s("p",[t._v("Address and alias are stored as keys respectively, and alias data is stored in two copies.")]),t._v(" "),s("p",[t._v("Need to create different alias tables according to different chains.")])])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("address")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("alias")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account alias")])])])]),t._v(" "),s("ul",[s("li",[t._v("MultiSigAccount object design")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("Field name")])]),t._v(" "),s("th",[s("code",[t._v("type")])]),t._v(" "),s("th",[s("code",[t._v("Description")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("address")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Account address")])]),t._v(" "),s("tr",[s("td",[t._v("pubKeyList")]),t._v(" "),s("td",[t._v("List")]),t._v(" "),s("td",[t._v("Public key list that needs to be signed")])]),t._v(" "),s("tr",[s("td",[t._v("minSigns")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("Minimum number of signatures")])])])]),t._v(" "),s("h2",{attrs:{id:""}},[s("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[t._v("#")])]),t._v(" "),s("h2",{attrs:{id:"_7、to-add-on"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7、to-add-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 7、to add on")])])}],i=a(0),n=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},s,!1,null,null,null);n.options.__file="accountModuleDesign.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/23.9f1f092a.js b/docs/.vuepress/dist/assets/js/23.9f1f092a.js new file mode 100644 index 00000000..c344225b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/23.9f1f092a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{208:function(t,e,s){t.exports=s.p+"assets/img/1547628433529.82f02f3c.png"},519:function(t,e,s){t.exports=s.p+"assets/img/1547780793.d1901165.png"},520:function(t,e,s){t.exports=s.p+"assets/img/1547627744781.d29f4151.png"},521:function(t,e,s){t.exports=s.p+"assets/img/1547629113708.a978d574.png"},522:function(t,e,s){t.exports=s.p+"assets/img/1547629614931.c21668db.png"},523:function(t,e,s){t.exports=s.p+"assets/img/1547631195826.4604d1ee.png"},524:function(t,e,s){t.exports=s.p+"assets/img/1547630048933.09832fac.png"},525:function(t,e,s){t.exports=s.p+"assets/img/1547630351497.bb1c264a.png"},526:function(t,e,s){t.exports=s.p+"assets/img/1547630438203.46cfbc93.png"},527:function(t,e,s){t.exports=s.p+"assets/img/1547630589355.f9869b27.png"},997:function(t,e,s){"use strict";s.r(e);var r=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"猜大小游戏客户端操作手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#猜大小游戏客户端操作手册","aria-hidden":"true"}},[this._v("#")]),this._v(" 猜大小游戏客户端操作手册")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"合约地址:ttb4653r7bul9pw2qklts4k7fiwknz8n"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#合约地址:ttb4653r7bul9pw2qklts4k7fiwknz8n","aria-hidden":"true"}},[this._v("#")]),this._v(" 合约地址:TTb4653R7bUL9Pw2qKLtS4K7FiWKnZ8N")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"查找合约"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查找合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 查找合约")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(519),alt:"1547780793"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"创建游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#创建游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 创建游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("0代表【猜小】")]),this._v(" "),e("li",[this._v("1代表【猜大】")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(520),alt:"1547628483706"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(208),alt:"1547628433529"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"加入游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#加入游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 加入游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(208),alt:"1547628433529"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"开奖"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开奖","aria-hidden":"true"}},[this._v("#")]),this._v(" 开奖")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("为防止技术作弊,合约会要求随机确认几个块才可开奖,上限为10。因此加入游戏后最多确认10个块之后即可进行开奖")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(521),alt:"1547629113708"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("由于需防止技术作弊,")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(522),alt:"1547629614931"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"撤销游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#撤销游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 撤销游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("若创建游戏100个块之后还没有参与者,则本轮游戏创建者可选择撤销游戏,拿回下注的NULS")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(523),alt:"1547631195826"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"查看游戏详情"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查看游戏详情","aria-hidden":"true"}},[this._v("#")]),this._v(" 查看游戏详情")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(524),alt:"1547630048933"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"查看本合约创建了多少个游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查看本合约创建了多少个游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 查看本合约创建了多少个游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(525),alt:"1547630351497"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"查看等待参与的游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查看等待参与的游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 查看等待参与的游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(526),alt:"1547630438203"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"查看等待开奖的游戏"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#查看等待开奖的游戏","aria-hidden":"true"}},[this._v("#")]),this._v(" 查看等待开奖的游戏")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(527),alt:"1547630589355"}})])}],a=s(0),i=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("blockquote",[s("p",[t._v("目前猜大小游戏合约部署在测试网上运行,如果需要测试网NULS,可"),s("a",{attrs:{href:"http://testnet.wallet.nuls.io/#/testNetNULS/testNetNULS",target:"_blank",rel:"noopener noreferrer"}},[t._v("进行申请"),s("OutboundLink")],1)])]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("1 打开钱包客户端,点击顶部【合约】菜单")]),t._v(" "),s("p",[t._v("2 点击【查找合约】,在输入框中填入合约地址,点击访问。即可查找到该合约")]),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("3 还可点击合约右侧的星进行收藏。收藏后可在【我的合约】中看到该合约")]),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("1 下拉列表中选择【createGame】方法")]),t._v(" "),s("p",[t._v("2 在【selection】输入框中填写值:")]),t._v(" "),t._m(5),t._v(" "),s("p",[t._v("3 点击【高级选项】,在【value】输入框中填入值,该值代表本轮猜大小游戏中你所下注的NULS数量")]),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("4 点击【调用】按钮,创建本轮游戏")]),t._v(" "),s("p",[t._v("5 从返回结果中找到该轮游戏的ID")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("1 从游戏创建者或等待参与的游戏列表中拿到想要参与的某轮游戏ID")]),t._v(" "),s("p",[t._v("2 在下拉列表中选择【joinGame】方法,在【gameId】输入框中填入本轮游戏的ID")]),t._v(" "),s("p",[t._v("3 点击【高级选项】,在【value】输入框中填入下注的NULS数量,且该数量要和创建者的下注数量相同")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("4 点击【调用】按钮,加入游戏")]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("1 下拉列表中选择【draw】方法,【gameID】输入框中填入本轮游戏的ID")]),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("2 点击【调用】按钮,进行开奖。调用完成后会返回游戏结果,且合约会将赢得的NULS和抵押的NULS一起转入获胜账户地址")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),s("p",[t._v("1 下拉列表中选择【interrupt】")]),t._v(" "),s("p",[t._v("2 【gameId】输入框中填入想要撤销游戏的Id,点击【调用】按钮,即可撤销该轮游戏")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("1 下拉列表中选择【viewGameDetail】")]),t._v(" "),s("p",[t._v("2 【gameId】输入框中填入想要查询游戏的Id,点击【调用】按钮,即可获取该轮游戏详情")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),s("p",[t._v("下拉列表中选择【viewGamesTotalCount】方法,点击【调用】按钮即可")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),s("p",[t._v("下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),s("p",[t._v("下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可")]),t._v(" "),t._m(25)])},r,!1,null,null,null);i.options.__file="guessTheSize.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/24.2dd53084.js b/docs/.vuepress/dist/assets/js/24.2dd53084.js new file mode 100644 index 00000000..86a427d4 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/24.2dd53084.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{598:function(t,e,v){t.exports=v.p+"assets/img/account-context.aaa5f026.png"},599:function(t,e,v){t.exports=v.p+"assets/img/account-module.ab4c1b38.png"},600:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApYAAAEPCAIAAAB3ERNLAAAX1ElEQVR4nO3d3W8cZ6HAYf4d0uuqUu/5J3ITCW4CR9WRctubJBKgcpGboIhAdRKilrbHF6mCelqJqomR6QeoYBrapkqNqSFRILRu7Gwat8g6u157PTtf73p2331n7Cd6LuzZ2dnZsePfvrMzs9/a/qYHAHTOt5KvAQDQgIQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDQCdJOAB0koQDUO7YE08mXwdqSDgA5SS85SQc4DDo53YkOyX7RW7O0rsXl1Y/JwlJOEDn5Qqd/boY4OLXNXef8IFIQsIBOq+qpqUNnnx4faC7M38SDtB5B0p4/ZyTj8JJTsIBOm/KPeHBu08YeOZMwgEOg9Ld4JMfj1a1h9zhbG0m4QDQSRIOAJ0k4QDQSRIOAJ0k4QDQSRIOAJ0k4QDp/XDhxZMXz1c5dfliza0td+7aQvLNe1hJOEB6/dQlXwc6R8IB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCC9WSU8+DGgPir0MJFwgPRmOAqfJM8TJlzpW07CAdKTcBqQcID0pk/4aA95trtVu81Lp2TnzC4tN7Nd8e0h4QDpTZnwXLZrJga/rblX8FbmTMIB0ouU8JqRdO7bqkF88YGqlsn8SThAerFH4TXz18w5yR54EpJwgPRaviN9kmUyfxIOkN5sD2cr7kuvn610zuz00gdKvtGQcID0XJ2NBiQcID0JpwEJB0hPwmlAwgHSk3AakHCA9CScBiQcID0JpwEJB0jv+xfPn6x26vLFmltb7ty1heSb97CScID0jMJpQMIB0pNwGpBwgPQknAYkHCA9CacBCQdIT8JpQMIB0pNwGpBwgPQknAYkHCA9CZ+n4qesJl+lZiQcID0JT0jCAWhOwhOScACak/DGhnvCR3LTt8d3lRdn295LeNUSSu9bupz5k3CA9CR8GrnuZr8urWxpwuuXUz9DKhIOkJ6ETyOY3pr5tzOj8NzEqsF9zZLnTMIB0pPwaUyf8Kq961X3lXAAdkn4NGYyCp98OS3p97aEA7SBhE+j5nC2monFA9PqD2fLTk/+lIckHCA9CZ/GnJsq4QDsk/DG5nZ+V0tOJMuScID0ZpLwVtWlxoPNR/e/6H25kX5Nuk7CAdLr0Ch8mhcKX248Wrq5eX154+0PNxc/2LixvPH5lw+TP6PuknCA9I5CwtcfPOrH+1/rj7/e+7e+sbV0c+P+FyrekIQDpDdlwic59LpqYv0Sil80e0v4m8e9/vj78wf7/R7+2+xtvfXHB//ZSv8j6CIJB0gvxnvh2YuQ1J/6fKALlDYbha8/6C1+sPF12b8/3Nq4e39zONvKndWfvXHt2Rcv9zfIyKnLF7Pfdsu5awvxfm0kHCC91iY8+CgT+uvdh39e6fWD/errH164/O5Q/+v+lI8/2/zks43+PG8uv/fc1Vf+9OlH99fvJf+JdIKEA6R36BN+/4uHb3+4WToKX769uXZv89baStQB66Ek4QDpdTHhB2r51uPejeWNzd5Wrt9bjwfvhX/1qHf+tas3Vz9J/oPoFgmHgLUrJ0bH73z79PUGM0DQrA5nKz0GLfftgQ5nq3o7vMFY/B//fPjux5u9r7ay/V6+vbFyZ7AX/dSli73eevIfRLdIOEfZ7ReOP3lmcaKZh52uKXRwBqgxt5PK0l7+Ze3eZn8s/sHKw1ufbf5ltf/1g2G/57kFDhMJ5whbvXK8H93jV9Ymn7mm0MEZ6J7rZ+b1M51PwNpwidCvHvVW7w6OX+vHu9fbPyNcwhuQcI6u3XHzEydeWJ1gfgk/imIlvHiFUQGzBRqQcI6s62eOX3nh9MRvYEv4UTT7hFddYVTAGm+B5PsVEpJwjqrFs8ev3N7t7hNnl8rmWTq9fzjPt4+fKBa6cobFs7sTB0seZGD8hcLgPfi9GXL7APZvGsq8VV9z09jzyjx05oF23y/YXZnSFy5jx+Vlt0nVMgvbrXIJhVsz2230RkbFZpniGR14mfvrnN/afYNfmOl+62quMCrh02yBSAlv/ysDCedo6v+BHv5B3/1LXcjhzvBr/49+McOhGXZeHGQrvpuH8cH68EXA6NH73+aWMMlNefsPvbt6e4fanT2zl6jh42abNFj+KGA7hRs7SqBymdcnXMJw/t11Lh6FULtZmj2jpsu8nl/ChEdLhNRfYfS/fn4h9X+KxCS8AQnnSOr/aR79pS7mqvjn/ptQDwozDF8c7CVt5+vBQ2QnFu81KP1YhIa7CgI3FRUeJfsaonptM89ouITsHoKKZRbG0BVLyM087P3o1vrN0vwZNVlm8YXFjBJef4XR0y+/WnORzk5fYXTClf/BL37aeNvmzpfLTs9OKZ50V7zpWOHUu2OTnX23XdilP4eDByWco6g/3srUNzee7pXvXc8GIDjDQLEQpUnIpmh3KF82vK65qWgGcRpPbPUyK96DKCwhP/PYrYHN0ugZNV5msfozSnj9FUbPvboY9Xe+/WYyCj8WukbN5BO3y0bhNXMWS1+znFmRcI6g/XdPx96UrR2XjxU6OMNAWcL33oLNP/T4/ueS927rb8qbLuGFPcx1yyxNeNkS6nakBzdLg2fUeJnREl5/hdEf/u//pf5/kdj0Ca8aLhcHx1Uzly62akow9lXj+BmScI6e4i7o3Kg6csKDScgeJZdb1ZqbMpolfHdP+HBio1F4/RLGX4Vk33IOb5aGCW+yzGgJr7/C6H//z/NRftu7Y8qE14+Di9NLbw0uodl4PR4J56gZHciWm5jZTV36h7u4I71BwhtcTKZ6oFy9nAYJz7+bcPCEB5dw/UzVXvfwZpnJjvTJlhkt4du1Vxh1RPp8dqQHv63f0z79LvfZknCOmP4f5bK/yLtHI+/eVDyYK1fo4Ay98oRXHADfr91gSmH3QH+tdpdQc1OJGYxZD5zw0BKCK1y5WZo9o8bLjJnw7eorjEr4lOeFj8bWxbeog0Pkmj3epYP7qkcJzjlzEs6RUvi7P7L39u1uKfMHrO2dM5Yb5NXMUPVW8e4dx9q2+6DDCo6/CAjfVPU06w/QKx2z7s1Qdt26wjJzTzC4hLI3p/efQs1mafaMGiyz5EcWOGSvmdIrjEr4PLfAfPZyz4GEc1TkritSeqGVY1XXDOn/Ed9rfGZgVz3D6bNlCxwZO55uLGM714c5ln+g2ptyxkvZny33xHNTcmdF76/S6JC0/soXlll8lMASRs+ipuJVm6XpMzrQMkuf0fYcP4ZOwuewBeYwLJ4zCQfmoHT/R/VOkaNHwp95/sLW443kq9EtEg5Et/NGePlRhK4qPyThz119ZeXOavLV6BYJB+IrO8WroutHlITfuPn+rxZ/k3w1ukXCgbkoHM5mF3qWhPedf+3q1XcWe7315GvSFRIOkJ6ED73+/junLuWvqd7pS8RP7ty1hYNuLgkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmnAQkHSE/CaUDCAdKTcBqQcID0JJwGJBwgPQmfp+JHhSZfpWYknA5LfikGCJr8lzn5f6gjS8LhYNb++ffffbT8698vTSP5X2cImvB/xORzMnMSDhO5+++7P3vjWvHP3A8XXvzlW29IOIfPuWsLE835cwlvKHft/dz07fFd5aUfGZ6drbiE0vu25KPHJZz56Q+7n3n+QvbP1umXr/zp048aLzD5X2cImvyXOfn/0O7KdTf7dWllSxNev5z6GVKRcObkxs33c3/a+sPurccbyVcM2kDCpxFMb83825lReG5i1eC+ZslzJuHMw91/382Nv30wMGRJ+DSmT3jV3vWq+0o4R0ju7cDTL18x/oYsCZ/GTEbhky+nJf3elnDmoF/r3C70W2srydcKWkXCp1FzOFvNxOKBafWHs2WnJ3/KQxJOdCt3VrP9fub5C8lXCdpGwqcx56ZKOEfIm8vvZRP+3NVXkq8StI2ENza387taciJZloQTXe4E7oWl68lXCdrmSCX8weaj+1/0vtxIvyZdJ+FEl0t4/9vkqwRt06GETzMM/XLj0dLNzevLG29/uLn4wcaN5Y3Pv3yY/Bl1l4QTnYRD0FFI+PqDR/14/2v98dd7/9Y3tpZubtz/QsUbknCik3AImj7hwauBbpcdj1119+K96u8e9M3jXn/8/fmD/X4P/232tt7644P/bKX/EXSRhBOdhEPQlAmvvxpo4+uGzvCUqvUHvcUPNr4u+/eHWxt3728OZ1u5s/qzN649++Ll7B+NU5cvJr9QbmPnri3E+7WRcKKTcAiaPuE1p0Hn5ix+faBLozRL+F/vPvzzSq8f7Fdf//DC5XeH+l/3p3z82eYnnw2u9fTm8nvPXX3lT59+dH/9XvKfSCdIONFJOATNcBSem96ShN//4uHbH26WjsKXb2+u3du8tbYSdcB6KEk40Uk4BLV2R3rNYx2o5VuPezeWNzZ7W7l+bz0evBf+1aPe+deu3lz9JPkPolsknOgkHIIiHc5WNX3yw9mq3g5vMBb/xz8fvvvxZu+rrWy/l29vrNwZ7EU/delir7ee/AfRLRJOdBIOQXM7qSztxcXW7m32x+IfrDy89dnmX1b7Xz8Y9nueW+AwkXCik3AImk/A2nCJ0K8e9VbvDo5f68e719s/I1zCG5BwopNwCBIwW6ABCSc6CYcgAWu8BZLvV0hIwolOwiFIwqfZApES3v5XBhJOdBIOQRIu4Q10POFLP3nq6e+//LfUq0EtCYeg+ot0dvoKoxOu/A9+8dPGW6/09LnilOJ146vOtZvyYvJVc85ctxP+9o++89TT3/nuS58mXxNqSDgEGYXPZBTe7CI2k1/ZZvKLyQevkDMTXU7431767tODhD/1vZf+nnxlqCbhECTh0ye8arhcHBxXzVy62KopwdjXXBtnVjqc8L+/9P2nhgl/+js/Xkq/Pkl9+vL32vtqRsIhSMKnTHj9OLg4fZLLv0+Z8DlstO4mfBCt735vr+I/+m3q9Um/NSQcukvC57MjPfjtlFebn/DWWelswgd70X/y9mhfev/r5KuUkoRDt0l44y1QPAyt9KbcXUqXMMnV4Ce/mLzD2SoNDmQbjLz30nXU96VLOHSbhM9zC7T/bLEJdTThv/3xqNmD88omq9dozvr5m81Wcm7b/suL8eWMTx8/on54jH3+Pf6xxxp/oPxqTLDmcyfhECThc9gCbbhE/Gx1M+H9bu33aZDzioiO7M6zH8vdPfC5u0w2297e+0x6qwfB1a8wRrUunBQ3ekb9hOd7H3i50JpsZ0k4BEn4M89f2Hq8kXw1uqWTCe/Hr3TkWnGCeCHM32ROSNs/Dm6K2QaqIhque3G1swfblw/f84fvSTh0m4Q/d/WVlTuryVejWzqY8EFWK3YmlwVsL/Bjx7vtN3LvLtPMlluN8Xflp0p45QB98hcKLSDhECThN26+/6vF3yRfjW7pXsIHeasKWPGgtpJh9Nj03UZOOduu0r5OlfDCMXoHH+u3gIRDkIT3nX/t6tV3Fnu99eRr0hWdS/jO6eA1e55zca3OZITZRq8ksmN0CZdwCJPwodfff+fUpfw11Tt9ifjJnbu2cNDN1bWE758IXqV8T3h9m2c02yjh2f38Ei7hECbhNNCxhO+dDl5xUyF7Et4GEg5BEk4D3Up45nTwotKD2uxIbwEJhyAJp4FOJXzQvJoLqZadIB44AG2ms5XfKuESDmESTgMdSvhOpWoTW3aCeOnO7X2DWI5dqLV+tgYnle3dZT4Jb+W14iUcgiScBrqT8J3gTbije6xkNUPn7LB+wtkqL+2ytw+gcPe9HudfHNRckebgCQ9e3yYlCYcgCaeBjiS8tM11s5W/I56duJPJ8aVNOFvNBVYnPV985039l/ZeNFT3uLDAyqvJjl3QrWKeVCQcgiScBtqf8P0LhmeV76wu2k9g3YeLZEw4W/HzRer3YOeexc7M4yfIDR+orMTDJ1t6sfSxBx3fCC3aoy7hENSGhJd+/sch+1yQQ6b9CafzJByC2pDwolG8VbydJJzoJByCWp5w2knCiU7CIWiahOf2dWe/LX5C9ujbSWbLTc9+e/g+e7uLJJzoJByCphyF5+pbM3G7+u3t4sT6KfqdnIQTnYRDUKSEF0fS29XpnSTho4n63QYSTnQSDkHTvxdeLOvkqa6aLuEtJ+FEJ+EQFDvhMxyF10xnziSc6CQcgmZyRHppg2uOUyudWLofPvhAJCHhRCfhENTOk8qqSHhLSDjRSTgEdSLhTiRrGwknOgmHoE4knLaRcKKTcAiScBqQcKKTcAiScBqQcKKTcAiScBqQcKKTcAjK/h8pOnX5Yv0MbXbu2kLyzXtYSTjRSTgEGYXTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTgIQTnYRDkITTQMOE5/4ow1BpniUcgk5KOAcn4cyShEMzJyWcg5NwZunZX10KziPhUHRy6oSPPsx7+Hne2Q/2zn3Id/Fjv4v3Ki7Kx4S3kIQzS0bh0MzJ6RKe6/FBJ24XMl8zJ+0h4cyShEMzJ+eY8Nx4vThzbqJ+t5Yj0olOwiFongkPLiE3UcJbS8KJTsIhKGrCc++L19+rZsm0jYQTnYRD0JQJ3y4czpaduF2oeNUBbsVgS3ibSTjRSTgETZ/wkdlGV8LbTMKJTsIhaFYJn9UJYE4k6wQJJzoJh6AZjsI5OiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgiScBiSc6CQcgk5dulhz3cNTl+tubY9z1xaSb8kjRcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOgkHCAGCSc6CQeIQcKJTsIBYpBwopNwgBgknOi6lvDrZ5548tiObx+/spZ+fQDKSTjRtTjht184/uSZxbKbFs/mE7565Xh/yhMnXlhNvtoAAxJOdO1N+LDK5UPtwVh87KZh1J84u5R8tQF2SDjRtTbha1dOHKscWBcSDtAyEk50bU349TPHr7xweuc979PXS26VcKDdJJzoWprwxbPHr9zee4e7uHt8LOFLp/cOcBufcziOL71p+Eb76Na+8jfdAZqScKJrZcL7fR3uP98NbaGvhVF4Ifb9ru9/Wzj8bXDraHC/c18JB2ZLwomujQnvN3XU1+LB5wPFHemD2GcSnmv/8NbR2+qDuw9G+aO7Dwf9yZ84cIhIONG1MOFrV05kxsQ7tc4f1BZMeN7OoHws4XaeA1FJONG1L+H7F2/JGj+o7SAJ39lPnj+4fWdwf6w4HWBGJJzoWpfw4j7tkoPaJkn47r704Wzjo/Bdo+PgjuX2qwNMTcKJrmUJHx3IlpuY2+8dTHh+93tpwnfVXUMGoCEJJ7p2Jbxf07KU7l7mZf+mUMJLD0EfJbww0O8v35XdgNmScKJrU8KrL9iy9372XnqHg+zCrvVRpMf3vecv9DYM/P6b64P825EOzJaEE11LEp69DEuxr8Wj28YuyZI5Nm20vz27wNFVYnaH5oOx/onjrusCxCThRNeShAMcMhJOdBIOEIOEE52EA8Qg4UQn4QAxSDjRSThADBJOdBIOEIOEE10u4VffWUy+SgCHgIQT3evvv5NN+PnXriZfJYBDQMKJ7ubqJ9mEn7p0MfkqARwCEk50vd56NuF999fvJV8rgK6TcObh2Rcv25cOMFsSzjzk9qX3/e6j5eRrBdBpEs6c/PKtN3LviPe7nnytALpLwpmTXm/9/GtXc2Pxftf70xsvM7e0wyr5zw5oJwlnrn730XJ//J1L1LlrCwtL13/9+6WDSh5XCQcSknASuLW28ubyew2aLeEAIxJOhyWPq4QDCUk4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHSShANAJ0k4AHTS/wMENPtauFzXDwAAAABJRU5ErkJggg=="},601:function(t,e,v){t.exports=v.p+"assets/img/account-create-address.23098bf5.png"},602:function(t,e,v){t.exports=v.p+"assets/img/account-create-offline.71a206b9.png"},603:function(t,e,v){t.exports=v.p+"assets/img/account-remove-address.e8b7a30d.png"},604:function(t,e,v){t.exports=v.p+"assets/img/account-import-prikey.e1a987ac.png"},605:function(t,e,v){t.exports=v.p+"assets/img/account-import-keystore.5886df1e.png"},606:function(t,e,v){t.exports=v.p+"assets/img/account-export-prikey.49b3d4d1.png"},607:function(t,e,v){t.exports=v.p+"assets/img/account-export-keystore.a0ab3ab5.png"},851:function(t,e,v){"use strict";v.r(e);var _=[function(){var t=this,e=t.$createElement,_=t._self._c||e;return _("div",{staticClass:"content"},[_("h1",{attrs:{id:"账户模块设计"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#账户模块设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 账户模块设计")]),t._v(" "),_("h1",{attrs:{id:"账户模块设计文档"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#账户模块设计文档","aria-hidden":"true"}},[t._v("#")]),t._v(" 账户模块设计文档")]),t._v(" "),_("p",[t._v("[TOC]")]),t._v(" "),_("h2",{attrs:{id:"一、总体描述"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),_("h3",{attrs:{id:"_1-1-模块概述"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 模块概述")]),t._v(" "),_("h4",{attrs:{id:"_1-1-1-为什么要有《账户》模块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《账户》模块","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《账户》模块")]),t._v(" "),_("ul",[_("li",[t._v("用于管理账户的生成、安全和保管、信息的获取")]),t._v(" "),_("li",[t._v("用户保存账户的地址、公私钥对、以及验证数据签名")])]),t._v(" "),_("h4",{attrs:{id:"_1-1-2-《账户》要做什么"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《账户》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《账户》要做什么")]),t._v(" "),_("p",[t._v("账户模块是提供关于账户各项功能的基础性模块。主要对账户的生成、安全和保管、信息的获取等几个方面的功能提供支持,其他模块可以根据账户模块提供的接口来使用账户的各种功能以及获取账户信息,用户或者其他应用可以根据RPC接口对账户进行更加实用性和个性化的操作。账户是基础模块,也是用户数据的载体 。")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("账户的生成")]),t._v(" "),_("p",[t._v("创建账户、导入账户")])]),t._v(" "),_("li",[_("p",[t._v("账户的安全和保管")]),t._v(" "),_("p",[t._v("账户的备份、设置账户密码、修改账户密码、移除账户")])]),t._v(" "),_("li",[_("p",[t._v("账户信息的获取")]),t._v(" "),_("p",[t._v("查询单个账户信息、获取多个账户信息、获取账户地址、查询账户余额、查询账户别名")])]),t._v(" "),_("li",[_("p",[t._v("其他实用性和个性化功能")]),t._v(" "),_("p",[t._v("设置账户别名、设置账户备注、验证账户是否加密、签名、验证账户地址格式、验证账户密码是否正确等功能")])])]),t._v(" "),_("h4",{attrs:{id:"_1-1-3-《账户》在系统中的定位"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《账户》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《账户》在系统中的定位")]),t._v(" "),_("p",[_("img",{attrs:{src:v(598),alt:""}})]),t._v(" "),_("p",[t._v("账户是底层模块,与账本、共识、交易、内核、事件总线、社区治理模块有依赖关系。")]),t._v(" "),_("p",[t._v("1、账户模块依赖账本模块")]),t._v(" "),_("pre",[_("code",[t._v("ledger模块需要处理本地交易,依赖于账户信息。\n\n账户模块需要发起设置别名交易,需要ledger模块支付费用\n\n账户余额查询,需要依赖ledger模块\n")])]),t._v(" "),_("p",[t._v("2、账户模块依赖内核模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("上报模块信息、共享数据操作\n")])])]),_("p",[t._v("3、账户模块依赖网络模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("通过网络模块来接收和发送数据\n")])])]),_("p",[t._v("4、账户模块依赖事件总线模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("创建账户、删除账户、修改密码事件通过事件总线模块发送消息\n账户模块并非强依赖事件总线模块,因为即使事件发送失败也不影响业务正常流程\n")])])]),_("p",[t._v("5、共识模块依赖账户模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("共识需要账户信息进行打包出块\n")])])]),_("p",[t._v("6、交易管理模块依赖账户模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("交易管理模块要对交易进行验证,依赖账户中address功能,验证地址是否合法\n")])])]),_("p",[t._v("7、社区治理模块依赖账户模块")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("社区治理需要账户签名\n")])])]),_("h3",{attrs:{id:"_1-2-架构图"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 架构图")]),t._v(" "),_("p",[_("img",{attrs:{src:v(599),alt:""}})]),t._v(" "),_("p",[t._v("1、API:对外提供接口层,提供账户的创建、备份、设置别名等操作;")]),t._v(" "),_("p",[t._v("2、业务逻辑层:定义账户、账户地址、别名的功能;")]),t._v(" "),_("p",[t._v("3、数据持久化层:保存账户、别名数据;")]),t._v(" "),_("h2",{attrs:{id:"二、功能设计"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),_("h3",{attrs:{id:"_2-1-功能架构图"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 功能架构图")]),t._v(" "),_("p",[_("img",{attrs:{src:v(600),alt:""}})]),t._v(" "),_("h3",{attrs:{id:"_2-2-模块服务"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 模块服务")]),t._v(" "),_("h4",{attrs:{id:"_2-2-1-创建账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 创建账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("创建用户的账户,包括账户的地址、公匙、私匙的创建,账户信息保存到数据库,并将创建账户通过事件通知其他节点")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(601),alt:""}})]),t._v(" "),_("p",[t._v("创建地址:创建卫星链标准账户地址")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、生成随机公私钥对\n2、获取chainId和账户类型\n3、根据公钥计算hash160\n4、拼接字节数组组成地址:\n4.1、如果是NULS体系地址:address=type+hash160\n4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址\n5、生成地址字符串:地址字节[]+校验位,然后执行Base58计算生成字符串\n5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)\n5.1、如果非NULS体系校验位:xor=XOR(length+address)\n6、base58计算生成地址字符串:\n NULS体系地址:Base58(type+hash160+xor)+Hex(chainId)\n 非NULS体系地址:Base58(length+address+xor)+Hex(chainId)\n7、根据密码对私钥进行加密,并将私钥的明文删除\n8、存储账户信息\n9、将账户加入缓存\n10、发送创建账户事件\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_createAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口创建一个或多个账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")])])]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd":"ac_createAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])]),_("ul",[_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID,说明该账户属于哪个链")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("count")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("要创建账户数量,约束条件:1-100.")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户初始密码,可为空")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")])])]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t["address","",""]\n }\n}\n')])])]),_("ul",[_("li",[t._v("返回字段说明")])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址列表")])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("事件总线:发送创建账户事件")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-2-创建离线账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-创建离线账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 创建离线账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("创建用户的离线账户,包括账户的地址、公匙、私匙的创建,账户信息并不会保存到数据库")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(602),alt:""}})]),t._v(" "),_("p",[t._v("创建地址:创建卫星链标准账户地址")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、生成随机公私钥对\n2、获取chainId和账户类型\n3、根据公钥计算hash160\n4、拼接字节数组组成地址:\n4.1、如果是NULS体系地址:address=type+hash160\n4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址\n5、生成地址字符串:地址字节[]+校验位,然后执行Base58计算生成字符串\n5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)\n5.1、如果非NULS体系校验位:xor=XOR(length+address)\n6、base58计算生成地址字符串:\n NULS体系地址:Base58(type+hash160+xor)+Hex(chainId)\n 非NULS体系地址:Base58(length+address+xor)+Hex(chainId)\n7、根据密码对私钥进行加密,并将私钥的明文删除\n8、返回账户信息,并不保存到数据库\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_createOfflineAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口创建一个或多个离线账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd":"ac_createOfflineAccount",\n "minVersion":1.0,\n "params":[\n 1234,\n 10,\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID,说明该账户属于哪个链")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("count")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("要创建账户数量,约束条件:1-100.")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户初始密码,可为空")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t[\n \t{\n \t"address":"LgkSxjwficqMwnMVXpdA3kntVjXDm3930",\n \t"pubKey":"0253aa17b27482261cc9e91d5ff6f4820130055ad092629e6981bff78c545c6289",\n \t"priKey":"0253aa17b27482261cc9e91d5ff6f4820130055ad092629e6981bff78c545c6111",\t\n \t\t"encryptedPriKey":"e447b8427ce96b49e0fcf167f31635b93c8e8acf15e48c01e6753e23a",\n \t\t"extend":null,\n \t\t"createTime":1542003713441,\n \t\t"encrypted":true,\n \t\t"remark":null\n \t\t},{}\n \t]\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址列表")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公匙16进制编码")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("私匙16进制编码")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("加密私匙16进制编码,与priKey不会同时为空")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("extend")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("扩展字段16进制编码")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户创建时间")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encrypted")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户是否加密")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("remark")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("备注")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("无")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-3-创建多签账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-创建多签账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 创建多签账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("创建多重签名账户,包括账户的地址、脚本的创建,多签账户信息保存到数据库")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证签名公匙列表,最少验证签名数是否正确\n2、创建多重签名脚本\n3、根据多签脚本创建多重签名类型的账户地址\n4、保存多重签名账户\n5、返回多签账户信息\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_createMultiSigAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口创建多重签名账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "createMultiAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID,说明该账户属于哪个链")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("pubKeys")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("jsonArray")]),t._v(" "),_("td",[t._v("需要签名的公钥列表")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("minSigns")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("最少签名数,最少需要几个公钥验证通过")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "minSigns":"",\n "pubKeys":[{\n "pubKey":"",\n "address":""\n },{}\n ]\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("多签账户地址")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("minSigns")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("最小签名数")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("pubKeys")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公钥列表")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("--pubKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公钥")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("--address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("地址")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("无")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-4-移除账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-移除账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 移除账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("移除用户的本地账户,包括删除本地账户的地址,并将删除账户通过事件通知其他节点")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(603),alt:""}})]),t._v(" "),_("p",[t._v("删除账户")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户地址格式是否正确\n2、验证账户存在\n3、验证账户是否加密,如果加密,则需要验证密码\n3.1、根据账户已加密私匙+密码得到未加密私匙\n3.2、根据未加密私匙得到公匙\n3.3、将解密出的公匙与查询出的账户公匙比较是否相等\n4、删除数据\n4.1、删除本地账户信息\n4.2、删除账户缓存信息\n5、发送删除账户事件\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_removeAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于移除账户")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_removeAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("要删除的账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码,可为空")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("删除是否成功")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("事件总线模块:发送删除账户事件")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-5-导入账户-私匙"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-导入账户-私匙","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 导入账户-私匙")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据私匙导入账户,根据私匙生成账户,并导入账户账本数据")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(604),alt:""}})]),t._v(" "),_("p",[t._v("根据私匙导入账户信息")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、根据私钥生成公私钥对\n2、获取chainId和账户类型\n3、根据公钥计算hash160\n4、拼接字节数组组成地址:\n4.1、如果是NULS体系地址:address=type+hash160\n4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址\n5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)\n5.1、如果非NULS体系校验位:xor=XOR(length+address)\n6、base58计算生成地址字符串:\n NULS体系地址:Base58(type+hash160+xor)+Base58(chainId)\n 非NULS体系地址:Base58(length+address+xor)+Base58(chainId)\n7、根据密码对私钥进行加密,并将私钥的明文删除\n8、存储账户信息\n9、将账户加入缓存\n10、若发送导入账户事件:账户已存在的情况不发布新事件,只做覆盖更新\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_importAccountByPriKey接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口根据账户私匙导入账户")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_importAccountByPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("priKey")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户私匙")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("overwrite")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Boolean")]),t._v(" "),_("td",[t._v("账户存在时是否覆盖")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("事件总线模块:账户不存在时,发送导入账户事件")]),t._v(" "),_("p",[t._v("账本模块:导入账户账本(已确认交易)")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-6-导入账户-keystore"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-导入账户-keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 导入账户-keystore")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据keystore导入账户,根据keystore解析解密得到私匙并生成账户,并导入账户账本数据")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(605),alt:""}})]),t._v(" "),_("p",[t._v("导入账户keystore")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证keystore和密码是否匹配\n2、根据密码解密keystore中的私钥,keyStore包括json格式(address,encryptedPrivateKey,pubKey,prikey)\n3、根据私钥生成公私\n4、获取chainId和账户类型\n5、拼接字节数组组成地址\n6、生成地址字符串\n7、验证地址字符串和keystore中的地址是否一致\n8、存储账户信息\n9、发送导入账户事件:账户已存在的情况不发布新事件,只做覆盖更新\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_importAccountByKeystore接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于导入账户keystore")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_importAccountByKeystore",\n "minVersion":1.0,\n "params": [\n 1234,\n "HEX",\n "123456",\n true\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("keyStore")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("keyStore HEX编码")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("overwrite")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Boolean")]),t._v(" "),_("td",[t._v("账户存在时是否覆盖")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("事件总线模块:账户不存在时,发送导入账户事件")]),t._v(" "),_("p",[t._v("账本模块:导入账户账本(已确认交易)")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-7-导入多签账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-导入多签账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 导入多签账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("导入一个跟本地地址相关的多签账户,包括账户的地址、脚本的创建,多签账户信息保存到数据库")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证多签地址、签名公匙列表、最少验证签名数是否正确\n2、创建多重签名脚本\n3、根据多签脚本创建多重签名类型的账户地址\n4、判断导入的多签地址与脚本生成的地址是否相同,不相同则提示导入错误\n5、保存多签账户信息,包括:地址、公匙列表、最少验证签名数\n6、返回多签地址\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_importMultiSigAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于导入多重签名账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_importMultiSigAccount",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ["pubKey1","pubKey2"],\n 2\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("多签账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("pubkeys")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("jsonArray")]),t._v(" "),_("td",[t._v("需要签名的公钥列表")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("minSigns")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("最小签名数,最少需要几个公钥验证通过")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("多签地址")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-8-导出账户私匙"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-导出账户私匙","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 导出账户私匙")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("导出账户私匙十六进制编码,与查询账户私钥功能重叠,作废")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(606),alt:""}})]),t._v(" "),_("p",[t._v("导出账户私匙")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在,验证密码是否正确\n2、解密私钥,生成Hex字符串\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_exportAccountPriKey接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于导出账户私匙。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_exportAccountPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n \t"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("地址")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("私匙十六进制")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-9-导出账户keystore"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-导出账户keystore","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 导出账户KeyStore")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("导出账户keystore")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[_("img",{attrs:{src:v(607),alt:""}})]),t._v(" "),_("p",[t._v("导出账户keystore")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在,验证密码是否正确\n2、生成keystore文件\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_exportAccountKeyStore接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于导出账户keystore。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_exportAccountKeyStore",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n "backup"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("path")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("文件备份地址")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"path":"backup/TTax8wqxALqjyhrL8Wv1tQiqswAshAnX.keystore"\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("path")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("文件备份地址")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-10-查询全部账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-查询全部账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.10 查询全部账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("查询全部账户")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[t._v("查询账户信息")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、查询全部账户信息\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAccountList接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("接口说明:该接口用于查询全部账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd":"ac_getAccountList",\n "minVersion":1.0,\n "params":[\n 1234\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t[{\n \t"address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n },{}]\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("List")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户列表集合")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公匙16进制编码")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("加密私匙16进制编码")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-11-根据地址获取账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-根据地址获取账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.11 根据地址获取账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据地址获取账户")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证地址是否存在\n2、根据地址获取账户\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAccountByAddress接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于根据地址获取账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAccountByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "address":"",\n "alias":"",\n "pubkeyHex":"",\n "encryptedPrikeyHex":""\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("pubkeyHex")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公匙16进制编码")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPrikeyHex")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("加密私匙16进制编码")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-12-查询账户地址列表"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-查询账户地址列表","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.12 查询账户地址列表")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("查询账户地址列表")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、校验分页参数是否合法,分页数、分页大小不能小于0,必须为整数;\n2、查询所有账户;\n3、过滤符合分页条件的账户;\n4、只返回账户的地址列表;\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAddressList接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于查询账户地址列表。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAddressList",\n "minVersion":1.0,\n "params": [\n 1234,\n 1,\n 10\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("pageNumber")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("页码")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("pageSize")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Integer")]),t._v(" "),_("td",[t._v("每页显示数量")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t["","",""]\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("地址列表集合")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-13-根据别名获取地址"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-根据别名获取地址","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.13 根据别名获取地址")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据别名获取地址")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、查询别名是否存在\n2、返回设置别名时使用的账户地址,并使用Base58对账户地址进行编码\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAddressByAlias接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于根据别名获取地址。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAddressByAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("地址,Base58编码")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-14-查询账户私匙"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-查询账户私匙","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.14 查询账户私匙")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("查询账户私匙")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、校验地址是否正确,使用Base58解码,分别校验链ID、地址类型、校验位\n2、验证账户是否存在\n3、如果账户加过密(有密码), 就通过AES解密并验证密码是否正确,获得未加密私匙\n4、如果账户未加密,则不返回私钥,账户如果存在则返回账户有效标识\n5、使用十六进制编码,并返回账户私匙\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getPriKeyByAddress接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于查询账户私匙。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getPriKeyByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("address")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308",\n "valid":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("私匙十六进制")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("valid")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户是否存在")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-15-查询所有账户私匙"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15-查询所有账户私匙","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.15 查询所有账户私匙")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("查询所有账户私匙")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证密码格式是否正确,密码可为空\n2、获取所有本地账户\n3、本地账户的加密信息必须一致,如果参数密码不为空,所有账户的密码都必须与之相同,如果参数密码为空,所有账户都不能设置密码,否则提示错误\n4、如果账户加密则通过密码反解出未加密私匙,否则未加密直接获得私匙\n5、将所有私匙添加到集合并返回\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAllPriKey接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于查询所有账户私匙。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAllPriKey",\n "minVersion":1.0,\n "params": [\n 1234,\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID,默认为0查询所有链账户")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n ["",""]\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("私匙集合")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-16-设置密码"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-设置密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.16 设置密码")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("设置密码")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在\n2、验证密码是否已经设置\n3、设置账户密码\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_setPassword接口定义")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于设置账户密码。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据,密码设置是否成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-17-设置离线账户密码"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-设置离线账户密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.17 设置离线账户密码")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("设置离线账户密码")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证地址是否正确\n2、验证私匙是否正确\n3、根据私匙创建\n4、设置离线账户密码\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_setOfflineAccountPassword接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于设置离线账户密码。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("priKey")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户私匙")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("加密私匙")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-18-修改密码"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-修改密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.18 修改密码")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("Request Body")])]),t._v(" "),_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("修改密码")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证旧密码正确性\n2、更新私钥密文\n3、发送修改密码事件\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_updatePassword接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于修改账户密码。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_updatePassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "111111"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("newPassword")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户新密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("密码修改是否成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-19-修改离线账户密码"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-修改离线账户密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.19 修改离线账户密码")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("修改离线账户密码")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证地址是否正确\n2、根据地址、私匙、新密码生成离线账户\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_updateOfflineAccountPassword接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于修改离线账户密码。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_updateOfflineAccountPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",\n "123456",\n "111111"\n ]\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("priKey")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("私匙")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("4")]),t._v(" "),_("td",[t._v("newPassword")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户新密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "encryptedPriKey":""\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("加密私匙")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-20-验证密码"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-验证密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.20 验证密码")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("验证密码")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证密码是否正确\n2、返回验证结果\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_validationPassword接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于验证密码。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_validationPassword",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("密码是否正确")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-21-验证账户是否加密"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-验证账户是否加密","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.21 验证账户是否加密")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("验证账户是否加密")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("p",[t._v("1、验证账户是否存在\n2、验证账户是否加密\n3、返回验证结果")])]),t._v(" "),_("li",[_("p",[t._v("ac_isEncrypted接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于验证账户是否加密。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_isEncrypted",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户是否加密")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-22-设置账户别名"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-设置账户别名","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.22 设置账户别名")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("设置账户别名")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证别名是否合法\n2、生成设置别名交易\n3、调用ledger填充交易费用信息\n4、广播交易\n5、交易确认后,会保存别名到数据库,将address和alias分别作为key存储,也就是别名数据会存两条数据,主要是为了便于根据address和alias分别查询\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_setAlias接口定义")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于设置账户别名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名交易hash")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("账本模块:设置别名需要花费手续费")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-23-获取设置别名手续费"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-获取设置别名手续费","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.23 获取设置别名手续费")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("获取设置别名手续费")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在,验证别名是否正确\n2、计算别名设置所需手续费\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAliasFee接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于获取设置别名手续费。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAliasFee",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "abc"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "fee":"100",\n "maxAmount":"10000"\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("fee")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名交易手续费")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("maxAmount")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("交易最大手续费")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-3-24-根据地址查询别名"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-根据地址查询别名","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3.24 根据地址查询别名")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据地址查询别名")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在\n2、从数据库中查询账户对应的别名\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_getAliasByAddress接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于根据地址查询别名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_getAliasByAddress",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "alias":""\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户别名")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-25-验证别名是否可用"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-验证别名是否可用","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.25 验证别名是否可用")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("验证别名是否可用")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、查询别名是否已存在,如果存在则不可用,反之则可用\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_isAliasUsable接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于验证别名是否可用。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_isAliasUsable",\n "minVersion":1.0,\n "params": [\n 1234,\n "abc"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户别名")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名是否可用")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-26-设置账户备注"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-设置账户备注","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.26 设置账户备注")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("设置账户备注")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在\n2、修改备注信息并保存\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_setRemark接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于设置账户备注。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setRemark",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"\n "remark1"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("remark")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户备注")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("pre",[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("设置是否成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-27-设置多签账户别名"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-设置多签账户别名","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.27 设置多签账户别名")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("设置多签账户别名")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户地址、别名、账户密码、签名地址参数是否合法\n2、查询账户地址、签名地址是否存在\n3、生成设置多签账户别名交易\n4、调用ledger填充交易费用信息\n5、使用签名账户对交易进行签名\n6、当已签名数等于最少签名数则保存未确认交易到本地账户\n7、广播该交易\n8、返回交易hash\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_setMultiSigAlias接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于设置多签账户别名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setMultiSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "123456",\n "abc"\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("多签账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("signAddress")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("签名地址")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("4")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"\n }\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("多签别名交易hash")])])])])])])]),t._v(" "),_("li",[_("p",[t._v("依赖服务")]),t._v(" "),_("p",[t._v("账本模块:设置多签别名需要花费手续费")])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-28-移除多签账户"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-移除多签账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.28 移除多签账户")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("移除多签账户")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户地址是否正确\n2、数据库中删除多签账户\n3、返回删除是否成功\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_removeMultiSigAccount接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于移除多签账户。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_setMutilSigAlias",\n "minVersion":1.0,\n "params": [\n 1234,\n "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",\n ]\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("多签账户地址")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("是否移除成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-29-交易统一验证"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-交易统一验证","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.29 交易统一验证")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("账户模块所有交易统一验证接口,目前只有别名交易")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、交易列表是否为空\n2、循环所有交易列表,针对别名交易进行处理\n3、检测当前交易列表中,是否存在设置相同的别名\n4、检测当前交易列表中,是否存在账户重复设置别名\n5、如果交易列表中没有冲突,则验证通过\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_accountTxValidate接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于批量验证账户模块所有交易。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_accountTxValidate",\n "minVersion":1.0,\n "params": [chianId, ["txHex","txHex","txHex", ...]]\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("txHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("array")]),t._v(" "),_("td",[t._v("别名交易序列化数据数组")])])])]),t._v(" "),_("p",[t._v("txHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"10000",\n "nonce":"123"\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"1"\n }]\n },\n "txData":\n {\n "chainId":12345,\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "list":["txHex", "txHex", "txHex", ...]\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonArray")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("不合法交易序列化数据数组")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-30-别名交易验证"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-30-别名交易验证","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.30 别名交易验证")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("别名交易验证接口")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、反序列化txHex别名交易数据\n2、验证别名格式\n3、验证别名是否已被占用\n4、验证该账户是否已设置别名\n5、验证coinData输入输出\n6、验证脚本签名格式\n7、验证签名中是否包含设置别名的地址,如果不包含则属于恶意犯规,否则验证通过\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_aliasTxValidate接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于单个别名交易。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_aliasTxValidate",\n "minVersion":1.0,\n "params": [chainId,"txHex"]\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("txHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名交易序列化数据")])])])]),t._v(" "),_("p",[t._v("txHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"10000",\n "nonce":"123"\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"1"\n }]\n },\n "txData":\n {\n "chainId":12345,\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("是否验证成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-31-别名交易提交"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-31-别名交易提交","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.31 别名交易提交")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("别名交易提交,保存别名")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、反序列化txHex别名交易数据\n2、保存别名alias至数据库\n3、将别名设置到account然后保存至数据库\n4、将修改后的account重新进行缓存\n5、返回别名保存是否成功\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_aliasTxCommit接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于保存别名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_aliasTxCommit",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("txHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名交易序列化数据")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("secondaryDataHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("区块头序列化数据")])])])]),t._v(" "),_("p",[t._v("txHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"10000",\n "nonce":"123"\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"1"\n }]\n },\n "txData":\n {\n "chainId":12345,\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),_("p",[t._v("secondaryDataHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名交易保存是否成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-32-别名交易回滚"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-32-别名交易回滚","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.32 别名交易回滚")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("别名交易回滚接口")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、反序列化txHex别名交易数据\n2、从数据库删除别名对象数据\n3、取出对应的account将别名清除,重新存入数据库\n4、重新缓存account\n5、返回别名回滚是否成功\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_aliasTxRollback接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于回滚别名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_aliasTxRollback",\n "minVersion":1.0,\n "params": [chainId,"txHex","secondaryDataHex"]\n}\n\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("txHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("别名交易序列化数据")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("secondaryDataHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("区块头序列化数据")])])])]),t._v(" "),_("p",[t._v("txHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "type":3,\n "time":"12546545596",\n "scriptSig":"",\n "hash":"",\n "coinData":\n {\n "froms":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"10000",\n "nonce":"123"\n }],\n "to":\n [{\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "amount":"1"\n }]\n },\n "txData":\n {\n "chainId":12345,\n "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",\n "alias":"lucas"\n }\n}\n')])])]),_("p",[t._v("secondaryDataHex说明")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('"txData":\n {\n "hash":"",\n "height":1,\n "time":13369748564\n }\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("value")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("boolean")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("别名交易回滚是否成功")])])])])])])])]),t._v(" "),_("h4",{attrs:{id:"_2-2-33-数据签名"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-33-数据签名","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.33 数据签名")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("功能说明:")]),t._v(" "),_("p",[t._v("根据私钥将数据进行加密签名")])]),t._v(" "),_("li",[_("p",[t._v("流程描述")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、验证账户是否存在,验证密码是否正确\n2、根据椭圆曲线算法对数据签名\n3、返回十六进制签名后数据\n")])])])]),t._v(" "),_("li",[_("p",[t._v("ac_signDigest接口")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("接口说明")]),t._v(" "),_("p",[t._v("该接口用于数据签名。")])]),t._v(" "),_("li",[_("p",[t._v("请求示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "cmd": "ac_signDigest",\n "minVersion":1.0,\n "params": \n {\n "chainId":"12345",\n "address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",\n "password":"",\n "dataHex":""\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("请求参数说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("index")]),t._v(" "),_("th",[t._v("parameter")]),t._v(" "),_("th",[t._v("required")]),t._v(" "),_("th",[t._v("type")]),t._v(" "),_("th",[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("0")]),t._v(" "),_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("Short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("1")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("2")]),t._v(" "),_("td",[t._v("password")]),t._v(" "),_("td",[t._v("false")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户密码")])]),t._v(" "),_("tr",[_("td",[t._v("3")]),t._v(" "),_("td",[t._v("dataHex")]),t._v(" "),_("td",[t._v("true")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("待签名数据HEX编码,如交易hash摘要")])])])])]),t._v(" "),_("li",[_("p",[t._v("返回示例")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v('{\n "code": 0,\n "msg": "success",\n "version":1.0,\n "result": {\n "signatureHex":""\n }\n}\n')])])])]),t._v(" "),_("li",[_("p",[t._v("返回字段说明")]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[t._v("description")])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("返回结果状态")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("失败时的信息")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("jsonObj")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("业务数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("signatureHex")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("签名后的数据")])])])])])])])]),t._v(" "),_("h3",{attrs:{id:"_2-3-模块内部功能"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 模块内部功能")]),t._v(" "),_("h2",{attrs:{id:"四、事件说明"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 四、事件说明")]),t._v(" "),_("h3",{attrs:{id:"_4-1-发布的事件"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-发布的事件","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 发布的事件")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("创建账户")]),t._v(" "),_("p",[t._v('event_topic : "evt_ac_createAccount"')]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("data:{\n address:''\n isEncrypted:true //是否设置了密码\n}\n")])])])]),t._v(" "),_("li",[_("p",[t._v("删除账户")]),t._v(" "),_("p",[t._v('event_topic : "evt_ac_removeAccount"')]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("data:{\n\taddress:''\n}\n")])])])]),t._v(" "),_("li",[_("p",[t._v("修改密码")]),t._v(" "),_("p",[t._v('event_topic : "evt_ac_updatePassword"')]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("data:{\n\taddress:''\n}\n")])])])])]),t._v(" "),_("h3",{attrs:{id:"_4-2-订阅的事件"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-订阅的事件","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 订阅的事件")]),t._v(" "),_("p",[t._v("无")]),t._v(" "),_("h2",{attrs:{id:"五、协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 五、协议")]),t._v(" "),_("h3",{attrs:{id:"_5-1-网络通讯协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-网络通讯协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 网络通讯协议")]),t._v(" "),_("ul",[_("li",[t._v("无")])]),t._v(" "),_("h3",{attrs:{id:"_5-2-交易协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-交易协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 交易协议")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("设置别名")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("协议")]),t._v(" "),_("p",[t._v("与通用交易相比,只有类型和txData有区别,具体区别如下")])])]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("type: n //设置别名交易的类型\ntxData:{\n address: //VarByte 设置别名的地址\n alias: //VarByte 别名字符串转成的字节数组,用UTF-8解码\n}\n")])])]),_("ul",[_("li",[t._v("别名交易参数")])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[t._v("Len")]),t._v(" "),_("th",[t._v("Fields")]),t._v(" "),_("th",[t._v("Data Type")]),t._v(" "),_("th",[t._v("Remark")])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("24")]),t._v(" "),_("td",[t._v("address")]),t._v(" "),_("td",[t._v("byte[]")]),t._v(" "),_("td",[t._v("设置别名的地址")])]),t._v(" "),_("tr",[_("td",[t._v("32")]),t._v(" "),_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("byte[]")]),t._v(" "),_("td",[t._v("别名字符串转成的字节数组,用UTF-8解码")])])])]),t._v(" "),_("ul",[_("li",[t._v("验证器")])]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、别名格式合法性验证\n2、地址必须是卫星链地址,且一个地址只能设置一个别名\n3、烧毁一个token单位\n4、交易手续费\n5、签名:设置的地址、input、签名三者验证\n")])])]),_("ul",[_("li",[t._v("处理器")])]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("1、资产处理器\n2、存储alias数据\n3、更新本地账户信息\n")])])])])]),t._v(" "),_("h2",{attrs:{id:"六、模块配置项"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置项","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、模块配置项")]),t._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[t._v("server.ip:0.0.0.0 //本机ip,用于提供服务给其他模块\nserver.port:8080 //提供服务的端口\n")])])]),_("h2",{attrs:{id:"七、java特有的设计"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、Java特有的设计")]),t._v(" "),_("ul",[_("li",[_("p",[t._v("Account对象设计")]),t._v(" "),_("p",[t._v("该表存储时使用的key:")]),t._v(" "),_("p",[t._v("NULS体系:chainId+type+hash160")]),t._v(" "),_("p",[t._v("非NULS体系:chainId+length+address")])])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",{staticStyle:{"text-align":"left"}},[_("code",[t._v("字段名称")])]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[_("code",[t._v("type")])]),t._v(" "),_("th",{staticStyle:{"text-align":"left"}},[_("code",[t._v("说明")])])])]),t._v(" "),_("tbody",[_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("short")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("链ID")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户地址(Base58(address)+Base58(chainId))")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("alias")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("账户别名")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("status")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("Integer")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("是否默认账户(不保存)")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("pubKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("公匙")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("priKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("私匙-未加密")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("encryptedPriKey")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("已加密私匙")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("extend")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("byte[]")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("扩展数据")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("remark")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("备注")])]),t._v(" "),_("tr",[_("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),_("td",{staticStyle:{"text-align":"left"}},[t._v("创建时间")])])])]),t._v(" "),_("ul",[_("li",[t._v("Address对象设计(不持久化存储)")])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[_("code",[t._v("字段名称")])]),t._v(" "),_("th",[_("code",[t._v("type")])]),t._v(" "),_("th",[_("code",[t._v("说明")])])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("chainId")]),t._v(" "),_("td",[t._v("short")]),t._v(" "),_("td",[t._v("链ID")])]),t._v(" "),_("tr",[_("td",[t._v("addressType")]),t._v(" "),_("td",[t._v("byte")]),t._v(" "),_("td",[t._v("地址类型")])]),t._v(" "),_("tr",[_("td",[t._v("hash160")]),t._v(" "),_("td",[t._v("byte[]")]),t._v(" "),_("td",[t._v("公匙hash")])]),t._v(" "),_("tr",[_("td",[t._v("addressBytes")]),t._v(" "),_("td",[t._v("byte[]")]),t._v(" "),_("td",[t._v("地址字节数组")])])])]),t._v(" "),_("ul",[_("li",[_("p",[t._v("Alias对象设计")]),t._v(" "),_("p",[t._v("该表存储时使用的key:")]),t._v(" "),_("p",[t._v("address和alias分别作为key存储,别名数据存储两份")]),t._v(" "),_("p",[t._v("需要按照不同的链分别创建不同的别名表")])])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[_("code",[t._v("字段名称")])]),t._v(" "),_("th",[_("code",[t._v("type")])]),t._v(" "),_("th",[_("code",[t._v("说明")])])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("address")]),t._v(" "),_("td",[t._v("byte[]")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("alias")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户别名")])])])]),t._v(" "),_("ul",[_("li",[t._v("MultiSigAccount对象设计")])]),t._v(" "),_("table",[_("thead",[_("tr",[_("th",[_("code",[t._v("字段名称")])]),t._v(" "),_("th",[_("code",[t._v("type")])]),t._v(" "),_("th",[_("code",[t._v("说明")])])])]),t._v(" "),_("tbody",[_("tr",[_("td",[t._v("address")]),t._v(" "),_("td",[t._v("String")]),t._v(" "),_("td",[t._v("账户地址")])]),t._v(" "),_("tr",[_("td",[t._v("pubKeyList")]),t._v(" "),_("td",[t._v("List")]),t._v(" "),_("td",[t._v("需要签名的公钥列表")])]),t._v(" "),_("tr",[_("td",[t._v("minSigns")]),t._v(" "),_("td",[t._v("long")]),t._v(" "),_("td",[t._v("最少签名数")])])])]),t._v(" "),_("h2",{attrs:{id:""}},[_("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[t._v("#")])]),t._v(" "),_("h2",{attrs:{id:"八、补充内容"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 八、补充内容")])])}],a=v(0),l=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},_,!1,null,null,null);l.options.__file="accountModuleDesign.md";e.default=l.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/25.0460bbcd.js b/docs/.vuepress/dist/assets/js/25.0460bbcd.js new file mode 100644 index 00000000..704f075d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/25.0460bbcd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{608:function(t,_,e){t.exports=e.p+"assets/img/block-module.ffc57f74.png"},609:function(t,_,e){t.exports=e.p+"assets/img/block-module-boot.4686b7bf.png"},610:function(t,_,e){t.exports=e.p+"assets/img/block-synchronization.3b5f0ded.png"},611:function(t,_,e){t.exports=e.p+"assets/img/block-synchronization2.1bde323a.png"},612:function(t,_,e){t.exports=e.p+"assets/img/block-synchronization3.99496017.png"},613:function(t,_,e){t.exports=e.p+"assets/img/block-basic-validation.07557d70.png"},614:function(t,_,e){t.exports=e.p+"assets/img/block-basic-validation1.cf392d66.png"},615:function(t,_,e){t.exports=e.p+"assets/img/block-fork.a3b65fd6.png"},616:function(t,_,e){t.exports=e.p+"assets/img/block-fork-chain.ceeb7bdd.png"},849:function(t,_,e){"use strict";e.r(_);var v=[function(){var t=this.$createElement,_=this._self._c||t;return _("h1",{attrs:{id:"区块管理模块设计文档"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#区块管理模块设计文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 区块管理模块设计文档")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"一、总体描述"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、总体描述")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_1-1-模块概述"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 模块概述")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_1-1-1-为什么要有《区块管理》模块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《区块管理》模块","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 为什么要有《区块管理》模块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_1-1-2-《区块管理》要做什么"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《区块管理》要做什么","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 《区块管理》要做什么")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("如果是自身节点打包区块,共识模块会把打包好的区块交给区块管理模块,区块管理模块会负责进行区块验证、区块保存、区块广播,并且要响应网络上的其他节点发起的获取该区块的请求。")]),this._v(" "),_("li",[this._v("如果是其他共识节点打包区块,本地节点会收到网络上发来的转发区块消息,此时要从其他节点获取区块信息,进行验证并保存,保存完成后再次转发该区块,让区块在全网传播。")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("pre",[_("code",[this._v("对外提供区块头、区块查询服务\n")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_1-1-3-《区块管理》在系统中的定位"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《区块管理》在系统中的定位","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《区块管理》在系统中的定位")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("区块同步-依赖网络模块的通讯接口,依赖工具模块的序列化工具")]),this._v(" "),_("li",[this._v("区块存储、回滚-依赖工具模块的数据库存储工具、共识模块、交易管理模块")]),this._v(" "),_("li",[this._v("区块转发-依赖网络模块的广播消息接口")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("整个系统可以发起交易-区块同步")]),this._v(" "),_("li",[this._v("共识模块:区块详细验证、打包-区块查询、区块保存、区块广播、区块回滚")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_1-2-架构图"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 架构图")])},function(){var t=this.$createElement,_=this._self._c||t;return _("p",[_("img",{attrs:{src:e(608),alt:""}})])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"二、功能设计"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、功能设计")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_2-1-功能架构图"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 功能架构图")])},function(){var t=this.$createElement,_=this._self._c||t;return _("p",[_("img",{attrs:{src:"image/block-module/block-functions.png",alt:""}})])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ol",[e("li",[t._v("提供api,进行区块存储、查询、回滚的操作")]),t._v(" "),e("li",[t._v("从网络上同步最新区块,进行初步验证、分叉验证,如果没有分叉,调用共识模块进行共识验证,调用交易模块进行交易验证,全部验证通过后保存到本地。")]),t._v(" "),e("li",[t._v("区块同步、广播、转发消息的处理")]),t._v(" "),e("li",[t._v("分叉区块的判断、存储")]),t._v(" "),e("li",[t._v("孤儿区块的判断、存储")]),t._v(" "),e("li",[t._v("分叉链维护、切换")]),t._v(" "),e("li",[t._v("孤儿链维护、切换")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_2-2-模块服务"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 模块服务")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-1-获取本地最新区块头"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-获取本地最新区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 获取本地最新区块头")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID、缓存的最新区块高度查询DB得到最新区块头HASH")]),this._v(" "),_("li",[this._v("根据HASH查询DB得到区块头byte数组")]),this._v(" "),_("li",[this._v("反序列化为区块头对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bestBlockHeader",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("上一区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块MerkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("size")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("区块大小")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块打包时间")])]),t._v(" "),e("tr",[e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("packingAddress")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("打包地址")])]),t._v(" "),e("tr",[e("td",[t._v("reward")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("共识奖励")])]),t._v(" "),e("tr",[e("td",[t._v("fee")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("手续费")])]),t._v(" "),e("tr",[e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),e("tr",[e("td",[t._v("scriptSig")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-2-获取本地最新区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-获取本地最新区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 获取本地最新区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明:")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID获取本地最新区块头")]),this._v(" "),_("li",[this._v("根据区块头高度查询DB得到交易HASH列表")]),this._v(" "),_("li",[this._v("根据HASH列表从交易管理模块获取交易数据")]),this._v(" "),_("li",[this._v("组装成block对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bestBlock",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("pre",[e("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //区块头\n \t"transactions": [\n \t {\n "chainId": "888", //链Id\n "height": "1", //区块高度\n "hash": "1", //交易HASH\n "remark": "1", //交易备注\n "size": "1", //交易大小\n "time": "1", //交易时间\n "type": "1", //交易类型\n "transactionSignature": "1", //交易签名\n "coinData": {\n "from" : [\n {\n "fromAssetsChainId":""//资产发行链的id \n "fromAssetsId":""//资产id\n "fromAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n "to" : [\n {\n "toAssetsChainId":""//资产发行链的id \n "toAssetsId":""//资产id\n "toAddress":""//转出账户地址\n "amount":""//转出金额\n "locktime":""\n },{...}\n ]\n }\n "txData": XXXX, //交易数据 HEX\n \t },\n \t {...}\n \t] //交易列表\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("p",[t._v("略")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-3-根据高度获取区块头"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-根据高度获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 根据高度获取区块头")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID、高度查询DB得到最新区块头HASH")]),this._v(" "),_("li",[this._v("根据HASH查询DB得到区块头byte数组")]),this._v(" "),_("li",[this._v("反序列化为区块头对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "getBlockHeaderByHeight",\n "minVersion":"1.1",\n "params": ["111","888"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("height")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("区块高度")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("链Id")])]),t._v(" "),e("tr",[e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("上一区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块MerkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("size")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("区块大小")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块打包时间")])]),t._v(" "),e("tr",[e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("packingAddress")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("打包地址")])]),t._v(" "),e("tr",[e("td",[t._v("reward")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("共识奖励")])]),t._v(" "),e("tr",[e("td",[t._v("fee")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("手续费")])]),t._v(" "),e("tr",[e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),e("tr",[e("td",[t._v("scriptSig")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-4-根据高度获取区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-根据高度获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 根据高度获取区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明:")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID、高度获取区块头")]),this._v(" "),_("li",[this._v("根据区块头高度查询DB得到交易HASH列表")]),this._v(" "),_("li",[this._v("根据HASH列表从交易管理模块获取交易数据")]),this._v(" "),_("li",[this._v("组装成block对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getBlockByHeight",\n "minVersion":"1.1",\n "params": ["111","888"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("height")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("区块高度")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("pre",[e("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //区块头\n \t"transactions": [\n \t {\n "chainId": "888",//链ID\n "height": "1", //区块高度\n "hash": "1", //交易HASH\n "remark": "1", //交易备注\n "size": "1", //交易大小\n "time": "1", //交易时间\n "type": "1", //交易类型\n "transactionSignature": "1", //交易签名\n "coinData": {\n "from" : [\n {\n "fromAssetsChainId":""//资产发行链的id \n "fromAssetsId":""//资产id\n "fromAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n "to" : [\n {\n "toAssetsChainId":""//资产发行链的id \n "toAssetsId":""//资产id\n "toAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n }\n "txData": XXXX, //交易数据 HEX\n \t },\n \t {...}\n \t], //交易列表\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("p",[t._v("略")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-5-根据hash获取区块头"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-根据hash获取区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 根据HASH获取区块头")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID、HASH查询DB得到区块头byte数组")]),this._v(" "),_("li",[this._v("反序列化为区块头对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getBlockHeaderByHash",\n "minVersion":"1.1",\n "params": ["888","aaa"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("区块hash")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("上一区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块MerkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("size")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("区块大小")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块打包时间")])]),t._v(" "),e("tr",[e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("packingAddress")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("打包地址")])]),t._v(" "),e("tr",[e("td",[t._v("reward")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("共识奖励")])]),t._v(" "),e("tr",[e("td",[t._v("fee")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("手续费")])]),t._v(" "),e("tr",[e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),e("tr",[e("td",[t._v("scriptSig")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-6-根据hash获取区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-根据hash获取区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 根据HASH获取区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明:")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据链ID、hash获取区块头")]),this._v(" "),_("li",[this._v("根据区块头高度查询DB得到交易HASH列表")]),this._v(" "),_("li",[this._v("根据HASH列表从交易管理模块获取交易数据")]),this._v(" "),_("li",[this._v("组装成block对象")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getBlockByHash",\n "minVersion":"1.1",\n "params": ["888","aaa"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("区块hash")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("pre",[e("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n \t "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //区块头\n \t"transactions": [\n \t {\n \t "chainId": "888",\n "height": "1", //区块高度\n "hash": "1", //交易HASH\n "remark": "1", //交易备注\n "size": "1", //交易大小\n "time": "1", //交易时间\n "type": "1", //交易类型\n "transactionSignature": "1", //交易签名\n "coinData": {\n "from" : [\n {\n "fromAssetsChainId":""//资产发行链的id \n "fromAssetsId":""//资产id\n "fromAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n "to" : [\n {\n "toAssetsChainId":""//资产发行链的id \n "toAssetsId":""//资产id\n "toAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n }\n "txData": XXXX, //交易数据 HEX\n \t },\n \t {...}\n \t], //交易列表\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("p",[t._v("略")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-7-获取当前同步区块状态"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-获取当前同步区块状态","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 获取当前同步区块状态")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getSynchronizeInfo",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"chainId": "888", "sync": "true"}\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("sync")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块同步是否完成")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-8-获取某高度区间内区块头"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-获取某高度区间内区块头","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 获取某高度区间内区块头")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ol",[e("li",[t._v("令queryHash=endHash")]),t._v(" "),e("li",[t._v("根据链ID、queryHash查询DB得到区块头byte数组")]),t._v(" "),e("li",[t._v("反序列化为区块头对象blockHeader,添加到List中作为返回值")]),t._v(" "),e("li",[t._v("如果blockHeader.hash!=startHash,令queryHash=blockHeader.preHash,重复第2步")]),t._v(" "),e("li",[t._v("返回List")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getBlockHeaderBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("startHeight")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("起始高度")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("endHeight")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("结束高度")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "list" : [\n {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n ]\n\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("上一区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块MerkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("size")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("区块大小")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("区块打包时间")])]),t._v(" "),e("tr",[e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Integer")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("packingAddress")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("打包地址")])]),t._v(" "),e("tr",[e("td",[t._v("reward")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("共识奖励")])]),t._v(" "),e("tr",[e("td",[t._v("fee")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",[t._v("手续费")])]),t._v(" "),e("tr",[e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),e("tr",[e("td",[t._v("scriptSig")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-9-获取某高度区间内区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-获取某高度区间内区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 获取某高度区间内区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ol",[e("li",[t._v("令queryHash=endHash")]),t._v(" "),e("li",[t._v("根据链ID、queryHash查询DB得到区块byte数组")]),t._v(" "),e("li",[t._v("反序列化为区块对象block,添加到List中作为返回值")]),t._v(" "),e("li",[t._v("如果block.hash!=startHash,令queryHash=block.preHash,startHash,重复第2步")]),t._v(" "),e("li",[t._v("返回List")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("请求示例")]),this._v(" "),_("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n "cmd": "bl_getBlockBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),_("li",[_("p",[this._v("请求参数说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("index")]),t._v(" "),e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("required")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("0")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("startHeight")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("起始高度")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("endHeight")]),t._v(" "),e("td",[t._v("true")]),t._v(" "),e("td",[t._v("Long")]),t._v(" "),e("td",{staticStyle:{"text-align":"center"}},[t._v("结束高度")])])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "list" : [\n {\n "blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }, //区块头\n "transactions": [\n {\n "chainId": "888",\n "height": "1", //区块高度\n "hash": "1", //交易HASH\n "remark": "1", //交易备注\n "size": "1", //交易大小\n "time": "1", //交易时间\n "type": "1", //交易类型\n "transactionSignature": "1", //交易签名\n "coinData": {\n "from" : [\n {\n "fromAssetsChainId":""//资产发行链的id \n "fromAssetsId":""//资产id\n "fromAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n "to" : [\n {\n "toAssetsChainId":""//资产发行链的id \n "toAssetsId":""//资产id\n "toAddress":""//转出账户地址\n "amount":""//转出金额\n "nonce":""//交易顺序号,递增\n },{...}\n ]\n }\n "txData": XXXX, //交易数据 HEX\n },\n {...}\n ], //交易列表\n }\n ]\n\n }\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")]),t._v(" "),e("p",[t._v("略")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-10-接收最新打包区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-接收最新打包区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 接收最新打包区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "cmd": "receivePackingBlock",\n "minVersion":"1.1",\n "params": [\n \tblockhex//能用hex就用hex\n ]\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"sync": "true"}\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("sync")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块是否保存成功")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-11-运行一条链"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-运行一条链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 运行一条链")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "cmd": "bl_startChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("result")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("新链是否启动成功")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-2-12-停止一条链"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-停止一条链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 停止一条链")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("接口说明")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("请求示例")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "cmd": "bl_stopChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("请求参数说明")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("result")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("新链是否停止成功")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_2-3-模块内部功能"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 模块内部功能")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-1-模块启动"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-模块启动","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 模块启动")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("功能说明:")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("流程描述")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("p",[_("img",{attrs:{src:e(609),alt:""}})])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[t._v("1.加载区块模块配置信息")]),t._v(" "),e("li",[t._v("2.加载区块模块消息、消息处理器")]),t._v(" "),e("li",[t._v("3.注册区块模块服务接口(向核心模块注册)")]),t._v(" "),e("li",[t._v("4.注册区块模块事件(向事件总线模块注册)")]),t._v(" "),e("li",[t._v("5.启动同步区块线程、区块监控线程、分叉链处理线程")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("依赖服务")]),this._v(" "),_("p",[this._v("工具模块、内核模块")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-2-区块存储"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-区块存储","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 区块存储")])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("说明存储表划分")]),t._v(" "),e("ul",[e("li",[t._v("主链存储")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" 不同的链存到不同的表,表名加chainID后缀\n 一个完整的区块由区块头和交易组成,区块头与交易分别进行存储。\n 区块头:(放在区块管理模块)\n key(区块高度)-value(区块头hash) block-header-index\n key(区块头hash)-value(完整的区块头) block-header\n 交易:(放在交易管理模块)\n")])])]),e("ul",[e("li",[t._v("分叉链存储")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v(" 内存中缓存每一个分叉链的(起始高度、起始hash、结束高度、结束hash),在硬盘中缓存全量分叉链数据\n 不同链的分叉链集合存在不同的表,表名加chainID后缀,每一个分叉链对象如下:\n key(start区块高度+start区块hash)-value(完整的chains) fork chains\n private Chain chain;\n private String id;\n private String preChainId;\n private BlockHeader startBlockHeader;\n private BlockHeader endBlockHeader;\n private List blockHeaderList;\n private List blockList;\n")])])])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-2-区块同步"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-区块同步","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 区块同步")])},function(){var t=this,_=t.$createElement,v=t._self._c||_;return v("ul",[v("li",[v("p",[t._v("功能说明:")]),t._v(" "),v("p",[t._v("略")])]),t._v(" "),v("li",[v("p",[t._v("流程描述")]),t._v(" "),v("ul",[v("li",[t._v("区块同步主流程")])]),t._v(" "),v("p",[v("img",{attrs:{src:e(610),alt:""}})]),t._v(" "),v("ul",[v("li",[t._v("获取网络上可用节点列表")])]),t._v(" "),v("div",{staticClass:"language- extra-class"},[v("pre",{pre:!0,attrs:{class:"language-text"}},[v("code",[t._v(" 1. 遍历节点,统计两个MAP,假定每个节点的(最新HASH+最新高度)是key\n 2. 一个以key为主键统计次数\n 3. 一个以key为主键记录持有该key的节点列表\n 4. 最终统计出出现频率最大的key,就获取到当前可信的最新高度与最新hash,以及可信的节点列表\n \n 举个栗子:\n 现在同时连接到10个节点。其中4个节点(A,B,C,D)的最新区块高度是100,最新区块hash是aaa,其中6个节点(E,F,G,H,I,J)的最新区块高度是101,最新区块hash是bbb。\n 最终返回(101,bbb,[E,F,G,H,I,J])。\n")])])]),v("ul",[v("li",[t._v("下载区块逻辑")])]),t._v(" "),v("p",[v("img",{attrs:{src:e(611),alt:""}})]),t._v(" "),v("div",{staticClass:"language- extra-class"},[v("pre",{pre:!0,attrs:{class:"language-text"}},[v("code",[t._v(" 在正式下载区块前,要判断本地与网络是否发生分叉,是否需要回滚。以便找到准确的区块下载高度。\n 以下分情况讨论:\n 取上一步的结果(101,bbb,[E,F,G,H,I,J]),同时LH(N)代表本地第N块的hash,RH(N)代表网络上第N块的hash。\n 1.本地高度100<网络高度101,LH(100)==RH(100),正常,比远程节点落后,下载区块\n 2.本地高度100<网络高度101,LH(100)!=RH(100),认为本地分叉,回滚本地区块,如果LH(99)==RH(99)\n 回滚结束,从99块开始下载,如果LH(99)!=RH(99),继续回滚,重复上述逻辑。但最多回滚10个块就停止,等待下次同步,这样可以避免被恶意节点攻击,大量回滚正常区块。\n 3.本地高度102>网络高度101,LH(101)==RH(101),正常,比远程节点领先,无需下载区块\n 4.本地高度102>网络高度101,LH(101)!=RH(101),认为本地分叉,先一次性回滚到高度与远程一致,重复场景2\n 5.本地高度101=网络高度101,LH(101)==RH(101),正常,与远程节点一致,无需下载区块\n 6.本地高度101=网络高度101,LH(101)!=RH(101),认为本地分叉,重复场景2\n \n 场景1、2需要额外从节点下载与本地高度一致的区块,进行hash判断\n 上述需要回滚的场景,要满足可用节点数(10个)>配置,一致可用节点数(6个)占比超80%两个条件,避免节点太少导致频繁回滚。以上两个条件都不满足,清空已连接节点,重新获取可用节点。\n\n 真正下载区块时,举个栗子:\n 当前高度100,网络高度500,可用节点12个,一致可用节点10个,每个节点每次下载区块2个\n 那么计算得出需要下载区块400个,400/(2*10)=20轮下载完毕,同时可以计算出每轮每个节点下载区块的高度范围\n 伪代码表示\n For(20轮){\n for(10个节点){\n 每个节点下载对应区块,并放到共享队列给区块验证线程处理\n }\n }\n 考虑下载过程中,节点掉线的情况。可能20轮不能下载完,所以外层加循环。\n while(没有下载完){\n 重新计算轮次、各节点下载区块高度区间\n For(20轮){\n for(10个节点){\n 每个节点下载对应区块,并放到共享队列给区块验证线程处理\n }\n }\n }\n")])])]),v("ul",[v("li",[t._v("从节点下载某高度区间内的区块")])]),t._v(" "),v("p",[v("img",{attrs:{src:e(612),alt:""}})])]),t._v(" "),v("li",[v("p",[t._v("依赖服务")]),t._v(" "),v("p",[t._v("工具模块的数据库存储工具、RPC工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-3-区块基础验证"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-区块基础验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 区块基础验证")])},function(){var t=this,_=t.$createElement,v=t._self._c||_;return v("ul",[v("li",[v("p",[t._v("功能说明:")]),t._v(" "),v("p",[t._v("验证区块自身数据正确性,下载过程中验证,验证通过说明区块数据本身没有问题,验证失败则丢弃该区块")])]),t._v(" "),v("li",[v("p",[t._v("流程描述")]),t._v(" "),v("ul",[v("li",[t._v("区块基本验证")])]),t._v(" "),v("p",[v("img",{attrs:{src:e(613),alt:""}})]),t._v(" "),v("ul",[v("li",[t._v("区块头验证")])]),t._v(" "),v("p",[v("img",{attrs:{src:e(614),alt:""}})])]),t._v(" "),v("li",[v("p",[t._v("依赖服务")]),t._v(" "),v("p",[t._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-4-分叉块验证"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-分叉块验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 分叉块验证")])},function(){var t=this,_=t.$createElement,v=t._self._c||_;return v("ul",[v("li",[v("p",[t._v("功能说明:")]),t._v(" "),v("p",[t._v("验证区块上下文正确性,下载完成后验证,验证通过说明该区块与主链相连,验证失败说明该区块分叉,进入分叉链处理逻辑")])]),t._v(" "),v("li",[v("p",[t._v("流程描述")]),t._v(" "),v("ul",[v("li",[v("p",[t._v("定义一条主链(MasterChain),一个分叉链集合(forkChains)")])]),t._v(" "),v("li",[v("p",[t._v("定义待验证区块为Block")])]),t._v(" "),v("li",[v("p",[t._v("定义主链高度MG,待验证区块高度BG")])]),t._v(" "),v("li",[v("p",[t._v("定义主链最新区块HASH为MH,待验证区块HASH为BH,待验证区块PREHASH为BPH")])]),t._v(" "),v("li",[v("p",[t._v("分六种情况讨论")])]),t._v(" "),v("li",[v("p",[t._v("1.MG==BG,MH==BH,说明重复收到最新主链区块,丢弃")])]),t._v(" "),v("li",[v("p",[t._v("2.MG==BG,MH!=BH,说明网络分叉")]),t._v(" "),v("ul",[v("li",[t._v("遍历已有分叉链集合,判断是否已存在此区块\n"),v("ul",[v("li",[t._v("如果已存在,丢弃该区块")]),t._v(" "),v("li",[t._v("如果不存在,新建一条分叉链\n"),v("ul",[v("li",[t._v("判断是否能连接上其他的分叉链(若能连上,则连接到其他分叉链则视为一条链)")]),t._v(" "),v("li",[t._v("递归判断")])])])])])])]),t._v(" "),v("li",[v("p",[t._v("3.MG==BG-1,MH==BPH,说明区块连续,保存到主链")])]),t._v(" "),v("li",[v("p",[t._v("4.MG==BG-1,MH!=BPH,说明网络分叉,处理同第2步")])]),t._v(" "),v("li",[v("p",[t._v("5.MGBG,说明网络分叉,处理同第2步")])])]),t._v(" "),v("p",[t._v("高度差1000以内缓存到磁盘,磁盘空间做大小限制,超出高度则丢弃,缓存空间满则按加入缓存时间顺序清理分叉链。\n如果是正常运行时,收到其他节点转发的区块,发现分叉了要通知共识模块给生成这个区块的节点红牌惩罚,系统启动后的同步过程中不做这个判断")]),t._v(" "),v("p",[v("img",{attrs:{src:e(615),alt:""}})])]),t._v(" "),v("li",[v("p",[t._v("依赖服务")]),t._v(" "),v("p",[t._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-5-分叉链管理"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-分叉链管理","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 分叉链管理")])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("判断分叉链与主链是否需要进行切换")])]),t._v(" "),e("li",[e("p",[t._v("流程描述\n​")]),t._v(" "),e("ul",[e("li",[t._v("检查是否有分叉链能链接上主链,如果有则链接")]),t._v(" "),e("li",[t._v("取出最长的一条分叉链与主链长度对比判断是否需要切换主链\n"),e("ul",[e("li",[t._v("如果分叉链长度比主链长度长3(配置)个区块以上则需要切换主链")]),t._v(" "),e("li",[t._v("找到主链与最长分叉链的分叉点")]),t._v(" "),e("li",[t._v("验证分叉链中的区块,如果验证通过继续往下执行")]),t._v(" "),e("li",[t._v("回滚主链区块")]),t._v(" "),e("li",[t._v("切换分叉链为主链")])])])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("p",[_("img",{attrs:{src:e(616),alt:""}})])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("依赖服务")]),this._v(" "),_("p",[this._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-5-孤儿链管理"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-孤儿链管理","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 孤儿链管理")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-6-转发区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-转发区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 转发区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("功能说明:")]),this._v(" "),_("p",[this._v("详细说明")])]),this._v(" "),_("li",[_("p",[this._v("流程描述")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("使用blockHash组装ForwardSmallBlockMessage,发送给目标节点")]),this._v(" "),_("li",[this._v("目标节点收到ForwardSmallBlockMessage后,取出hash判断是否重复,如果不重复,使用hash组装GetSmallBlockMessage发给源节点")]),this._v(" "),_("li",[this._v("源节点收到GetSmallBlockMessage后,取出hash,查询SmallBlock并组装SmallBlockMessage,发给目标节点")]),this._v(" "),_("li",[this._v("后续交互流程参考广播区块")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("依赖服务")]),this._v(" "),_("p",[this._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-7-广播区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-广播区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 广播区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("功能说明:")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("流程描述")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ol",[e("li",[t._v("根据HASH获取BlockHeader,TxList,组装成SmallBlock,")]),t._v(" "),e("li",[t._v("将一个放入缓存中,若不主动删除,则在缓存存满或者存在时间超过1000秒时,自动清理")]),t._v(" "),e("li",[t._v("组装SmallBlockMessage,调用RPC模块发送消息给目标节点")]),t._v(" "),e("li",[t._v("目标节点收到消息后根据txHashList判断哪些交易本地没有,再组装GetTxGroupRequest发给源节点")]),t._v(" "),e("li",[t._v("源节点收到信息后按照hashlist组装TxGroupMessage,返回给目标节点")]),t._v(" "),e("li",[t._v("至此所有区块数据已经发送给目标节点。")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("依赖服务")]),this._v(" "),_("p",[this._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_2-3-8-区块监控"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-区块监控","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 区块监控")])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("略")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("ul",[e("li",[t._v("启动监控定时任务,每分钟执行一次")]),t._v(" "),e("li",[t._v("取本地最新区块头")]),t._v(" "),e("li",[t._v("验证网络模块是否需要重启(如果本地最新区块3分钟都没有更新过则需要网络模块断开并随机重连),这里区分chainID")])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("工具模块的数据库存储工具")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"三、事件说明"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#三、事件说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、事件说明")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_3-1-发布的事件"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-发布的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 发布的事件")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_3-1-1-同步完成"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-同步完成","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 同步完成")])},function(){var t=this.$createElement,_=this._self._c||t;return _("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_3-1-2-保存区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-保存区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 保存区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_3-1-3-回滚区块"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-回滚区块","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 回滚区块")])},function(){var t=this.$createElement,_=this._self._c||t;return _("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_3-2-订阅的事件"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-订阅的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 订阅的事件")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_3-2-1-网络稳定"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-网络稳定","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2.1 网络稳定")])},function(){var t=this.$createElement,_=this._self._c||t;return _("pre",[_("code",[this._v("data:{\n chainId\n}\n")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"四、协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#四、协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、协议")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_4-1-网络通讯协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-网络通讯协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 网络通讯协议")])},function(){var t=this.$createElement,_=this._self._c||t;return _("pre",[_("code",[this._v("参见网络模块\n")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h3",{attrs:{id:"_4-2-消息协议"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-消息协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 消息协议")])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-1-单个摘要消息hashmessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-单个摘要消息hashmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.1 单个摘要消息HashMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"转发区块","孤儿链维护"功能')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("forward,getBlock,getsBlock")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("hash")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("目标节点收到消息后,先根据chainID判断缓存中hash是否重复")]),this._v(" "),_("li",[this._v("如果重复,说明已经收到别的节点转发的SmallBlock,丢弃消息")]),this._v(" "),_("li",[this._v("如果没有重复,用hash组装GetSmallBlockMessage,并发送给源节点")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-2-摘要列表消息hashlistmessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-摘要列表消息hashlistmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.2 摘要列表消息HashListMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"转发区块"功能')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("GetSmallBlock")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("blockHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("hash")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("hash")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据chainID、hash获取SmallBlock对象")]),this._v(" "),_("li",[this._v("组装SmallBlockMessage,并发送给源节点")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-3-区块广播消息smallblockmessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-区块广播消息smallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.3 区块广播消息SmallBlockMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"转发区块"、"广播区块"功能')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(short)")]),this._v(" "),_("p",[this._v("SmallBlock")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("preHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("preHash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("preHash")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("merkleHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("merkleHash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("merkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("时间")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("extendLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("extend数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("extend")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("publicKeyLength")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("公钥数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("publicKey")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("公钥")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("signAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("签名算法类型")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("signBytesLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("签名数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("signBytes")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("签名")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txHashListLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("交易hash列表数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("交易hash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("交易hash")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("ol",[e("li",[t._v("判断区块时间戳是否大于(当前时间+10s),如果大于这个时间,则判定为恶意提前出块,忽略该消息")]),t._v(" "),e("li",[t._v("根据chainID、区块hash判断消息是否重复,如果重复,则忽略该消息(这里要求维护一个集合,按照chainID分类储存收到的区块hash)")]),t._v(" "),e("li",[t._v("根据chainID、区块hash在DB中查询本地是否已经有该区块,如果已经有了,则忽略该消息")]),t._v(" "),e("li",[t._v("验证区块头,验证失败,则忽略该消息")]),t._v(" "),e("li",[t._v("取txHashList,判断那些tx本地没有,组装HashListMessage,发给源节点,获取没有的那些交易信息")]),t._v(" "),e("li",[t._v("如果交易都有,组放入缓存队列,等待验证线程验证后存储")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-4-高度区间消息heightrangemessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-4-高度区间消息heightrangemessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.4 高度区间消息HeightRangeMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"同步区块"功能')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("GetBlocksByHeight")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("startHeight")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("起始高度")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("endHeight")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("结束高度")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("chainID、高度参数验证")]),this._v(" "),_("li",[this._v("返回响应消息ReactMessage")]),this._v(" "),_("li",[this._v("从endHeight开始查找Block,组装BlockMessage,发给目标节点")]),this._v(" "),_("li",[this._v("查找到startHeight为止,组装CompleteMessage,发给目标节点")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-5-完整的区块消息blockmessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-5-完整的区块消息blockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.5 完整的区块消息BlockMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"区块同步"')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("Block")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("preHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("preHash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("preHash")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("merkleHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("merkleHash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("merkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("time")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("时间")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("height")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("extendLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("extend数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("extend")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("publicKeyLength")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("公钥数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("publicKey")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("公钥")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("signAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("签名算法类型")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("signBytesLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("签名数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("signBytes")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("区块签名")])]),t._v(" "),e("tr",[e("td",[t._v("16")]),t._v(" "),e("td",[t._v("type")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("交易类型")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("time")]),t._v(" "),e("td",[t._v("uint48")]),t._v(" "),e("td",[t._v("交易时间")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("remarkLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("备注数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("remark")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("备注")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("转出记录数")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromAssetsChainId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产发行链的id")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromAssetsId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("fromAddress")]),t._v(" "),e("td",[t._v("VarChar")]),t._v(" "),e("td",[t._v("转出账户地址")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("amount")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("转出金额")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("nonce")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("交易顺序号,递增")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("转入记录数")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toAssetsChainId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产发行链的id")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toAssetsId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("toAddress")]),t._v(" "),e("td",[t._v("VarChar")]),t._v(" "),e("td",[t._v("转入账户地址")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("amount")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("转入金额")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("lockTIme")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("锁定时间")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txData")]),t._v(" "),e("td",[t._v("T")]),t._v(" "),e("td",[t._v("交易数据")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txSignLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("交易签名数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txSign")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("交易签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("放入缓存队列")]),this._v(" "),_("li",[this._v("等待其他区块同步中")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-6-请求完成消息completemessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-6-请求完成消息completemessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.6 请求完成消息CompleteMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息说明:通用消息,用于异步请求,标志异步请求处理结束。")])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("Complete")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("HashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("Hash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("Hash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("Hash")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("success")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("成功标志")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ol",[_("li",[this._v("根据chainID、hash查找源节点缓存的异步请求,把处理结果标志设置为完成。")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h4",{attrs:{id:"_4-2-7-交易列表的消息txgroupmessage"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-7-交易列表的消息txgroupmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.7 交易列表的消息TxGroupMessage")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v('消息说明:用于"转发区块"')])]),this._v(" "),_("li",[_("p",[this._v("消息类型(cmd)")]),this._v(" "),_("p",[this._v("TxGroup")])]),this._v(" "),_("li",[_("p",[this._v("消息的格式(messageBody)")])])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("chainID")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("链ID")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("digestAlgType")]),t._v(" "),e("td",[t._v("byte")]),t._v(" "),e("td",[t._v("摘要算法标识")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("requestHashLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("requestHash数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("requestHash")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("requestHash")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("16")]),t._v(" "),e("td",[t._v("type")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("交易类型")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("time")]),t._v(" "),e("td",[t._v("uint48")]),t._v(" "),e("td",[t._v("交易时间")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("remarkLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("备注数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("remark")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("备注")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("转出记录数")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromAssetsChainId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产发行链的id")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("fromAssetsId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("fromAddress")]),t._v(" "),e("td",[t._v("VarChar")]),t._v(" "),e("td",[t._v("转出账户地址")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("amount")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("转出金额")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("nonce")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("交易顺序号,递增")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toCount")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("转入记录数")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toAssetsChainId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产发行链的id")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("toAssetsId")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("toAddress")]),t._v(" "),e("td",[t._v("VarChar")]),t._v(" "),e("td",[t._v("转入账户地址")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("amount")]),t._v(" "),e("td",[t._v("Uint48")]),t._v(" "),e("td",[t._v("转入金额")])]),t._v(" "),e("tr",[e("td",[t._v("32")]),t._v(" "),e("td",[t._v("lockTIme")]),t._v(" "),e("td",[t._v("Uint32")]),t._v(" "),e("td",[t._v("锁定时间")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txData")]),t._v(" "),e("td",[t._v("T")]),t._v(" "),e("td",[t._v("交易数据")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txSignLength")]),t._v(" "),e("td",[t._v("VarInt")]),t._v(" "),e("td",[t._v("交易签名数组长度")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("txSign")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("交易签名")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[_("p",[this._v("消息的验证")]),this._v(" "),_("p",[this._v("略")])]),this._v(" "),_("li",[_("p",[this._v("消息的处理逻辑")]),this._v(" "),_("p",[this._v("略")])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"五、模块配置"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#五、模块配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、模块配置")])},function(){var t=this.$createElement,_=this._self._c||t;return _("div",{staticClass:"language- extra-class"},[_("pre",{pre:!0,attrs:{class:"language-text"}},[_("code",[this._v('{\n {\n "name": "validBlockInterval",\n "remark": "为阻止恶意节点提前出块,设置此参数,区块时间戳大于当前时间多少就丢弃该区块",\n "readOnly": "true",\n "value": "1000"\n },\n {\n "name": "blockCache",\n "remark": "同步区块时最多缓存多少个区块",\n "readOnly": "true",\n "value": "1000"\n },\n {\n "name": "smallBlockCache",\n "remark": "系统正常运行时最多缓存多少个从别的节点接收到的小区块",\n "readOnly": "true",\n "value": "100"\n },\n {\n "name": "chainSwtichThreshold",\n "remark": "分叉链切换为主链的高度差阈值",\n "readOnly": "true",\n "value": "1"\n },\n {\n "name": "chainName",\n "remark": "链名称",\n "readOnly": "true",\n "value": "nuls"\n },\n {\n "name": "serverIp",\n "remark": "服务ip",\n "readOnly": "true",\n "value": "127.0.0.1"\n },\n {\n "name": "serverPort",\n "remark": "服务端口",\n "readOnly": "true",\n "value": ""\n },\n {\n "name": "blockMaxSize",\n "remark": "区块大小最大值",\n "readOnly": "false",\n "value": "3145728"\n },\n {\n "name": "resetTime",\n "remark": "持续多长时间区块高度没有更新时,就重新获取可用节点",\n "readOnly": "true",\n "value": "180"\n },\n {\n "name": "cacheSize",\n "remark": "分叉链、孤儿链缓存区块最大数量",\n "readOnly": "true",\n "value": "10000"\n },\n {\n "name": "heightRange",\n "remark": "缓存到分叉链的高度区间",\n "readOnly": "false",\n "value": "1000"\n },\n {\n "name": "maxRollback",\n "remark": "每次最多回滚多少区块",\n "readOnly": "true",\n "value": "20"\n },\n {\n "name": "consistencyNodePercent",\n "remark": "一致可用节点最低比例,低于此数不同步区块",\n "readOnly": "false",\n "value": "80"\n },\n {\n "name": "minNodeAmount",\n "remark": "最小可用节点个数,低于此数不同步区块",\n "readOnly": "false",\n "value": "1"\n },\n {\n "name": "downloadNumber",\n "remark": "同步时,每次从一个节点下载多少区块",\n "readOnly": "true",\n "value": "20"\n },\n {\n "name": "orphanChainMaxAge",\n "remark": "孤儿链最大年龄",\n "readOnly": "true",\n "value": "10"\n },\n {\n "name": "extendMaxSize",\n "remark": "区块头扩展字段最大值",\n "readOnly": "false",\n "value": "1024"\n }\n}\n\n')])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"六、java特有的设计"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#六、java特有的设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、Java特有的设计")])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("Block对象设计")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("thead",[_("tr",[_("th",[_("code",[this._v("字段名称")])]),this._v(" "),_("th",[_("code",[this._v("字段类型")])]),this._v(" "),_("th",[_("code",[this._v("说明")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("tr",[_("td",[this._v("blockHeader")]),this._v(" "),_("td",[this._v("BlockHeader")]),this._v(" "),_("td",[this._v("区块头")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("SmallBlock对象设计")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("thead",[_("tr",[_("th",[_("code",[this._v("字段名称")])]),this._v(" "),_("th",[_("code",[this._v("字段类型")])]),this._v(" "),_("th",[_("code",[this._v("说明")])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("tr",[_("td",[this._v("blockHeader")]),this._v(" "),_("td",[this._v("BlockHeader")]),this._v(" "),_("td",[this._v("区块头")])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("BlockHeader对象设计")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("blockquote",[e("table",[e("thead",[e("tr",[e("th",[e("code",[t._v("字段名称")])]),t._v(" "),e("th",[e("code",[t._v("字段类型")])]),t._v(" "),e("th",[e("code",[t._v("说明")])])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("hash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("preHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("上一区块HASH")])]),t._v(" "),e("tr",[e("td",[t._v("merkleHash")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块MerkleHash")])]),t._v(" "),e("tr",[e("td",[t._v("height")]),t._v(" "),e("td",[t._v("int")]),t._v(" "),e("td",[t._v("区块高度")])]),t._v(" "),e("tr",[e("td",[t._v("time")]),t._v(" "),e("td",[t._v("long")]),t._v(" "),e("td",[t._v("区块打包时间")])]),t._v(" "),e("tr",[e("td",[t._v("txCount")]),t._v(" "),e("td",[t._v("short")]),t._v(" "),e("td",[t._v("交易数")])]),t._v(" "),e("tr",[e("td",[t._v("packingAddress")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("打包地址")])]),t._v(" "),e("tr",[e("td",[t._v("extend")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("扩展字段")])]),t._v(" "),e("tr",[e("td",[t._v("blockSignature")]),t._v(" "),e("td",[t._v("BlockSignature")]),t._v(" "),e("td",[t._v("区块签名")])])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("ul",[_("li",[this._v("BlockSignature对象设计")])])},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("blockquote",[e("table",[e("thead",[e("tr",[e("th",[e("code",[t._v("字段名称")])]),t._v(" "),e("th",[e("code",[t._v("字段类型")])]),t._v(" "),e("th",[e("code",[t._v("说明")])])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("signData")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("区块签名")])]),t._v(" "),e("tr",[e("td",[t._v("publicKey")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("公钥")])])])])])},function(){var t=this.$createElement,_=this._self._c||t;return _("h2",{attrs:{id:"七、补充内容"}},[_("a",{staticClass:"header-anchor",attrs:{href:"#七、补充内容","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、补充内容")])}],n=e(0),s=Object(n.a)({},function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("div",{staticClass:"content"},[t._m(0),t._v(" "),e("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),e("p",[t._v("​\t区块链上所有交易数据都保存在区块中,所以要有一个模块负责区块的存储与管理,以便其他模块对区块中数据进行验证、业务处理时可以获取到区块。")]),t._v(" "),e("p",[t._v("​\t区块链程序初次启动时,需要同步网络上的最新区块到本地,这个过程一般耗时较长,且同步未完成时不能发起交易,所以适合由单独模块来完成该工作。")]),t._v(" "),e("p",[t._v("​\t综上所述,为其他模块提供统一的区块数据服务是必要的,也能更好地把区块的管理与区块的具体业务进行分离,用到区块的模块不必关心区块的获取细节。")]),t._v(" "),t._m(4),t._v(" "),e("p",[t._v("​\t系统启动时,判断本地区块高度是否达到网络上大多数节点的最新高度,如果没有达到,要从网络上下载区块到本地,进行区块的验证,验证通过后,保存到本地数据库,这叫区块的同步。")]),t._v(" "),e("p",[t._v("​\t区块同步完成后,系统开始正常运行,分下面两种情况讨论")]),t._v(" "),t._m(5),t._v(" "),e("p",[t._v("异常情况下,区块验证不通过,新区块无法与主链上最后一个区块相连,则把该区块视为分叉区块或孤儿区块,放入分叉链集合维护。当发现有一条分叉链A比主链B高度更高时,进行链切换,以分叉链A为最新的链\n,原主链B回滚,并进入分叉链集合维护。")]),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),e("p",[t._v("区块管理是底层模块之一,以下分功能讨论模块依赖情况")]),t._v(" "),e("p",[t._v("依赖")]),t._v(" "),t._m(8),t._v(" "),e("p",[t._v("被依赖")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),e("p",[t._v("某个ChainID上的区块同步完成时,更新缓存的同步状态标识。同步区块未完成时,禁止发起交易")]),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),e("p",[t._v("本地节点共识模块打包后,调用此接口保存区块数据")]),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),e("p",[t._v("在链工厂发布一条链后,核心模块会调用区块管理模块的该接口,根据chainID初始化区块、分叉链数据库,开启chainID对应的一系列工作线程,并为运行新链做准备。")]),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),e("p",[t._v("在链工厂停止一条链后,核心模块会调用区块管理模块的该接口,删除该链的缓存区块、分叉链数据,停止chainID对应的一系列工作线程。")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),e("p",[t._v("说明:同步完成,本地区块高度与网络高度一致时,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "bl_blockSyncComplete",')]),t._v(" "),t._m(119),t._m(120),t._v(" "),e("p",[t._v("说明:每保存一个区块,发布该事件,初次同步时不发该事件")]),t._v(" "),e("p",[t._v('event_topic : "bl_saveBlock",')]),t._v(" "),t._m(121),t._m(122),t._v(" "),e("p",[t._v("说明:每回滚一个区块,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "bl_rollbackBlock",')]),t._v(" "),t._m(123),t._m(124),t._v(" "),t._m(125),t._v(" "),e("p",[t._v("说明:网络稳定时,发布该事件")]),t._v(" "),e("p",[t._v('event_topic : "nt_networkDone",')]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),t._m(148),t._v(" "),t._m(149),t._v(" "),t._m(150),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),t._m(153),t._v(" "),t._m(154),t._v(" "),t._m(155),t._v(" "),t._m(156),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),t._m(159),t._v(" "),t._m(160),t._v(" "),t._m(161),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),t._m(164),t._v(" "),t._m(165),t._v(" "),t._m(166),t._m(167),t._v(" "),t._m(168),t._v(" "),e("blockquote",[e("table",[t._m(169),t._v(" "),e("tbody",[t._m(170),t._v(" "),e("tr",[e("td",[t._v("transactions")]),t._v(" "),e("td",[t._v("List"),e("Transaction")],1),t._v(" "),e("td",[t._v("交易列表")])])])])]),t._v(" "),t._m(171),t._v(" "),e("blockquote",[e("table",[t._m(172),t._v(" "),e("tbody",[t._m(173),t._v(" "),e("tr",[e("td",[t._v("transactions")]),t._v(" "),e("td",[t._v("List"),e("String")],1),t._v(" "),e("td",[t._v("所有交易HASH列表")])]),t._v(" "),e("tr",[e("td",[t._v("subTxList")]),t._v(" "),e("td",[t._v("List"),e("Transaction")],1),t._v(" "),e("td",[t._v("其他节点一定没有的交易(如共识奖励交易、红黄牌交易等)")])])])])]),t._v(" "),t._m(174),t._v(" "),t._m(175),t._v(" "),t._m(176),t._v(" "),t._m(177),t._v(" "),t._m(178)])},v,!1,null,null,null);s.options.__file="blockModuleDesign.md";_.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/26.cac7fce9.js b/docs/.vuepress/dist/assets/js/26.cac7fce9.js new file mode 100644 index 00000000..5c98718c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/26.cac7fce9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{169:function(t,e,s){t.exports=s.p+"assets/img/1546518956812.2aa8e3b0.png"},170:function(t,e,s){t.exports=s.p+"assets/img/1546519370742.c4239db8.png"},171:function(t,e,s){t.exports=s.p+"assets/img/1546519548787.20972169.png"},172:function(t,e,s){t.exports=s.p+"assets/img/1546520020388.3442ad67.png"},173:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},174:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},235:function(t,e,s){t.exports=s.p+"assets/img/1546518367717.3884ae76.png"},236:function(t,e,s){t.exports=s.p+"assets/img/1546518556230.b3d05831.png"},865:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"connect-main-net"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#connect-main-net","aria-hidden":"true"}},[t._v("#")]),t._v(" Connect Main-net")]),t._v(" "),n("h2",{attrs:{id:"downloading-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Downloading wallet")]),t._v(" "),n("p",[t._v("The NULS main-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.")]),t._v(" "),n("p",[t._v("Option 1: downloading from the official website (https://nuls.io/newWallet)")]),t._v(" "),n("p",[n("img",{attrs:{src:s(235),alt:"1546518367717"}})]),t._v(" "),n("p",[t._v("Option 2: downloading from github (https://github.com/nuls-io/nuls/releases)")]),t._v(" "),n("p",[n("img",{attrs:{src:s(236),alt:"1546518556230"}})]),t._v(" "),n("p",[t._v("Note: The version marked [Main-net] is the main-net wallet.")]),t._v(" "),n("h2",{attrs:{id:"launching-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Launching wallet")]),t._v(" "),n("p",[t._v("After the wallet is downloaded, unzip it according to specific operating systems.")]),t._v(" "),n("p",[t._v("For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(169),alt:"1546518956812"}})]),t._v(" "),n("p",[t._v("Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(170),alt:"1546519370742"}})]),t._v(" "),n("p",[t._v("When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(171),alt:"1546519548787"}})]),t._v(" "),n("p",[t._v("The appearance of block synchronization means the successful connection to the NULS main-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(172),alt:"1546520020388"}})]),t._v(" "),n("p",[t._v("For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(173),alt:"1546520382686"}})]),t._v(" "),n("p",[t._v("Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the main-net has been successfully connected, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(174),alt:"1546520727643"}})]),t._v(" "),n("p",[t._v("Users can also track the nuls.log in the logs folder to check the latest status of the wallet.")]),t._v(" "),n("p",[t._v("For MAC users, steps are almost the same as the Windows users, so let’s skip it.")])])}],i=s(0),a=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);a.options.__file="connectMainnet.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/27.d07d1fcb.js b/docs/.vuepress/dist/assets/js/27.d07d1fcb.js new file mode 100644 index 00000000..ddb14adc --- /dev/null +++ b/docs/.vuepress/dist/assets/js/27.d07d1fcb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{252:function(t,e,s){t.exports=s.p+"assets/img/block-module.ffc57f74.png"},253:function(t,e,s){t.exports=s.p+"assets/img/block-module-boot.4686b7bf.png"},254:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization.3b5f0ded.png"},255:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization2.1bde323a.png"},256:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization3.99496017.png"},257:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation.07557d70.png"},258:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation1.cf392d66.png"},259:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation2.ed057a96.png"},899:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"block-management-module-design-documents"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#block-management-module-design-documents","aria-hidden":"true"}},[this._v("#")]),this._v(" Block management module design documents")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-1-general-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-1-general-description","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 1. General description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-the-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-the-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 The module overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-should-have-the-block-management-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-should-have-the-block-management-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 Why do you should have the block management module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-block-management-module-s-tasks"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-block-management-module-s-tasks","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 Block management module's tasks")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[e("p",[this._v("When the system starts, it is judged whether the height of the local block reaches the latest height of most nodes on the network. If it is not reached, the block is downloaded from the network to the local, and then the block will be verified. If the verification is passed, the data is saved to the local database. This is called synchronization of blocks.")])]),this._v(" "),e("li",[e("p",[this._v("After the block synchronization is completed, the system starts normal operation.Let's discuss separately below")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("If the self-node performs the packing block, the consensus module broadcasts the block information to the network before the packaged block is handed over to the block management module. The block management module verifies whether the block is legal, if legal then save it to the database, and respond to requests from other nodes on the network to get this block.")])]),this._v(" "),e("li",[e("p",[this._v("If other nodes on the network are packing blocks, the local node will receive the forwarding block message sent from the network. At this time, the block information is obtained from other nodes, verified and saved.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"3"}},[e("li",[e("p",[this._v("In the abnormal case, the block's verification fails, and the new block cannot be connected to the last block on the main chain. The block is regarded as a forked block and placed in the forked chain set for maintenance. When it is found that one of the forked chains A is longer than the main chain B, the switching is performed, and the bifurcation chain A is the latest main chain, and the original main chain B enters the bifurcation chain assembly maintenance.")])]),this._v(" "),e("li",[e("p",[this._v("Provide block header and block's query services for other modules or clients.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-the-position-of-block-management-module-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-position-of-block-management-module-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 The position of block management module in the system")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Block synchronization - depends on the communication interface of the network module, relying on the serialization tool of the tool module")]),this._v(" "),e("li",[this._v("Block storage, rollback-dependent tool module database storage tool, consensus module, transaction management module")]),this._v(" "),e("li",[this._v("Block forwarding - dependent on the network module's broadcast message interface")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The entire system can initiate transactions - block synchronization")]),this._v(" "),e("li",[this._v("Consensus module: block detailed verification, packing - block query, block saving, block broadcasting, block rollback")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(252),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-2-functional-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-2-functional-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 2. Functional design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"image/block-module/block-functions.png",alt:""}})])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Provide the API to block storage, query, rollback operations.")]),t._v(" "),s("li",[t._v("Synchronous latest blocks from the Internet, a preliminary verification, validation, bifurcation without bifurcate, call consensus in a consensus based verification, the trading module dual authentication, all validation after saved to the local.")]),t._v(" "),s("li",[t._v("Block synchronization, broadcasting, forwarding message process")]),t._v(" "),s("li",[t._v("Fork blocks judgment and storage")]),t._v(" "),s("li",[t._v("Fork chains maintenance and switch")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-the-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-the-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 The module service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-get-the-latest-local-block-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-get-the-latest-local-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Get the latest local block header")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Query the DB according to the chain ID and the latest block height in the cache to get the latest block header HASH.")]),this._v(" "),e("li",[this._v("According to the HASH query DB to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_bestBlockHeader",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block HASH")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block HASH")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("packing address")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-get-the-latest-local-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-get-the-latest-local-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Get the latest local block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the latest local block header according to the the chain ID")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_bestBlock",\n "minVersion":"1.1",\n "params": [“888”]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n "chainId": "888", //chain Id\n "height": "1", //block height\n "hash": "1", //transaction HASH\n "remark": "1", //transaction remark\n "size": "1", //transaction size\n "time": "1", //transaction timestamp\n "type": "1", //transaction type\n "transactionSignature": "1", //transaction sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”//Transaction sequence number and increasing\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“”\n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “locktime”:“”\n },{...}\n ]\n }\n "txData": XXXX, //Special transaction data HEX\n \t },\n \t {...}\n \t], //transaction list\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-get-block-header-according-to-the-height"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-get-block-header-according-to-the-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 get block header according to the height")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Query DB according to the chain ID and height, get the latest block header HASH")]),this._v(" "),e("li",[this._v("Query DB according to the HASH to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderByHeight",\n "minVersion":"1.1",\n "params": ["111","888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block's height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-4-get-block-according-to-the-height"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-get-block-according-to-the-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 get block according to the height")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the block header according to the chain ID and height")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockByHeight",\n "minVersion":"1.1",\n "params": [“111”,"888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block's height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n "chainId": "888",//chain ID\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n \t },\n \t {...}\n \t], \n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-5-get-block-header-according-to-the-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-get-block-header-according-to-the-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 get block header according to the hash")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("According to the chain ID, HASH query DB to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderByHash",\n "minVersion":"1.1",\n "params": ["888","aaa"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block hash")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-6-get-block-according-to-the-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-get-block-according-to-the-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 get block according to the hash")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the block header according to the chain ID and hash")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockByHash",\n "minVersion":"1.1",\n "params": ["888",“aaa”]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block hash")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n \t "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n \t "chainId": "888",\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n \t },\n \t {...}\n \t], \n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-7-get-sync-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-get-sync-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 get sync status")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getSynchronizeInfo",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"sync": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("sync")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block the synchronization to be achieved")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-8-get-block-header-according-to-the-height-range"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-get-block-header-according-to-the-height-range","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 get block header according to the height range")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Make queryHash = endHash")]),t._v(" "),s("li",[t._v("Query DB according to queryHash to get block header byte array")]),t._v(" "),s("li",[t._v("Deserialization for block header object blockHeader, added to the List as a return value")]),t._v(" "),s("li",[t._v("If the blockHeader.Hash!= startHash, make queryHash = blockHeader.preHash, repeat step 2")]),t._v(" "),s("li",[t._v("Return to the List")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("end Height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n “list” : [\n {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n ]\n\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-9-get-block-according-to-the-height-range"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-get-block-according-to-the-height-range","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 get block according to the height range")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("make queryHash=endHash")]),t._v(" "),s("li",[t._v("Query DB according to the chain ID, queryHash to get the block byte array")]),t._v(" "),s("li",[t._v("Deserialize to block object block, add to List as return value")]),t._v(" "),s("li",[t._v("If block.hash!=startHash, make queryHash=block.preHash, repeat step 2")]),t._v(" "),s("li",[t._v("Return to List")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("end Height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n “list” : [\n {\n "blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }, //block header\n "transactions": [\n {\n "chainId": "888",\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n },\n {...}\n ], \n }\n ]\n\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-10-receive-the-latest-packaging-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-receive-the-latest-packaging-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 Receive the latest packaging block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_receivePackingBlock",\n "minVersion":"1.1",\n "params": [\n \tblockhex\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"sync": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("sync")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("wherther the Block's save is completed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-11-run-a-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-run-a-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 run a chain")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_startChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("result")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("whether the new chain started successfully")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-12-stop-a-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-stop-a-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 stop a chain")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_stopChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("result")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("whether the new chain started successfully")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-s-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-s-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 module's internal function")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-module-s-boot"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-module-s-boot","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 module's boot")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(253),alt:""}})])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Load block module configuration information")]),t._v(" "),s("li",[t._v("Register block module's message handlers")]),t._v(" "),s("li",[t._v("Register block module's service interfaces")]),t._v(" "),s("li",[t._v("Register block module's events")]),t._v(" "),s("li",[t._v("Start the synchronization thread, the block monitoring thread, branching chain processing thread.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Tool module、kernel module")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-block-s-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-block-s-storage","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 block's storage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Functional specifications:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("main chain's storage")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("process description")]),this._v(" "),e("p",[this._v("omit")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-block-s-synchronization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-block-s-synchronization","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 block's Synchronization")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Functional specifications:")]),t._v(" "),a("p",[t._v("omit")])]),t._v(" "),a("li",[a("p",[t._v("process description")]),t._v(" "),a("ul",[a("li",[t._v("Block synchronization main flow")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(254),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("Get a list of available nodes on the network")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" 1. Traverse the node and count the two MAPs, assuming that each node (the latest HASH+ latest height) is the key\n 2. A key with the key as the number of statistics\n 3. A key is used to record the list of nodes holding the key.\n 4. Finally, the most frequently occurring key is obtained, and the current trusted latest height and latest hash, as well as the list of trusted nodes are obtained.\n \n for example:\n Now connect to 10 nodes at the same time. The latest block's height of 4 nodes (A, B, C, D) is 100, the latest block hash is aaa, and the latest block's height of 6 nodes (E, F, G, H, I, J) is 101. The latest block hash is bbb.\n Finally return (101, bbb, [E, F, G, H, I, J]).\n")])])]),a("ul",[a("li",[t._v("Download block logic")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(255),alt:""}})]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" Before the official download of the block, it is necessary to determine whether the local and the network are forked, and whether it needs to be rolled back. In order to find the exact block download height.\n        The following discussion is divided into:\n        Take the result of the previous step (101, bbb, [E, F, G, H, I, J]), while LH(N) represents the hash of the local Nth block, and RH(N) represents the hash of the Nth block on the network. .\n        1. Local height 100 < network height 101, LH (100) == RH (100), normal, behind the remote node, download block\n        2. Local height 100 < network height 101, LH (100)! = RH (100), think local fork, roll back the local block, if LH (99) == RH (99)\n        At the end of the rollback, download from 99 blocks. If LH(99)!=RH(99), continue to roll back and repeat the above logic. However, if you roll back 10 blocks at most, it will stop and wait for the next synchronization. This will avoid being attacked by malicious nodes and roll back normal blocks in large quantities.\n        3. Local height 102> network height 101, LH (101) == RH (101), normal, leading than remote node, no need to download block\n        4. Local height 102> network height 101, LH (101)! = RH (101), think local fork, first roll back to the height and remote consistency, repeat scene 2\n        5. Local height 101 = network height 101, LH (101) == RH (101), normal, consistent with the remote node, no need to download the block\n        6. Local height 101 = network height 101, LH (101)! = RH (101), think local fork, repeat scene 2\n        \n        In the scenario that needs to be rolled back, the number of available nodes (10) > configuration, the number of consistent available nodes (6) accounted for more than 80%, and avoiding too few nodes leads to frequent rollback. The above two conditions are not met, empty the connected nodes, and re-acquire the available nodes.\n \n        When you actually download the block, give a chestnut:\n        The current height is 100, the network height is 500, 12 nodes are available, 10 nodes are consistently available, and each node downloads 2 blocks at a time.\n        Then calculate that you need to download 400 blocks, 400/(2*10)=20 rounds of downloading, and you can calculate the height range of each node download block per round.\n        Pseudo code representation\n            For (20 rounds){\n                For (10 nodes) {\n                    Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process\n                }\n            }\n        Consider the case where the node is dropped during the download process. It is possible that 20 rounds cannot be downloaded, so the outer layer is added to the loop.\n            While (not downloaded){\n                Recalculate the round, download the block's height interval for each node\n                For (20 rounds){\n                    For (10 nodes) {\n                        Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process\n                    }\n                }\n            }\n")])])]),a("ul",[a("li",[t._v("Download blocks from a height interval from a node")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(256),alt:""}})])]),t._v(" "),a("li",[a("p",[t._v("Dependent service")]),t._v(" "),a("p",[t._v("Database storage tool of tool modules、RPC tool")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-3-block-s-validation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-block-s-validation","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 block's validation")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Functional specifications:")]),t._v(" "),a("p",[t._v("Verify the correctness of the block's own data, verify during the download process, verify that there is no problem with the block data itself, and discard the block if the verification fails.")])]),t._v(" "),a("li",[a("p",[t._v("process description")]),t._v(" "),a("ul",[a("li",[t._v("block's basic validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(257),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("block header's validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(258),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("Merkelhash validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(259),alt:""}})])]),t._v(" "),a("li",[a("p",[t._v("Dependent service")]),t._v(" "),a("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-4-fork-block-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-fork-block-management","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 fork block management")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("Verify the correctness of the block context. After the download is complete, verify that the block is connected to the main chain.\nThe verification failure indicates that the block is bifurcated and enters the forked chain processing logic.")])]),t._v(" "),s("li",[s("p",[t._v("process description")]),t._v(" "),s("ul",[s("li",[t._v("Define a main chain (MasterChain), a fork chain set (forkChains)\n    - Define the block to be verified as Block\n    - Define the main chain height MG, to be verified block's heightBG\n    - Define the latest block HASH of the main chain as MH, the HASH of the block to be verified is BH, and the PHHASH of the block to be verified is BPH\n    \n    - Discussion in six situations\n    - 1.MG==BG, MH==BH, indicating that the latest main chain block is repeatedly received and discarded.\n    - 2.MG==BG, MH!=BH, indicating network fork\n        - Traverse the existing set of forked chains to determine if this block already exists\n            - discard the block if it already exists\n            - If it does not exist, create a new fork chain\n              - Determine if you can connect to other fork chains (if you can connect, connect to other fork chains as a chain)\n              - Recursive judgment\n    - 3.MG==BG-1, MH==BPH, indicating that the block is continuous and saved to the main chain\n    - 4.MG==BG-1, MH!=BPH, indicating network fork, processing the same as step 2\n    - 5.MGBG, indicating network fork, processing the same as step 2\n    \n    The height difference is less than 1000 cached to disk, the disk space is limited in size, and the height is discarded.\nIf the cache space is full, the forked chain is cleared in the order of adding cache time.")])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-5-fork-chain-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-fork-chain-management","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 fork chain management")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("Determine if the fork chain and the main chain need to be switched")])]),t._v(" "),s("li",[s("p",[t._v("process description\n​")]),t._v(" "),s("ul",[s("li",[t._v("Check if there is an orphan chain that links to the main chain or the forked chain, if any")]),t._v(" "),s("li",[t._v("Take the longest one of the fork chains and compare the length of the main chain to determine whether you need to switch the main chain\n"),s("ul",[s("li",[t._v("If the length of the fork chain is longer than the length of the main chain by 3 (configured), you need to switch the main chain.")]),t._v(" "),s("li",[t._v("Find the bifurcation point of the main chain and the longest bifurcation chain")]),t._v(" "),s("li",[t._v("Verify the block in the forked chain if the verification continues by going down")]),t._v(" "),s("li",[t._v("Roll back the main chain block")]),t._v(" "),s("li",[t._v("Switch the fork chain as the main chain")])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-6-forward-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-forward-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 forward block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Use the blockHash to assemble the ForwardSmallBlockMessage and send it to the target node.")]),this._v(" "),e("li",[this._v("After receiving the ForwardSmallBlockMessage, the target node takes out the hash to determine whether it is duplicated. If it does not repeat, use the hash assembly GetSmallBlockMessage to send to the source node.")]),this._v(" "),e("li",[this._v("After the source node receives the GetSmallBlockMessage, it takes out the hash, queries the SmallBlock and assembles the SmallBlockMessage, and sends it to the target node.")]),this._v(" "),e("li",[this._v("Subsequent interaction process reference broadcast block")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-7-braodcast-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-braodcast-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 braodcast block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Get BlockHeader, TxList according to HASH, assemble into SmallBlock,")]),t._v(" "),s("li",[t._v("Put a SmallBlock into the memory. If it is not deleted actively, it will be automatically cleared when the cache is full or exists for more than 1000 seconds.")]),t._v(" "),s("li",[t._v("Local cache blockHash for filtering duplicate downloads")]),t._v(" "),s("li",[t._v("Assem the SmallBlockMessage and call the RPC module to send a message to the target node.")]),t._v(" "),s("li",[t._v("After receiving the message, the target node determines which transactions are not locally based on txHashList, and then assembles GetTxGroupRequest to the source node.")]),t._v(" "),s("li",[t._v("After receiving the information, the source node assembles the TxGroupMessage according to the hashlist and returns it to the target node.")]),t._v(" "),s("li",[t._v("All block data has been sent to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-8-block-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-block-monitoring","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 Block monitoring")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("process description")]),t._v(" "),s("ul",[s("li",[t._v("Start monitoring scheduled tasks, once every minute")]),t._v(" "),s("li",[t._v("Take the local latest block header")]),t._v(" "),s("li",[t._v("Verify that the network module needs to be restarted (if the latest local block has not been updated for 3 minutes, the network module needs to be disconnected and reconnected randomly)")]),t._v(" "),s("li",[t._v("to be perfected")])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-3-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-3-events","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 3. Events")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-1-synchronization-completed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-synchronization-completed","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 Synchronization completed")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Data:{\n     chainId\n     Height\n     Hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-2-save-block-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-save-block-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 save block event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-3-rollback-block-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-rollback-block-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 rollback block event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("omit\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-4-network-message"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-4-network-message","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 4. Network Message")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Network communication protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("omit\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-message-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-message-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Message protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-1-forward-block-message-forwardsmallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-forward-block-message-forwardsmallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.1 Forward block message-ForwardSmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for the "forward block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("ForwardSmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("After receiving the message, the target node first determines whether the hash in the cache is duplicated according to the chainID.")]),this._v(" "),e("li",[this._v("If it is repeated, it indicates that the SmallBlock forwarded by another node has been received, and the message is discarded.")]),this._v(" "),e("li",[this._v("If there is no duplication, assemble GetSmallBlockMessage with hash and send it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-2-get-small-block-message-getsmallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-get-small-block-message-getsmallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.2 Get small block message-GetSmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for the "forward block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetSmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the SmallBlock object according to the hash")]),this._v(" "),e("li",[this._v("Assem the SmallBlockMessage and send it to the source node")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-3-block-broadcast-message-smallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-block-broadcast-message-smallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.3 Block broadcast message-SmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding block" and "broadcast block" functions')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("SmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("preHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("preHash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("merkleHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("merkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("time")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extendLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("extend array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("extend")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("publicKeyLength")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("public key array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("signAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Signature algorithm type")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytesLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("sign bytes")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHashListLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's hash list array's length")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Determine whether the block timestamp is greater than (current time +10s). If it is greater than this time, it is determined to be maliciously prematurely out of the block, ignoring the message.")]),t._v(" "),s("li",[t._v("Determine whether the message is repeated according to the block hash. If it is repeated, ignore the message (requires maintenance of a set to store the received block hash)")]),t._v(" "),s("li",[t._v("Query the DB according to the block hash to see if the block already exists in the local area. If it already exists, ignore the message.")]),t._v(" "),s("li",[t._v("Verify the block header, if the verification fails, ignore the message")]),t._v(" "),s("li",[t._v("Take txHashList, determine that tx is not local, assemble GetTxGroupMessage, and send it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-4-get-block-message-based-on-height-getblocksbyheightmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-4-get-block-message-based-on-height-getblocksbyheightmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.4 Get block message based on height-GetBlocksByHeightMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:For the "sync block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetBlocksByHeight")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("end Height")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Height parameter verification")]),this._v(" "),e("li",[this._v("Return the response message ReactMessage")]),this._v(" "),e("li",[this._v("Find the Block from endHeight, assemble the BlockMessage, and send it to the target node.")]),this._v(" "),e("li",[this._v("Find the startHeight, assemble the CompleteMessage, and send it to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-5-get-block-message-getblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-5-get-block-message-getblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.5 Get block message-GetBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "block synchronization"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Return the response message ReactMessage")]),this._v(" "),e("li",[this._v("Find the Block according to the hash, assemble the BlockMessage, and send it to the target node.")]),this._v(" "),e("li",[this._v("Assemble the CompleteMessage and send it to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-6-complete-block-message-blockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-6-complete-block-message-blockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.6 Complete block message-BlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "block synchronization"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("Block")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("preHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("preHash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("merkleHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("merkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("time")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extendLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("extend array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("extend")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("publicKeyLength")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("public key array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("signAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Signature algorithm type")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytesLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Signature of block")])]),t._v(" "),s("tr",[s("td",[t._v("16")]),t._v(" "),s("td",[t._v("type")]),t._v(" "),s("td",[t._v("uint16")]),t._v(" "),s("td",[t._v("transaction's type")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("uint48")]),t._v(" "),s("td",[t._v("transaction's timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remarkLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("remark array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("remark bytes")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of froms")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("fromAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("from account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("nonce")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("Transaction sequence number, increment")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of tos")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("toAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("to account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("lockTime")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("lock time")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txData")]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("data of special transaction")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSignLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSign")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's sign")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Put into the cache queue")]),this._v(" "),e("li",[this._v("Wait for other blocks to be synchronized")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-7-data-message-not-found-notfoundmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-7-data-message-not-found-notfoundmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.7 Data message not found-NotFoundMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message for an asynchronous request that marks the target node not finding the corresponding information.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("NotFound")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("msgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Data type not found")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, set the processing result flag to complete, and set the return result to null.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-8-response-message-reactmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-8-response-message-reactmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.8 Response message-ReactMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message, used for asynchronous requests, to flag that the target node receives the request and is processing it.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("React")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to wait.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-9-request-completion-message-completemessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-9-request-completion-message-completemessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.9 Request completion message-CompleteMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message for asynchronous requests that marks the end of asynchronous request processing.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("Complete")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("success")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("flag")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to complete.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-10-get-the-message-of-the-transaction-list-gettxgrouprequest"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-10-get-the-message-of-the-transaction-list-gettxgrouprequest","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.10 Get the message of the transaction list-GetTxGroupRequest")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding blocks"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetTxGroup")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("ArrayLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash list length")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("After receiving the message, the target node takes out the hashList, traverses the hashList, obtains Tx according to txHash, assembles TxGroupMessage, and sends it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-11-transaction-list-message-txgroupmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-11-transaction-list-message-txgroupmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.11 Transaction list message-TxGroupMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding blocks"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("TxGroup")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("requestHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("requestHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("requestHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("requestHash")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("16")]),t._v(" "),s("td",[t._v("type")]),t._v(" "),s("td",[t._v("uint16")]),t._v(" "),s("td",[t._v("transaction's type")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("uint48")]),t._v(" "),s("td",[t._v("transaction's timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remarkLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("remark array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("remark bytes")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of froms")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("fromAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("from account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("nonce")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("Transaction sequence number, increment")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of tos")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("toAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("to account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("lockTime")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("lock time")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txData")]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("data of special transaction")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSignLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSign")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's sign")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")]),this._v(" "),e("p",[this._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-5-the-module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-5-the-module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 5. The module configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n    {\n        "name": "serverIp",\n        "remark": "service ip",\n        "changable": "true",\n        "default": "127.0.0.1"\n    },\n    {\n        "name": "serverPort",\n        "remark": "service port",\n        "changable": "true",\n        "default": ""\n    },\n    {\n        "name": "blockSize",\n        "remark": "block size",\n        "changable": "false",\n        "default": "3m"\n    },\n    {\n        "name": "resetTime",\n        "remark": "When the block height is not updated for a long time, the available nodes are reacquired",\n        "changable": "true",\n        "default": "180"\n    },\n    {\n        "name": "forkCount",\n        "remark": "When the fork chain is higher than the main chain, switch",\n        "changable": "false",\n        "default": "3"\n    },\n    {\n        "name": "cacheSize",\n        "remark": "forked chain cache size",\n        "changable": "true",\n        "default": "50m"\n    },\n    {\n        "name": "heightRange",\n        "remark": "Cache to the height range of the forked chain",\n        "changable": "false",\n        "default": "1000"\n    },\n    {\n        "name": "maxRollback",\n        "remark": "How many blocks are rolled back at most each time",\n        "changable": "true",\n        "default": "20"\n    },\n    {\n        "name": "consistencyNodePercent",\n        "remark": "The lowest percentage of consistent nodes available, below this number of unsynchronized blocks",\n        "changable": "false",\n        "default": "80"\n    },\n    {\n        "name": "minNodeAmount",\n        "remark": "The minimum number of available nodes, lower than this number of unsynchronized blocks",\n        "changable": "false",\n        "default": "10"\n    },\n    {\n        "name": "downloadNumber",\n        "remark": "How many blocks are downloaded from one node each time during synchronization",\n        "changable": "true",\n        "default": "20"\n    },\n    {\n        "name": "extendMaxSize",\n        "remark": "block header extension field maximum value",\n        "changable": "false",\n        "default": "1024"\n    }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-6-java-s-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-6-java-s-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 6. Java's design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Block Object design")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[e("code",[this._v("field name")])]),this._v(" "),e("th",[e("code",[this._v("field type")])]),this._v(" "),e("th",[e("code",[this._v("instruction")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("blockHeader")]),this._v(" "),e("td",[this._v("BlockHeader")]),this._v(" "),e("td",[this._v("block header")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("SmallBlock Object design")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[e("code",[this._v("field name")])]),this._v(" "),e("th",[e("code",[this._v("field type")])]),this._v(" "),e("th",[e("code",[this._v("instruction")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("blockHeader")]),this._v(" "),e("td",[this._v("BlockHeader")]),this._v(" "),e("td",[this._v("block header")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("BlockHeader Object design")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("blockquote",[s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("field name")])]),t._v(" "),s("th",[s("code",[t._v("field type")])]),t._v(" "),s("th",[s("code",[t._v("instruction")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Extension field")])]),t._v(" "),s("tr",[s("td",[t._v("blockSignature")]),t._v(" "),s("td",[t._v("BlockSignature")]),t._v(" "),s("td",[t._v("Signature of block")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("BlockSignature Object design")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("blockquote",[s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("field name")])]),t._v(" "),s("th",[s("code",[t._v("field type")])]),t._v(" "),s("th",[s("code",[t._v("instruction")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("signData")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])]),t._v(" "),s("tr",[s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-7-additional-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-7-additional-content","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 7. additional content")])}],n=s(0),i=Object(n.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("All transaction data in the blockchain is stored in the block, so there is a module responsible for the saving and management of the block, so that other modules can obtain the block when verifying the data in the block and processing the business etc.")]),t._v(" "),s("p",[t._v("When the blockchain program is started for the first time, it is necessary to synchronize the full blocks from the network to the local. This process is generally time consuming, and the transaction cannot be initiated when the synchronization is not completed, so it is suitable for the work to be performed by a separate module.")]),t._v(" "),s("p",[t._v("In summary, it is necessary to provide a unified block data service for other modules, and it is also better to separate the management of the block from the specific service of the block. The modules who used the block do not have to care about the details of block's acquire.")]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("Block management is one of the underlying modules. The following sub-functions discuss module dependencies.")]),t._v(" "),s("p",[t._v("rely")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("Be dependent")]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),s("p",[t._v("When the block synchronization on a ChainID is completed, the cached synchronization status identifier is updated. It is forbidden to initiate a transaction when the block synchronization is not completed.")]),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),s("p",[t._v("After the local node's consensus module paking a block, this interface is called to save the block data.")]),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("After the chain factory releases a chain, the core module calls the interface of the block management module, initializes the block and the forked chain database according to the chainID, starts a series of work threads corresponding to the chainID, and prepares for running the new chain.")]),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),s("p",[t._v("After stopping a chain in the chain factory, the core module will call the interface of the block management module, delete the cache block and the fork chain data of the chain, and stop a series of work threads corresponding to the chainID.")]),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),s("p",[t._v("Description storage table division")]),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("A complete block consists of a block header and a transaction, and the block header is stored separately from the transaction.\nBlock header: (in the block management module)\nKey(block's height)-value(block header hash) block-header-index\nKey(block headerhash)-value(complete block header) block-header\nTrading: (put in the transaction management module)")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("fork chain's storage\nCache each forked chain (starting height, starting hash, ending height, ending hash) in memory, and cache full forked chain data in the hard disk\n         There are different tables for the bifurcation chain collection of different chains. The table name is added with the chainID suffix. Each bifurcation chain object is as follows:\n             Key (start block height + start block hash) - value (complete chains) fork chains\n         Private chain chain;\n                 Private String id;\n                 Private String preChainId;\n                 Private BlockHeader startBlockHeader;\n                 Private BlockHeader endBlockHeader;\n                 Private List"),s("BlockHeader",[t._v(" blockHeaderList;\n                 Private List"),s("Block",[t._v(" blockList;")])],1)],1)]),t._v(" "),t._m(97),t._v(" "),t._m(98)]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),t._m(119),t._v(" "),s("p",[t._v("Description: The synchronization is completed. When the height of the area is the same as the height of the network, the event is released.")]),t._v(" "),s("p",[t._v('Event_topic : "bl_blockSyncComplete",')]),t._v(" "),t._m(120),t._m(121),t._v(" "),s("p",[t._v("Description:Each save a block, release the event")]),t._v(" "),s("p",[t._v('event_topic : "evt_bl_saveBlock",')]),t._v(" "),t._m(122),t._m(123),t._v(" "),s("p",[t._v("Description:Each roll back a block, release the event")]),t._v(" "),s("p",[t._v('event_topic : "evt_bl_rollbackBlock",')]),t._v(" "),t._m(124),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),t._m(148),t._v(" "),t._m(149),t._v(" "),t._m(150),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),t._m(153),t._v(" "),t._m(154),t._v(" "),t._m(155),t._v(" "),t._m(156),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),t._m(159),t._v(" "),t._m(160),t._v(" "),t._m(161),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),t._m(164),t._v(" "),t._m(165),t._v(" "),t._m(166),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),t._m(169),t._v(" "),t._m(170),t._v(" "),t._m(171),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),t._m(174),t._v(" "),t._m(175),t._v(" "),t._m(176),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),t._m(179),t._v(" "),t._m(180),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),t._m(187),t._v(" "),t._m(188),t._v(" "),s("blockquote",[s("table",[t._m(189),t._v(" "),s("tbody",[t._m(190),t._v(" "),s("tr",[s("td",[t._v("transactions")]),t._v(" "),s("td",[t._v("List"),s("Transaction")],1),t._v(" "),s("td",[t._v("transaction's list")])])])])]),t._v(" "),t._m(191),t._v(" "),s("blockquote",[s("table",[t._m(192),t._v(" "),s("tbody",[t._m(193),t._v(" "),s("tr",[s("td",[t._v("transactions")]),t._v(" "),s("td",[t._v("List"),s("String")],1),t._v(" "),s("td",[t._v("transaction's hash list")])]),t._v(" "),s("tr",[s("td",[t._v("subTxList")]),t._v(" "),s("td",[t._v("List"),s("Transaction")],1),t._v(" "),s("td",[t._v("Transactions that other nodes must not have (such as consensus reward transactions, red and yellow card transactions, etc.")])])])])]),t._v(" "),t._m(194),t._v(" "),t._m(195),t._v(" "),t._m(196),t._v(" "),t._m(197),t._v(" "),t._m(198)])},a,!1,null,null,null);i.options.__file="blockModuleDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/28.af448362.js b/docs/.vuepress/dist/assets/js/28.af448362.js new file mode 100644 index 00000000..a17522d9 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/28.af448362.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{361:function(t,e,s){t.exports=s.p+"assets/img/block-module.ffc57f74.png"},362:function(t,e,s){t.exports=s.p+"assets/img/block-module-boot.4686b7bf.png"},363:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization.3b5f0ded.png"},364:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization2.1bde323a.png"},365:function(t,e,s){t.exports=s.p+"assets/img/block-synchronization3.99496017.png"},366:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation.07557d70.png"},367:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation1.cf392d66.png"},368:function(t,e,s){t.exports=s.p+"assets/img/block-basic-validation2.ed057a96.png"},947:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"block-management-module-design-documents"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#block-management-module-design-documents","aria-hidden":"true"}},[this._v("#")]),this._v(" Block management module design documents")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-1-general-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-1-general-description","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 1. General description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-the-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-the-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 The module overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-should-have-the-block-management-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-should-have-the-block-management-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 Why do you should have the block management module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-block-management-module-s-tasks"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-block-management-module-s-tasks","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 Block management module's tasks")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[e("p",[this._v("When the system starts, it is judged whether the height of the local block reaches the latest height of most nodes on the network. If it is not reached, the block is downloaded from the network to the local, and then the block will be verified. If the verification is passed, the data is saved to the local database. This is called synchronization of blocks.")])]),this._v(" "),e("li",[e("p",[this._v("After the block synchronization is completed, the system starts normal operation.Let's discuss separately below")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("If the self-node performs the packing block, the consensus module broadcasts the block information to the network before the packaged block is handed over to the block management module. The block management module verifies whether the block is legal, if legal then save it to the database, and respond to requests from other nodes on the network to get this block.")])]),this._v(" "),e("li",[e("p",[this._v("If other nodes on the network are packing blocks, the local node will receive the forwarding block message sent from the network. At this time, the block information is obtained from other nodes, verified and saved.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"3"}},[e("li",[e("p",[this._v("In the abnormal case, the block's verification fails, and the new block cannot be connected to the last block on the main chain. The block is regarded as a forked block and placed in the forked chain set for maintenance. When it is found that one of the forked chains A is longer than the main chain B, the switching is performed, and the bifurcation chain A is the latest main chain, and the original main chain B enters the bifurcation chain assembly maintenance.")])]),this._v(" "),e("li",[e("p",[this._v("Provide block header and block's query services for other modules or clients.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-the-position-of-block-management-module-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-position-of-block-management-module-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 The position of block management module in the system")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Block synchronization - depends on the communication interface of the network module, relying on the serialization tool of the tool module")]),this._v(" "),e("li",[this._v("Block storage, rollback-dependent tool module database storage tool, consensus module, transaction management module")]),this._v(" "),e("li",[this._v("Block forwarding - dependent on the network module's broadcast message interface")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The entire system can initiate transactions - block synchronization")]),this._v(" "),e("li",[this._v("Consensus module: block detailed verification, packing - block query, block saving, block broadcasting, block rollback")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(361),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-2-functional-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-2-functional-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 2. Functional design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:"image/block-module/block-functions.png",alt:""}})])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Provide the API to block storage, query, rollback operations.")]),t._v(" "),s("li",[t._v("Synchronous latest blocks from the Internet, a preliminary verification, validation, bifurcation without bifurcate, call consensus in a consensus based verification, the trading module dual authentication, all validation after saved to the local.")]),t._v(" "),s("li",[t._v("Block synchronization, broadcasting, forwarding message process")]),t._v(" "),s("li",[t._v("Fork blocks judgment and storage")]),t._v(" "),s("li",[t._v("Fork chains maintenance and switch")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-the-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-the-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 The module service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-get-the-latest-local-block-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-get-the-latest-local-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Get the latest local block header")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Query the DB according to the chain ID and the latest block height in the cache to get the latest block header HASH.")]),this._v(" "),e("li",[this._v("According to the HASH query DB to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_bestBlockHeader",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block HASH")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block HASH")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("packing address")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-get-the-latest-local-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-get-the-latest-local-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Get the latest local block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the latest local block header according to the the chain ID")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_bestBlock",\n "minVersion":"1.1",\n "params": [“888”]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n "chainId": "888", //chain Id\n "height": "1", //block height\n "hash": "1", //transaction HASH\n "remark": "1", //transaction remark\n "size": "1", //transaction size\n "time": "1", //transaction timestamp\n "type": "1", //transaction type\n "transactionSignature": "1", //transaction sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”//Transaction sequence number and increasing\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“”\n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “locktime”:“”\n },{...}\n ]\n }\n "txData": XXXX, //Special transaction data HEX\n \t },\n \t {...}\n \t], //transaction list\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-get-block-header-according-to-the-height"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-get-block-header-according-to-the-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 get block header according to the height")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Query DB according to the chain ID and height, get the latest block header HASH")]),this._v(" "),e("li",[this._v("Query DB according to the HASH to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderByHeight",\n "minVersion":"1.1",\n "params": ["111","888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block's height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-4-get-block-according-to-the-height"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-get-block-according-to-the-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 get block according to the height")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the block header according to the chain ID and height")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockByHeight",\n "minVersion":"1.1",\n "params": [“111”,"888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block's height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n "chainId": "888",//chain ID\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n \t },\n \t {...}\n \t], \n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-5-get-block-header-according-to-the-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-get-block-header-according-to-the-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 get block header according to the hash")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("According to the chain ID, HASH query DB to get the block header byte array")]),this._v(" "),e("li",[this._v("Deserialize to block header object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderByHash",\n "minVersion":"1.1",\n "params": ["888","aaa"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block hash")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-6-get-block-according-to-the-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-get-block-according-to-the-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 get block according to the hash")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the block header according to the chain ID and hash")]),this._v(" "),e("li",[this._v("Query the DB according to the block head height to get the transaction HASH list.")]),this._v(" "),e("li",[this._v("Obtain transaction data from the transaction management module according to the HASH list")]),this._v(" "),e("li",[this._v("Assemble into a block object")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockByHash",\n "minVersion":"1.1",\n "params": ["888",“aaa”]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("block hash")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("pre",[s("code",[t._v('```\n{\n "version": 1.2,\n "code":1,\n "msg" :"xxxxxxxxxxxxxxxxxx",\n "result":{}\n}\n```\n')])]),t._v(" "),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n \t"blockHeader": {\n \t "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n \t}, //block header\n \t"transactions": [\n \t {\n \t "chainId": "888",\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n \t },\n \t {...}\n \t], \n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-7-get-sync-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-get-sync-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 get sync status")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getSynchronizeInfo",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"sync": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("sync")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Block the synchronization to be achieved")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-8-get-block-header-according-to-the-height-range"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-get-block-header-according-to-the-height-range","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 get block header according to the height range")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Make queryHash = endHash")]),t._v(" "),s("li",[t._v("Query DB according to queryHash to get block header byte array")]),t._v(" "),s("li",[t._v("Deserialization for block header object blockHeader, added to the List as a return value")]),t._v(" "),s("li",[t._v("If the blockHeader.Hash!= startHash, make queryHash = blockHeader.preHash, repeat step 2")]),t._v(" "),s("li",[t._v("Return to the List")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockHeaderBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("end Height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n “list” : [\n {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }\n ]\n\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Integer")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("reward")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("Consensus reward")])]),t._v(" "),s("tr",[s("td",[t._v("fee")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("procedure fee")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Extension field,HEX,contains roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot")])]),t._v(" "),s("tr",[s("td",[t._v("scriptSig")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-9-get-block-according-to-the-height-range"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-get-block-according-to-the-height-range","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 get block according to the height range")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("make queryHash=endHash")]),t._v(" "),s("li",[t._v("Query DB according to the chain ID, queryHash to get the block byte array")]),t._v(" "),s("li",[t._v("Deserialize to block object block, add to List as return value")]),t._v(" "),s("li",[t._v("If block.hash!=startHash, make queryHash=block.preHash, repeat step 2")]),t._v(" "),s("li",[t._v("Return to List")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Sample request")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "bl_getBlockBetweenHeights",\n "minVersion":"1.1",\n "params": ["888",111","111"]\n}\n')])])])]),this._v(" "),e("li",[e("p",[this._v("Instructions of request parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("index")]),t._v(" "),s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("required")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("2")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("true")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("end Height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {\n “list” : [\n {\n "blockHeader": {\n "chainId": "888",\n "hash": "xxxxxxx",\n "preHash": "xxxxxxx",\n "merkleHash": "1",\n "height": 1,\n "size": 1,\n "time": 1,\n "txCount": 1,\n "packingAddress": "1",\n "reward": 0,\n "fee": 0,\n "extend": xxxxxxx,HEX\n "scriptSig": "1"\n }, //block header\n "transactions": [\n {\n "chainId": "888",\n "height": "1", //block\'s height\n "hash": "1", //transaction\'s hash\n "remark": "1", //transaction\'s remark\n "size": "1", //transaction\'s size\n "time": "1", //transaction\'s timestamp\n "type": "1", //transaction\'s type\n "transactionSignature": "1", //transaction\'s sign\n "coinData": {\n "from" : [\n {\n “fromAssetsChainId”:“” \n “fromAssetsId”:“”\n “fromAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n "to" : [\n {\n “toAssetsChainId”:“” \n “toAssetsId”:“”\n “toAddress”:“”\n “amount”:“”\n “nonce”:“”\n },{...}\n ]\n }\n "txData": XXXX, //HEX\n },\n {...}\n ], \n }\n ]\n\n }\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")]),t._v(" "),s("p",[t._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-10-receive-the-latest-packaging-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-receive-the-latest-packaging-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 Receive the latest packaging block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_receivePackingBlock",\n "minVersion":"1.1",\n "params": [\n \tblockhex\n ]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"sync": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("sync")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("wherther the Block's save is completed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-11-run-a-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-run-a-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 run a chain")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_startChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("result")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("whether the new chain started successfully")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-12-stop-a-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-stop-a-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 stop a chain")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Interface specification")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Sample request")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "cmd": "bl_stopChain",\n "minVersion":"1.1",\n "params": ["888"]\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of request parameters")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("response sample")]),t._v(" "),s("p",[t._v("Failed")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 1,\n "msg": "error message",\n "result": {}\n}\n')])])]),s("p",[t._v("Success")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "version": 1.2,\n "code": 0,\n "result": {"result": "true"}\n}\n')])])])]),t._v(" "),s("li",[s("p",[t._v("Instructions of response parameters")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("result")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("whether the new chain started successfully")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-s-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-s-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 module's internal function")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-module-s-boot"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-module-s-boot","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 module's boot")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(362),alt:""}})])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Load block module configuration information")]),t._v(" "),s("li",[t._v("Register block module's message handlers")]),t._v(" "),s("li",[t._v("Register block module's service interfaces")]),t._v(" "),s("li",[t._v("Register block module's events")]),t._v(" "),s("li",[t._v("Start the synchronization thread, the block monitoring thread, branching chain processing thread.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Tool module、kernel module")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-block-s-storage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-block-s-storage","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 block's storage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Functional specifications:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("main chain's storage")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("process description")]),this._v(" "),e("p",[this._v("omit")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-block-s-synchronization"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-block-s-synchronization","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 block's Synchronization")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Functional specifications:")]),t._v(" "),a("p",[t._v("omit")])]),t._v(" "),a("li",[a("p",[t._v("process description")]),t._v(" "),a("ul",[a("li",[t._v("Block synchronization main flow")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(363),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("Get a list of available nodes on the network")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" 1. Traverse the node and count the two MAPs, assuming that each node (the latest HASH+ latest height) is the key\n 2. A key with the key as the number of statistics\n 3. A key is used to record the list of nodes holding the key.\n 4. Finally, the most frequently occurring key is obtained, and the current trusted latest height and latest hash, as well as the list of trusted nodes are obtained.\n \n for example:\n Now connect to 10 nodes at the same time. The latest block's height of 4 nodes (A, B, C, D) is 100, the latest block hash is aaa, and the latest block's height of 6 nodes (E, F, G, H, I, J) is 101. The latest block hash is bbb.\n Finally return (101, bbb, [E, F, G, H, I, J]).\n")])])]),a("ul",[a("li",[t._v("Download block logic")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(364),alt:""}})]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v(" Before the official download of the block, it is necessary to determine whether the local and the network are forked, and whether it needs to be rolled back. In order to find the exact block download height.\n        The following discussion is divided into:\n        Take the result of the previous step (101, bbb, [E, F, G, H, I, J]), while LH(N) represents the hash of the local Nth block, and RH(N) represents the hash of the Nth block on the network. .\n        1. Local height 100 < network height 101, LH (100) == RH (100), normal, behind the remote node, download block\n        2. Local height 100 < network height 101, LH (100)! = RH (100), think local fork, roll back the local block, if LH (99) == RH (99)\n        At the end of the rollback, download from 99 blocks. If LH(99)!=RH(99), continue to roll back and repeat the above logic. However, if you roll back 10 blocks at most, it will stop and wait for the next synchronization. This will avoid being attacked by malicious nodes and roll back normal blocks in large quantities.\n        3. Local height 102> network height 101, LH (101) == RH (101), normal, leading than remote node, no need to download block\n        4. Local height 102> network height 101, LH (101)! = RH (101), think local fork, first roll back to the height and remote consistency, repeat scene 2\n        5. Local height 101 = network height 101, LH (101) == RH (101), normal, consistent with the remote node, no need to download the block\n        6. Local height 101 = network height 101, LH (101)! = RH (101), think local fork, repeat scene 2\n        \n        In the scenario that needs to be rolled back, the number of available nodes (10) > configuration, the number of consistent available nodes (6) accounted for more than 80%, and avoiding too few nodes leads to frequent rollback. The above two conditions are not met, empty the connected nodes, and re-acquire the available nodes.\n \n        When you actually download the block, give a chestnut:\n        The current height is 100, the network height is 500, 12 nodes are available, 10 nodes are consistently available, and each node downloads 2 blocks at a time.\n        Then calculate that you need to download 400 blocks, 400/(2*10)=20 rounds of downloading, and you can calculate the height range of each node download block per round.\n        Pseudo code representation\n            For (20 rounds){\n                For (10 nodes) {\n                    Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process\n                }\n            }\n        Consider the case where the node is dropped during the download process. It is possible that 20 rounds cannot be downloaded, so the outer layer is added to the loop.\n            While (not downloaded){\n                Recalculate the round, download the block's height interval for each node\n                For (20 rounds){\n                    For (10 nodes) {\n                        Each node downloads the corresponding block and puts it in the shared queue for the block verification thread to process\n                    }\n                }\n            }\n")])])]),a("ul",[a("li",[t._v("Download blocks from a height interval from a node")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(365),alt:""}})])]),t._v(" "),a("li",[a("p",[t._v("Dependent service")]),t._v(" "),a("p",[t._v("Database storage tool of tool modules、RPC tool")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-3-block-s-validation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-block-s-validation","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 block's validation")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Functional specifications:")]),t._v(" "),a("p",[t._v("Verify the correctness of the block's own data, verify during the download process, verify that there is no problem with the block data itself, and discard the block if the verification fails.")])]),t._v(" "),a("li",[a("p",[t._v("process description")]),t._v(" "),a("ul",[a("li",[t._v("block's basic validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(366),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("block header's validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(367),alt:""}})]),t._v(" "),a("ul",[a("li",[t._v("Merkelhash validation")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(368),alt:""}})])]),t._v(" "),a("li",[a("p",[t._v("Dependent service")]),t._v(" "),a("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-4-fork-block-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-fork-block-management","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 fork block management")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("Verify the correctness of the block context. After the download is complete, verify that the block is connected to the main chain.\nThe verification failure indicates that the block is bifurcated and enters the forked chain processing logic.")])]),t._v(" "),s("li",[s("p",[t._v("process description")]),t._v(" "),s("ul",[s("li",[t._v("Define a main chain (MasterChain), a fork chain set (forkChains)\n    - Define the block to be verified as Block\n    - Define the main chain height MG, to be verified block's heightBG\n    - Define the latest block HASH of the main chain as MH, the HASH of the block to be verified is BH, and the PHHASH of the block to be verified is BPH\n    \n    - Discussion in six situations\n    - 1.MG==BG, MH==BH, indicating that the latest main chain block is repeatedly received and discarded.\n    - 2.MG==BG, MH!=BH, indicating network fork\n        - Traverse the existing set of forked chains to determine if this block already exists\n            - discard the block if it already exists\n            - If it does not exist, create a new fork chain\n              - Determine if you can connect to other fork chains (if you can connect, connect to other fork chains as a chain)\n              - Recursive judgment\n    - 3.MG==BG-1, MH==BPH, indicating that the block is continuous and saved to the main chain\n    - 4.MG==BG-1, MH!=BPH, indicating network fork, processing the same as step 2\n    - 5.MGBG, indicating network fork, processing the same as step 2\n    \n    The height difference is less than 1000 cached to disk, the disk space is limited in size, and the height is discarded.\nIf the cache space is full, the forked chain is cleared in the order of adding cache time.")])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-5-fork-chain-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-fork-chain-management","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 fork chain management")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("Determine if the fork chain and the main chain need to be switched")])]),t._v(" "),s("li",[s("p",[t._v("process description\n​")]),t._v(" "),s("ul",[s("li",[t._v("Check if there is an orphan chain that links to the main chain or the forked chain, if any")]),t._v(" "),s("li",[t._v("Take the longest one of the fork chains and compare the length of the main chain to determine whether you need to switch the main chain\n"),s("ul",[s("li",[t._v("If the length of the fork chain is longer than the length of the main chain by 3 (configured), you need to switch the main chain.")]),t._v(" "),s("li",[t._v("Find the bifurcation point of the main chain and the longest bifurcation chain")]),t._v(" "),s("li",[t._v("Verify the block in the forked chain if the verification continues by going down")]),t._v(" "),s("li",[t._v("Roll back the main chain block")]),t._v(" "),s("li",[t._v("Switch the fork chain as the main chain")])])])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-6-forward-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-forward-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 forward block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Use the blockHash to assemble the ForwardSmallBlockMessage and send it to the target node.")]),this._v(" "),e("li",[this._v("After receiving the ForwardSmallBlockMessage, the target node takes out the hash to determine whether it is duplicated. If it does not repeat, use the hash assembly GetSmallBlockMessage to send to the source node.")]),this._v(" "),e("li",[this._v("After the source node receives the GetSmallBlockMessage, it takes out the hash, queries the SmallBlock and assembles the SmallBlockMessage, and sends it to the target node.")]),this._v(" "),e("li",[this._v("Subsequent interaction process reference broadcast block")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-7-braodcast-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-braodcast-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 braodcast block")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Functional specifications:")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("process description")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Get BlockHeader, TxList according to HASH, assemble into SmallBlock,")]),t._v(" "),s("li",[t._v("Put a SmallBlock into the memory. If it is not deleted actively, it will be automatically cleared when the cache is full or exists for more than 1000 seconds.")]),t._v(" "),s("li",[t._v("Local cache blockHash for filtering duplicate downloads")]),t._v(" "),s("li",[t._v("Assem the SmallBlockMessage and call the RPC module to send a message to the target node.")]),t._v(" "),s("li",[t._v("After receiving the message, the target node determines which transactions are not locally based on txHashList, and then assembles GetTxGroupRequest to the source node.")]),t._v(" "),s("li",[t._v("After receiving the information, the source node assembles the TxGroupMessage according to the hashlist and returns it to the target node.")]),t._v(" "),s("li",[t._v("All block data has been sent to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Dependent service")]),this._v(" "),e("p",[this._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-8-block-monitoring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-block-monitoring","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 Block monitoring")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Functional specifications:")]),t._v(" "),s("p",[t._v("omit")])]),t._v(" "),s("li",[s("p",[t._v("process description")]),t._v(" "),s("ul",[s("li",[t._v("Start monitoring scheduled tasks, once every minute")]),t._v(" "),s("li",[t._v("Take the local latest block header")]),t._v(" "),s("li",[t._v("Verify that the network module needs to be restarted (if the latest local block has not been updated for 3 minutes, the network module needs to be disconnected and reconnected randomly)")]),t._v(" "),s("li",[t._v("to be perfected")])])]),t._v(" "),s("li",[s("p",[t._v("Dependent service")]),t._v(" "),s("p",[t._v("Database storage tool of tool modules")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-3-events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-3-events","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 3. Events")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-1-synchronization-completed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-synchronization-completed","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 Synchronization completed")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Data:{\n     chainId\n     Height\n     Hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-2-save-block-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-save-block-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 save block event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-3-rollback-block-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-rollback-block-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 rollback block event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("data:{\n chainId\n height\n hash\n}\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("omit\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-4-network-message"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-4-network-message","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 4. Network Message")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Network communication protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("omit\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-message-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-message-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Message protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-1-forward-block-message-forwardsmallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-forward-block-message-forwardsmallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.1 Forward block message-ForwardSmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for the "forward block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("ForwardSmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("After receiving the message, the target node first determines whether the hash in the cache is duplicated according to the chainID.")]),this._v(" "),e("li",[this._v("If it is repeated, it indicates that the SmallBlock forwarded by another node has been received, and the message is discarded.")]),this._v(" "),e("li",[this._v("If there is no duplication, assemble GetSmallBlockMessage with hash and send it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-2-get-small-block-message-getsmallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-get-small-block-message-getsmallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.2 Get small block message-GetSmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for the "forward block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetSmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Get the SmallBlock object according to the hash")]),this._v(" "),e("li",[this._v("Assem the SmallBlockMessage and send it to the source node")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-3-block-broadcast-message-smallblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-block-broadcast-message-smallblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.3 Block broadcast message-SmallBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding block" and "broadcast block" functions')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("SmallBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("preHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("preHash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("merkleHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("merkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("time")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extendLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("extend array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("extend")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("publicKeyLength")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("public key array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("signAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Signature algorithm type")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytesLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("sign bytes")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHashListLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's hash list array's length")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ol",[s("li",[t._v("Determine whether the block timestamp is greater than (current time +10s). If it is greater than this time, it is determined to be maliciously prematurely out of the block, ignoring the message.")]),t._v(" "),s("li",[t._v("Determine whether the message is repeated according to the block hash. If it is repeated, ignore the message (requires maintenance of a set to store the received block hash)")]),t._v(" "),s("li",[t._v("Query the DB according to the block hash to see if the block already exists in the local area. If it already exists, ignore the message.")]),t._v(" "),s("li",[t._v("Verify the block header, if the verification fails, ignore the message")]),t._v(" "),s("li",[t._v("Take txHashList, determine that tx is not local, assemble GetTxGroupMessage, and send it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-4-get-block-message-based-on-height-getblocksbyheightmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-4-get-block-message-based-on-height-getblocksbyheightmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.4 Get block message based on height-GetBlocksByHeightMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:For the "sync block" function')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetBlocksByHeight")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("start Height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("end Height")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Height parameter verification")]),this._v(" "),e("li",[this._v("Return the response message ReactMessage")]),this._v(" "),e("li",[this._v("Find the Block from endHeight, assemble the BlockMessage, and send it to the target node.")]),this._v(" "),e("li",[this._v("Find the startHeight, assemble the CompleteMessage, and send it to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-5-get-block-message-getblockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-5-get-block-message-getblockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.5 Get block message-GetBlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "block synchronization"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetBlock")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Return the response message ReactMessage")]),this._v(" "),e("li",[this._v("Find the Block according to the hash, assemble the BlockMessage, and send it to the target node.")]),this._v(" "),e("li",[this._v("Assemble the CompleteMessage and send it to the target node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-6-complete-block-message-blockmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-6-complete-block-message-blockmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.6 Complete block message-BlockMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "block synchronization"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("Block")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("preHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("preHash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("merkleHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("merkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("time")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extendLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("extend array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("extend")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("publicKeyLength")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("public key array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("signAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Signature algorithm type")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytesLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("signBytes")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Signature of block")])]),t._v(" "),s("tr",[s("td",[t._v("16")]),t._v(" "),s("td",[t._v("type")]),t._v(" "),s("td",[t._v("uint16")]),t._v(" "),s("td",[t._v("transaction's type")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("uint48")]),t._v(" "),s("td",[t._v("transaction's timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remarkLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("remark array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("remark bytes")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of froms")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("fromAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("from account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("nonce")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("Transaction sequence number, increment")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of tos")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("toAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("to account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("lockTime")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("lock time")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txData")]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("data of special transaction")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSignLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSign")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's sign")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Put into the cache queue")]),this._v(" "),e("li",[this._v("Wait for other blocks to be synchronized")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-7-data-message-not-found-notfoundmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-7-data-message-not-found-notfoundmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.7 Data message not found-NotFoundMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message for an asynchronous request that marks the target node not finding the corresponding information.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("NotFound")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("msgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("Data type not found")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, set the processing result flag to complete, and set the return result to null.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-8-response-message-reactmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-8-response-message-reactmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.8 Response message-ReactMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message, used for asynchronous requests, to flag that the target node receives the request and is processing it.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("React")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to wait.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-9-request-completion-message-completemessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-9-request-completion-message-completemessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.9 Request completion message-CompleteMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message description:A generic message for asynchronous requests that marks the end of asynchronous request processing.")])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("Complete")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("success")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("flag")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Find the asynchronous request of the source node cache according to the chainID and hash, and set the processing result flag to complete.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-10-get-the-message-of-the-transaction-list-gettxgrouprequest"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-10-get-the-message-of-the-transaction-list-gettxgrouprequest","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.10 Get the message of the transaction list-GetTxGroupRequest")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding blocks"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("GetTxGroup")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("ArrayLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash list length")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("HashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("Hash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("Hash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("After receiving the message, the target node takes out the hashList, traverses the hashList, obtains Tx according to txHash, assembles TxGroupMessage, and sends it to the source node.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-2-11-transaction-list-message-txgroupmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-11-transaction-list-message-txgroupmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2.11 Transaction list message-TxGroupMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v('Message description:Used for "forwarding blocks"')])]),this._v(" "),e("li",[e("p",[this._v("Message type(cmd)")]),this._v(" "),e("p",[this._v("TxGroup")])]),this._v(" "),e("li",[e("p",[this._v("Message format(txData)")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Length")]),t._v(" "),s("th",[t._v("Fields")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("chainID")]),t._v(" "),s("td",[t._v("uint32")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("digestAlgType")]),t._v(" "),s("td",[t._v("byte")]),t._v(" "),s("td",[t._v("digest algorithm identifier")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("requestHashLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("requestHash array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("requestHash")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("requestHash")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("16")]),t._v(" "),s("td",[t._v("type")]),t._v(" "),s("td",[t._v("uint16")]),t._v(" "),s("td",[t._v("transaction's type")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("time")]),t._v(" "),s("td",[t._v("uint48")]),t._v(" "),s("td",[t._v("transaction's timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remarkLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("remark array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("remark")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("remark bytes")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of froms")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("fromAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("fromAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("from account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("nonce")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("Transaction sequence number, increment")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toCount")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("count of tos")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsChainId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("chain id")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("toAssetsId")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("asset id")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("toAddress")]),t._v(" "),s("td",[t._v("VarChar")]),t._v(" "),s("td",[t._v("to account address")])]),t._v(" "),s("tr",[s("td",[t._v("48")]),t._v(" "),s("td",[t._v("amount")]),t._v(" "),s("td",[t._v("Uint48")]),t._v(" "),s("td",[t._v("Transfer amount")])]),t._v(" "),s("tr",[s("td",[t._v("32")]),t._v(" "),s("td",[t._v("lockTime")]),t._v(" "),s("td",[t._v("Uint32")]),t._v(" "),s("td",[t._v("lock time")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txData")]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("data of special transaction")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSignLength")]),t._v(" "),s("td",[t._v("VarInt")]),t._v(" "),s("td",[t._v("transaction's sign array's length")])]),t._v(" "),s("tr",[s("td",[t._v("?")]),t._v(" "),s("td",[t._v("txSign")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("transaction's sign")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message validation")]),this._v(" "),e("p",[this._v("omit")])]),this._v(" "),e("li",[e("p",[this._v("Message processing logic")]),this._v(" "),e("p",[this._v("omit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-5-the-module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-5-the-module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 5. The module configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n    {\n        "name": "serverIp",\n        "remark": "service ip",\n        "changable": "true",\n        "default": "127.0.0.1"\n    },\n    {\n        "name": "serverPort",\n        "remark": "service port",\n        "changable": "true",\n        "default": ""\n    },\n    {\n        "name": "blockSize",\n        "remark": "block size",\n        "changable": "false",\n        "default": "3m"\n    },\n    {\n        "name": "resetTime",\n        "remark": "When the block height is not updated for a long time, the available nodes are reacquired",\n        "changable": "true",\n        "default": "180"\n    },\n    {\n        "name": "forkCount",\n        "remark": "When the fork chain is higher than the main chain, switch",\n        "changable": "false",\n        "default": "3"\n    },\n    {\n        "name": "cacheSize",\n        "remark": "forked chain cache size",\n        "changable": "true",\n        "default": "50m"\n    },\n    {\n        "name": "heightRange",\n        "remark": "Cache to the height range of the forked chain",\n        "changable": "false",\n        "default": "1000"\n    },\n    {\n        "name": "maxRollback",\n        "remark": "How many blocks are rolled back at most each time",\n        "changable": "true",\n        "default": "20"\n    },\n    {\n        "name": "consistencyNodePercent",\n        "remark": "The lowest percentage of consistent nodes available, below this number of unsynchronized blocks",\n        "changable": "false",\n        "default": "80"\n    },\n    {\n        "name": "minNodeAmount",\n        "remark": "The minimum number of available nodes, lower than this number of unsynchronized blocks",\n        "changable": "false",\n        "default": "10"\n    },\n    {\n        "name": "downloadNumber",\n        "remark": "How many blocks are downloaded from one node each time during synchronization",\n        "changable": "true",\n        "default": "20"\n    },\n    {\n        "name": "extendMaxSize",\n        "remark": "block header extension field maximum value",\n        "changable": "false",\n        "default": "1024"\n    }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-6-java-s-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-6-java-s-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 6. Java's design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Block Object design")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[e("code",[this._v("field name")])]),this._v(" "),e("th",[e("code",[this._v("field type")])]),this._v(" "),e("th",[e("code",[this._v("instruction")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("blockHeader")]),this._v(" "),e("td",[this._v("BlockHeader")]),this._v(" "),e("td",[this._v("block header")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("SmallBlock Object design")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[e("code",[this._v("field name")])]),this._v(" "),e("th",[e("code",[this._v("field type")])]),this._v(" "),e("th",[e("code",[this._v("instruction")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("blockHeader")]),this._v(" "),e("td",[this._v("BlockHeader")]),this._v(" "),e("td",[this._v("block header")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("BlockHeader Object design")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("blockquote",[s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("field name")])]),t._v(" "),s("th",[s("code",[t._v("field type")])]),t._v(" "),s("th",[s("code",[t._v("instruction")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("chainId")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("chain ID")])]),t._v(" "),s("tr",[s("td",[t._v("hash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block hash")])]),t._v(" "),s("tr",[s("td",[t._v("preHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("pre block hash")])]),t._v(" "),s("tr",[s("td",[t._v("merkleHash")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("block's MerkleHash")])]),t._v(" "),s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("block's height")])]),t._v(" "),s("tr",[s("td",[t._v("size")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("block's size")])]),t._v(" "),s("tr",[s("td",[t._v("time")]),t._v(" "),s("td",[t._v("long")]),t._v(" "),s("td",[t._v("block's packing timestamp")])]),t._v(" "),s("tr",[s("td",[t._v("txCount")]),t._v(" "),s("td",[t._v("short")]),t._v(" "),s("td",[t._v("count of transactions")])]),t._v(" "),s("tr",[s("td",[t._v("packingAddress")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("address of packing")])]),t._v(" "),s("tr",[s("td",[t._v("extend")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("Extension field")])]),t._v(" "),s("tr",[s("td",[t._v("blockSignature")]),t._v(" "),s("td",[t._v("BlockSignature")]),t._v(" "),s("td",[t._v("Signature of block")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("BlockSignature Object design")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("blockquote",[s("table",[s("thead",[s("tr",[s("th",[s("code",[t._v("field name")])]),t._v(" "),s("th",[s("code",[t._v("field type")])]),t._v(" "),s("th",[s("code",[t._v("instruction")])])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("signData")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Signature of block")])]),t._v(" "),s("tr",[s("td",[t._v("publicKey")]),t._v(" "),s("td",[t._v("byte[]")]),t._v(" "),s("td",[t._v("public key")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"chapter-7-additional-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#chapter-7-additional-content","aria-hidden":"true"}},[this._v("#")]),this._v(" Chapter 7. additional content")])}],n=s(0),i=Object(n.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),s("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("All transaction data in the blockchain is stored in the block, so there is a module responsible for the saving and management of the block, so that other modules can obtain the block when verifying the data in the block and processing the business etc.")]),t._v(" "),s("p",[t._v("When the blockchain program is started for the first time, it is necessary to synchronize the full blocks from the network to the local. This process is generally time consuming, and the transaction cannot be initiated when the synchronization is not completed, so it is suitable for the work to be performed by a separate module.")]),t._v(" "),s("p",[t._v("In summary, it is necessary to provide a unified block data service for other modules, and it is also better to separate the management of the block from the specific service of the block. The modules who used the block do not have to care about the details of block's acquire.")]),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),s("p",[t._v("Block management is one of the underlying modules. The following sub-functions discuss module dependencies.")]),t._v(" "),s("p",[t._v("rely")]),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("Be dependent")]),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),s("p",[t._v("When the block synchronization on a ChainID is completed, the cached synchronization status identifier is updated. It is forbidden to initiate a transaction when the block synchronization is not completed.")]),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),s("p",[t._v("After the local node's consensus module paking a block, this interface is called to save the block data.")]),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("After the chain factory releases a chain, the core module calls the interface of the block management module, initializes the block and the forked chain database according to the chainID, starts a series of work threads corresponding to the chainID, and prepares for running the new chain.")]),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),s("p",[t._v("After stopping a chain in the chain factory, the core module will call the interface of the block management module, delete the cache block and the fork chain data of the chain, and stop a series of work threads corresponding to the chainID.")]),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),s("p",[t._v("Description storage table division")]),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("A complete block consists of a block header and a transaction, and the block header is stored separately from the transaction.\nBlock header: (in the block management module)\nKey(block's height)-value(block header hash) block-header-index\nKey(block headerhash)-value(complete block header) block-header\nTrading: (put in the transaction management module)")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("fork chain's storage\nCache each forked chain (starting height, starting hash, ending height, ending hash) in memory, and cache full forked chain data in the hard disk\n         There are different tables for the bifurcation chain collection of different chains. The table name is added with the chainID suffix. Each bifurcation chain object is as follows:\n             Key (start block height + start block hash) - value (complete chains) fork chains\n         Private chain chain;\n                 Private String id;\n                 Private String preChainId;\n                 Private BlockHeader startBlockHeader;\n                 Private BlockHeader endBlockHeader;\n                 Private List"),s("BlockHeader",[t._v(" blockHeaderList;\n                 Private List"),s("Block",[t._v(" blockList;")])],1)],1)]),t._v(" "),t._m(97),t._v(" "),t._m(98)]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),t._m(119),t._v(" "),s("p",[t._v("Description: The synchronization is completed. When the height of the area is the same as the height of the network, the event is released.")]),t._v(" "),s("p",[t._v('Event_topic : "bl_blockSyncComplete",')]),t._v(" "),t._m(120),t._m(121),t._v(" "),s("p",[t._v("Description:Each save a block, release the event")]),t._v(" "),s("p",[t._v('event_topic : "evt_bl_saveBlock",')]),t._v(" "),t._m(122),t._m(123),t._v(" "),s("p",[t._v("Description:Each roll back a block, release the event")]),t._v(" "),s("p",[t._v('event_topic : "evt_bl_rollbackBlock",')]),t._v(" "),t._m(124),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),t._m(148),t._v(" "),t._m(149),t._v(" "),t._m(150),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),t._m(153),t._v(" "),t._m(154),t._v(" "),t._m(155),t._v(" "),t._m(156),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),t._m(159),t._v(" "),t._m(160),t._v(" "),t._m(161),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),t._m(164),t._v(" "),t._m(165),t._v(" "),t._m(166),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),t._m(169),t._v(" "),t._m(170),t._v(" "),t._m(171),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),t._m(174),t._v(" "),t._m(175),t._v(" "),t._m(176),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),t._m(179),t._v(" "),t._m(180),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),t._m(187),t._v(" "),t._m(188),t._v(" "),s("blockquote",[s("table",[t._m(189),t._v(" "),s("tbody",[t._m(190),t._v(" "),s("tr",[s("td",[t._v("transactions")]),t._v(" "),s("td",[t._v("List"),s("Transaction")],1),t._v(" "),s("td",[t._v("transaction's list")])])])])]),t._v(" "),t._m(191),t._v(" "),s("blockquote",[s("table",[t._m(192),t._v(" "),s("tbody",[t._m(193),t._v(" "),s("tr",[s("td",[t._v("transactions")]),t._v(" "),s("td",[t._v("List"),s("String")],1),t._v(" "),s("td",[t._v("transaction's hash list")])]),t._v(" "),s("tr",[s("td",[t._v("subTxList")]),t._v(" "),s("td",[t._v("List"),s("Transaction")],1),t._v(" "),s("td",[t._v("Transactions that other nodes must not have (such as consensus reward transactions, red and yellow card transactions, etc.")])])])])]),t._v(" "),t._m(194),t._v(" "),t._m(195),t._v(" "),t._m(196),t._v(" "),t._m(197),t._v(" "),t._m(198)])},a,!1,null,null,null);i.options.__file="blockModuleDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/29.014f7be8.js b/docs/.vuepress/dist/assets/js/29.014f7be8.js new file mode 100644 index 00000000..0c119348 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/29.014f7be8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{196:function(t,e,s){t.exports=s.p+"assets/img/1546518956812.2aa8e3b0.png"},197:function(t,e,s){t.exports=s.p+"assets/img/1546519370742.c4239db8.png"},198:function(t,e,s){t.exports=s.p+"assets/img/1546519548787.20972169.png"},199:function(t,e,s){t.exports=s.p+"assets/img/1546520020388.3442ad67.png"},200:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},201:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},490:function(t,e,s){t.exports=s.p+"assets/img/1546518367717.3884ae76.png"},491:function(t,e,s){t.exports=s.p+"assets/img/1546518556230.b3d05831.png"},920:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"how-to-connect-wallet-to-nuls-main-net"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-connect-wallet-to-nuls-main-net","aria-hidden":"true"}},[t._v("#")]),t._v(" How to connect wallet to NULS main-net")]),t._v(" "),n("h2",{attrs:{id:"downloading-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Downloading wallet")]),t._v(" "),n("p",[t._v("The NULS main-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.")]),t._v(" "),n("p",[t._v("Option 1: downloading from the official website (https://nuls.io/newWallet)")]),t._v(" "),n("p",[n("img",{attrs:{src:s(490),alt:"1546518367717"}})]),t._v(" "),n("p",[t._v("Option 2: downloading from github (https://github.com/nuls-io/nuls/releases)")]),t._v(" "),n("p",[n("img",{attrs:{src:s(491),alt:"1546518556230"}})]),t._v(" "),n("p",[t._v("Note: The version marked [Main-net] is the main-net wallet.")]),t._v(" "),n("h2",{attrs:{id:"launching-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Launching wallet")]),t._v(" "),n("p",[t._v("After the wallet is downloaded, unzip it according to specific operating systems.")]),t._v(" "),n("p",[t._v("For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(196),alt:"1546518956812"}})]),t._v(" "),n("p",[t._v("Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(197),alt:"1546519370742"}})]),t._v(" "),n("p",[t._v("When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(198),alt:"1546519548787"}})]),t._v(" "),n("p",[t._v("The appearance of block synchronization means the successful connection to the NULS main-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(199),alt:"1546520020388"}})]),t._v(" "),n("p",[t._v("For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(200),alt:"1546520382686"}})]),t._v(" "),n("p",[t._v("Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the main-net has been successfully connected, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(201),alt:"1546520727643"}})]),t._v(" "),n("p",[t._v("Users can also track the nuls.log in the logs folder to check the latest status of the wallet.")]),t._v(" "),n("p",[t._v("For MAC users, steps are almost the same as the Windows users, so let’s skip it.")])])}],i=s(0),a=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);a.options.__file="connectMainnet.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/3.944c2fb9.js b/docs/.vuepress/dist/assets/js/3.944c2fb9.js new file mode 100644 index 00000000..9cd3edbe --- /dev/null +++ b/docs/.vuepress/dist/assets/js/3.944c2fb9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{749:function(t,a,s){t.exports=s.p+"assets/img/1547434994872.92dbbc1e.png"},750:function(t,a,s){t.exports=s.p+"assets/img/1547458467571.a14a4e0b.png"},751:function(t,a,s){t.exports=s.p+"assets/img/1547458489793.f9af2155.png"},752:function(t,a,s){t.exports=s.p+"assets/img/1547436510741.06607801.png"},753:function(t,a,s){t.exports=s.p+"assets/img/1547436748834.fe0f9423.png"},754:function(t,a,s){t.exports=s.p+"assets/img/1547436768246.f101c590.png"},755:function(t,a,s){t.exports=s.p+"assets/img/1547437357998.b682db26.png"},756:function(t,a,s){t.exports=s.p+"assets/img/1547437427946.7b123720.png"},757:function(t,a,s){t.exports=s.p+"assets/img/1547445305902.570917cf.png"},758:function(t,a,s){t.exports=s.p+"assets/img/1547445221113.c3f48bb9.png"},759:function(t,a,s){t.exports=s.p+"assets/img/1547437842317.019395e0.png"},760:function(t,a,s){t.exports=s.p+"assets/img/1547437878443.667d71a0.png"},761:function(t,a,s){t.exports=s.p+"assets/img/1547458691614.21c0d621.png"},762:function(t,a,s){t.exports=s.p+"assets/img/1547458844211.915e83ae.png"},763:function(t,a,s){t.exports=s.p+"assets/img/1547459086013.698b1bc6.png"},764:function(t,a,s){t.exports=s.p+"assets/img/1547459110975.8cb3878e.png"},765:function(t,a,s){t.exports=s.p+"assets/img/1547459677163.2aac5dcb.png"},766:function(t,a,s){t.exports=s.p+"assets/img/1547459708942.564adc16.png"},767:function(t,a,s){t.exports=s.p+"assets/img/1547459737912.24ee8a80.png"},768:function(t,a,s){t.exports=s.p+"assets/img/1547459824098.05b8ba9b.png"},769:function(t,a,s){t.exports=s.p+"assets/img/1547461252921.f60612aa.png"},770:function(t,a,s){t.exports=s.p+"assets/img/1547461277501.70b4b430.png"},771:function(t,a,s){t.exports=s.p+"assets/img/1547461383782.e376e971.png"},772:function(t,a,s){t.exports=s.p+"assets/img/1547460181242.914f1175.png"},773:function(t,a,s){t.exports=s.p+"assets/img/1547460237710.d8e664ca.png"},774:function(t,a,s){t.exports=s.p+"assets/img/1547460590047.38d13fda.png"},775:function(t,a,s){t.exports=s.p+"assets/img/1547460865338.ace153bf.png"},776:function(t,a,s){t.exports=s.p+"assets/img/20190115102249.d551ecec.png"},777:function(t,a,s){t.exports=s.p+"assets/img/20190115103504.342076cb.png"},778:function(t,a,s){t.exports=s.p+"assets/img/20190115104427.1df39c02.png"},779:function(t,a,s){t.exports=s.p+"assets/img/20190115104911.71222bc1.png"},780:function(t,a,s){t.exports=s.p+"assets/img/20190115110413.617e8ffb.png"},781:function(t,a,s){t.exports=s.p+"assets/img/20190115110806.ad21b29f.png"},782:function(t,a,s){t.exports=s.p+"assets/img/20190115111229.1227e59a.png"},783:function(t,a,s){t.exports=s.p+"assets/img/20190115111447.ddf1ea31.png"},784:function(t,a,s){t.exports=s.p+"assets/img/20190115111721.cb32c823.png"},785:function(t,a,s){t.exports=s.p+"assets/img/20190115112217.f8239e8a.png"},786:function(t,a,s){t.exports=s.p+"assets/img/20190115112121.0f04e108.png"},787:function(t,a,s){t.exports=s.p+"assets/img/20190115112741.272fc0b7.png"},824:function(t,a,s){"use strict";s.r(a);var r=[function(){var t=this,a=t.$createElement,r=t._self._c||a;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"客户端钱包使用指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#客户端钱包使用指南","aria-hidden":"true"}},[t._v("#")]),t._v(" 客户端钱包使用指南")]),t._v(" "),r("h2",{attrs:{id:"客户端"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#客户端","aria-hidden":"true"}},[t._v("#")]),t._v(" 客户端")]),t._v(" "),r("h3",{attrs:{id:"获取"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#获取","aria-hidden":"true"}},[t._v("#")]),t._v(" 获取")]),t._v(" "),r("p",[t._v("​\t在NULS官网(nuls.io)下载钱包客户端后运行程序。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(749),alt:"1547434994872"}})]),t._v(" "),r("h3",{attrs:{id:"安装"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#安装","aria-hidden":"true"}},[t._v("#")]),t._v(" 安装")]),t._v(" "),r("p",[t._v("​\tNULS钱包客户端是绿色免安装的,文件解压之后直接点击文件夹里的exe应用程序就可以进入客户端界面。")]),t._v(" "),r("h2",{attrs:{id:"账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 账户")]),t._v(" "),r("h3",{attrs:{id:"创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建账户")]),t._v(" "),r("h4",{attrs:{id:"钱包无账户时创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包无账户时创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包无账户时创建账户")]),t._v(" "),r("p",[t._v("​\t钱包语言已切换为中文,开始创建自己的账户。点击顶部菜单的“钱包”开始“创建账户”,界面如图1:")]),t._v(" "),r("p",[r("img",{attrs:{src:s(750),alt:"1547458467571"}})]),t._v(" "),r("h5",{attrs:{id:"创建有密码的账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建有密码的账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建有密码的账户")]),t._v(" "),r("p",[t._v("​\t点击“创建账户”之后,首先设置密码,输入两次密码一致,注意密码规则:8-20位字符,需包含字母和数字。")]),t._v(" "),r("p",[t._v("然后点击“确定”,界面如图2:")]),t._v(" "),r("p",[r("img",{attrs:{src:s(751),alt:"1547458489793"}})]),t._v(" "),r("p",[t._v("​\t"),r("strong",[t._v("PS:账户密码一定要认真保存,丢失后将无法进行转账和共识等关键操作。")])]),t._v(" "),r("h5",{attrs:{id:"创建不带密码的账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建不带密码的账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建不带密码的账户")]),t._v(" "),r("p",[t._v("​\t点击“创建账户”后,弹出设置密码窗口,直接点击“此账户不需要密码”即可创建无密码账户。")]),t._v(" "),r("h4",{attrs:{id:"钱包有账户时创建账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包有账户时创建账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包有账户时创建账户")]),t._v(" "),r("p",[t._v("​\t点击顶部菜单的钱包,进入钱包页面后,点击“账户管理”图标(见图3):")]),t._v(" "),r("p",[r("img",{attrs:{src:s(752),alt:"1547436510741"}})]),t._v(" "),r("p",[t._v("​\t进入账户管理界面之后,点击账户列表右上方的“+”(见图4),进入创建或导入账户界面(见下图5)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(753),alt:"1547436748834"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(754),alt:"1547436768246"}})]),t._v(" "),r("p",[t._v("​\t选择“创建账户”,之后的操作请参照“"),r("strong",[t._v("创建有密码账户")]),t._v("”和“"),r("strong",[t._v("创建不带密码账户")]),t._v("”。")]),t._v(" "),r("h3",{attrs:{id:"备份账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 备份账户")]),t._v(" "),r("h4",{attrs:{id:"备份入口"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#备份入口","aria-hidden":"true"}},[t._v("#")]),t._v(" 备份入口")]),t._v(" "),r("p",[t._v("​\t账户创建成功之后,此时需要立即进行账户备份,以保证账户资产安全。")]),t._v(" "),r("ul",[r("li",[t._v("方式一:点击顶部菜单中的“设置”,进入设置页面之后,点击“账户备份”按钮(见图6),进入账户管理界面(如图7)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(755),alt:"1547437357998"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(756),alt:"1547437427946"}})]),t._v(" "),r("ul",[r("li",[t._v("方式二:点击顶部菜单“钱包”,再点击“账户管理”图标,进入账户管理界面(图7)。")]),t._v(" "),r("li",[t._v("方式三:钱包地址创建成功后,直接在完成界面进行备份,设置密码的地址备份界面(图8),没有设置密码的地址备份界面(图9)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(757),alt:"1547445305902"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(758),alt:"1547445221113"}})]),t._v(" "),r("ul",[r("li",[t._v("当账户已经设置密码,点击“备份”,弹出密码确认框,输入正确账户密码之后进入钱包备份界面(图10),可进行Keystore备份和私钥备份;")]),t._v(" "),r("li",[t._v("当账户未设置密码,点击“备份”,直接跳转至账户备份界面(图11),只能进行Keystore备份。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(759),alt:"1547437842317"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(760),alt:"1547437878443"}})]),t._v(" "),r("h4",{attrs:{id:"明文私钥备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#明文私钥备份","aria-hidden":"true"}},[t._v("#")]),t._v(" 明文私钥备份")]),t._v(" "),r("p",[t._v("​\t进入已经设置密码账户备份界面,点击“明文私钥备份”,弹出私钥备份窗口,然后点击“复制”按钮(图12),提示复制成功。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(761),alt:"1547458691614"}})]),t._v(" "),r("h4",{attrs:{id:"keystore备份"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#keystore备份","aria-hidden":"true"}},[t._v("#")]),t._v(" Keystore备份")]),t._v(" "),r("p",[t._v("​\t点击“Keystore备份”,直接显示Keystore保存路径(图13),在该路径下可以查看Keystore备份文件。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(762),alt:"1547458844211"}})]),t._v(" "),r("h3",{attrs:{id:"导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 导入账户")]),t._v(" "),r("h4",{attrs:{id:"钱包中无账户时导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包中无账户时导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包中无账户时导入账户")]),t._v(" "),r("ul",[r("li",[t._v("点击顶部菜单的“钱包”,选择“导入账户”(图14);")]),t._v(" "),r("li",[t._v("进入导入账户页面(图15);")]),t._v(" "),r("li",[t._v("选择备份时的明文私钥或者Keystore文件进行导入,将备份账户导入钱包。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(763),alt:"1547459086013"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(764),alt:"1547459110975"}})]),t._v(" "),r("h4",{attrs:{id:"钱包中已有账户时导入账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#钱包中已有账户时导入账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 钱包中已有账户时导入账户")]),t._v(" "),r("ul",[r("li",[t._v("如果钱包中已有账户地址,点击顶部菜单的“钱包”进入钱包界面;")]),t._v(" "),r("li",[t._v("点击钱包页面的“账户管理”图标(图16)进入账户管理界面(图17);")]),t._v(" "),r("li",[t._v("点击账户管理界面右上角的“+”进入创建或导入账户界面(图18),选择导入账户进入导入账户界面(图19)")]),t._v(" "),r("li",[t._v("选择明文私钥(导入时可以设置密码,也可以不设置密码)或者Keystore文件(如果备份Keystore文件是账户已经设置了密码,则导入的时候需要进行密码确认才能成功导入)进行导入,将已有的账户导入钱包。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(765),alt:"1547459677163"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(766),alt:"1547459708942"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(767),alt:"1547459737912"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(768),alt:"1547459824098"}})]),t._v(" "),r("h3",{attrs:{id:"管理账户"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#管理账户","aria-hidden":"true"}},[t._v("#")]),t._v(" 管理账户")]),t._v(" "),r("ul",[r("li",[t._v("在钱包界面,点击账户管理图标进入账户管理界面,此界面展示了钱包的所有账户信息,可花费NULS对账户设置别名(图20),一旦设置便不可更改。")]),t._v(" "),r("li",[t._v("该界面也可以移除和备份账户,备份流程见“备份账户”。")]),t._v(" "),r("li",[t._v("该界面可以进入创建或导入账户界面,其流程与“创建账户”、“导入账户”一致。")]),t._v(" "),r("li",[t._v("该界面可以对没有密码的账户进行密码设置,对已有密码的账户可以进行密码修改(具体流程见“修改密码”、“设置密码”),账户管理界面如图21。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(769),alt:"1547461252921"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(770),alt:"1547461277501"}})]),t._v(" "),r("p",[t._v("​\t账户管理界面还可以对已有账户设置备注(图22)")]),t._v(" "),r("p",[r("img",{attrs:{src:s(771),alt:"1547461383782"}})]),t._v(" "),r("h3",{attrs:{id:"交易"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#交易","aria-hidden":"true"}},[t._v("#")]),t._v(" 交易")]),t._v(" "),r("ul",[r("li",[t._v("钱包首页展示了当前账户的资产情况,包括总额、可用和冻结;")]),t._v(" "),r("li",[t._v("可以通过账户地址的下拉框切换不同账户查看账户信息")]),t._v(" "),r("li",[t._v("在账户资产页面,点击资产后面的“转账”(图23)进入转账界面(图24)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(772),alt:"1547460181242"}})]),t._v(" "),r("p",[r("img",{attrs:{src:s(773),alt:"1547460237710"}})]),t._v(" "),r("ul",[r("li",[t._v("进入转账界面之后,转出地址可以通过下拉列表进行选择;")]),t._v(" "),r("li",[t._v("输入收款地址(可以点击收款地址输入框后面的头像图标选择通讯录中已经保存的联系人,选择之后地址自动填入收款地址输入框);")]),t._v(" "),r("li",[t._v("输入正确的转账金额(备注可选填);")]),t._v(" "),r("li",[t._v("点击确认转账即可进行转账(若转出地址有密码,需要输入正确的密码发起转账交易);")]),t._v(" "),r("li",[t._v("转账完成之后进入转出地址交易记录界面,可以查看该交易进度(图25)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(774),alt:"1547460590047"}})]),t._v(" "),r("p",[t._v("​\t点击txid可以查看转账详情,界面如图26。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(775),alt:"1547460865338"}})]),t._v(" "),r("p",[t._v("​")]),t._v(" "),r("h2",{attrs:{id:"共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 共识")]),t._v(" "),r("h3",{attrs:{id:"创建共识节点"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#创建共识节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 创建共识节点")]),t._v(" "),r("p",[t._v("​\t点击钱包顶部菜单的“共识”,进入共识界面,该界面展示了共识的总览信息,包括全网的委托总额和节点总数以及自己的参与共识情况,界面下方展示了全网所有的共识节点和自己创建、委托的共识节点信息(图27)")]),t._v(" "),r("p",[r("img",{attrs:{src:s(776),alt:"20190115102249"}})]),t._v(" "),r("ul",[r("li",[t._v("当前账户(未受红牌惩罚)还未创建节点,点击我的总体情况中的创建(图27中红框标识),便可进入创建节点界面(图28)")]),t._v(" "),r("li",[t._v("输入正确的必填信息,考虑到安全问题,出块地址必须使用自己创建的其他账户地址,创建节点的保证金范围:20000-200000NULS,代理佣金比例(10%-100%)一旦确定便不可更改")]),t._v(" "),r("li",[t._v("点击确定经过密码确认之后便成功创建节点,节点创建成功后返回共识页面(图27)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(777),alt:"20190115103504"}})]),t._v(" "),r("p",[r("strong",[t._v("PS:创建节点时,出块地址不能设置密码,节点正常出块过程中,出块地址不能设置密码,否则无法正常出块并影响节点信用值")])]),t._v(" "),r("h3",{attrs:{id:"注销共识节点"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#注销共识节点","aria-hidden":"true"}},[t._v("#")]),t._v(" 注销共识节点")]),t._v(" "),r("p",[t._v("​\t账户自己创建的节点可以进行注销(节点注销之后,创建节点时的保证金会被冻结3天),点击钱包顶端菜单“共识”进入共识界面(图29),点击我的总体情况中创建节点后面的查看(图29红框标识)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(778),alt:"20190115104427"}})]),t._v(" "),r("p",[t._v("​\t进入节点详情页面(图30),点击“注销节点”按钮,确认密码之后则节点注销成功。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(779),alt:"20190115104911"}})]),t._v(" "),r("h3",{attrs:{id:"参与共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参与共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 参与共识")]),t._v(" "),r("ul",[r("li",[t._v("在共识界面中,我的总体情况点击委托节点后面的“委托”入口(也可以直接点击节点列表中的某个未委托节点进入);")]),t._v(" "),r("li",[t._v("在参与共识界面(图31)显示节点的信息(节点ID、节点来源、佣金比例、保证金、参与人数、信用值、委托数量);")]),t._v(" "),r("li",[t._v("可以在该界面直接选择委托地址,输入保证金参与委托(需要确认密码)。")])]),t._v(" "),r("p",[r("img",{attrs:{src:s(780),alt:"20190115110413"}})]),t._v(" "),r("h3",{attrs:{id:"追加和退出共识"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#追加和退出共识","aria-hidden":"true"}},[t._v("#")]),t._v(" 追加和退出共识")]),t._v(" "),r("p",[t._v("​\t在共识界面中,我的共识table页中点击某个节点进入节点详情(图32),此页面可以进行追加委托保证金和选择退出共识。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(781),alt:"20190115110806"}})]),t._v(" "),r("h2",{attrs:{id:"设置"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置")]),t._v(" "),r("p",[t._v("​\t点击顶部菜单的“设置”,进入系统设置界面(图33),可以对系统语言、通讯录、密码进行设置和账户备份、版本升级、退出系统。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(782),alt:"20190115111229"}})]),t._v(" "),r("h3",{attrs:{id:"语言切换"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#语言切换","aria-hidden":"true"}},[t._v("#")]),t._v(" 语言切换")]),t._v(" "),r("p",[t._v("​\t系统设置界面中可以对系统语言进行中英文切换(图34)。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(783),alt:"20190115111447"}})]),t._v(" "),r("h3",{attrs:{id:"查看通讯录"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#查看通讯录","aria-hidden":"true"}},[t._v("#")]),t._v(" 查看通讯录")]),t._v(" "),r("p",[t._v("​\t系统设置界面可以查看通讯录,在通讯录界面(图35)可以对通讯录进行新增、编辑和删除操作。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(784),alt:"20190115111721"}})]),t._v(" "),r("h3",{attrs:{id:"设置-修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置-修改密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置/修改密码")]),t._v(" "),r("h4",{attrs:{id:"设置密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#设置密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 设置密码")]),t._v(" "),r("p",[t._v("​\t在系统设置中,对为设置密码的账户地址可以进行密码设置(图36),设置密码需要符合密码规则。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(785),alt:"20190115112217"}})]),t._v(" "),r("h4",{attrs:{id:"修改密码"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#修改密码","aria-hidden":"true"}},[t._v("#")]),t._v(" 修改密码")]),t._v(" "),r("p",[t._v("​\t在系统设置中,对已经设置密码的账户地址可以进行密码修改(图37),修改密码时,需要输入账户地址当前的正确密码,修改的密码需要符合密码规则。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(786),alt:"20190115112121"}})]),t._v(" "),r("h3",{attrs:{id:"版本升级"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#版本升级","aria-hidden":"true"}},[t._v("#")]),t._v(" 版本升级")]),t._v(" "),r("p",[t._v("​\t在系统设置中,当最新版本号高于当前版本号时,可以直接点击“最新版本”(图38),对系统进行升级。")]),t._v(" "),r("p",[r("img",{attrs:{src:s(787),alt:"20190115112741"}})]),t._v(" "),r("h3",{attrs:{id:"退出系统"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#退出系统","aria-hidden":"true"}},[t._v("#")]),t._v(" 退出系统")]),t._v(" "),r("p",[t._v("​\t在系统设置界面进行退出操作,直接点击“退出系统”按钮(图38)即可。")])])}],e=s(0),i=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},r,!1,null,null,null);i.options.__file="clientWalletGuide.md";a.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/30.71024fdc.js b/docs/.vuepress/dist/assets/js/30.71024fdc.js new file mode 100644 index 00000000..db965273 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/30.71024fdc.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{202:function(t,s,i){t.exports=i.p+"assets/img/1546518956812.2aa8e3b0.png"},203:function(t,s,i){t.exports=i.p+"assets/img/1546519370742.c4239db8.png"},204:function(t,s,i){t.exports=i.p+"assets/img/1546519548787.20972169.png"},205:function(t,s,i){t.exports=i.p+"assets/img/1546520020388.3442ad67.png"},206:function(t,s){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},207:function(t,s){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},516:function(t,s,i){t.exports=i.p+"assets/img/1546518367717.3884ae76.png"},517:function(t,s,i){t.exports=i.p+"assets/img/1546518556230.b3d05831.png"},902:function(t,s,i){"use strict";i.r(s);var A=[function(){var t=this,s=t.$createElement,A=t._self._c||s;return A("div",{staticClass:"content"},[A("h1",{attrs:{id:"连接主网"}},[A("a",{staticClass:"header-anchor",attrs:{href:"#连接主网","aria-hidden":"true"}},[t._v("#")]),t._v(" 连接主网")]),t._v(" "),A("h2",{attrs:{id:"下载钱包"}},[A("a",{staticClass:"header-anchor",attrs:{href:"#下载钱包","aria-hidden":"true"}},[t._v("#")]),t._v(" 下载钱包")]),t._v(" "),A("p",[t._v("NULS全节点钱包,有Windows、Linux、Mac三个版本,且持续更新,用户可以根据自己的服务器系统下载。")]),t._v(" "),A("p",[t._v("方式1:官网下载(https://nuls.io/newWallet)")]),t._v(" "),A("p",[A("img",{attrs:{src:i(516),alt:"1546518367717"}})]),t._v(" "),A("p",[t._v("方式2:github下载(https://github.com/nuls-io/nuls/releases)")]),t._v(" "),A("p",[A("img",{attrs:{src:i(517),alt:"1546518556230"}})]),t._v(" "),A("p",[t._v("注:版本号后标注了[Main-net]的版本为主网的钱包")]),t._v(" "),A("h2",{attrs:{id:"运行钱包"}},[A("a",{staticClass:"header-anchor",attrs:{href:"#运行钱包","aria-hidden":"true"}},[t._v("#")]),t._v(" 运行钱包")]),t._v(" "),A("p",[t._v("钱包下载好后,根据不同的操作系统解压")]),t._v(" "),A("p",[t._v("Windows系统钱包解压后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。")]),t._v(" "),A("p",[A("img",{attrs:{src:i(202),alt:"1546518956812"}})]),t._v(" "),A("p",[t._v("双击NULS-Wallet.exe启动并运行钱包,系统默认浏览器会自动打开钱包界面,如下图:")]),t._v(" "),A("p",[A("img",{attrs:{src:i(203),alt:"1546519370742"}})]),t._v(" "),A("p",[t._v("首次打开界面时,页面还会提示当前正在同步区块中,如下图:")]),t._v(" "),A("p",[A("img",{attrs:{src:i(204),alt:"1546519548787"}})]),t._v(" "),A("p",[t._v("出现正在同步区块后,表面已成功连接上NULS主网,待区块同步完成后,即可正常使用钱包。用户为节约时间不想从第一个区块开始重新同步数据,也可以到github上下载每个版本对应的最新区块数据包,如下图:")]),t._v(" "),A("p",[A("img",{attrs:{src:i(205),alt:"1546520020388"}})]),t._v(" "),A("p",[t._v("Linux系统解压钱包后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。")]),t._v(" "),A("p",[A("img",{attrs:{src:i(206),alt:"1546520382686"}})]),t._v(" "),A("p",[t._v("执行命令 sh bin/start.sh 启动钱包,启动后可根据命令 sh bin/cmd.sh 进入nuls钱包命令行,在命令行里执行getnetinfo命令,查看当前网络状态,当localBestHeight出现增长时,则表明连接主网成功。如下图:")]),t._v(" "),A("p",[A("img",{attrs:{src:i(207),alt:"1546520727643"}})]),t._v(" "),A("p",[t._v("用户也可跟踪logs文件夹下的nuls.log日志文件,查看钱包最新状态")]),t._v(" "),A("p",[t._v("MAC版本的钱包运行与Windows钱包基本一致,不再复述。")])])}],r=i(0),v=Object(r.a)({},function(){this.$createElement;this._self._c;return this._m(0)},A,!1,null,null,null);v.options.__file="connectMainnet.md";s.default=v.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/31.a1d400ee.js b/docs/.vuepress/dist/assets/js/31.a1d400ee.js new file mode 100644 index 00000000..4cc94296 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/31.a1d400ee.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{169:function(t,e,s){t.exports=s.p+"assets/img/1546518956812.2aa8e3b0.png"},170:function(t,e,s){t.exports=s.p+"assets/img/1546519370742.c4239db8.png"},171:function(t,e,s){t.exports=s.p+"assets/img/1546519548787.20972169.png"},172:function(t,e,s){t.exports=s.p+"assets/img/1546520020388.3442ad67.png"},173:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},174:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},237:function(t,e,s){t.exports=s.p+"assets/img/1546586728639.68220b93.png"},867:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"connect-test-net"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#connect-test-net","aria-hidden":"true"}},[t._v("#")]),t._v(" Connect Test-net")]),t._v(" "),n("h2",{attrs:{id:"downloading-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Downloading wallet")]),t._v(" "),n("p",[t._v("The NULS test-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.")]),t._v(" "),n("p",[t._v("Download: downloading from github (https://github.com/nuls-io/nuls/releases)")]),t._v(" "),n("p",[t._v("!"),n("img",{attrs:{src:s(237),alt:"1546586728639"}})]),t._v(" "),n("p",[t._v("Note: The version marked [Testnet] is the test-net wallet.")]),t._v(" "),n("h2",{attrs:{id:"launching-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Launching wallet")]),t._v(" "),n("p",[t._v("After the wallet is downloaded, unzip it according to specific operating systems.")]),t._v(" "),n("p",[t._v("For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(169),alt:"1546518956812"}})]),t._v(" "),n("p",[t._v("Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(170),alt:"1546519370742"}})]),t._v(" "),n("p",[t._v("When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(171),alt:"1546519548787"}})]),t._v(" "),n("p",[t._v("The appearance of block synchronization means the successful connection to the NULS test-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(172),alt:"1546520020388"}})]),t._v(" "),n("p",[t._v("For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(173),alt:"1546520382686"}})]),t._v(" "),n("p",[t._v("Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the test-net has been successfully connected, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(174),alt:"1546520727643"}})]),t._v(" "),n("p",[t._v("Users can also track the nuls.log in the logs folder to check the latest status of the wallet.")]),t._v(" "),n("p",[t._v("For MAC users, steps are almost the same as the Windows users, so let’s skip it.")])])}],i=s(0),a=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);a.options.__file="connectTestnet.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/32.f6916684.js b/docs/.vuepress/dist/assets/js/32.f6916684.js new file mode 100644 index 00000000..e6d6b547 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/32.f6916684.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{196:function(t,e,s){t.exports=s.p+"assets/img/1546518956812.2aa8e3b0.png"},197:function(t,e,s){t.exports=s.p+"assets/img/1546519370742.c4239db8.png"},198:function(t,e,s){t.exports=s.p+"assets/img/1546519548787.20972169.png"},199:function(t,e,s){t.exports=s.p+"assets/img/1546520020388.3442ad67.png"},200:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},201:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},492:function(t,e,s){t.exports=s.p+"assets/img/1546586728639.68220b93.png"},918:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"how-to-connect-wallet-to-nuls-test-net"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-connect-wallet-to-nuls-test-net","aria-hidden":"true"}},[t._v("#")]),t._v(" How to connect wallet to NULS test-net")]),t._v(" "),n("h2",{attrs:{id:"downloading-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Downloading wallet")]),t._v(" "),n("p",[t._v("The NULS test-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.")]),t._v(" "),n("p",[t._v("Download: downloading from github (https://github.com/nuls-io/nuls/releases)")]),t._v(" "),n("p",[t._v("!"),n("img",{attrs:{src:s(492),alt:"1546586728639"}})]),t._v(" "),n("p",[t._v("Note: The version marked [Testnet] is the test-net wallet.")]),t._v(" "),n("h2",{attrs:{id:"launching-wallet"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-wallet","aria-hidden":"true"}},[t._v("#")]),t._v(" Launching wallet")]),t._v(" "),n("p",[t._v("After the wallet is downloaded, unzip it according to specific operating systems.")]),t._v(" "),n("p",[t._v("For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(196),alt:"1546518956812"}})]),t._v(" "),n("p",[t._v("Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(197),alt:"1546519370742"}})]),t._v(" "),n("p",[t._v("When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(198),alt:"1546519548787"}})]),t._v(" "),n("p",[t._v("The appearance of block synchronization means the successful connection to the NULS test-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(199),alt:"1546520020388"}})]),t._v(" "),n("p",[t._v("For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.")]),t._v(" "),n("p",[n("img",{attrs:{src:s(200),alt:"1546520382686"}})]),t._v(" "),n("p",[t._v("Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the test-net has been successfully connected, as shown below:")]),t._v(" "),n("p",[n("img",{attrs:{src:s(201),alt:"1546520727643"}})]),t._v(" "),n("p",[t._v("Users can also track the nuls.log in the logs folder to check the latest status of the wallet.")]),t._v(" "),n("p",[t._v("For MAC users, steps are almost the same as the Windows users, so let’s skip it.")])])}],a=s(0),i=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);i.options.__file="connectTestnet.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/33.7a11d236.js b/docs/.vuepress/dist/assets/js/33.7a11d236.js new file mode 100644 index 00000000..85f97e73 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/33.7a11d236.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{202:function(t,s,A){t.exports=A.p+"assets/img/1546518956812.2aa8e3b0.png"},203:function(t,s,A){t.exports=A.p+"assets/img/1546519370742.c4239db8.png"},204:function(t,s,A){t.exports=A.p+"assets/img/1546519548787.20972169.png"},205:function(t,s,A){t.exports=A.p+"assets/img/1546520020388.3442ad67.png"},206:function(t,s){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfgAAACLCAYAAACN6YukAAASsklEQVR4nO3dT2gbd5/H8Y+Xva1vPYTuPFCt7BRCtpCHOeRJRGERFSYlEYFA9zKiJ6WYEsfk4hZ6+B0KbS5BUSim8amMTg8EjBISjItYKJM8PQwtZLOBxtLjQmeLDz1tnvPsQSNbtqWJ/tmSR+/XwxeeWBrNd0ZDf5rfjPSRpLBrOW4YeCa0457Tbw34mrZxQy8IwiAIBuvpwHodNwg94zT/bZvQDbzQ2AolJzSuCR07Ws52QuMFoev006sXesbue9/0t1xvfXZ8TdsJXS/al4EXeq4z2veYoiiKGnv9k/plG3mekXE9BUGgIPBk7P2Ptf4px1XQ/u/Yl3XlBUHzNT137zUl2cZTNVfXat6SZeW10iiq6jqtR2U8T+6+5aN12ib6myd3oX1tjhayNa2ainxJ8o1Ka1Luii2pIlMwqvjRU/2KHm5uKz3fy1Ycp0H7tGXKt5XezCu/VtNaPqOljQUtm0nbPgDAMPof4CUpVdTcxpIsy1J+TSouO29eJo5tVC5Km3lLlmXJWtqQlvcG6XKxoZVMazDzVSmtaTu7oL21ppTN1bVkRctnjHzZMuWiGit5WdaSNpRtW9+80tt1vWxrwd9qKDV3pkNvjpZzKTW2/MOPTZK++tzW5sO95/mVggpmwrcPANCXwQZ41bQRnTr6Ww0pPd/TWXq8tHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobtcOrtI289hmIvQdkvGg2oLoobeZVqAy9gUdgkD59PVxtKFd2tTyXVqfPNACAk2+wAf7A2e/QfKOllU3NLZZ3p9Rbg649n9Z2/aUkR8vFtDbzljKluhr7G1K9U0Nv6tM3ylgZHT559WUy0WxAflX1XFXeRE5hD9anXykokylpQ1J6wZPnuRpyDgYAMGEGPIMfPb9iVMhklLEs5dcaKpZ7u3YfKzWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kGqdtQE9LjS35ar82XlFpraFctTlFn35jLw+1uZ3VgmN36KWijVpWi6112kbLRTWvSzsHe7FlFrOdB/9+RTf9uf2eLndabuA+bRnXyLH3/n3lJNxjAADoy4jP4CsqrUnFaqAgKGu+3uG6t2+0WkvrdhAoCKKpYd+opAWVo7vgq7mGVkrRxeTKhmrZRRlb8k1BGctSplBQxioo/nKzL7O0pvTtqoKgrAXt76VSyGtzblHVIFBQzUkrS82p+spDbbT1EgRl5RorWurlJjTHbfZfTClVrCrodTAfZLmB+/RlStJCOVC1mFWxWlWusTKh9xgAAIbR/Xt0jht9V7q/74GPumzjhUHg7n3nm+qhnNCN3rtu3623jRt995+iKIpKYI29gZ7KdtzQ2/1xFjd0JqCnk14M8BRFUcmtmej/AACABJmYu+gBAMDoMMADAJBA8QN8dHd3z3eDx7CNt/tavf4+/Uj18bv4yeDIjfb3ZP5IDwDgKL35DH57TXnLGvprVL7JNH9xbaXDV+fGwt4XmOM6bd8od4zc1k/ABp7cHgfI9g8x/QyqAy8X22dFBctSfm07Zr1uh5/pBQAkwYmZorc7pcUNwXGrytVXlbcsWflN6XY5GuwcXVmQNpb2/wRsLzMYrQ8xcYPq6JYbvE/Zjlyv9T14T57rTNHMBgBMB+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUmFnGxADDNiIslLhYAkEAnZoqeuNhDW0BcLACgK+JiJeJiiYsFgMQhLjZCXOyEbx8AoC/ExRIXCwBIIOJiiYslLhYAEmhibrIjLnZIxMUCANoQFxutn7hYrsEDQJIQF0tcLHGxAJBQ3dNoiIs9wUVcLEVR1JTX2BvoqYiLPYJ9ygBPURSV2CIuFgCABJqYu+gBAMDoMMADAJBAxMUm1mjjYsf+/gEA+kJcLHGxPZm89w8AEOfETNETF3toC4iLBQB0RVysRFzsCOJi494/AMDxIy42QlzsENsX9/4BAMaCuFjiYkeky/sHABgL4mKJix0+Ljbm/QMAjMfE3GRHXOyQxhwXeyTvHwBgYMTFRusnLrbHCfU+3z8AwPh0/7F6xw0Dz4R2+99sE3rtfzvwnGbyWxAGgRca02F5KXRc71BojG3c0IvSzwKvPTnOCd3AiwlFsUPjdXncNtFreqHrHuzFDo2716vr2Lt/d9p7CbzQc51D29B1f+0u1yGFL+rnUDLfQMv11qdtvMNpcrYJXW9vXZ7r9BVg0N/7R1EURY2pYh4kLvYEF3GxFEVRU15jb6CnIi72CPYpAzxFUVRii7hYAAASaGLuogcAAKPDAA8AQAJ1HODf+vSVrtZCXbgct+h1XaiFuuqW9NbR9HYMLuo9N9TVWrM++PTi6F768uPRv+ZItbb9sVJj6qB1nDWrWx+Hj7Pejs/j7hMAJst0n8Ff/kJzlvT6QUbr2Rl9/83TsbWS+irU1dorvXd2bC0cuz++Oa31bEb1YNydxDspfQJAu38efNH7epa9P7pOcMye6nlhRs/H3cYbcZwBwCDiB/jMY31w65Jm1TzLbZ3hpr4Kde589Jzgrn4oLOsPNacy3782r9c/PpHOX9KstlS/c1rPHw3Z5dnruvDZtzplSdKWdu6c1rPWa54t6cJnNw89Ft/LdV2ofatT0UvMXvN09dr+bRzEW58+1p+vNde1s+9s76Lecz3NWXt/ef3jJ/r+8/vNqfxbl6K/zmvuXqg5STt3ZvTsUcxyQ2jtm6Yn+jn7oXaT6KN+XgdPJKv53u++x4f29cd69ujoZj26HWe7uh6fr3TufLR9wRPVv/5Qz18cWZtdj0FJ0uW2HoMtzVrzu70ee58ApkrsFP2pP/2in7Iz+vlHafbad7vTx9ufz2g9+4l2uiw3q3V9f+OuXmtec/857DX667pw71udsp7o5xszWs9+rN/fab3mdV24d1OndFc/ZGf084/zOnVr/zR3517u61l2Rut3nkga0RT92VJzcA/u6ofsaf3+23zbg82z5fVsVHeeaPb8t81ryI8+1Hq0j6Ut1W80n9McIGKWG0IvU86zlrRzY0br2Yx+/pt0cF//8EA6deu7I72k8KbjrOPxefmxzp2f331P179el5yjvE8k7hi8rgu3WsfEjLbaj4lj7xPAtIkd4F//7a/6Q9K290TSvE79R283jO1496UX/6N/jKBBXb6qU5JeP/hS2y8k6am2v4nO5FqPxfQ50l7i/Nu7zbO0fb3E+5d3BrsBb9Dl+vH6wZfR2WS0vw/s6z9+faV+jokj6THmfZ/9y0dKnb0ovbiv558fOPMfpbhjsONj+x1bnwCmTuwU/T9+Hd9NZy1vvXNaUude4h47bvG9XFTqq+/2pmN7Nuhyo9favtbljEnQcV8/+lL1zGnNnb+pc/du6tzBKfMRG/j4POY+AUyf2DP44zhTfJPmmWLnXuIeO26xvVz+IpqO/WR3qr0ngy53BFrbt3On7ZLBSL558FT/99tgS3Z+35/q+eentZ6d0Q93orPpoS8TNV+3U5+DH59H1ScANMUO8LN/+UhvSUplLkna0s5/jeFM+dG6diTNXvtCqbOSdFGpT6P/ELYem4Q+//6LXh/q5aD/lnSxy2NxBl1uhKJ93T4IvXX5sd4b2XfRL+ntPl+r4/t+uaQLl5sD6h9//6Xr9fuR9Rl3DMYdE0feJ4BpFzvA7/z2rv5ca97J/PrBx81rsmdL+qAW6mrrLnTrpt6PfgDkX4+kxft6duMT7QSXdO5eqKu17/T2r61rlff17MZd7ajZw7nzzWnOsdyJ/GJZPz14otfWTb1fe6W3/7S199ijL1X/cas5vV37bv9jke3KXe0Ezbvod3/EpYfljs/+fX219krvvrOu/x3BlPL2559oJ5BO3Wr7waEejrOOx+ejv+r3d75oLnvvpk4FT1T/ejTXtjv2GXcMvljWT3dax0So+X3HxNH1CQCSRNjM1Gp9Be/A1+RwdFpfQRzy65gA0Ivp/iW7qfbvmrXe/CwM46Le+6q0d2kpmqKfhJtCASTfEL9khxPpbEkf3LvZ/AEbbWnnDmfvR+epnlc+0oXPQp1r/QjOg4+5Ux7AsWCKHgCABOIMHr2J+xg4c2xdAAB6FH8N3nEVBIGCIJDrDLci23i7rxV4RvZwL9c/xx3PesfGkRvtb89Mz1YDAJrefJPd9prylqVCZbgV+SYjy7JkrdSGe6GRsWXc1ocOT66zNwjajpHrBXuP9ThAtn+I6WdQHXi52D4rKliW8mvdr7DbxhVjPwAk04m5i942rrwRzgA4blW5+qryliUrvyndLkeDnaMrC9LGktX8QJJfVT1X7WkGo/UhJm5QHd1yg/cp25HrBaoWsypWPXmuM0UzGwAwHfof4G0jzzP7zn53zwKjx3YHiz6mxfcP4PvPLG3jqZqrazVvybLyWmkUVd0dyWwZz5Pb6QOAbaK/eXIX2tfmaCFb06qpyJck36i0JuWu2JIqMgWjih891a/o4ea20vOTNgQO2qctU76t9GZe+bWa1vIZLW0saJlTeQBIlMHO4FNFzW0sRWedUnF56Av0KhelzXx0Nrq0IS3vDdLlYkMrmdZg5qtSWtN2dkF7a00pm6tryYqWzxj5smXKRTVW8rKsJW0o27a+eaW363rZ1oK/1VBq7kyH3hwt51JqbPmHH5skffW5rc2He8/zKwUVzIRvHwCgLwNO0de0EZ06+lsNKT0/ginetHQmehW/eXbqS9KZOaVqG6po7yzfW5473NFq9PwW+4pyqVafviobHa7920Ze+wzE3gMyrWvb1UVpMz/0PQhHY5A+fT1cbShXdrU8l1anzzQAgJNvsAH+wNnv0HyjpZVNzS2Wd6fUW4OuPZ/Wdv2lJEfLxbQ285Yypboa+xtSvVNDb+rTN8pYGR0+efVlMvuvbU/mneiD9elXCspkStqQlF7w5HmuhpyDAQBMmIm5yc6vGBUyGWUsS/m1horlEXylLTWnjieo/pYaBx7b+yBxqDGZ1Vrn6ftJ0nefvl7WG9osZbS0mdbiRH6AAQAMarQDvL+lRiqnK82L53IWsoef87Ku7YMDr23kmvY7udNSY0u+2q+NV1RaayhXbU7Rp9/Yy0Ntbme14Ngdeqloo5bVYmudttFyUc3r0s7BXmyZxWznwb9f0U1/ff+mQKflBu7TlnGN9r4VaOvKSbjHAADQlxGfwVdUWpOK1UBBUNZ8vcN1b99otZbW7SBQEERTw75RSQsqR3fBV3MNrZSii8mVDdWyizK25JuCMpalTKGgjFVQ/OVmX2ZpTenbVQVBWQva30ulkNfm3KKqQaCgmpNWlppT9ZWH2mjrJQjKyjVWtNTLTWjRDwNViymlitXefyBokOUG7tOXKUkL5dbX5KrKNVYm9B4DAMAwwq7luGEQBGEQBKHrxDzviMs2XhgEbujY4+vh5JUTutF75xm7y351Q9PrPo3739i3laIoiupQY2+gp7IdN/S8IPrA4YbOBPR00osBnqIoKrlFmhx6E3eUEDYDABOHAR4AgASamK/JAQCA0WGABwAggRjgAQBIIAZ4AAASiAEeAIAEYoAHACCBGOABAEig/wdyeONVa0ZkmwAAAABJRU5ErkJggg=="},207:function(t,s){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcwAAACMCAYAAADx9JleAAAUZUlEQVR4nO3dv27qvsMG8Of36nsXWRB06eyRDQkxlSswIwML6tbVK1vFwsDoXAGdEBKbx8xnKYjF15F3yB+SkIQUSAnl+UiWTpsmsZOjunaCn/8B8EFERESl/u/eFSAiInoE7DCJiIgqYIdJRERUATtMIiKiCq7qMIUysNYGxSiIW9Xq6QkoY6HlBXvG98RA8YYQEd2Uf3WR2rdG+eIWx2pgEcr4RonGHxOQvrbalw24ZiwsLCx/rXBK9i8RL2jfuw5ERH9U0GEKBWMUlM6Zzgu3xbN7UleefhVKw8RTtjo+plAaRkuInINcuq1CZcK6GGidbYNItV1HFZUa1lqsxi20xqtwu4aMjld0zS49JtLT3Kkp2dLzBVO4djVGCz3Mcu6hNsExjebUORHRpXwI5RtrfS2DKUKhjG+19ONtyenWvOnXvO8J5RurfSWir6WvdPQzwpdK+8Za3xrtK5mcmrx0W1kRvjJR+4QvtU3VV2rrGyWDr4X0tbG+lsf9c6dPy67Zpcc8qW/18yWvuTzT9ttPBbOwsLD8/ZKYkt1i7XoAAO97D7RfbjASaQOv4VE8F2qkEJ4Brhqh6zhwpmtgMIe1BkaJK7aVEG/ot6L2eXDX28Q2hUlvi4Vyg7p5Lj43B7RfqrS+4JpddcwLzlcmp+2tzuuV9SAiej7/xf867PDvlkf2FKYfwPtkDjNroYUDlsMulHfLk/xAafuCacxZ8lvbVwBnKlvHMS8+3w/2Czvae90KIqJHVOtLP56rMOp20XUcDJd7jOfR8zMBGT3fnA+A9RSO00VXeVdsO6PVQeG46rDE0HHgJMvIva7xdRzzUtm277/ZWRIR/dD5DtP7xr7Vx1sw1wg56J3+zL8dDtlfykJBK5mYMmzHv6iFeseks8Z06MDpjqBcL7HbZdvK2/CFzaGHgRSnbfAUFvsx5olpXSE1VOYzkK3OW/Up6jqOeamcth92N51LICJ6Gmdf7BHK+NZa31rjK5X/mUupo585vnQiohd0wpd0pKj/oWxhCV+asdb4WmfbIHwV19/6RstM+4KXdlLtO/sy1AXHhPR1dL0SRcsq50PBSz/B96NzGf13Py/LwsLCUmf5X/iP5yI17GB9vylSIiJ6OE+zcIFQ0edAOS1JREQ/99/5H/kbPPWJN2NhW8Bhu8T0bq/rEhHRI3rOKVkiIqIfepopWSIiomucdJjH9V+P65sSERE9u8wzTIG3fg/7DwddvkBKREQUy5mSPYAvkBIREaXxGSYREVEF6Q5TvKHTulNNiIiIGizuMKW2sKs+sJzeL1GEiIioodKfwxQKZtXH5p4xXERERA2UnpL1vrA53KkmREREDcaXfoiIiCrI6TBb6BQmLRMRET2nTIfp4WuzRXvGlX6IiIiSuPg6ERFRBXyGSUREVAE7TCIiogrYYRIREVVQW4cplIG1NihGQdR1ojudr14Cyljoqm9dCQXz8G0mImq2G3SYEtpqyMwveU914TgOnI/t9aeooPR8Uh87U2thrYGWt+lehDIwKnMsqWGzvV3e9wp5UF0HoxtGrOXWM6hY7v2rS/IPm2x9jlmsFtZoJG+RkAraJO5fYVtOj0tEdAvPMyV7WGLoOEGnOlwAszn4e/X3RX/YDJeZJaWEwntnjWl4j4abNmbzaNQs8TYA1tPj/dv1Vyedu9QTYMulqoioHvfrMMVxxGB0djpRQGmTOxqU2l4/9eq5WG+TCzRkzpfoSbOjnnhTOGpdjVtojVfhvlU/u1p2vuMI7GS0J1RYFwOt9Un73xLHvE09f5GnMBq58OIvF9i2OghukQs1UnDjjS6+Nge0XxKtlxoTLPC5+9VaE9ETuUGH6WLkjOD+aBpRQM3HwGIIxxligTHmKtkprtDfLcIR4RTrl9e4Y3BH4SjDcTDc9LG6ZA5RSAx6x6Ds1PmGCyAavQiF+RjYDMNzTtfAe9hJuaN4pHRYDsM6jVCl+YXnQzQCGyI7AIuu2f5jGFwT9NKbW2N01tOwTsD4XUYX7Ew9L7l/UZWCDryWaVw5QO+wQ26WuZB477ew/456UAE1ARa3nMMmIsq4zwhTvKHf2mLtegA8uOstWtFwTyhMelssVDTa8OCq48gjyfveA+2XaqPM1hiraKS4mqC9XASJLNnzeS4+U6OXNvAa/tsLRjqVglx6s/Rz01kvv30n5yuQc83Som0/vC6NJKFnPWwXyWsdPGON7h82w7hzF2qO/uaz0h8rRESX+u9uZ86OHsJf8F7etgShNObjHuKc60PFObjDEsNu9AtYQJkVDP6h+wUAPcysxSz589tXwFOYfgDvkznMrIUWDlhWjT7bfsBJjnikhh1EXxSc71xXXHJdSrfVxVPoOurGBxVQZob2cohuqgcMRsAKAISEmq9gMERXveK9v8eiyzw6IqrX/Z5hxs+nQvvvY3eR3RbJTpFe/AauB7VIjGqTLwRFJezsPFdh1O2i6zgYLvcYz2/w8Y2S85Uqui5/RvCHTH8zRLfsrxLPPd4/OUCvFfwBknpWy4/ZENGN1d9h/tvhkP1F731hc+hhIAUAATno4RA9UPQUFtseJkqGv/AEZPzvwHf0/UHmOV7R+U4IqOicnsJin36GKqSGCp9h6tS52+mOPdTqvFX/5Vx2vtL9Tq/ZT/2onlXc9BmmgDLz/M5SZu+DgJqE9y98Rhs/146e1XYT07l1Pmsloqfi112kNr611rdW+zL6vlC+Nta31vpGK1+k9hG+ivcxvpYi51jGV0r71mT3zTmf1OHXx2K0TOyXPF96m1DaN9F+RvtSZNsn43akzqdl+udS3ys6n/R1pp7WWl/L4zUz0TXRibYL5ZvkdZB51yWnnteWsD5x/aqUnHuhZf73j/UUvkzeB2sy9+9YhDK+USLnnDdqMwsLy9MWppU8KqlhB+tqU7lPTmqLye7MNC8R0RnPs3DBHyBU9DnQzDQ2lXJHDjtLIrra/d6SpR/z1CfejIVtAYftElN2AkREv4ZTskRERBVwSpaIiKgCdpi1YkwXEdFfUVu817UKY7MY09XwmK7EEnaJ+xT9SHm8V8m2knivsliw4HO8Jt5u+GFMIrrQ440wGdPVCIUxXQCAA5bD5EpGx+UEy/Yr3lYS71UaCxasMzvrb+Lt0/UL/78Q0UXq6zDD6UWVFzkV/EB+xNVP4qgY09W8mK5alMR7lcaCSbyP9/hIrPrjuaraWsBERBn1xnsVRU6hJOLqJ7FZjOlqaExXC+PV7afNYyfxXgnJWDDxgvZhhxedmOrVks+IiegiNU/JFkROXRpxBTCmq/GCDttJTZuvbtAZF8d7HeXEgiX+AHGcITbtWWodXyKiqurtMEsjp44JE/FUY6dCFkcq6WOKTX+WeEGk4JiewvRjg85kHk+FVv6duf1Ip4qkElIubUMTY7pu+3LS8dguRh9b9AbX9piJjjh8hnn6slEQC5Zqx2GJz+NcbjqlhojoB+6Yh5nMp7xU8AtwPEjEdBUc03MVRm6Q3SiUxmqu8HXt+S9tQ/iMjY/SLuS5UItBeN89FMaCed/Y4+VetSSiP+Y+b8lWjLg6H0fFmK6buOUzzGwUlwinSddXDF/L4r3KYsHgYr3v4z1+hprcL/oWo7+IqLp6olDORk4VR2oFpSA2izFdzY7pgvClMqkormQ8W/F+545ZEO9VGguWvV45/88Y/cXCwlKxcC3Ze2NM110x+ouIqnq8hQv+AMZ0NQejv4ioKsZ73QFjuoiIHg+nZImIiCrglCwREVEFd+4wfydZI3VGVbS2bfk2IiKiK1+1lb622pcQvjKnH00QyvhGiSvP8YO6mIKPM6TqWtaO29WnuO3l16yW61JwPqESH4s5qWv6IyIm+xGbGv6/sLCwsDS1/KEp2XBptE24MPlwcxr9JV7QLty9ZNsfVha3xWgsIqKj+jrMM3FUufFXQsEYA2PCCK4wZeJkzdC8SK1wUfPFMXgRn0ug/xasqKOMhV2N0YrXfzXxRzuKt5XEgpXV5U9EcRVEY+H8PSq/ZkREj6vWIWz5lGxmWk4o3ySm64wSJ6vdSG19o8LVWkQwBasl8lfFya7UEx8/py5528LvqWhVICF9pSvUpVLbLyyXrMpzyX0KVx06Wcno3D06c81YWFhYHrU0b0r2sMM/ePjeI8g7/LdDPFl4TSzYxQpiwe5Sl1+WF4313im/RwAujlIjImqw5nWYZ10YqXWJs7Fgv1iXRJ1qi+LKyovGap950ntNlBoRUYM9XoeZysMMy8gNRjlhbFZEvLSvXnbOcxVG3S66joPhco/xXB1TM4rq8hd439hfumvZNSMielC/0mHeLI6qLFIrjM2aHN/WwfsY2HxdMRlYFgt2s4iyn9fpd+KoCqKx9me60YpRamX7M26LiJqo9g7TUwts22OsUm+KSmhrYe0K4xbQm4Vvy76dP547GmLTmcfToPPBGl8uAHhQ3Q/s++Fbqas+8DHFVcu0egqfGGAeTbn29/j4PI4gi+tS1vaGyXmjN+qs3NECmERv+a7Q339g+rkrP96Za3bWawctbHFNfCYRUR24liw1CuO2iKip2GESERFV8Hgv/RAREd0BO0wiIqIK2GESERFV8Asd5u9HeBEREd3aDTpMCW01ZGHH6EF1f74yzW8v4C2UySzyHjnXvpvXJL2gu+RH/omImqCRU7JCGcz7OyyG4eo50zU6b88xRJV6hf5uEawglBdRRkREd1Frh5kb4RVsgDEqNZI6dgpBrNSiq3BcxtTFSLnxvtoExzQ6seRaeMzjYTRs9HXZ+RoVxSUxSC3onowoIyKie6s5EiUT4QUkIqqCOCmhzDGGK4yVyo+Dio4lfECE8Voif7+TyKmC84WlEVFceW3PRpSxsLCwsNyl3HFKdot1OIT0vvdA+yUYDb520CraJQyJDvbz4K63P0gHKThfEwkFw5QPIqJG+e9uZz7scFGOSHa/sOM7u5Dapee7hqfQddR1+9WcFkZERNU076Ufd41tJqYrJbvtJ0kYTed9Y19DRBkREV2veR0mXHwu25gYhWOylIRWMo7wGkgBQEAOesfOxPvGvtVH8H5MsO2n7h/F5WK97WESxWPlRZQx/oqI6C5q7DALIrwq/KL3VBfTTQeTVfg5zPkAuy8XgAc1XYaRUytMsMQ0TrVw8bkExisLa+d42W1/VNumRHEFkWGToB55EWWMvyIiugumlTwYxl8REd0HO0wiIqIKGvgMk4iIqHnYYRIREVXADpOIiKgCdphEREQV/EK812WK47aeN/or2+508hdjwYiI6vRwI8ynjf4SCu+dNaZO0O7hpo3Z/JjOwlgwIqL6XbmCu/S11b4sSCXRxvrWWt/oRApHWbKI1L61NlO0L1PnKqjLJecLtyltwnMZX4nEzxXW5Uzbay/Ja3F6XWpJX2FhYWF57lLXgS+M4gpL7i/8Z47+ypacTp+xYCwsLCz1lfqmZK+K4irA6K+QhJ71sF2o9MLzjAUjIqpNvfFel0Zx/fb5Hin6CwLKzNBeDtHNrifLWDAiotrU+9LPraO4njn6C0DQWa7Q32TWkmUsGBFR7errMG8QxXUat/XM0V8CysxPO0sAjAUjIqpfjSPM66K4iuK2njb6S75j3GqhNV6Fn7VM14WxYERE9WJayZNgLBgR0XXYYRIREVXwcCv9EBER3QM7TCIiogrYYRIREVXADvM3SA1rVKNXDxLqmHRybqWg48/axreLiOhWGhvvVSY3biuvU5IatlKFBKQycXSW0ffsBH7/egIS7+M9PhwHjtPFuRdpPdUNkmI+fvbxHCKiR8YRJoJorFlnEUdnTdfAMySGxcQL2veuAxFRw9XTYQoFYwyMCQOew2Dj5KhQals4rVcYEC01rLVYjZMf4K+wkIBQMEYd65EaQUoMelt8jNx4GT3PVVDxB/wFlDHQqToF+5e1IVpZx1oDPTipUDrs+W6rpQejWLsao4UeZpkp2dL2lR21NOC7KW0nIvq528egCOWbRE6kUSI3wisqqUitcN84k1JIX+kK0V95x48irlIRXpnor5J6BSVoQ/nPZGPBTqPGkvsH55dhNJf09a2yNC+NDIvvV9X2lVzzM/evtrazsLCw1Fzqm5I97PAPHr73wP7bA/7tcCj40dNIrTbwGn7luVAjdYNF1KtFf8WjqszDw5MorYxUG3KixmJCYdLbYqHCEa3n4nNzQPul2SOtn8WeFdy/B207ERFwx2eYqWm7WWIxdE9h+rFBZzKPpzRvMmtXEP2V5Y7yXmY5IC/4o7ANeedLiaY/7XGK+dqsUCCM93IwutF6saXtK6lD+f2rqe1ERDW7T4cpFOZjYDN0ct+29FyFUbeLruNguNxjPL/BW6tF0V/nIsOKnGnDyfmSDksMwxeM4nKrXu5WzrWvROn9e4S2ExHluOtbst8ATuK2hIKOYqoAAO3cXMuTuC13jW0c4RUcVyUjvlAQ/RVGY8308Zzi5co25ESNHbcpLPZjzBPDLiE11C3eyq0hwiu3fZF/OxyyfxiU3b86205EVLP7dJiewmLbxiwvbstT+MQA82jKrr/Hx6eb2T0vbsvFaLhBZx5N983R330cI74OS+wG85zoryAa62M3SZwTWH6eGfWUtSGMGmvPVrB2jgHSo7MgimseT0vOB2t8NW2QVdq+zM8k78OZ+/cQbSciyvEcaSVCwcyBafcWLw8REdEz4sIFREREFbDDJCIiquA5pmSJiIiuxBEmERFRBXGHGa1wY34nHoOIiOihpKdkhYJedbB2RuCb/kREREfpKVnvG0AbXNqTiIgojc8wiYiIKsh0mP+wO7TQeeUQk4iIKCnTYXpQi2hJtwrBzERERE8i8zlMAWVW6CyGGLlcRI6IiCiSGWG+otM6YPePnSUREVESX/ohIiKqIN1hihcAe3xzgElERJSSXulnNUZ7u+aiBURERBlcfJ2IiKgCPsMkIiKqgB0mERFRBf/duwK/omzS+X+/VgsiInpg/w/BqySM9WHlPAAAAABJRU5ErkJggg=="},518:function(t,s,A){t.exports=A.p+"assets/img/1546586728639.68220b93.png"},900:function(t,s,A){"use strict";A.r(s);var i=[function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",{staticClass:"content"},[i("h1",{attrs:{id:"连接测试网"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#连接测试网","aria-hidden":"true"}},[t._v("#")]),t._v(" 连接测试网")]),t._v(" "),i("h2",{attrs:{id:"下载钱包"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#下载钱包","aria-hidden":"true"}},[t._v("#")]),t._v(" 下载钱包")]),t._v(" "),i("p",[t._v("NULS全节点公测网钱包,有Windows、Linux、Mac三个版本,且持续更新,用户可以根据自己的服务器系统下载。")]),t._v(" "),i("p",[t._v("下载方式:github下载(https://github.com/nuls-io/nuls/releases)")]),t._v(" "),i("p",[t._v("!"),i("img",{attrs:{src:A(518),alt:"1546586728639"}})]),t._v(" "),i("p",[t._v("注:版本号后标注了[Testnet]的版本为测试网的钱包")]),t._v(" "),i("h2",{attrs:{id:"运行钱包"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#运行钱包","aria-hidden":"true"}},[t._v("#")]),t._v(" 运行钱包")]),t._v(" "),i("p",[t._v("钱包下载好后,根据不同的操作系统解压")]),t._v(" "),i("p",[t._v("Windows系统钱包解压后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。")]),t._v(" "),i("p",[i("img",{attrs:{src:A(202),alt:"1546518956812"}})]),t._v(" "),i("p",[t._v("双击NULS-Wallet.exe启动并运行钱包,系统默认浏览器会自动打开钱包界面,如下图:")]),t._v(" "),i("p",[i("img",{attrs:{src:A(203),alt:"1546519370742"}})]),t._v(" "),i("p",[t._v("首次打开界面时,页面还会提示当前正在同步区块中,如下图:")]),t._v(" "),i("p",[i("img",{attrs:{src:A(204),alt:"1546519548787"}})]),t._v(" "),i("p",[t._v("出现正在同步区块后,表面已成功连接上NULS主网,待区块同步完成后,即可正常使用钱包。用户为节约时间不想从第一个区块开始重新同步数据,也可以到github上下载每个版本对应的最新区块数据包,如下图:")]),t._v(" "),i("p",[i("img",{attrs:{src:A(205),alt:"1546520020388"}})]),t._v(" "),i("p",[t._v("Linux系统解压钱包后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。")]),t._v(" "),i("p",[i("img",{attrs:{src:A(206),alt:"1546520382686"}})]),t._v(" "),i("p",[t._v("执行命令 sh bin/start.sh 启动钱包,启动后可根据命令 sh bin/cmd.sh 进入nuls钱包命令行,在命令行里执行getnetinfo命令,查看当前网络状态,当localBestHeight出现增长时,则表明连接主网成功。如下图:")]),t._v(" "),i("p",[i("img",{attrs:{src:A(207),alt:"1546520727643"}})]),t._v(" "),i("p",[t._v("用户也可跟踪logs文件夹下的nuls.log日志文件,查看钱包最新状态")]),t._v(" "),i("p",[t._v("MAC版本的钱包运行与Windows钱包基本一致,不再复述。")])])}],r=A(0),v=Object(r.a)({},function(){this.$createElement;this._self._c;return this._m(0)},i,!1,null,null,null);v.options.__file="connectTestnet.md";s.default=v.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/34.2e902b60.js b/docs/.vuepress/dist/assets/js/34.2e902b60.js new file mode 100644 index 00000000..a3a75eaf --- /dev/null +++ b/docs/.vuepress/dist/assets/js/34.2e902b60.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{260:function(t,e,a){t.exports=a.p+"assets/img/architecture.784f3b18.png"},261:function(t,e,a){t.exports=a.p+"assets/img/structure.2a58a4c4.png"},262:function(t,e,a){t.exports=a.p+"assets/img/chainRegister.9111e337.png"},263:function(t,e,a){t.exports=a.p+"assets/img/chainDestroy.013520b1.png"},264:function(t,e,a){t.exports=a.p+"assets/img/assetRegister.b72c7a79.png"},265:function(t,e,a){t.exports=a.p+"assets/img/assetDestroy.62602f22.png"},901:function(t,e,a){"use strict";a.r(e);var i=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[i("h1",{attrs:{id:"chain-management-module-design-document"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#chain-management-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Chain management module design document")]),t._v(" "),i("p",[t._v("[TOC]")]),t._v(" "),i("h2",{attrs:{id:"_1、general-description"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1、General description")]),t._v(" "),i("h3",{attrs:{id:"_1-1-module-overview"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module overview")]),t._v(" "),i("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-chain-management-module"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-chain-management-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why do you have a Chain Management module")]),t._v(" "),i("p",[t._v("In NULS 1.0, there is only one chain (NULS main network), so no chain management module is required.")]),t._v(" "),i("p",[t._v("In NULS 2.0, the NULS main network can register other friend information, including:")]),t._v(" "),i("ul",[i("li",[t._v("Chains in the NULS ecosystem: Derived from the same set of code as the NULS main network.")]),t._v(" "),i("li",[t._v("Other chains: Bitcoin, Ethereum, etc.")])]),t._v(" "),i("p",[t._v("The Chain Management module is used to manage all the friends that join the NULS main network.")]),t._v(" "),i("p",[t._v("Glossary:")]),t._v(" "),i("ul",[i("li",[t._v('NULS main network: Unlike NULS 1.0, it is another chain that runs independently, also known as NULS 2.0."Chain Management" is one of the modules of the NULS main network.')]),t._v(" "),i("li",[t._v("Friends Chain: Other chains registered on the NULS main website.")])]),t._v(" "),i("p",[t._v("Hypothesis 1: Friendship A, which owns asset A")]),t._v(" "),i("p",[t._v("Hypothesis 2: Friendship B, which owns asset B")]),t._v(" "),i("ul",[i("li",[t._v("Cross-chain trading:\n"),i("ul",[i("li",[t._v("Friend chain A transfers asset A to friend chain B")]),t._v(" "),i("li",[t._v("Friendship B internal transfer of assets A")]),t._v(" "),i("li",[t._v("Friend Chain B turns asset A back to friend chain A")]),t._v(" "),i("li",[t._v("Friendship B transfers asset A to other friends (C, D, etc.)")])])]),t._v(" "),i("li",[t._v("Non-cross-chain trading:\n"),i("ul",[i("li",[t._v("Friend Chain A Internal Transfer Asset A")]),t._v(" "),i("li",[t._v("Friendship B internal transfer of assets B")])])])]),t._v(" "),i("p",[t._v("Remarks: Regardless of the assets in the chain or the assets outside the chain, as long as the assets are traded across the chain, the main network needs to be confirmed.")]),t._v(" "),i("h4",{attrs:{id:"_1-1-2-what-does-chain-management-do"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-does-chain-management-do","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.2 What does "Chain Management" do?')]),t._v(" "),i("p",[t._v("The Chain Management module is used to manage basic information about the chain that joins the NULS main network, including:")]),t._v(" "),i("ul",[i("li",[t._v("Sign up for a new friend chain")]),t._v(" "),i("li",[t._v("Destroy existing friendship chains")]),t._v(" "),i("li",[t._v("Query friend information")]),t._v(" "),i("li",[t._v("Increase the asset type for a specific friend chain")]),t._v(" "),i("li",[t._v("Destroy asset type for a specific friend chain")]),t._v(" "),i("li",[t._v("Cross-chain asset verification")])]),t._v(" "),i("h4",{attrs:{id:"_1-1-3-the-positioning-of-chain-management-in-the-system"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-positioning-of-chain-management-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.3 The Positioning of "Chain Management" in the System')]),t._v(" "),i("p",[t._v('"chain management" dependent module:')]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Kernel module")])]),t._v(" "),i("li",[i("p",[t._v("Network module")])]),t._v(" "),i("li",[i("p",[t._v("Transaction management module")])]),t._v(" "),i("li",[i("p",[t._v("Account module")]),t._v(" "),i("p",[t._v('"chain management" weakly dependent module:')])]),t._v(" "),i("li",[i("p",[t._v("Event bus module")])])]),t._v(" "),i("h3",{attrs:{id:"_1-2-module-internal-architecture-diagram"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-module-internal-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Module internal architecture diagram")]),t._v(" "),i("p",[i("img",{attrs:{src:a(260),alt:""}})]),t._v(" "),i("h2",{attrs:{id:"_2、feature-design"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2、feature-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2、feature design")]),t._v(" "),i("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional architecture diagram")]),t._v(" "),i("p",[i("img",{attrs:{src:a(261),alt:""}})]),t._v(" "),i("h3",{attrs:{id:"_2-2-module-service"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module service")]),t._v(" "),i("h4",{attrs:{id:"_2-2-1-sign-up-for-a-new-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-sign-up-for-a-new-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 Sign up for a new friend chain")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("he NULS main network will provide an entry (web page) through which you can register a new friend chain to the NULS main network.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(262),alt:""}})])])]),t._v(" "),i("p",[t._v("步骤描述:")]),t._v(" "),i("p",[t._v("Step description:")]),t._v(" "),i("pre",[i("code",[t._v("1> The user registers the registration chain information with the terminal and the asset information initialized with the chain.\n\n2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n And the seed node information of the cross-chain is obtained through the network module and returned to the user.\n\n3>The transaction module will perform a callback of the data check during the transaction process.\n\n4>The chain management module performs registration data submission through the transaction module callback interface of the “submission chain registration transaction”.\n\n5> The chain management module stores the data and sends the registration information to the network module.\n\n6> The registration chain requires 1000NULS, of which 20% is directly destroyed, 80% is used for mortgages, and is returned when assets are deleted.\n")])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Register friendchain information with the chain management module.")]),t._v(" "),i("p",[t._v("​ method : cm_chainReg")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": "1",\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS CHAIN",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Chain name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("The address type of the account created on the chain: 1 within the ecological 2 non-ecological")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Network magic parameter")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of single node connections")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Transaction confirmation block number")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"\n}\n\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("seeds")]),t._v(" "),i("td",[t._v("String")]),t._v(" "),i("td",[t._v("Seed node")])])])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Network management module")]),t._v(" "),i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Account book module, get the book information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-2-log-out-of-existing-friends"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-log-out-of-existing-friends","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 Log out of existing friends")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which you can log out existing friends.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(263),alt:""}})]),t._v(" "),i("p",[t._v("1>The chain is created with the asset, so the logout chain must be checked for assets. Only the last asset will be deleted and the chain will be logged off.")]),t._v(" "),i("p",[t._v("2>Conditions for determining whether to allow cancellation:")])])]),t._v(" "),i("p",[t._v("​ Assets and chains exist.")]),t._v(" "),i("p",[t._v("​ There is only one last asset with the chain.")]),t._v(" "),i("p",[t._v("​ Chain assets have n% of assets in their own main chain.")]),t._v(" "),i("p",[t._v("3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.")]),t._v(" "),i("p",[t._v("​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.")]),t._v(" "),i("p",[t._v("4>The transaction module will perform a callback of the data check during the transaction process.")]),t._v(" "),i("p",[t._v("5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.")]),t._v(" "),i("p",[t._v("6>The chain management module stores the data and sends the registration information to the network module.")]),t._v(" "),i("p",[t._v("7>Deleting the chain with the cancelled assets will return 80% of the mortgage deposit.")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Unregister the chain information to the chain management module (the asset logout interface is called because the chain is logged off with the last asset)")]),t._v(" "),i("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the main network account address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Network management module")]),t._v(" "),i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Ledger module, checkbook information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-3-increase-asset-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-increase-asset-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 Increase asset information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which the selection chain and registered assets can be registered.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[i("img",{attrs:{src:a(264),alt:""}})]),t._v(" "),i("p",[t._v("Step description:\n​ 1>The user enters the asset information through the terminal selection chain and the chain: judge whether the assets overlap.\n​ 2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n​ 3> The transaction module will perform a callback of the data check during the transaction process.\n​ 4> The chain management module performs registration data submission through the transaction module callback interface of “submit asset registration transaction”.\n​ 5> Registered assets receive 1000NULS, of which 20% are directly destroyed, 80% are used for mortgage, and returned when assets are deleted.")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Register asset information with the chain management module")]),t._v(" "),i("p",[t._v("​ method : cm_assetReg")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("请求参数说明")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Account book module, get the book information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-4-deleting-an-asset-type-for-a-specific-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-deleting-an-asset-type-for-a-specific-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 Deleting an asset type for a specific friend chain")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which the assets can be destroyed for the specified friend chain.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(265),alt:""}})]),t._v(" "),i("p",[t._v("Step description:\n1> When there are multiple assets registered, the single asset is allowed to be written off. If there is only one asset, the asset is written off along with the chain.\n2> Conditions for determining whether to allow cancellation:\n​ There are multiple assets in the chain.\n​ Chain assets have n% of assets in their own main chain.\n3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n4>The transaction module will perform a callback of the data check during the transaction process.\n5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.\n6>The cancellation of the assets will be refunded 80% of the mortgage deposit.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Log out asset information to the chain management module")]),t._v(" "),i("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the main network account address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Ledger module, checkbook information")])])])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-5-chain-asset-verification-for-cross-chain-transactions"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-chain-asset-verification-for-cross-chain-transactions","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 Chain asset verification for cross-chain transactions")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the transaction module generates a cross-chain transaction, the interface is called to perform cross-chain asset verification.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("1>Check chain and assets are registered normally in the cross-chain module")]),t._v(" "),i("p",[t._v("2>Check if the amount of assets on the chain is overdrawn.")]),t._v(" "),i("p",[t._v("3>Verify that the asset status is normal.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Submit verification to chain management when cross-chain assets are in circulation")]),t._v(" "),i("p",[t._v("​ method : cm_assetCirculateValidator")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),i("td",[t._v("Trading the HEX value of coindata")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, cross-chain transaction verification call")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-6-chain-asset-submission-for-cross-chain-trading"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-chain-asset-submission-for-cross-chain-trading","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 Chain asset submission for cross-chain trading")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the transaction module generates a cross-chain transaction and verifies the pass, it calls the interface to submit the cross-chain asset.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("Used to change chain assets and manage them for chain assets")]),t._v(" "),i("p",[t._v("Direct call cm_assetCirculateCommit")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ When the cross-chain asset is circulated, the transaction can be submitted to the chain management when the verification is passed and the confirmation is submitted.")]),t._v(" "),i("p",[t._v("​ method : cm_assetCirculateCommit")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),i("td",[t._v("Trading the HEX value of coindata")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, cross-chain transaction call")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-7-registration-of-chain-management-transaction-processing-functions"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-registration-of-chain-management-transaction-processing-functions","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 Registration of chain management transaction processing functions")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the module is started, registration of the transaction callback function is required, so that the transaction module performs callback processing when performing related type transaction processing.")]),t._v(" "),i("p",[t._v("The registration function is divided into 4 categories: 1> transaction verification 2> transaction submission 3> transaction rollback 4> module batch transaction verification within a block")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("1>Chain management module startup.")]),t._v(" "),i("p",[t._v("2>Determine whether the transaction module RPC call status is accessible.")]),t._v(" "),i("p",[t._v("3>Submit callback interface.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("p",[t._v('See the "Registering a Transaction" section in the Transaction Module Design Document.')])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-8-query-chain-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-query-chain-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 Query chain information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("Query registration chain information")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[t._v("​ NA")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Query registration friend information")]),t._v(" "),i("p",[t._v("​ method : cm_chain")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId":4545 \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": 1,\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "regTxHash":"FFFFF", \n "selfAssetKeyList":["1232_32","528_8"],\n "totalAssetKeyList":["1232_32","528_8"],\n "createTime":1212131\n}\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Chain name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("The address type of the account created on the chain: 1 within the ecological 2 non-ecological")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Network magic parameter")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of single node connections")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Transaction confirmation block number")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("regTxHash")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Transaction hash")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("regAddress")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("selfAssetKeyList")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),i("td",[t._v("List of assets registered under the chain, asset key value combined by chainId_assetId")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("totalAssetKeyList")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),i("td",[t._v("List of assets circulating under the chain, asset key value combined by chainId_assetId")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),i("td",[t._v("Creation time")])])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("p",[t._v("NA")])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-9-query-chain-asset-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-query-chain-asset-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 Query chain asset information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("Query a chain asset information")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[t._v("​ NA")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Query the asset management module for an asset information.")]),t._v(" "),i("p",[t._v("​ method : cm_asset")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId":4545, \n "assetId":45\n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS ASSET",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "txHash":"xxxxxxxxxxxxx",\n "createTime":125848\n }\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Transaction hash")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),i("td",[t._v("Creation time")])])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("p",[t._v("NA")])])]),t._v(" "),i("h2",{attrs:{id:"_3、event-description"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 3、Event description")]),t._v(" "),i("ul",[i("li",[t._v("Chain registration event")]),t._v(" "),i("li",[t._v("Chain logout event")]),t._v(" "),i("li",[t._v("New asset event")]),t._v(" "),i("li",[t._v("Logout asset event")])]),t._v(" "),i("h2",{attrs:{id:"_4、protocol"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4、protocol")]),t._v(" "),i("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 Network communication protocol")]),t._v(" "),i("h4",{attrs:{id:"_4-1-1-asking-the-friend-chain-for-the-total-amount-of-assets-issued"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-asking-the-friend-chain-for-the-total-amount-of-assets-issued","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 Asking the friend chain for the total amount of assets issued")]),t._v(" "),i("ul",[i("li",[t._v("Message description: Periodic chain management initiates the issue of total asset data request message to the friend chain")]),t._v(" "),i("li",[t._v("cmd:requestAssetAmount")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("randomCode")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("random number")])])])]),t._v(" "),i("h4",{attrs:{id:"_4-1-1-receive-the-total-amount-of-assets-returned-by-the-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-receive-the-total-amount-of-assets-returned-by-the-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 Receive the total amount of assets returned by the friend chain")]),t._v(" "),i("ul",[i("li",[t._v("Message Description: Received a reply from the friend chain to the asset.")]),t._v(" "),i("li",[t._v("cmd:responseAssetAmount")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td"),t._v(" "),i("td",[t._v("biginteger")]),t._v(" "),i("td",[t._v("Total assets amount")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("randomCode")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("random number")])])])]),t._v(" "),i("h3",{attrs:{id:"_4-2-transaction-agreement"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 Transaction agreement")]),t._v(" "),i("h5",{attrs:{id:"_4-2-1-sign-up-for-a-new-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-sign-up-for-a-new-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.1 Sign up for a new friend chain")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10101")]),t._v(" "),i("p",[t._v("txData definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain ID")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("name")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Chain Name")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("addressType")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("address type")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("magicNumber")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("Magic parameter")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("supportInflowAsset")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Whether to spend asset inflows")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("minAvailableNodeNum")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("singleNodeMinConnectionNum")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Single node minimum connection number")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("address")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Account address")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("symbol")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("symbol")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("assetName")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Asset name")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("depositNuls")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Mortgage NULS quantity")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td",[t._v("initNumber")]),t._v(" "),i("td",[t._v("Biginteger")]),t._v(" "),i("td",[t._v("Initial quantity of assets")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("decimalPlaces")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Minimum number of assets")])])])]),t._v(" "),i("h5",{attrs:{id:"_4-2-2-log-out-of-existing-friends"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-log-out-of-existing-friends","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 Log out of existing friends")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10102")]),t._v(" "),i("p",[t._v("txData definition:Same as 4.2.1 chain registration transaction")]),t._v(" "),i("h5",{attrs:{id:"_4-2-3-new-friend-chain-assets"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-new-friend-chain-assets","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.3 New friend chain assets")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10103")]),t._v(" "),i("p",[t._v("txData definition:")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("symbol")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("symbol")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("assetName")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Asset name")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("depositNuls")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Mortgage NULS quantity")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td",[t._v("initNumber")]),t._v(" "),i("td",[t._v("Biginteger")]),t._v(" "),i("td",[t._v("Initial quantity of assets")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("decimalPlaces")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Minimum number of assets")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("address")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Account address")])])])]),t._v(" "),i("h5",{attrs:{id:"_4-2-2-log-out-of-existing-assets"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-log-out-of-existing-assets","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 Log out of existing assets")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10104")]),t._v(" "),i("p",[t._v("txData definition:New transactions with 4.2.3 assets")]),t._v(" "),i("h2",{attrs:{id:"_5、module-configuration"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 5、Module configuration")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("[system]\nlanguage = en\nencoding = UTF-8\n\n[db]\nrocksdb.datapath = ../data\n\n[param]\nasset_symbol_max = 5\nasset_name_max = 20\nasset_depositNuls = 200000\nasset_depositNuls_destroy_rate = 0.2\nasset_depositNuls_lock_rate = 0.8\nasset_initNumber_min = 10000\nasset_initNumber_max = 100000000\nasset_decimalPlaces_min = 4\nasset_decimalPlaces_max = 8\nasset_recovery_rate = 0.9\n\n[defaultAsset]\nnuls_chain_id = 8964\nnuls_chain_name = nuls chain\nnuls_asset_id = 1\nnuls_asset_initNumber_max = 100000000\nnuls_asset_symbol = NULS\n")])])]),i("h2",{attrs:{id:"_6、java-specific-design"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 6、Java-specific design")]),t._v(" "),i("p",[t._v("NA")]),t._v(" "),i("h2",{attrs:{id:"_7、to-add-on"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_7、to-add-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 7、to add on")]),t._v(" "),i("p",[t._v("NA")])])}],n=a(0),s=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},i,!1,null,null,null);s.options.__file="chainModuleDesign.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/35.77cbe800.js b/docs/.vuepress/dist/assets/js/35.77cbe800.js new file mode 100644 index 00000000..f8a204f0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/35.77cbe800.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{271:function(t,e,s){t.exports=s.p+"assets/img/event-bus-module.18c5a6f0.png"},272:function(t,e,s){t.exports=s.p+"assets/img/event-bus-content.23c1f972.png"},273:function(t,e,s){t.exports=s.p+"assets/img/event-bus-model.a7412672.png"},274:function(t,e,s){t.exports=s.p+"assets/img/event-bus-function.8044546e.png"},275:function(t,e,s){t.exports=s.p+"assets/img/event-bus-seq-flow.2de08cda.png"},276:function(t,e,s){t.exports=s.p+"assets/img/event-bus-main-flow.c97c465a.png"},905:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"event-bus-module-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#event-bus-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Event bus module design document")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"_1-overall-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Overall description")]),t._v(" "),a("h3",{attrs:{id:"_1-1-module-overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module Overview")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-why-should-i-have-the-event-bus-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-should-i-have-the-event-bus-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why should I have the Event Bus module?")]),t._v(" "),a("blockquote",[a("p",[t._v("The Event Bus Module is a functional module designed to receive and notify processing module events, managing all module events.")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-what-is-the-event-bus"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-is-the-event-bus","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.2 What is the "Event Bus"?')]),t._v(" "),a("blockquote",[a("p",[t._v("Provide event subscription, receiving, sending and other functions, which is an event transfer station between modules")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-positioning-of-event-bus-in-the-system"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-event-bus-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 Positioning of Event Bus in the System")]),t._v(" "),a("blockquote",[a("p",[t._v("The event module is an edge system that provides some major asynchronous messaging, which means that even without an event bus, the system can operate normally, is lightweight, and does not depend on other module systems.")])]),t._v(" "),a("h3",{attrs:{id:"_1-2-architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Architecture")]),t._v(" "),a("p",[a("img",{attrs:{src:s(271),alt:"event-bus-module"}})]),t._v(" "),a("ul",[a("li",[t._v("The event bus module mainly contains 2 parts of interactive logic:\n  - Microservice registration and service information acquisition with the system core module.\n  - Event message creation, subscription, and forwarding management with other base modules.")])]),t._v(" "),a("h2",{attrs:{id:"_2-functional-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2. functional design")]),t._v(" "),a("h3",{attrs:{id:"_2-1-functional-architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional Architecture")]),t._v(" "),a("p",[a("img",{attrs:{src:s(272),alt:"event-bus-content"}})]),t._v(" "),a("h3",{attrs:{id:"_2-2-module-service"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module Service")]),t._v(" "),a("p",[a("img",{attrs:{src:s(273),alt:"event-bus-model"}})]),t._v(" "),a("blockquote",[a("p",[t._v("This module provides event subscriptions, event forwarding")])]),t._v(" "),a("h4",{attrs:{id:"_2-2-1-modifying-system-operating-parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-modifying-system-operating-parameters","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 Modifying system operating parameters")]),t._v(" "),a("blockquote",[a("p",[t._v("Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,")])]),t._v(" "),a("h3",{attrs:{id:"_2-3-module-internal-function"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 Module internal function")]),t._v(" "),a("p",[a("img",{attrs:{src:s(274),alt:"event-bus-function"}})]),t._v(" "),a("blockquote",[a("p",[t._v("Module internal work mainly includes, subscription manager, event manager, and forwarding manager.")])]),t._v(" "),a("ul",[a("li",[t._v("Microservice interface information synchronization management\n  - for synchronizing the service interface with the kernel service management module")]),t._v(" "),a("li",[t._v("Event Storage Management (eventBus)\n  - Used to create event information, subscribe to other storage, and initialize the information when the module is restarted.")]),t._v(" "),a("li",[t._v('Event subscription management (subscribe)\n  - Maintain a "configuration table" for subscription events: including important parameters for all individual module subscriptions')]),t._v(" "),a("li",[t._v("Event forwarding management (dispatcher)\n  - The open interface is used for event reception, the receiving event is forwarded by subscription, and the forwarding call interface is obtained through the service information management interface.")]),t._v(" "),a("li",[t._v("Function Interface Management (rpc)\n  - Open query interface for external query")])]),t._v(" "),a("h3",{attrs:{id:"_2-4-event-bus-process"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-event-bus-process","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.4 Event Bus Process")]),t._v(" "),a("ul",[a("li",[t._v("Event processing timing")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(275),alt:"event-bus-seq-flow"}})]),t._v(" "),a("ul",[a("li",[t._v("Event processing basic process")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(276),alt:"event-bus-main-flow"}})]),t._v(" "),a("h3",{attrs:{id:"_2-5-business-logic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-business-logic","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.5 Business Logic")]),t._v(" "),a("blockquote",[a("p",[t._v("Exception logic processing in case of event forwarding failure (such as network reason), according to the following two logics:")])]),t._v(" "),a("ul",[a("li",[a("ol",[a("li",[t._v("Retaining event calls Repeat calls by queue until the forwarding is successful.")])])]),t._v(" "),a("li",[a("ol",{attrs:{start:"2"}},[a("li",[t._v("Discard it directly after trying many times. (Tentatively 5 times) Retry every 10 seconds.")])])])]),t._v(" "),a("h2",{attrs:{id:"_3-interface-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 3. Interface Design")]),t._v(" "),a("h3",{attrs:{id:"_3-1-module-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-module-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 Module Interface")]),t._v(" "),a("h4",{attrs:{id:"_3-1-1-event-theme-subscription"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-event-theme-subscription","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.1 Event Theme Subscription")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: subscribe")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter Description (Request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"subscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" Return value description (Response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"app_secret"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxx"')]),t._v(" // app_secret"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" temporarily not needed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" may need to be verified later if it is not required to be called locally\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-2-event-unsubscribe"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-event-unsubscribe","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.2 Event Unsubscribe")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: unsubscribe")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-2","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter Description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unsubscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-2","aria-hidden":"true"}},[t._v("#")]),t._v(" Return value description: (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-3-event-sending-automatically-create-topic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-event-sending-automatically-create-topic","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.3 Event Sending [Automatically Create Topic]")]),t._v(" "),a("blockquote",[a("p",[t._v("Do you keep a certain amount of time when no one is subscribed?")])]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: send")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-3","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"send"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" // event to be sent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" jsonObj\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-3","aria-hidden":"true"}},[t._v("#")]),t._v(" return value description (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-4-event-broadcast-push-push-or-dispatcher"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-event-broadcast-push-push-or-dispatcher","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.4 Event broadcast (push push or dispatcher)")]),t._v(" "),a("blockquote",[a("p",[t._v("I need each interface to provide an interface when subscribing to events. I can call it when I broadcast. I am using multithreading to remove your interface. You need to return the correct code, otherwise there will be a retry mechanism.")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-4","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dispatcher"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" //data event to be sent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" payload\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-4","aria-hidden":"true"}},[t._v("#")]),t._v(" return value description (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​must return correctly"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" do not need to tell you whether the business logic is wrong"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" as long as you receive it"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tell me that you have successfully received it.\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_3-2-function-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-function-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 Function Interface")]),t._v(" "),a("blockquote",[a("p",[t._v("The functional interface is the interface provided to the interface and command line tools")])]),t._v(" "),a("h4",{attrs:{id:"get-event-topic-information"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-event-topic-information","aria-hidden":"true"}},[t._v("#")]),t._v(" Get event topic information")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: topics")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-5","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"topics"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"response-body-response-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-body-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" Response Body (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​must return correctly"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" do not need to tell you whether the business logic is wrong"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" as long as you receive it"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tell me that you have successfully received it.\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topics"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topic"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //topic id\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //Create time\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // theme creator (module"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Id\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("//subscriber information\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //subscriber\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribeTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v(" //Subscription time\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"get-event-topic-information-including-all-event-information-on-this-topic-every-event-i-don-t-care-about"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-event-topic-information-including-all-event-information-on-this-topic-every-event-i-don-t-care-about","aria-hidden":"true"}},[t._v("#")]),t._v(" Get event topic information (including all event information on this topic?) Every event I don't care about.")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd : get_topic")])]),t._v(" "),a("h2",{attrs:{id:"_4-description-of-the-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-description-of-the-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 4. Description of the event")]),t._v(" "),a("blockquote",[a("p",[t._v("does not depend on any events")])]),t._v(" "),a("h2",{attrs:{id:"_5-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 5. agreement")]),t._v(" "),a("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 Network Communication Protocol")]),t._v(" "),a("p",[t._v("no")]),t._v(" "),a("h3",{attrs:{id:"_5-2-trading-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-trading-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 Trading Agreement")]),t._v(" "),a("h2",{attrs:{id:"_6-module-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-module-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 6. Module Configuration")]),t._v(" "),a("h3",{attrs:{id:"_6-1-configuration-instructions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-configuration-instructions","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.1 Configuration Instructions")]),t._v(" "),a("blockquote",[a("p",[t._v("General support configuration, port, number of retries, retry time, thread pool size of default executor, network call timeout configuration, etc.")])]),t._v(" "),a("div",{staticClass:"language-yml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Server:\n  Ip: 127.0.0.1 // local ip, used to provide services to other modules, you can not fill, the default is automatically obtained\n  Port: 8080 //The port that provides the service, you can leave it blank, the default is automatically obtained.\n")])])]),a("h3",{attrs:{id:"_6-2-module-dependencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-module-dependencies","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.2 Module Dependencies")]),t._v(" "),a("ul",[a("li",[t._v("Kernel module\n  - Module registration\n  - Module logout\n  - Module status escalation (heartbeat)\n  - Service interface data acquisition and timing update")])]),t._v(" "),a("h2",{attrs:{id:"_7-java-specific-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 7. Java-specific design")]),t._v(" "),a("blockquote",[a("p",[t._v("Core object class definition, storing data structures, ...")])]),t._v(" "),a("h2",{attrs:{id:"_8-supplementary-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 8. supplementary content")]),t._v(" "),a("blockquote",[a("p",[t._v("Required content not covered above")])])])}],n=s(0),r=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);r.options.__file="eventBusModuleDesign.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/36.b4a03b7d.js b/docs/.vuepress/dist/assets/js/36.b4a03b7d.js new file mode 100644 index 00000000..ecb9d179 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/36.b4a03b7d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{338:function(e,t,r){e.exports=r.p+"assets/img/modules.5667d6c6.png"},339:function(e,t,r){e.exports=r.p+"assets/img/module.84e040d4.png"},340:function(e,t,r){e.exports=r.p+"assets/img/mykernelstarted.cfb5fce2.png"},341:function(e,t,r){e.exports=r.p+"assets/img/ledger.d4383200.png"},342:function(e,t,r){e.exports=r.p+"assets/img/ledgerstart.e024f199.png"},343:function(e,t,r){e.exports=r.p+"assets/img/package.06d61e5f.png"},935:function(e,t,r){"use strict";r.r(t);var a=[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"package-generation"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#package-generation","aria-hidden":"true"}},[this._v("#")]),this._v(" Package Generation")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"essential-knowledge"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#essential-knowledge","aria-hidden":"true"}},[this._v("#")]),this._v(" Essential knowledge")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"get-the-program-source-code"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#get-the-program-source-code","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the program source code")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"debugger"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#debugger","aria-hidden":"true"}},[this._v("#")]),this._v(" Debugger")])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(338),alt:"modules"}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(339),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(340),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(341),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(342),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"generating-executable-packages"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#generating-executable-packages","aria-hidden":"true"}},[this._v("#")]),this._v(" Generating executable packages")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("./package.sh -J /usr/local/java/jdk11.0.2 -o ../NULS2\n")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[t("img",{attrs:{src:r(343),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[this._v("Lijunzhou:nuls_2.0 zhoulijun$ ./package.sh -h\n     Desc: Use this script to generate an executable submodule that conforms to the NULSTAR specification.\n     All submodules are configured according to module.ncf, packaged with the mvn command, and generate start and stop scripts.\n     Usage: ./package.sh\n     -b Synchronize the latest code before packaging. Parameter is the remote branch name for synchronization.\n     -p Synchronize the latest code before packing. Pull from the master branch\n     -o specifies the output directory\n     -h View help\n     -j JAVA_HOME\n     -J outputs the jvm virtual machine directory, the script will copy this directory to the program dependencies\n     -i skip mvn package\n     -z generates a tarball\n     Author: zlj\n")])])])}],s=r(0),n=Object(s.a)({},function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),r("p",[e._v("The Nuls2 base module is developed using java11, which uses a distributed multi-module micro-service architecture, and uses websocket for communication between modules. However, there is no language requirement between modules. The language that can support the websocket protocol for network programming can be a module of NULS2, so you need to have a certain understanding of the websocket protocol.")]),e._v(" "),e._m(2),e._v(" "),r("p",[e._v("The source code for NULS2 is hosted on github.com and is freely available to anyone. Project address "),r("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls_2.0"),r("OutboundLink")],1),e._v(", see "),r("a",{attrs:{href:"https://git-scm.com/book/en/v2",target:"_blank",rel:"noopener noreferrer"}},[e._v("git"),r("OutboundLink")],1),e._v(" for how to get it.")]),e._v(" "),e._m(3),e._v(" "),r("p",[e._v("If you want to develop or debug the source code of NULS2, you need to prepare the development environment, install JDK11.0.2, apache maven 3.3, and a development tool. We recommend IntelliJ IDEA. After the development environment and source code are ready, import the program module in IDEA by importing the maven project.")]),e._v(" "),e._m(4),e._v(" "),r("p",[e._v("The module with the module.ncf file in the root directory of the module is defined as the nuls2 submodule, where mykernel is the core scheduling module, which is responsible for other submodule registration services. The startup class of each module is named XXXXBootstrap, and the main function of the startup class is used to start the module.")]),e._v(" "),e._m(5),e._v(" "),r("p",[e._v('In the development environment, you first need to start the mykernel module, and then start other modules, the dependencies between modules are automatically controlled by the framework. When the "MYKELNEL STARTED. PORT:8887" is printed in the log, the mykernel module is successfully started.')]),e._v(" "),e._m(6),e._v(" "),r("p",[e._v("Start other modules (take the ledger module as an example), find the LedgerBootstrap class, and run the main function.")]),e._v(" "),e._m(7),e._v(" "),r("p",[e._v('When the log prints "RMB:module state : Running", the module starts successfully.')]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),r("p",[e._v("Once you have the source code, you can generate your own scripts from the source code. Run the script package.sh in the nuls2.0 root directory to execute the automatic packager (the script needs to rely on jdk11, maven3.3, git).")]),e._v(" "),r("p",[e._v("Execute the packager and copy the JDK in the /usr/local/java/jdk11.0.2 directory to the runtime directory to the wallet directory. The wallet can run the program output to the relative directory of ../NULS2.")]),e._v(" "),e._m(10),r("p",[e._v("When the log outputs XXXX PACKAGE FINISH, the packager is successfully generated.")]),e._v(" "),e._m(11),e._v(" "),r("p",[e._v("More package.sh script parameters can be viewed with help in -h.")]),e._v(" "),e._m(12),r("p",[e._v("Please refer to the [Command Line User Manual] (/zh/NULS2.0/linuxTutorial.html) for how to use the wallet.")])])},a,!1,null,null,null);n.options.__file="packageGeneration.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/37.835e1993.js b/docs/.vuepress/dist/assets/js/37.835e1993.js new file mode 100644 index 00000000..253288e0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/37.835e1993.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{369:function(t,e,a){t.exports=a.p+"assets/img/architecture.784f3b18.png"},370:function(t,e,a){t.exports=a.p+"assets/img/structure.2a58a4c4.png"},371:function(t,e,a){t.exports=a.p+"assets/img/chainRegister.9111e337.png"},372:function(t,e,a){t.exports=a.p+"assets/img/chainDestroy.013520b1.png"},373:function(t,e,a){t.exports=a.p+"assets/img/assetRegister.b72c7a79.png"},374:function(t,e,a){t.exports=a.p+"assets/img/assetDestroy.62602f22.png"},949:function(t,e,a){"use strict";a.r(e);var i=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"content"},[i("h1",{attrs:{id:"chain-management-module-design-document"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#chain-management-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Chain management module design document")]),t._v(" "),i("p",[t._v("[TOC]")]),t._v(" "),i("h2",{attrs:{id:"_1、general-description"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1、General description")]),t._v(" "),i("h3",{attrs:{id:"_1-1-module-overview"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module overview")]),t._v(" "),i("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-chain-management-module"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-chain-management-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why do you have a Chain Management module")]),t._v(" "),i("p",[t._v("In NULS 1.0, there is only one chain (NULS main network), so no chain management module is required.")]),t._v(" "),i("p",[t._v("In NULS 2.0, the NULS main network can register other friend information, including:")]),t._v(" "),i("ul",[i("li",[t._v("Chains in the NULS ecosystem: Derived from the same set of code as the NULS main network.")]),t._v(" "),i("li",[t._v("Other chains: Bitcoin, Ethereum, etc.")])]),t._v(" "),i("p",[t._v("The Chain Management module is used to manage all the friends that join the NULS main network.")]),t._v(" "),i("p",[t._v("Glossary:")]),t._v(" "),i("ul",[i("li",[t._v('NULS main network: Unlike NULS 1.0, it is another chain that runs independently, also known as NULS 2.0."Chain Management" is one of the modules of the NULS main network.')]),t._v(" "),i("li",[t._v("Friends Chain: Other chains registered on the NULS main website.")])]),t._v(" "),i("p",[t._v("Hypothesis 1: Friendship A, which owns asset A")]),t._v(" "),i("p",[t._v("Hypothesis 2: Friendship B, which owns asset B")]),t._v(" "),i("ul",[i("li",[t._v("Cross-chain trading:\n"),i("ul",[i("li",[t._v("Friend chain A transfers asset A to friend chain B")]),t._v(" "),i("li",[t._v("Friendship B internal transfer of assets A")]),t._v(" "),i("li",[t._v("Friend Chain B turns asset A back to friend chain A")]),t._v(" "),i("li",[t._v("Friendship B transfers asset A to other friends (C, D, etc.)")])])]),t._v(" "),i("li",[t._v("Non-cross-chain trading:\n"),i("ul",[i("li",[t._v("Friend Chain A Internal Transfer Asset A")]),t._v(" "),i("li",[t._v("Friendship B internal transfer of assets B")])])])]),t._v(" "),i("p",[t._v("Remarks: Regardless of the assets in the chain or the assets outside the chain, as long as the assets are traded across the chain, the main network needs to be confirmed.")]),t._v(" "),i("h4",{attrs:{id:"_1-1-2-what-does-chain-management-do"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-does-chain-management-do","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.2 What does "Chain Management" do?')]),t._v(" "),i("p",[t._v("The Chain Management module is used to manage basic information about the chain that joins the NULS main network, including:")]),t._v(" "),i("ul",[i("li",[t._v("Sign up for a new friend chain")]),t._v(" "),i("li",[t._v("Destroy existing friendship chains")]),t._v(" "),i("li",[t._v("Query friend information")]),t._v(" "),i("li",[t._v("Increase the asset type for a specific friend chain")]),t._v(" "),i("li",[t._v("Destroy asset type for a specific friend chain")]),t._v(" "),i("li",[t._v("Cross-chain asset verification")])]),t._v(" "),i("h4",{attrs:{id:"_1-1-3-the-positioning-of-chain-management-in-the-system"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-the-positioning-of-chain-management-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.3 The Positioning of "Chain Management" in the System')]),t._v(" "),i("p",[t._v('"chain management" dependent module:')]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Kernel module")])]),t._v(" "),i("li",[i("p",[t._v("Network module")])]),t._v(" "),i("li",[i("p",[t._v("Transaction management module")])]),t._v(" "),i("li",[i("p",[t._v("Account module")]),t._v(" "),i("p",[t._v('"chain management" weakly dependent module:')])]),t._v(" "),i("li",[i("p",[t._v("Event bus module")])])]),t._v(" "),i("h3",{attrs:{id:"_1-2-module-internal-architecture-diagram"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-module-internal-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Module internal architecture diagram")]),t._v(" "),i("p",[i("img",{attrs:{src:a(369),alt:""}})]),t._v(" "),i("h2",{attrs:{id:"_2、feature-design"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2、feature-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2、feature design")]),t._v(" "),i("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional architecture diagram")]),t._v(" "),i("p",[i("img",{attrs:{src:a(370),alt:""}})]),t._v(" "),i("h3",{attrs:{id:"_2-2-module-service"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module service")]),t._v(" "),i("h4",{attrs:{id:"_2-2-1-sign-up-for-a-new-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-sign-up-for-a-new-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 Sign up for a new friend chain")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("he NULS main network will provide an entry (web page) through which you can register a new friend chain to the NULS main network.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(371),alt:""}})])])]),t._v(" "),i("p",[t._v("步骤描述:")]),t._v(" "),i("p",[t._v("Step description:")]),t._v(" "),i("pre",[i("code",[t._v("1> The user registers the registration chain information with the terminal and the asset information initialized with the chain.\n\n2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n And the seed node information of the cross-chain is obtained through the network module and returned to the user.\n\n3>The transaction module will perform a callback of the data check during the transaction process.\n\n4>The chain management module performs registration data submission through the transaction module callback interface of the “submission chain registration transaction”.\n\n5> The chain management module stores the data and sends the registration information to the network module.\n\n6> The registration chain requires 1000NULS, of which 20% is directly destroyed, 80% is used for mortgages, and is returned when assets are deleted.\n")])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Register friendchain information with the chain management module.")]),t._v(" "),i("p",[t._v("​ method : cm_chainReg")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": "1",\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS CHAIN",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Chain name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("The address type of the account created on the chain: 1 within the ecological 2 non-ecological")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Network magic parameter")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of single node connections")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Transaction confirmation block number")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"\n}\n\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("seeds")]),t._v(" "),i("td",[t._v("String")]),t._v(" "),i("td",[t._v("Seed node")])])])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Network management module")]),t._v(" "),i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Account book module, get the book information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-2-log-out-of-existing-friends"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-log-out-of-existing-friends","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 Log out of existing friends")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which you can log out existing friends.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(372),alt:""}})]),t._v(" "),i("p",[t._v("1>The chain is created with the asset, so the logout chain must be checked for assets. Only the last asset will be deleted and the chain will be logged off.")]),t._v(" "),i("p",[t._v("2>Conditions for determining whether to allow cancellation:")])])]),t._v(" "),i("p",[t._v("​ Assets and chains exist.")]),t._v(" "),i("p",[t._v("​ There is only one last asset with the chain.")]),t._v(" "),i("p",[t._v("​ Chain assets have n% of assets in their own main chain.")]),t._v(" "),i("p",[t._v("3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.")]),t._v(" "),i("p",[t._v("​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.")]),t._v(" "),i("p",[t._v("4>The transaction module will perform a callback of the data check during the transaction process.")]),t._v(" "),i("p",[t._v("5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.")]),t._v(" "),i("p",[t._v("6>The chain management module stores the data and sends the registration information to the network module.")]),t._v(" "),i("p",[t._v("7>Deleting the chain with the cancelled assets will return 80% of the mortgage deposit.")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Unregister the chain information to the chain management module (the asset logout interface is called because the chain is logged off with the last asset)")]),t._v(" "),i("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the main network account address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Network management module")]),t._v(" "),i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Ledger module, checkbook information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-3-increase-asset-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-increase-asset-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 Increase asset information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which the selection chain and registered assets can be registered.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[i("img",{attrs:{src:a(373),alt:""}})]),t._v(" "),i("p",[t._v("Step description:\n​ 1>The user enters the asset information through the terminal selection chain and the chain: judge whether the assets overlap.\n​ 2> The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n​ 3> The transaction module will perform a callback of the data check during the transaction process.\n​ 4> The chain management module performs registration data submission through the transaction module callback interface of “submit asset registration transaction”.\n​ 5> Registered assets receive 1000NULS, of which 20% are directly destroyed, 80% are used for mortgage, and returned when assets are deleted.")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Register asset information with the chain management module")]),t._v(" "),i("p",[t._v("​ method : cm_assetReg")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("请求参数说明")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Account book module, get the book information")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-4-deleting-an-asset-type-for-a-specific-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-deleting-an-asset-type-for-a-specific-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 Deleting an asset type for a specific friend chain")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("The NULS main network will provide an entry (web page) through which the assets can be destroyed for the specified friend chain.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[i("img",{attrs:{src:a(374),alt:""}})]),t._v(" "),i("p",[t._v("Step description:\n1> When there are multiple assets registered, the single asset is allowed to be written off. If there is only one asset, the asset is written off along with the chain.\n2> Conditions for determining whether to allow cancellation:\n​ There are multiple assets in the chain.\n​ Chain assets have n% of assets in their own main chain.\n3>The chain management module performs the encapsulation of the chain transaction and sends it to the transaction module.\n​ During the period, you need to obtain the account balance and the transaction nonce value through the ledger module.\n4>The transaction module will perform a callback of the data check during the transaction process.\n5>The chain management module performs the logout data submission through the transaction module callback interface of the “commit chain cancellation transaction”.\n6>The cancellation of the assets will be refunded 80% of the mortgage deposit.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Log out asset information to the chain management module")]),t._v(" "),i("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the main network account address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Password corresponding to the private key")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, send transaction")]),t._v(" "),i("li",[t._v("Ledger module, checkbook information")])])])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-5-chain-asset-verification-for-cross-chain-transactions"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-chain-asset-verification-for-cross-chain-transactions","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 Chain asset verification for cross-chain transactions")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the transaction module generates a cross-chain transaction, the interface is called to perform cross-chain asset verification.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("1>Check chain and assets are registered normally in the cross-chain module")]),t._v(" "),i("p",[t._v("2>Check if the amount of assets on the chain is overdrawn.")]),t._v(" "),i("p",[t._v("3>Verify that the asset status is normal.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Submit verification to chain management when cross-chain assets are in circulation")]),t._v(" "),i("p",[t._v("​ method : cm_assetCirculateValidator")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),i("td",[t._v("Trading the HEX value of coindata")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, cross-chain transaction verification call")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-6-chain-asset-submission-for-cross-chain-trading"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-chain-asset-submission-for-cross-chain-trading","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 Chain asset submission for cross-chain trading")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the transaction module generates a cross-chain transaction and verifies the pass, it calls the interface to submit the cross-chain asset.")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("Used to change chain assets and manage them for chain assets")]),t._v(" "),i("p",[t._v("Direct call cm_assetCirculateCommit")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ When the cross-chain asset is circulated, the transaction can be submitted to the chain management when the verification is passed and the confirmation is submitted.")]),t._v(" "),i("p",[t._v("​ method : cm_assetCirculateCommit")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),i("td",[t._v("Trading the HEX value of coindata")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("parameter")]),t._v(" "),i("th",[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td"),t._v(" "),i("td"),t._v(" "),i("td")])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module, cross-chain transaction call")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-7-registration-of-chain-management-transaction-processing-functions"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-registration-of-chain-management-transaction-processing-functions","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 Registration of chain management transaction processing functions")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("When the module is started, registration of the transaction callback function is required, so that the transaction module performs callback processing when performing related type transaction processing.")]),t._v(" "),i("p",[t._v("The registration function is divided into 4 categories: 1> transaction verification 2> transaction submission 3> transaction rollback 4> module batch transaction verification within a block")])]),t._v(" "),i("li",[i("p",[t._v("Process description")]),t._v(" "),i("p",[t._v("1>Chain management module startup.")]),t._v(" "),i("p",[t._v("2>Determine whether the transaction module RPC call status is accessible.")]),t._v(" "),i("p",[t._v("3>Submit callback interface.")])]),t._v(" "),i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("p",[t._v('See the "Registering a Transaction" section in the Transaction Module Design Document.')])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("ul",[i("li",[t._v("Transaction management module")])])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-8-query-chain-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-query-chain-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 Query chain information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("Query registration chain information")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[t._v("​ NA")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Query registration friend information")]),t._v(" "),i("p",[t._v("​ method : cm_chain")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId":4545 \n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": 1,\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "regTxHash":"FFFFF", \n "selfAssetKeyList":["1232_32","528_8"],\n "totalAssetKeyList":["1232_32","528_8"],\n "createTime":1212131\n}\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Chain name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("The address type of the account created on the chain: 1 within the ecological 2 non-ecological")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Network magic parameter")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum number of single node connections")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Transaction confirmation block number")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("regTxHash")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Transaction hash")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("regAddress")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("selfAssetKeyList")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),i("td",[t._v("List of assets registered under the chain, asset key value combined by chainId_assetId")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("totalAssetKeyList")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),i("td",[t._v("List of assets circulating under the chain, asset key value combined by chainId_assetId")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),i("td",[t._v("Creation time")])])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("p",[t._v("NA")])])]),t._v(" "),i("h4",{attrs:{id:"_2-2-9-query-chain-asset-information"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-query-chain-asset-information","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 Query chain asset information")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Function Description:")]),t._v(" "),i("p",[t._v("Query a chain asset information")])]),t._v(" "),i("li",[i("p",[t._v("Process description")])])]),t._v(" "),i("p",[t._v("​ NA")]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Interface definition")]),t._v(" "),i("ul",[i("li",[t._v("Interface Description")])]),t._v(" "),i("p",[t._v("​ Query the asset management module for an asset information.")]),t._v(" "),i("p",[t._v("​ method : cm_asset")]),t._v(" "),i("ul",[i("li",[t._v("Request example")])]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId":4545, \n "assetId":45\n}\n')])])]),i("ul",[i("li",[t._v("Request parameter description")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Asset id")])])])]),t._v(" "),i("ul",[i("li",[i("p",[t._v("Return example")]),t._v(" "),i("p",[t._v("Failed")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("Unified RPC standard format\n\n")])])]),i("p",[t._v("Success")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"NULS ASSET",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "txHash":"xxxxxxxxxxxxx",\n "createTime":125848\n }\n')])])])]),t._v(" "),i("li",[i("p",[t._v("Return field description")])])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),i("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),i("th",[t._v("description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Chain identification")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset symbol")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Asset Name")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Initial value of assets")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),i("td",[t._v("Minimum asset separable digits")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Create the primary network address of the chain")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),i("td",[t._v("Transaction hash")])]),t._v(" "),i("tr",[i("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),i("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),i("td",[t._v("Creation time")])])])])]),t._v(" "),i("li",[i("p",[t._v("Dependent service")]),t._v(" "),i("p",[t._v("NA")])])]),t._v(" "),i("h2",{attrs:{id:"_3、event-description"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3、event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 3、Event description")]),t._v(" "),i("ul",[i("li",[t._v("Chain registration event")]),t._v(" "),i("li",[t._v("Chain logout event")]),t._v(" "),i("li",[t._v("New asset event")]),t._v(" "),i("li",[t._v("Logout asset event")])]),t._v(" "),i("h2",{attrs:{id:"_4、protocol"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4、protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4、protocol")]),t._v(" "),i("h3",{attrs:{id:"_4-1-network-communication-protocol"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 Network communication protocol")]),t._v(" "),i("h4",{attrs:{id:"_4-1-1-asking-the-friend-chain-for-the-total-amount-of-assets-issued"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-asking-the-friend-chain-for-the-total-amount-of-assets-issued","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 Asking the friend chain for the total amount of assets issued")]),t._v(" "),i("ul",[i("li",[t._v("Message description: Periodic chain management initiates the issue of total asset data request message to the friend chain")]),t._v(" "),i("li",[t._v("cmd:requestAssetAmount")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("randomCode")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("random number")])])])]),t._v(" "),i("h4",{attrs:{id:"_4-1-1-receive-the-total-amount-of-assets-returned-by-the-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-receive-the-total-amount-of-assets-returned-by-the-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 Receive the total amount of assets returned by the friend chain")]),t._v(" "),i("ul",[i("li",[t._v("Message Description: Received a reply from the friend chain to the asset.")]),t._v(" "),i("li",[t._v("cmd:responseAssetAmount")])]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td"),t._v(" "),i("td",[t._v("biginteger")]),t._v(" "),i("td",[t._v("Total assets amount")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("randomCode")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("random number")])])])]),t._v(" "),i("h3",{attrs:{id:"_4-2-transaction-agreement"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-transaction-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 Transaction agreement")]),t._v(" "),i("h5",{attrs:{id:"_4-2-1-sign-up-for-a-new-friend-chain"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-sign-up-for-a-new-friend-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.1 Sign up for a new friend chain")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10101")]),t._v(" "),i("p",[t._v("txData definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain ID")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("name")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Chain Name")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("addressType")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("address type")])]),t._v(" "),i("tr",[i("td",[t._v("4")]),t._v(" "),i("td",[t._v("magicNumber")]),t._v(" "),i("td",[t._v("uint32")]),t._v(" "),i("td",[t._v("Magic parameter")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("supportInflowAsset")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Whether to spend asset inflows")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("minAvailableNodeNum")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Minimum number of available nodes")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("singleNodeMinConnectionNum")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Single node minimum connection number")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("address")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Account address")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("symbol")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("symbol")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("assetName")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Asset name")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("depositNuls")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Mortgage NULS quantity")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td",[t._v("initNumber")]),t._v(" "),i("td",[t._v("Biginteger")]),t._v(" "),i("td",[t._v("Initial quantity of assets")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("decimalPlaces")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Minimum number of assets")])])])]),t._v(" "),i("h5",{attrs:{id:"_4-2-2-log-out-of-existing-friends"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-log-out-of-existing-friends","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 Log out of existing friends")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10102")]),t._v(" "),i("p",[t._v("txData definition:Same as 4.2.1 chain registration transaction")]),t._v(" "),i("h5",{attrs:{id:"_4-2-3-new-friend-chain-assets"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-new-friend-chain-assets","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.3 New friend chain assets")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10103")]),t._v(" "),i("p",[t._v("txData definition:")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Length")]),t._v(" "),i("th",[t._v("Fields")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Remark")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("chainId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Chain Id")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("assetId")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Asset id")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("symbol")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("symbol")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("assetName")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Asset name")])]),t._v(" "),i("tr",[i("td",[t._v("2")]),t._v(" "),i("td",[t._v("depositNuls")]),t._v(" "),i("td",[t._v("uint16")]),t._v(" "),i("td",[t._v("Mortgage NULS quantity")])]),t._v(" "),i("tr",[i("td",[t._v("48")]),t._v(" "),i("td",[t._v("initNumber")]),t._v(" "),i("td",[t._v("Biginteger")]),t._v(" "),i("td",[t._v("Initial quantity of assets")])]),t._v(" "),i("tr",[i("td",[t._v("1")]),t._v(" "),i("td",[t._v("decimalPlaces")]),t._v(" "),i("td",[t._v("uint8")]),t._v(" "),i("td",[t._v("Minimum number of assets")])]),t._v(" "),i("tr",[i("td",[t._v("?")]),t._v(" "),i("td",[t._v("address")]),t._v(" "),i("td",[t._v("byte[]")]),t._v(" "),i("td",[t._v("Account address")])])])]),t._v(" "),i("h5",{attrs:{id:"_4-2-2-log-out-of-existing-assets"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-log-out-of-existing-assets","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 Log out of existing assets")]),t._v(" "),i("p",[t._v("Compared with the general transaction, only the type and txData are different, the specific difference is as follows")]),t._v(" "),i("p",[t._v("Transaction type definition:10104")]),t._v(" "),i("p",[t._v("txData definition:New transactions with 4.2.3 assets")]),t._v(" "),i("h2",{attrs:{id:"_5、module-configuration"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5、module-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 5、Module configuration")]),t._v(" "),i("div",{staticClass:"language- extra-class"},[i("pre",{pre:!0,attrs:{class:"language-text"}},[i("code",[t._v("[system]\nlanguage = en\nencoding = UTF-8\n\n[db]\nrocksdb.datapath = ../data\n\n[param]\nasset_symbol_max = 5\nasset_name_max = 20\nasset_depositNuls = 200000\nasset_depositNuls_destroy_rate = 0.2\nasset_depositNuls_lock_rate = 0.8\nasset_initNumber_min = 10000\nasset_initNumber_max = 100000000\nasset_decimalPlaces_min = 4\nasset_decimalPlaces_max = 8\nasset_recovery_rate = 0.9\n\n[defaultAsset]\nnuls_chain_id = 8964\nnuls_chain_name = nuls chain\nnuls_asset_id = 1\nnuls_asset_initNumber_max = 100000000\nnuls_asset_symbol = NULS\n")])])]),i("h2",{attrs:{id:"_6、java-specific-design"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_6、java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 6、Java-specific design")]),t._v(" "),i("p",[t._v("NA")]),t._v(" "),i("h2",{attrs:{id:"_7、to-add-on"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_7、to-add-on","aria-hidden":"true"}},[t._v("#")]),t._v(" 7、to add on")]),t._v(" "),i("p",[t._v("NA")])])}],n=a(0),s=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},i,!1,null,null,null);s.options.__file="chainModuleDesign.md";e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/38.d905a078.js b/docs/.vuepress/dist/assets/js/38.d905a078.js new file mode 100644 index 00000000..06ef5698 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/38.d905a078.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{380:function(t,e,s){t.exports=s.p+"assets/img/event-bus-module.18c5a6f0.png"},381:function(t,e,s){t.exports=s.p+"assets/img/event-bus-content.23c1f972.png"},382:function(t,e,s){t.exports=s.p+"assets/img/event-bus-model.a7412672.png"},383:function(t,e,s){t.exports=s.p+"assets/img/event-bus-function.8044546e.png"},384:function(t,e,s){t.exports=s.p+"assets/img/event-bus-seq-flow.2de08cda.png"},385:function(t,e,s){t.exports=s.p+"assets/img/event-bus-main-flow.c97c465a.png"},953:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"event-bus-module-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#event-bus-module-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" Event bus module design document")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"_1-overall-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Overall description")]),t._v(" "),a("h3",{attrs:{id:"_1-1-module-overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 Module Overview")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-why-should-i-have-the-event-bus-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-should-i-have-the-event-bus-module","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 Why should I have the Event Bus module?")]),t._v(" "),a("blockquote",[a("p",[t._v("The Event Bus Module is a functional module designed to receive and notify processing module events, managing all module events.")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-what-is-the-event-bus"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-is-the-event-bus","aria-hidden":"true"}},[t._v("#")]),t._v(' 1.1.2 What is the "Event Bus"?')]),t._v(" "),a("blockquote",[a("p",[t._v("Provide event subscription, receiving, sending and other functions, which is an event transfer station between modules")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-positioning-of-event-bus-in-the-system"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-event-bus-in-the-system","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 Positioning of Event Bus in the System")]),t._v(" "),a("blockquote",[a("p",[t._v("The event module is an edge system that provides some major asynchronous messaging, which means that even without an event bus, the system can operate normally, is lightweight, and does not depend on other module systems.")])]),t._v(" "),a("h3",{attrs:{id:"_1-2-architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 Architecture")]),t._v(" "),a("p",[a("img",{attrs:{src:s(380),alt:"event-bus-module"}})]),t._v(" "),a("ul",[a("li",[t._v("The event bus module mainly contains 2 parts of interactive logic:\n  - Microservice registration and service information acquisition with the system core module.\n  - Event message creation, subscription, and forwarding management with other base modules.")])]),t._v(" "),a("h2",{attrs:{id:"_2-functional-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2. functional design")]),t._v(" "),a("h3",{attrs:{id:"_2-1-functional-architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 Functional Architecture")]),t._v(" "),a("p",[a("img",{attrs:{src:s(381),alt:"event-bus-content"}})]),t._v(" "),a("h3",{attrs:{id:"_2-2-module-service"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 Module Service")]),t._v(" "),a("p",[a("img",{attrs:{src:s(382),alt:"event-bus-model"}})]),t._v(" "),a("blockquote",[a("p",[t._v("This module provides event subscriptions, event forwarding")])]),t._v(" "),a("h4",{attrs:{id:"_2-2-1-modifying-system-operating-parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-modifying-system-operating-parameters","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 Modifying system operating parameters")]),t._v(" "),a("blockquote",[a("p",[t._v("Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,")])]),t._v(" "),a("h3",{attrs:{id:"_2-3-module-internal-function"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 Module internal function")]),t._v(" "),a("p",[a("img",{attrs:{src:s(383),alt:"event-bus-function"}})]),t._v(" "),a("blockquote",[a("p",[t._v("Module internal work mainly includes, subscription manager, event manager, and forwarding manager.")])]),t._v(" "),a("ul",[a("li",[t._v("Microservice interface information synchronization management\n  - for synchronizing the service interface with the kernel service management module")]),t._v(" "),a("li",[t._v("Event Storage Management (eventBus)\n  - Used to create event information, subscribe to other storage, and initialize the information when the module is restarted.")]),t._v(" "),a("li",[t._v('Event subscription management (subscribe)\n  - Maintain a "configuration table" for subscription events: including important parameters for all individual module subscriptions')]),t._v(" "),a("li",[t._v("Event forwarding management (dispatcher)\n  - The open interface is used for event reception, the receiving event is forwarded by subscription, and the forwarding call interface is obtained through the service information management interface.")]),t._v(" "),a("li",[t._v("Function Interface Management (rpc)\n  - Open query interface for external query")])]),t._v(" "),a("h3",{attrs:{id:"_2-4-event-bus-process"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-event-bus-process","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.4 Event Bus Process")]),t._v(" "),a("ul",[a("li",[t._v("Event processing timing")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(384),alt:"event-bus-seq-flow"}})]),t._v(" "),a("ul",[a("li",[t._v("Event processing basic process")])]),t._v(" "),a("p",[a("img",{attrs:{src:s(385),alt:"event-bus-main-flow"}})]),t._v(" "),a("h3",{attrs:{id:"_2-5-business-logic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-business-logic","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.5 Business Logic")]),t._v(" "),a("blockquote",[a("p",[t._v("Exception logic processing in case of event forwarding failure (such as network reason), according to the following two logics:")])]),t._v(" "),a("ul",[a("li",[a("ol",[a("li",[t._v("Retaining event calls Repeat calls by queue until the forwarding is successful.")])])]),t._v(" "),a("li",[a("ol",{attrs:{start:"2"}},[a("li",[t._v("Discard it directly after trying many times. (Tentatively 5 times) Retry every 10 seconds.")])])])]),t._v(" "),a("h2",{attrs:{id:"_3-interface-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 3. Interface Design")]),t._v(" "),a("h3",{attrs:{id:"_3-1-module-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-module-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 Module Interface")]),t._v(" "),a("h4",{attrs:{id:"_3-1-1-event-theme-subscription"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-event-theme-subscription","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.1 Event Theme Subscription")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: subscribe")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter Description (Request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"subscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" Return value description (Response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"app_secret"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxx"')]),t._v(" // app_secret"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" temporarily not needed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" may need to be verified later if it is not required to be called locally\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-2-event-unsubscribe"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-event-unsubscribe","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.2 Event Unsubscribe")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: unsubscribe")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-2","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter Description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unsubscribe"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-2","aria-hidden":"true"}},[t._v("#")]),t._v(" Return value description: (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-3-event-sending-automatically-create-topic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-event-sending-automatically-create-topic","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.3 Event Sending [Automatically Create Topic]")]),t._v(" "),a("blockquote",[a("p",[t._v("Do you keep a certain amount of time when no one is subscribed?")])]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: send")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-3","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"send"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic event topic\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //moduleId subscriber module id\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" // event to be sent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" jsonObj\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-3","aria-hidden":"true"}},[t._v("#")]),t._v(" return value description (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"_3-1-4-event-broadcast-push-push-or-dispatcher"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-event-broadcast-push-push-or-dispatcher","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.4 Event broadcast (push push or dispatcher)")]),t._v(" "),a("blockquote",[a("p",[t._v("I need each interface to provide an interface when subscribing to events. I can call it when I broadcast. I am using multithreading to remove your interface. You need to return the correct code, otherwise there will be a retry mechanism.")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-4","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dispatcher"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" //data event to be sent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" payload\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"return-value-description-response-content-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-content-4","aria-hidden":"true"}},[t._v("#")]),t._v(" return value description (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​must return correctly"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" do not need to tell you whether the business logic is wrong"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" as long as you receive it"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tell me that you have successfully received it.\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"_3-2-function-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-function-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 Function Interface")]),t._v(" "),a("blockquote",[a("p",[t._v("The functional interface is the interface provided to the interface and command line tools")])]),t._v(" "),a("h4",{attrs:{id:"get-event-topic-information"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-event-topic-information","aria-hidden":"true"}},[t._v("#")]),t._v(" Get event topic information")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd: topics")])]),t._v(" "),a("h5",{attrs:{id:"parameter-description-request-body-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-body-5","aria-hidden":"true"}},[t._v("#")]),t._v(" Parameter description (request body)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"topics"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h5",{attrs:{id:"response-body-response-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-body-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" Response Body (response content)")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​must return correctly"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" do not need to tell you whether the business logic is wrong"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" as long as you receive it"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tell me that you have successfully received it.\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // ​​information on failure\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topics"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topic"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //topic id\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //Create time\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // theme creator (module"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Id\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("//subscriber information\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //subscriber\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribeTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v(" //Subscription time\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h4",{attrs:{id:"get-event-topic-information-including-all-event-information-on-this-topic-every-event-i-don-t-care-about"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-event-topic-information-including-all-event-information-on-this-topic-every-event-i-don-t-care-about","aria-hidden":"true"}},[t._v("#")]),t._v(" Get event topic information (including all event information on this topic?) Every event I don't care about.")]),t._v(" "),a("blockquote",[a("p",[t._v("cmd : get_topic")])]),t._v(" "),a("h2",{attrs:{id:"_4-description-of-the-event"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-description-of-the-event","aria-hidden":"true"}},[t._v("#")]),t._v(" 4. Description of the event")]),t._v(" "),a("blockquote",[a("p",[t._v("does not depend on any events")])]),t._v(" "),a("h2",{attrs:{id:"_5-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 5. agreement")]),t._v(" "),a("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 Network Communication Protocol")]),t._v(" "),a("p",[t._v("no")]),t._v(" "),a("h3",{attrs:{id:"_5-2-trading-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-trading-agreement","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 Trading Agreement")]),t._v(" "),a("h2",{attrs:{id:"_6-module-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-module-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 6. Module Configuration")]),t._v(" "),a("h3",{attrs:{id:"_6-1-configuration-instructions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-configuration-instructions","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.1 Configuration Instructions")]),t._v(" "),a("blockquote",[a("p",[t._v("General support configuration, port, number of retries, retry time, thread pool size of default executor, network call timeout configuration, etc.")])]),t._v(" "),a("div",{staticClass:"language-yml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Server:\n  Ip: 127.0.0.1 // local ip, used to provide services to other modules, you can not fill, the default is automatically obtained\n  Port: 8080 //The port that provides the service, you can leave it blank, the default is automatically obtained.\n")])])]),a("h3",{attrs:{id:"_6-2-module-dependencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-module-dependencies","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.2 Module Dependencies")]),t._v(" "),a("ul",[a("li",[t._v("Kernel module\n  - Module registration\n  - Module logout\n  - Module status escalation (heartbeat)\n  - Service interface data acquisition and timing update")])]),t._v(" "),a("h2",{attrs:{id:"_7-java-specific-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-specific-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 7. Java-specific design")]),t._v(" "),a("blockquote",[a("p",[t._v("Core object class definition, storing data structures, ...")])]),t._v(" "),a("h2",{attrs:{id:"_8-supplementary-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 8. supplementary content")]),t._v(" "),a("blockquote",[a("p",[t._v("Required content not covered above")])])])}],n=s(0),r=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);r.options.__file="eventBusModuleDesign.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/39.9a0ea84a.js b/docs/.vuepress/dist/assets/js/39.9a0ea84a.js new file mode 100644 index 00000000..ee34efb0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/39.9a0ea84a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{414:function(t,e,o){t.exports=o.p+"assets/img/1542526165310.ba6a717d.png"},415:function(t,e,o){t.exports=o.p+"assets/img/1542526178695.471936da.png"},416:function(t,e,o){t.exports=o.p+"assets/img/1542526190286.0403f20e.png"},417:function(t,e,o){t.exports=o.p+"assets/img/1542526202833.89727e78.png"},418:function(t,e,o){t.exports=o.p+"assets/img/1542526213174.38f2b59f.png"},419:function(t,e,o){t.exports=o.p+"assets/img/1542526223816.fa5a14f2.png"},985:function(t,e,o){"use strict";o.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h2",{attrs:{id:"guide-to-community-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#guide-to-community-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" Guide to Community Vote")]),t._v(" "),n("h3",{attrs:{id:"_1-voting"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-voting","aria-hidden":"true"}},[t._v("#")]),t._v(" 1 Voting")]),t._v(" "),n("p",[t._v("If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(414),alt:"1542526165310"}})]),t._v(" "),n("p",[t._v("Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(415),alt:"1542526178695"}})]),t._v(" "),n("p",[t._v('If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote.')]),t._v(" "),n("p",[t._v("The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B.")]),t._v(" "),n("p",[t._v("The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N.")]),t._v(" "),n("p",[t._v("Each option in the voting details page is clickable to show the current or final distribution of votes.")]),t._v(" "),n("h3",{attrs:{id:"_2-changing-and-updating-your-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-changing-and-updating-your-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" 2 Changing and Updating Your Vote")]),t._v(" "),n("p",[t._v('As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission.')]),t._v(" "),n("p",[n("img",{attrs:{src:o(416),alt:"1542526190286"}})]),t._v(" "),n("p",[t._v("There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(417),alt:"1542526202833"}})]),t._v(" "),n("h3",{attrs:{id:"_3-checking-my-votes"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-checking-my-votes","aria-hidden":"true"}},[t._v("#")]),t._v(" 3 Checking My Votes")]),t._v(" "),n("p",[t._v('In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow.')]),t._v(" "),n("p",[n("img",{attrs:{src:o(418),alt:"1542526213174"}})]),t._v(" "),n("p",[t._v("If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules.")]),t._v(" "),n("h3",{attrs:{id:"_4-creating-a-community-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-creating-a-community-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" 4 Creating A Community Vote")]),t._v(" "),n("p",[t._v("In the voting list, click "),n("strong",[t._v('“Create Voting"')]),t._v(' to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee.')]),t._v(" "),n("p",[t._v("In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(419),alt:"1542526223816"}})]),t._v(" "),n("p",[t._v("When creating a community vote, "),n("strong",[t._v("please fill in the item contents")]),t._v(" "),n("strong",[t._v("carefully.")]),t._v(" Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed.")])])}],i=o(0),a=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);a.options.__file="toolsGuide.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/4.10b50b1a.js b/docs/.vuepress/dist/assets/js/4.10b50b1a.js new file mode 100644 index 00000000..2b5cade2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/4.10b50b1a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{212:function(e,a,c){e.exports=c.p+"assets/img/deploy1.0620b80d.jpg"},213:function(e,a,c){e.exports=c.p+"assets/img/deploy2.c581a6ad.jpg"},214:function(e,a,c){e.exports=c.p+"assets/img/deploy3.f8cde6aa.jpg"},215:function(e,a,c){e.exports=c.p+"assets/img/deploy4.e0509949.jpg"},216:function(e,a,c){e.exports=c.p+"assets/img/deploy6.d41305b3.jpg"},217:function(e,a,c){e.exports=c.p+"assets/img/access1.e55b0e87.jpg"},218:function(e,a,c){e.exports=c.p+"assets/img/access2.142e5288.jpg"},219:function(e,a,c){e.exports=c.p+"assets/img/access3.473cdd05.jpg"},220:function(e,a,c){e.exports=c.p+"assets/img/access4.ec334fa4.jpg"},221:function(e,a,c){e.exports=c.p+"assets/img/access5.2eda257e.jpg"},222:function(e,a,c){e.exports=c.p+"assets/img/access6.f24bf883.jpg"},223:function(e,a,c){e.exports=c.p+"assets/img/access7.d4ad0113.jpg"},224:function(e,a,c){e.exports=c.p+"assets/img/myContract1.9dd9d99f.jpg"},225:function(e,a,c){e.exports=c.p+"assets/img/myContract2.01d9687b.jpg"},226:function(e,a,c){e.exports=c.p+"assets/img/myContract3.31870321.jpg"},227:function(e,a,c){e.exports=c.p+"assets/img/myContract4.07a83092.jpg"},228:function(e,a,c){e.exports=c.p+"assets/img/myContract5.912b5882.jpg"},229:function(e,a,c){e.exports=c.p+"assets/img/myContract6.405104a8.jpg"},230:function(e,a,c){e.exports=c.p+"assets/img/assets1.abc7fc62.jpg"},231:function(e,a,c){e.exports=c.p+"assets/img/assets2.a43e834e.jpg"},232:function(e,a,c){e.exports=c.p+"assets/img/assets3.68229e16.jpg"},233:function(e,a,c){e.exports=c.p+"assets/img/assets4.1e09a147.jpg"},855:function(e,a,c){"use strict";c.r(a);var d=[function(){var e=this.$createElement,a=this._self._c||e;return a("h1",{attrs:{id:"user-document-of-wallet-smart-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#user-document-of-wallet-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" User Document of Wallet Smart Contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"deploy-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Deploy contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(212),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(213),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(214),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(215),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(216),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("Click [to call] on the right of table to go to [call contract] page")])]),this._v(" "),a("li",[a("p",[this._v("Click contract address to access to contract overview page")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"review-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#review-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Review contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(217),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[this._v("Click [pull-down list] in the panel to select the contract method to call")]),this._v(" "),a("li",[this._v("Click star mark beside the contract address to collect this contract to the list of my contracts")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(218),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("li",[a("p",[this._v("If read-only method, click [call], get the deployment results after network requests met")]),this._v(" "),a("p",[a("img",{attrs:{src:c(219),alt:"access"}})])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(220),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(221),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(222),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(223),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"my-contracts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#my-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" My contracts")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(224),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("Click contract address to access to contract overview page")]),this._v(" "),a("p",[a("img",{attrs:{src:c(225),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("Click [to call] to access to the [call contract] page")]),this._v(" "),a("p",[a("img",{attrs:{src:c(226),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("Click [cancel collection] to remove this contract from the list of [my contracts]")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(227),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(228),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(229),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"account-multiple-assets"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#account-multiple-assets","aria-hidden":"true"}},[this._v("#")]),this._v(" Account multiple assets")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(230),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(231),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(232),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(233),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("blockquote",[a("p",[this._v("Hex coding of NRC-20 Token")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[this._v("504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000\n\n\n")])])])}],f=c(0),t=Object(f.a)({},function(){var e=this,a=e.$createElement,c=e._self._c||a;return c("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),c("p",[e._v("1 Start wallet, click [contract] and then click [deploy contract] tab page")]),e._v(" "),e._m(2),e._v(" "),c("p",[e._v("2 Insert Hex code of contract in textbox")]),e._v(" "),c("p",[e._v("3 Insert contract construction function parameter, and note the required item and value type. If not, it will fail the table verification.")]),e._v(" "),e._m(3),e._v(" "),c("p",[e._v("4 Click [advanced option] to alter default value of GasLimit and GasPrice. Other additional information can be inserted too. Such filed must be required. (Optional step)")]),e._v(" "),e._m(4),e._v(" "),c("p",[e._v("5 After filling out, click [test contract]. Wallet will conduct a trial deployment for this contract to verify contract legality.")]),e._v(" "),e._m(5),e._v(" "),c("p",[e._v("6 After passing this test, click [deploy contract]. In case of password, insert password, and then click [confirm]. If no password, click [confirm]. Then, the system will go to [my contracts] page on which the confirmation progress of deployed contract can be reviewed.")]),e._v(" "),c("p",[e._v("Review the confirmation progress of deployed contract.")]),e._v(" "),e._m(6),e._v(" "),c("p",[e._v("7 After confirmation completion")]),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),c("p",[e._v("1 Start wallet, click [contract] and click [review contract] tab page")]),e._v(" "),e._m(9),e._v(" "),c("p",[e._v("2 Insert legal contract address in box, and click [access], showing a panel below it")]),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),c("p",[e._v("3 Have two cases after selecting a method")]),e._v(" "),c("ul",[e._m(12),e._v(" "),c("li",[c("p",[e._v("If readable method (to be linked), click advanced option to alter default value of GasLimit and GasPrice. After clicking [call], generate a transaction, which will consume nuls. Therefore, in case of account password, insert your password. After transaction confirmation, feedback the results.")]),e._v(" "),c("p",[c("a",{attrs:{href:"http://dev.nuls.io/zh-cn/contract/SmartContractFee.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("View smart contract fee details"),c("OutboundLink")],1)]),e._v(" "),c("p",[e._v("Transaction on calling contract under confirmation")]),e._v(" "),e._m(13),e._v(" "),c("p",[e._v("Transaction on calling contract confirmed")]),e._v(" "),e._m(14)])]),e._v(" "),c("p",[e._v("4 If calling linking method, click TxID in panel, to review the details of this transaction to call contract")]),e._v(" "),e._m(15),e._v(" "),c("p",[e._v("Details of this transaction to call contract")]),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),c("p",[e._v("1 List of my contracts displays the created and collected contracts")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),c("p",[e._v("3 [Transaction records] display the transactions in this contract. Click TxID to review the details about this transaction.")]),e._v(" "),e._m(20),e._v(" "),c("p",[e._v("4 [Contract details] display all methods of this contract, corresponding parameters and returned value type.")]),e._v(" "),e._m(21),e._v(" "),c("p",[e._v("5 If the contract is created by current account, click [delete] on the top right of contract overview to delete this contract. After that, contract details are also available, but the method of contract cannot be called.")]),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),c("p",[e._v("After releasing Token via smart contract or transferring in different kinds of Token from other accounts, the account have multiple assets.")]),e._v(" "),c("p",[e._v("1 Access to wallet, to review all kinds of assets under this account address.")]),e._v(" "),e._m(24),e._v(" "),c("p",[e._v("2 Click [transfer] to access to transfer interface of this kind of asset, insert payee address and transfer amount, to finish transfer of such asset.")]),e._v(" "),e._m(25),e._v(" "),c("p",[e._v("3 Click [transaction records] to access to transaction records page of this kind of asset")]),e._v(" "),e._m(26),e._v(" "),c("p",[e._v("4 Click [pull-down list] on [transaction records] page to switch among transaction records of different kinds of assets.")]),e._v(" "),e._m(27),e._v(" "),c("p",[e._v("5 Click TxID to review the details of this transaction.")]),e._v(" "),c("hr"),e._v(" "),e._m(28),e._v(" "),e._m(29)])},d,!1,null,null,null);t.options.__file="GUIForSmartContract.md";a.default=t.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/40.6894dc38.js b/docs/.vuepress/dist/assets/js/40.6894dc38.js new file mode 100644 index 00000000..ffb6129b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/40.6894dc38.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{441:function(t,e,o){t.exports=o.p+"assets/img/1542526165310.ba6a717d.png"},442:function(t,e,o){t.exports=o.p+"assets/img/1542526178695.471936da.png"},443:function(t,e,o){t.exports=o.p+"assets/img/1542526190286.0403f20e.png"},444:function(t,e,o){t.exports=o.p+"assets/img/1542526202833.89727e78.png"},445:function(t,e,o){t.exports=o.p+"assets/img/1542526213174.38f2b59f.png"},446:function(t,e,o){t.exports=o.p+"assets/img/1542526223816.fa5a14f2.png"},958:function(t,e,o){"use strict";o.r(e);var n=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"content"},[n("h2",{attrs:{id:"guide-to-community-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#guide-to-community-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" Guide to Community Vote")]),t._v(" "),n("h3",{attrs:{id:"_1-voting"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-voting","aria-hidden":"true"}},[t._v("#")]),t._v(" 1 Voting")]),t._v(" "),n("p",[t._v("If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(441),alt:"1542526165310"}})]),t._v(" "),n("p",[t._v("Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(442),alt:"1542526178695"}})]),t._v(" "),n("p",[t._v('If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote.')]),t._v(" "),n("p",[t._v("The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B.")]),t._v(" "),n("p",[t._v("The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N.")]),t._v(" "),n("p",[t._v("Each option in the voting details page is clickable to show the current or final distribution of votes.")]),t._v(" "),n("h3",{attrs:{id:"_2-changing-and-updating-your-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-changing-and-updating-your-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" 2 Changing and Updating Your Vote")]),t._v(" "),n("p",[t._v('As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission.')]),t._v(" "),n("p",[n("img",{attrs:{src:o(443),alt:"1542526190286"}})]),t._v(" "),n("p",[t._v("There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(444),alt:"1542526202833"}})]),t._v(" "),n("h3",{attrs:{id:"_3-checking-my-votes"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-checking-my-votes","aria-hidden":"true"}},[t._v("#")]),t._v(" 3 Checking My Votes")]),t._v(" "),n("p",[t._v('In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow.')]),t._v(" "),n("p",[n("img",{attrs:{src:o(445),alt:"1542526213174"}})]),t._v(" "),n("p",[t._v("If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules.")]),t._v(" "),n("h3",{attrs:{id:"_4-creating-a-community-vote"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-creating-a-community-vote","aria-hidden":"true"}},[t._v("#")]),t._v(" 4 Creating A Community Vote")]),t._v(" "),n("p",[t._v("In the voting list, click "),n("strong",[t._v('“Create Voting"')]),t._v(' to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee.')]),t._v(" "),n("p",[t._v("In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked.")]),t._v(" "),n("p",[n("img",{attrs:{src:o(446),alt:"1542526223816"}})]),t._v(" "),n("p",[t._v("When creating a community vote, "),n("strong",[t._v("please fill in the item contents")]),t._v(" "),n("strong",[t._v("carefully.")]),t._v(" Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed.")])])}],i=o(0),a=Object(i.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);a.options.__file="toolsGuide.md";e.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/41.9abdd72f.js b/docs/.vuepress/dist/assets/js/41.9abdd72f.js new file mode 100644 index 00000000..6787546c --- /dev/null +++ b/docs/.vuepress/dist/assets/js/41.9abdd72f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{585:function(t,e,s){t.exports=s.p+"assets/img/modules.5667d6c6.png"},586:function(t,e,s){t.exports=s.p+"assets/img/module.84e040d4.png"},587:function(t,e,s){t.exports=s.p+"assets/img/mykernelstarted.cfb5fce2.png"},588:function(t,e,s){t.exports=s.p+"assets/img/ledger.d4383200.png"},589:function(t,e,s){t.exports=s.p+"assets/img/ledgerstart.e024f199.png"},590:function(t,e,s){t.exports=s.p+"assets/img/package.06d61e5f.png"},860:function(t,e,s){"use strict";s.r(e);var a=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"生成程序包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#生成程序包","aria-hidden":"true"}},[this._v("#")]),this._v(" 生成程序包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"必备知识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#必备知识","aria-hidden":"true"}},[this._v("#")]),this._v(" 必备知识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"获取程序源代码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#获取程序源代码","aria-hidden":"true"}},[this._v("#")]),this._v(" 获取程序源代码")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"调试程序"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#调试程序","aria-hidden":"true"}},[this._v("#")]),this._v(" 调试程序")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(585),alt:"modules"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(586),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(587),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(588),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(589),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"生成可执行程序包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#生成可执行程序包","aria-hidden":"true"}},[this._v("#")]),this._v(" 生成可执行程序包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("./package.sh -J /usr/local/java/jdk11.0.2 -o ../NULS2\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(590),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("lijunzhou:nuls_2.0 zhoulijun$ ./package.sh -h\n Desc: 使用此脚本将生成符合NULSTAR规范的可执行子模块,\n \t 所有子模块按照module.ncf配置,使用mvn命令进行打包,并生成启动、停止脚本\n Usage: ./package.sh \n \t\t-b 打包前同步最新代码 参数为同步的远程分支名称\n \t\t-p 打包前同步最新代码 从master分支拉取\n \t\t-o <目录> 指定输出目录\n \t\t-h 查看帮助\n \t\t-j JAVA_HOME\n \t\t-J 输出的jvm虚拟机目录,脚本将会把这个目录复制到程序依赖中\n \t\t-i 跳过mvn打包\n \t\t-z 生成压缩包\n Author: zlj\n")])])])}],r=s(0),n=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("Nuls2基础模块使用java11开发,使用分布式多模块的微服务架构,模块间使用websocket进行通信。但模块间并无语言要求,能支持websocket协议进行网络编程的语言理论上都可以成为NULS2的模块,所以需要对websocket协议有一定的了解。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("NULS2的源代码托管在github.com上,任何人可免费获取。项目地址"),s("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[t._v("nuls_2.0"),s("OutboundLink")],1),t._v(",获取方法参见"),s("a",{attrs:{href:"https://git-scm.com/book/en/v2",target:"_blank",rel:"noopener noreferrer"}},[t._v("git"),s("OutboundLink")],1)]),t._v(" "),t._m(3),t._v(" "),s("p",[t._v("如果想要开发或者调试NULS2的源代码,需要先准备开发环境,依次安装JDK11.0.2、apache maven 3.3,以及一个趁手的开发工具,我们推荐IntelliJ IDEA。开发环境和源代码准备好后,在IDEA中用导入maven项目的方式导入程序模块。")]),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("模块根目录存在module.ncf文件的模块定义为nuls2子模块,其中mykernel为核心调度模块,此模块负责其他子模块注册服务。每个模块的启动类的命名方式为XXXXBootstrap,运行启动类的main函数启动模块。")]),t._v(" "),t._m(5),t._v(" "),s("p",[t._v('在开发环境中,首先需要启动mykernel模块,再启动其他模块,模块间的依赖关系由框架自动控制。在日志中打印"MYKELNEL STARTED. PORT:8887"时,mykernel模块启动成功。')]),t._v(" "),t._m(6),t._v(" "),s("p",[t._v("启动其他模块(以ledger模块为例),找到LedgerBootstrap类,运行main函数。")]),t._v(" "),t._m(7),t._v(" "),s("p",[t._v('日志打印"RMB:module state : Running"时,模块启动成功。')]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),s("p",[t._v("获取到源代码后,可以自己通过源代码生成可使用的脚本程序。在nuls2.0根目录运行脚本package.sh执行自动打包程序(脚本需要依赖jdk11,maven3.3,git).")]),t._v(" "),s("p",[t._v("执行打包程序,将/usr/local/java/jdk11.0.2目录下的JDK作为运行环境复制到钱包目录中。钱包可运行程序输出到../NULS2这个相对目录中。")]),t._v(" "),t._m(10),s("p",[t._v("日志输出XXXX PACKAGE FINISH时,打包程序生成成功。")]),t._v(" "),t._m(11),t._v(" "),s("p",[t._v("更多的package.sh脚本参数可通过-h查看帮助。")]),t._v(" "),t._m(12),s("p",[t._v("钱包使用方法请参见"),s("router-link",{attrs:{to:"/zh/NULS2.0/linuxTutorial.html"}},[t._v("命令行使用手册")]),t._v("。")],1)])},a,!1,null,null,null);n.options.__file="packageGeneration.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/42.791cbfec.js b/docs/.vuepress/dist/assets/js/42.791cbfec.js new file mode 100644 index 00000000..7188a1ff --- /dev/null +++ b/docs/.vuepress/dist/assets/js/42.791cbfec.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{617:function(t,_,v){t.exports=v.p+"assets/img/architecture.784f3b18.png"},618:function(t,_,v){t.exports=v.p+"assets/img/structure.2a58a4c4.png"},619:function(t,_,v){t.exports=v.p+"assets/img/chainRegister.9111e337.png"},620:function(t,_,v){t.exports=v.p+"assets/img/chainDestroy.013520b1.png"},621:function(t,_,v){t.exports=v.p+"assets/img/assetRegister.b72c7a79.png"},622:function(t,_,v){t.exports=v.p+"assets/img/assetDestroy.62602f22.png"},848:function(t,_,v){"use strict";v.r(_);var e=[function(){var t=this,_=t.$createElement,e=t._self._c||_;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"链管理模块设计文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#链管理模块设计文档","aria-hidden":"true"}},[t._v("#")]),t._v(" 链管理模块设计文档")]),t._v(" "),e("p",[t._v("[TOC]")]),t._v(" "),e("h2",{attrs:{id:"一、总体描述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),e("h3",{attrs:{id:"_1-1-模块概述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 模块概述")]),t._v(" "),e("h4",{attrs:{id:"_1-1-1-为什么要有《链管理》模块"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《链管理》模块","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《链管理》模块")]),t._v(" "),e("p",[t._v("在NULS 1.0中,只有一条链(NULS主网),因此不需要链管理模块。")]),t._v(" "),e("p",[t._v("在NULS 2.0中,NULS主网上可以注册其他友链信息,包括:")]),t._v(" "),e("ul",[e("li",[t._v("NULS生态圈中的链:与NULS主网使用同一套代码衍生出来。")]),t._v(" "),e("li",[t._v("其他链:比特币、以太坊等")])]),t._v(" "),e("p",[t._v("《链管理》模块用来管理所有加入NULS主网的友链的信息")]),t._v(" "),e("p",[t._v("名词解释:")]),t._v(" "),e("ul",[e("li",[t._v("NULS主网:不同于NULS 1.0,是独立运行的另一条链,也称之为NULS 2.0。\n《链管理》是NULS主网的其中一个模块")]),t._v(" "),e("li",[t._v("友链:在NULS主网上注册的其他链")])]),t._v(" "),e("p",[t._v("假设1:友链A,其拥有资产A")]),t._v(" "),e("p",[t._v("假设2:友链B,其拥有资产B")]),t._v(" "),e("ul",[e("li",[t._v("跨链交易:\n"),e("ul",[e("li",[t._v("友链A把资产A转到友链B")]),t._v(" "),e("li",[t._v("友链B内部转移资产A")]),t._v(" "),e("li",[t._v("友链B把资产A转回到友链A")]),t._v(" "),e("li",[t._v("友链B把资产A转到其他友链(C,D等)")])])]),t._v(" "),e("li",[t._v("非跨链交易:\n"),e("ul",[e("li",[t._v("友链A内部转移资产A")]),t._v(" "),e("li",[t._v("友链B内部转移资产B")])])])]),t._v(" "),e("p",[t._v("备注:不论链内资产,还是链外资产,只要资产跨链进行交易,就需要主网进行确认。")]),t._v(" "),e("h4",{attrs:{id:"_1-1-2-《链管理》要做什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《链管理》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《链管理》要做什么")]),t._v(" "),e("p",[t._v("《链管理》模块用来管理加入NULS主网的链的基本信息,包括:")]),t._v(" "),e("ul",[e("li",[t._v("注册一条新的友链")]),t._v(" "),e("li",[t._v("销毁已经存在的友链")]),t._v(" "),e("li",[t._v("查询友链信息")]),t._v(" "),e("li",[t._v("特定友链增加资产类型")]),t._v(" "),e("li",[t._v("特定友链销毁资产类型")]),t._v(" "),e("li",[t._v("跨链资产校验")])]),t._v(" "),e("h4",{attrs:{id:"_1-1-3-《链管理》在系统中的定位"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《链管理》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《链管理》在系统中的定位")]),t._v(" "),e("p",[t._v("《链管理》强依赖的模块:")]),t._v(" "),e("ul",[e("li",[t._v("核心模块")]),t._v(" "),e("li",[t._v("网络模块")]),t._v(" "),e("li",[t._v("交易管理模块")]),t._v(" "),e("li",[t._v("账本模块")])]),t._v(" "),e("p",[t._v("《链管理》弱依赖的模块:")]),t._v(" "),e("ul",[e("li",[t._v("事件总线模块")])]),t._v(" "),e("h3",{attrs:{id:"_1-2-模块内部架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-模块内部架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 模块内部架构图")]),t._v(" "),e("p",[e("img",{attrs:{src:v(617),alt:""}})]),t._v(" "),e("h2",{attrs:{id:"二、功能设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),e("h3",{attrs:{id:"_2-1-功能架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 功能架构图")]),t._v(" "),e("p",[e("img",{attrs:{src:v(618),alt:""}})]),t._v(" "),e("h3",{attrs:{id:"_2-2-模块服务"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 模块服务")]),t._v(" "),e("h4",{attrs:{id:"_2-2-1-注册一条新的友链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-注册一条新的友链","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 注册一条新的友链")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("NULS主网会提供一个入口(网页),可以通过这个入口注册新的友链到NULS主网。")]),t._v(" "),e("p",[t._v("注册一条友链必须含一个注册资产。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:v(619),alt:""}})])])]),t._v(" "),e("p",[t._v("步骤描述:")]),t._v(" "),e("p",[t._v("1.用户通过终端注册登记链信息以及随链初始化的资产信息。")]),t._v(" "),e("p",[t._v("2.链管理模块进行链交易的封装发送给交易模块。期间需要通过账本模块获取账户余额及交易nonce值。")]),t._v(" "),e("p",[t._v("​ 并且通过网络模块获取跨链的种子节点信息 返回给用户。")]),t._v(" "),e("p",[t._v("3.交易模块会在交易处理过程中进行数据校验的回调。")]),t._v(" "),e("p",[t._v("4.链管理模块通过 交易模块回调 “提交链注册交易”的接口 来进行注册数据提交。")]),t._v(" "),e("p",[t._v("5.链管理模块存储数据并将注册信息下发给网络模块。")]),t._v(" "),e("p",[t._v("6.注册链需要1000NULS,其中20%直接销毁,80%用于抵押,删除资产时退回。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 向链管理模块注册友链信息。")]),t._v(" "),e("p",[t._v("​ method : cm_chainReg")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": "1",\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "assetId":85,\n "symbol":"NULS",\n "assetName":"纳斯",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("链名称")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链上创建的账户的地址类型:1生态内 2非生态内")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("网络魔法参数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("最小可用节点数量")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("单节点连接最小数量")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("交易确认块数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产符号")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产名称")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产初始值")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("最小资产可分割位数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("私钥对应的密码")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"\n}\n\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("seeds")]),t._v(" "),e("td",[t._v("String")]),t._v(" "),e("td",[t._v("种子节点")])])])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("网络管理模块")]),t._v(" "),e("li",[t._v("交易管理模块,发送交易")]),t._v(" "),e("li",[t._v("账本模块,获取账本信息")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-2-注销已经存在的友链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-注销已经存在的友链","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.2 注销已经存在的友链")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("NULS主网会提供一个入口(网页),可以通过这个入口注销已经存在的友链。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:v(620),alt:""}})])])]),t._v(" "),e("ol",[e("li",[t._v("链是随资产而创建,所以注销链必须进行资产校验,只有删除最后一条资产,链才会随着一起注销。")])]),t._v(" "),e("p",[t._v("2.判断是否允许注销的条件:")]),t._v(" "),e("p",[t._v("​ 资产与链存在。")]),t._v(" "),e("p",[t._v("​ 随链只有最后一个资产。")]),t._v(" "),e("p",[t._v("​ 链资产有n%资产在自有主链上。")]),t._v(" "),e("p",[t._v("3.链管理模块进行链交易的封装发送给交易模块。")]),t._v(" "),e("p",[t._v("​ 期间需要通过账本模块获取账户余额及交易nonce值。")]),t._v(" "),e("p",[t._v("4.交易模块会在交易处理过程中进行数据校验的回调。")]),t._v(" "),e("p",[t._v("5.链管理模块通过 交易模块回调 “提交链注销交易”的接口 来进行注销数据提交。")]),t._v(" "),e("p",[t._v("6.链管理模块存储数据并将注册信息下发给网络模块。")]),t._v(" "),e("p",[t._v("7.删除链随注销的资产,将退回抵押押金的80%。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 向链管理模块注销友链信息(调用的是资产注销接口,因为链随最后资产一起注销)。")]),t._v(" "),e("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网账户地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("私钥对应的密码")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("网络管理模块")]),t._v(" "),e("li",[t._v("交易管理模块,发送交易")]),t._v(" "),e("li",[t._v("账本模块,校验账本信息")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-3-增加资产信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-增加资产信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.3 增加资产信息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("NULS主网会提供一个入口(网页),可以通过这个入口选择链及登记注册资产。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[e("img",{attrs:{src:v(621),alt:""}})]),t._v(" "),e("p",[t._v("步骤描述:")]),t._v(" "),e("p",[t._v("1.用户通过终端选择链 及随链录入资产信息:判断资产是否重叠。")]),t._v(" "),e("p",[t._v("2.链管理模块进行链交易的封装发送给交易模块。")]),t._v(" "),e("p",[t._v("期间需要通过账本模块获取账户余额及交易nonce值。")]),t._v(" "),e("p",[t._v("3.交易模块会在交易处理过程中进行数据校验的回调。")]),t._v(" "),e("p",[t._v("4.链管理模块通过 交易模块回调 “提交资产注册交易”的接口 来进行注册数据提交。")]),t._v(" "),e("p",[t._v("5.注册资产收1000NULS,其中20%直接销毁,80%用于抵押,删除资产时退回。")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 向链管理模块注册资产信息。")]),t._v(" "),e("p",[t._v("​ method : cm_assetReg")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"纳斯",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产符号")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产名称")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产初始值")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("最小资产可分割位数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("私钥对应的密码")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n")])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("交易管理模块,发送交易")]),t._v(" "),e("li",[t._v("账本模块,获取账本信息")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-4-特定友链删除资产类型"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-特定友链删除资产类型","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.4 特定友链删除资产类型")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("NULS主网会提供一个入口(网页),可以通过这个入口对指定友链销毁资产。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("p",[e("img",{attrs:{src:v(622),alt:""}})]),t._v(" "),e("ol",[e("li",[e("p",[t._v("连下注册有多个资产时,单资产允许注销,如果只有一个资产,则资产随链一起注销。")]),t._v(" "),e("p",[t._v("2.判断是否允许注销的条件:")])])]),t._v(" "),e("p",[t._v("​ 连下存在多个资产。")]),t._v(" "),e("p",[t._v("​ 链资产有n%资产在自有主链上。")]),t._v(" "),e("p",[t._v("3.链管理模块进行链交易的封装发送给交易模块。")]),t._v(" "),e("p",[t._v("​ 期间需要通过账本模块获取账户余额及交易nonce值。")]),t._v(" "),e("p",[t._v("4.交易模块会在交易处理过程中进行数据校验的回调。")]),t._v(" "),e("p",[t._v("5.链管理模块通过 交易模块回调 “提交链注销交易”的接口 来进行注销数据提交。")]),t._v(" "),e("p",[t._v("6.注销资产将退回抵押押金的80%。")])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 向链管理模块注销资产信息。")]),t._v(" "),e("p",[t._v("​ method : cm_assetDisable")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "assetId": 45,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "password":"xxxxxxxxxxxxx"\n \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网账户地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("password")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("私钥对应的密码")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("交易管理模块,发送交易")]),t._v(" "),e("li",[t._v("账本模块,校验账本信息")])])])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-5-跨链交易的链资产校验"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-跨链交易的链资产校验","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.5 跨链交易的链资产校验")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("交易模块在产生一笔跨链交易时,调用该接口进行跨链资产的校验。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("ol",[e("li",[t._v("校验链及资产是否在跨链模块正常注册")]),t._v(" "),e("li",[t._v("校验链上资产金额是否透支。")]),t._v(" "),e("li",[t._v("校验资产状态是否正常。")])])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 跨链资产流通时,向链管理提交校验")]),t._v(" "),e("p",[t._v("​ method : cm_assetCirculateValidator")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),e("td",[t._v("交易coindata的HEX值")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("交易管理模块,跨链交易校验调用")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-6-跨链交易的链资产提交"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-跨链交易的链资产提交","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.6 跨链交易的链资产提交")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("交易模块在产生一笔跨链交易,并校验通过时,调用该接口进行跨链资产的提交。")]),t._v(" "),e("p",[t._v("用于变更链资产,并用于链资产的管理。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("ol",[e("li",[t._v("直接调用cm_assetCirculateCommit 接口")])])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 跨链资产流通时,校验通过并且确认可提交时,可向链管理提交该笔交易")]),t._v(" "),e("p",[t._v("​ method : cm_assetCirculateCommit")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "coinDatas": "FFAABB214324" \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("coinDatas")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("String")]),t._v(" "),e("td",[t._v("交易coindata的HEX值")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("parameter")]),t._v(" "),e("th",[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td"),t._v(" "),e("td"),t._v(" "),e("td")])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("交易管理模块,跨链交易调用")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-7-链管理交易处理函数的注册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-链管理交易处理函数的注册","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.7 链管理交易处理函数的注册")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("在模块启动时,需要进行交易回调函数的注册,以便交易模块在进行相关类型交易处理时,进行回调处理。")]),t._v(" "),e("p",[t._v("注册函数分为4类:1>交易校验 2>交易提交 3>交易回滚 4>一个区块内的模块批量交易校验")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")]),t._v(" "),e("ol",[e("li",[t._v("链管理模块启动")]),t._v(" "),e("li",[t._v("判断交易模块RPC调用状态是否可访问")]),t._v(" "),e("li",[t._v("提交回调接口")])])]),t._v(" "),e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("p",[t._v("参看 交易模块 设计文档中的 “注册交易” 部分")])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("ul",[e("li",[t._v("交易管理模块")])])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-8-查询链信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-查询链信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.8 查询链信息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("查询注册链信息")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 查询注册友链信息。")]),t._v(" "),e("p",[t._v("​ method : cm_chain")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":4545 \n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "chainName": "nuls chain",\n "addressType": 1,\n "magicNumber":454546,\n "supportInflowAsset":"1",\n "minAvailableNodeNum":5,\n "singleNodeMinConnectionNum":5,\n "txConfirmedBlockNum":30,\n "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "regTxHash":"FFFFF", \n "selfAssetKeyList":["1232_32","528_8"],\n "totalAssetKeyList":["1232_32","528_8"],\n "createTime":1212131\n}\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainName")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("链名称")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("addressType")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链上创建的账户的地址类型:1生态内 2非生态内")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("magicNumber")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("网络魔法参数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("minAvailableNodeNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("最小可用节点数量")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("singleNodeConMinNodeNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("单节点连接最小数量")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("txConfirmBlockNum")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("交易确认块数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("regTxHash")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("交易hash")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("regAddress")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("selfAssetKeyList")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),e("td",[t._v("链下注册的资产列表,由chainId_assetId 组合的资产key值")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("totalAssetKeyList")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("list")]),t._v(" "),e("td",[t._v("链下流通的资产列表,由chainId_assetId 组合的资产key值")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),e("td",[t._v("创建时间")])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h4",{attrs:{id:"_2-2-9-查询链下资产信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-查询链下资产信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.9 查询链下资产信息")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("功能说明:")]),t._v(" "),e("p",[t._v("查询某链资产信息。")])]),t._v(" "),e("li",[e("p",[t._v("流程描述")])])]),t._v(" "),e("p",[t._v("​ 无")]),t._v(" "),e("ul",[e("li",[e("p",[t._v("接口定义")]),t._v(" "),e("ul",[e("li",[t._v("接口说明")])]),t._v(" "),e("p",[t._v("​ 向链管理模块查询某资产信息。")]),t._v(" "),e("p",[t._v("​ method : cm_asset")]),t._v(" "),e("ul",[e("li",[t._v("请求示例")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId":4545, \n "assetId":45\n}\n')])])]),e("ul",[e("li",[t._v("请求参数说明")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("资产id")])])])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("返回示例")]),t._v(" "),e("p",[t._v("Failed")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("统一RPC标准格式\n\n")])])]),e("p",[t._v("Success")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('{\n "chainId": 152,\n "assetId":85,\n "symbol":"NULS",\n "assetName":"纳斯",\n "initNumber":"1000000000",\n "decimalPlaces":8,\n "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",\n "txHash":"xxxxxxxxxxxxx",\n "createTime":125848\n }\n')])])])]),t._v(" "),e("li",[e("p",[t._v("返回字段说明")])])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),e("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),e("th",[t._v("description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("chainId")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("链标识")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("symbol")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产符号")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("assetName")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产名称")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("initNumber")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("资产初始值")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("decimalPlaces")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),e("td",[t._v("最小资产可分割位数")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("address")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("创建链的主网地址")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("txHash")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),e("td",[t._v("交易hash")])]),t._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[t._v("createTime")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("long")]),t._v(" "),e("td",[t._v("创建时间")])])])])]),t._v(" "),e("li",[e("p",[t._v("依赖服务")]),t._v(" "),e("p",[t._v("无")])])]),t._v(" "),e("h2",{attrs:{id:"_3、事件说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 3、事件说明")]),t._v(" "),e("ul",[e("li",[t._v("链注册事件")]),t._v(" "),e("li",[t._v("链注销事件")]),t._v(" "),e("li",[t._v("新增资产事件")]),t._v(" "),e("li",[t._v("注销资产事件")])]),t._v(" "),e("h2",{attrs:{id:"_4、协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 4、协议")]),t._v(" "),e("h3",{attrs:{id:"_4-1-网络通讯协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-网络通讯协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1 网络通讯协议")]),t._v(" "),e("h4",{attrs:{id:"_4-1-1-向友链请求获取发行的资产总量"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-向友链请求获取发行的资产总量","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 向友链请求获取发行的资产总量")]),t._v(" "),e("ul",[e("li",[t._v("消息说明:定期链管理向友链发起发行资产总量数据请求消息。")]),t._v(" "),e("li",[t._v("cmd:requestAssetAmount")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("链Id")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("assetId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("randomCode")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("随机数")])])])]),t._v(" "),e("h4",{attrs:{id:"_4-1-1-接收友链回复的资产总量"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-接收友链回复的资产总量","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.1.1 接收友链回复的资产总量")]),t._v(" "),e("ul",[e("li",[t._v("消息说明:接收到友链对资产的回复。")]),t._v(" "),e("li",[t._v("cmd:responseAssetAmount")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("链Id")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("assetId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("amount")]),t._v(" "),e("td",[t._v("biginteger")]),t._v(" "),e("td",[t._v("资产总量")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("randomCode")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("随机数")])])])]),t._v(" "),e("h3",{attrs:{id:"_4-2-交易协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-交易协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2 交易协议")]),t._v(" "),e("h5",{attrs:{id:"_4-2-1-注册一条新的友链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-注册一条新的友链","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.1 注册一条新的友链")]),t._v(" "),e("p",[t._v("与通用交易相比,只有类型和txData有区别,具体区别如下")]),t._v(" "),e("p",[t._v("交易类型定义:10101")]),t._v(" "),e("p",[t._v("txData定义")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("链Id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("name")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("链名称")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("addressType")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("地址类型")])]),t._v(" "),e("tr",[e("td",[t._v("4")]),t._v(" "),e("td",[t._v("magicNumber")]),t._v(" "),e("td",[t._v("uint32")]),t._v(" "),e("td",[t._v("魔法参数")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("supportInflowAsset")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("是否支出资产流入")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("minAvailableNodeNum")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("最小可用节点数")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("singleNodeMinConnectionNum")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("单节点最小连接数")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("address")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("账户地址")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("assetId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("symbol")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("单位")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("assetName")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("资产名称")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("depositNuls")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("抵押NULS数量")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("initNumber")]),t._v(" "),e("td",[t._v("Biginteger")]),t._v(" "),e("td",[t._v("资产初始数量")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("decimalPlaces")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("资产最小分割位数")])])])]),t._v(" "),e("h5",{attrs:{id:"_4-2-2-注销已经存在的友链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-注销已经存在的友链","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 注销已经存在的友链")]),t._v(" "),e("p",[t._v("与通用交易相比,只有类型和txData有区别,具体区别如下")]),t._v(" "),e("p",[t._v("交易类型定义:10102")]),t._v(" "),e("p",[t._v("txData定义:同4.2.1 链注册交易")]),t._v(" "),e("h5",{attrs:{id:"_4-2-3-新增友链资产"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-3-新增友链资产","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.3 新增友链资产")]),t._v(" "),e("p",[t._v("与通用交易相比,只有类型和txData有区别,具体区别如下")]),t._v(" "),e("p",[t._v("交易类型定义:10103")]),t._v(" "),e("p",[t._v("txData定义:")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Length")]),t._v(" "),e("th",[t._v("Fields")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Remark")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("chainId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("链Id")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("assetId")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("资产id")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("symbol")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("单位")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("assetName")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("资产名称")])]),t._v(" "),e("tr",[e("td",[t._v("2")]),t._v(" "),e("td",[t._v("depositNuls")]),t._v(" "),e("td",[t._v("uint16")]),t._v(" "),e("td",[t._v("抵押NULS数量")])]),t._v(" "),e("tr",[e("td",[t._v("48")]),t._v(" "),e("td",[t._v("initNumber")]),t._v(" "),e("td",[t._v("Biginteger")]),t._v(" "),e("td",[t._v("资产初始数量")])]),t._v(" "),e("tr",[e("td",[t._v("1")]),t._v(" "),e("td",[t._v("decimalPlaces")]),t._v(" "),e("td",[t._v("uint8")]),t._v(" "),e("td",[t._v("资产最小分割位数")])]),t._v(" "),e("tr",[e("td",[t._v("?")]),t._v(" "),e("td",[t._v("address")]),t._v(" "),e("td",[t._v("byte[]")]),t._v(" "),e("td",[t._v("账户地址")])])])]),t._v(" "),e("h5",{attrs:{id:"_4-2-2-注销已经存在的资产"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-2-注销已经存在的资产","aria-hidden":"true"}},[t._v("#")]),t._v(" 4.2.2 注销已经存在的资产")]),t._v(" "),e("p",[t._v("与通用交易相比,只有类型和txData有区别,具体区别如下")]),t._v(" "),e("p",[t._v("交易类型定义:10104")]),t._v(" "),e("p",[t._v("txData定义:同4.2.3 资产新增交易")]),t._v(" "),e("h2",{attrs:{id:"六、模块配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、模块配置")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("[system]\nlanguage = en\nencoding = UTF-8\n\n[db]\nrocksdb.datapath = ../data\n\n[param]\nasset_symbol_max = 5\nasset_name_max = 20\nasset_depositNuls = 200000\nasset_depositNuls_destroy_rate = 0.2\nasset_depositNuls_lock_rate = 0.8\nasset_initNumber_min = 10000\nasset_initNumber_max = 100000000\nasset_decimalPlaces_min = 4\nasset_decimalPlaces_max = 8\nasset_recovery_rate = 0.9\n\n[defaultAsset]\nnuls_chain_id = 8964\nnuls_chain_name = nuls chain\nnuls_asset_id = 1\nnuls_asset_initNumber_max = 100000000\nnuls_asset_symbol = NULS\n")])])]),e("h2",{attrs:{id:"七、java特有的设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、Java特有的设计")]),t._v(" "),e("h2",{attrs:{id:"八、补充内容"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 八、补充内容")])])}],a=v(0),l=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},e,!1,null,null,null);l.options.__file="chainModuleDesign.md";_.default=l.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/43.b4204359.js b/docs/.vuepress/dist/assets/js/43.b4204359.js new file mode 100644 index 00000000..15a053af --- /dev/null +++ b/docs/.vuepress/dist/assets/js/43.b4204359.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{628:function(t,s,a){t.exports=a.p+"assets/img/event-bus-module.18c5a6f0.png"},629:function(t,s,a){t.exports=a.p+"assets/img/event-bus-content.23c1f972.png"},630:function(t,s,a){t.exports=a.p+"assets/img/event-bus-model.a7412672.png"},631:function(t,s,a){t.exports=a.p+"assets/img/event-bus-function.8044546e.png"},632:function(t,s,a){t.exports=a.p+"assets/img/event-bus-seq-flow.2de08cda.png"},633:function(t,s,a){t.exports=a.p+"assets/img/event-bus-main-flow.c97c465a.png"},839:function(t,s,a){"use strict";a.r(s);var r=[function(){var t=this,s=t.$createElement,r=t._self._c||s;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"事件总线模块设计"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#事件总线模块设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 事件总线模块设计")]),t._v(" "),r("h1",{attrs:{id:"事件总线模块设计文档"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#事件总线模块设计文档","aria-hidden":"true"}},[t._v("#")]),t._v(" 事件总线模块设计文档")]),t._v(" "),r("p",[t._v("[TOC]")]),t._v(" "),r("h2",{attrs:{id:"一、总体描述"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、总体描述")]),t._v(" "),r("h3",{attrs:{id:"_1-1-模块概述"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 模块概述")]),t._v(" "),r("h4",{attrs:{id:"_1-1-1-为什么要有《事件总线》模块"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《事件总线》模块","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 为什么要有《事件总线》模块")]),t._v(" "),r("blockquote",[r("p",[t._v("事件总线模块是专门用来接收及通知处理模块事件的功能性模块,管理着所有模块事件。")])]),t._v(" "),r("h4",{attrs:{id:"_1-1-2-《事件总线》要做什么"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《事件总线》要做什么","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 《事件总线》要做什么")]),t._v(" "),r("blockquote",[r("p",[t._v("提供事件的订阅、接收、发送等功能,是模块间的事件中转站")])]),t._v(" "),r("h4",{attrs:{id:"_1-1-3-《事件总线》在系统中的定位"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《事件总线》在系统中的定位","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 《事件总线》在系统中的定位")]),t._v(" "),r("blockquote",[r("p",[t._v("事件模块是一个边缘系统,提供主要一些异步的消息发送,也就说,即使没有事件总线,系统一样可以正常运行,比较轻量级,而且不依赖其他模块系统。")])]),t._v(" "),r("h3",{attrs:{id:"_1-2-架构图"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.2 架构图")]),t._v(" "),r("p",[r("img",{attrs:{src:a(628),alt:"event-bus-module"}})]),t._v(" "),r("ul",[r("li",[t._v("事件总线模块主要含2部分交互逻辑:\n"),r("ul",[r("li",[t._v("与系统核心模块的微服务注册与服务信息获取。")]),t._v(" "),r("li",[t._v("与其他基础模块间的事件消息创建、订阅、转发管理。")])])])]),t._v(" "),r("h2",{attrs:{id:"二、功能设计"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、功能设计")]),t._v(" "),r("h3",{attrs:{id:"_2-1-功能架构图"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1 功能架构图")]),t._v(" "),r("p",[r("img",{attrs:{src:a(629),alt:"event-bus-content"}})]),t._v(" "),r("h3",{attrs:{id:"_2-2-模块服务"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2 模块服务")]),t._v(" "),r("p",[r("img",{attrs:{src:a(630),alt:"event-bus-model"}})]),t._v(" "),r("blockquote",[r("p",[t._v("该模块提供事件的订阅,事件的转发")])]),t._v(" "),r("h4",{attrs:{id:"_2-2-1-修改系统运行参数"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-修改系统运行参数","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2.1 修改系统运行参数")]),t._v(" "),r("blockquote",[r("p",[t._v("只依赖核心系统,核心系统可以对事件模块系统的启动,停止,参数修改等,")])]),t._v(" "),r("h3",{attrs:{id:"_2-3-模块内部功能"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.3 模块内部功能")]),t._v(" "),r("p",[r("img",{attrs:{src:a(631),alt:"event-bus-function"}})]),t._v(" "),r("blockquote",[r("p",[t._v("模块内部工能主要包含,订阅管理器,事件管理器,转发管理器。")])]),t._v(" "),r("ul",[r("li",[t._v("微服务接口信息同步管理\n"),r("ul",[r("li",[t._v("用于与kernel服务治理模块之间的服务接口同步")])])]),t._v(" "),r("li",[t._v("事件储存管理(eventBus)\n"),r("ul",[r("li",[t._v("用于进行事件信息的创建,订阅等储存,并且在模块重启是进行信息的初始化。")])])]),t._v(" "),r("li",[t._v("事件订阅管理(subscribe)\n"),r("ul",[r("li",[t._v("维护订阅事件的“配置表”:包括所有各个模块订阅的重要参数")])])]),t._v(" "),r("li",[t._v("事件转发管理(dispatcher)\n"),r("ul",[r("li",[t._v("开放接口用于事件的接收,对接收事件按订阅进行转发,转发调用接口通过服务信息管理接口获得")])])]),t._v(" "),r("li",[t._v("功能接口管理(rpc)\n"),r("ul",[r("li",[t._v("开放查询接口供外部查询")])])])]),t._v(" "),r("h3",{attrs:{id:"_2-4-事件总线流程"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-事件总线流程","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.4 事件总线流程")]),t._v(" "),r("ul",[r("li",[t._v("事件处理时序")])]),t._v(" "),r("p",[r("img",{attrs:{src:a(632),alt:"event-bus-seq-flow"}})]),t._v(" "),r("ul",[r("li",[t._v("事件处理基本流程")])]),t._v(" "),r("p",[r("img",{attrs:{src:a(633),alt:"event-bus-main-flow"}})]),t._v(" "),r("h3",{attrs:{id:"_2-5-业务逻辑"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-业务逻辑","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.5 业务逻辑")]),t._v(" "),r("blockquote",[r("p",[t._v("在事件转发失败(比如网络原因)情况下进行的异常逻辑处理 ,按以下2种逻辑处理:")])]),t._v(" "),r("ul",[r("li",[t._v("1、保留事件调用 按队列重复调用,直到转发成功。")]),t._v(" "),r("li",[t._v("2、尝试多次后直接丢弃,(暂定5次)每10秒后重试一次。")])]),t._v(" "),r("h2",{attrs:{id:"三、接口设计"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#三、接口设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 三、接口设计")]),t._v(" "),r("h3",{attrs:{id:"_3-1-模块接口"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-模块接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 模块接口")]),t._v(" "),r("h4",{attrs:{id:"_3-1-1-事件主题订阅"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-事件主题订阅","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.1 事件主题订阅")]),t._v(" "),r("blockquote",[r("p",[t._v("cmd: subscribe")])]),t._v(" "),r("h5",{attrs:{id:"参数说明-request-body"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" 参数说明 (request body)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"subscribe"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic 事件主题\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId订阅者模块id\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h5",{attrs:{id:"返回值说明-response-content"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 返回值说明 (response content)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//操作码\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//失败时的信息\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"app_secret"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxx"')]),t._v(" // app_secret"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("暂时不需要,后期如果需要不是本机调用可能需要验证\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h4",{attrs:{id:"_3-1-2-事件取消订阅"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-事件取消订阅","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.2 事件取消订阅")]),t._v(" "),r("blockquote",[r("p",[t._v("cmd: unsubscribe")])]),t._v(" "),r("h5",{attrs:{id:"参数说明-request-body-2"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-body-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 参数说明 (request body)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unsubscribe"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //topic 事件主题\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),t._v(" //moduleId订阅者模块id\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h5",{attrs:{id:"返回值说明:-response-content"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 返回值说明:(response content)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //操作码\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//失败时的信息\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h4",{attrs:{id:"_3-1-3-事件发送【自动创建topic】"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-事件发送【自动创建topic】","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.3 事件发送【自动创建topic】")]),t._v(" "),r("blockquote",[r("p",[t._v("在没人订阅情况下是否保留一定时间?")])]),t._v(" "),r("blockquote",[r("p",[t._v("cmd: send")])]),t._v(" "),r("h5",{attrs:{id:"参数说明-request-body-3"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-body-3","aria-hidden":"true"}},[t._v("#")]),t._v(" 参数说明(request body)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"send"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"app.nuls.network.bandwidth"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//topic 事件主题\n "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleId"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //moduleId订阅者模块id\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key"')]),t._v(" "),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data value"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" // 需要发送的事件,jsonObj\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h5",{attrs:{id:"返回值说明-response-content-2"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-content-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 返回值说明(response content)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //操作码\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//失败时的信息\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h4",{attrs:{id:"_3-1-4-事件广播-推送push-or-dispatcher"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-事件广播-推送push-or-dispatcher","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1.4 事件广播(推送push or dispatcher)")]),t._v(" "),r("blockquote",[r("p",[t._v("需要每个接口在订阅事件时提供接口,我在广播时调用即可,我这里是多线程去掉你们接口,你们需要返回正确的code,否则会有走重试机制")])]),t._v(" "),r("h5",{attrs:{id:"参数说明-request-body-4"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-body-4","aria-hidden":"true"}},[t._v("#")]),t._v(" 参数说明(request body)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"dispatcher"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" //data 需要发送的事件,payload\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h5",{attrs:{id:"返回值说明-response-content-3"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-content-3","aria-hidden":"true"}},[t._v("#")]),t._v(" 返回值说明(response content)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //一定要正确返回"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("不要需要告诉你业务逻辑是否出错,你只要接收到了就告诉我你成功接收到了即可。\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//失败时的信息\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h3",{attrs:{id:"_3-2-功能接口"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-功能接口","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.2 功能接口")]),t._v(" "),r("blockquote",[r("p",[t._v("功能接口是提供给界面和命令行工具使用的接口")])]),t._v(" "),r("h4",{attrs:{id:"获取事件主题信息"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#获取事件主题信息","aria-hidden":"true"}},[t._v("#")]),t._v(" 获取事件主题信息")]),t._v(" "),r("blockquote",[r("p",[t._v("cmd: topics")])]),t._v(" "),r("h5",{attrs:{id:"参数说明-request-body-5"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-body-5","aria-hidden":"true"}},[t._v("#")]),t._v(" 参数说明(request body)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"topics"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h5",{attrs:{id:"返回值说明-response-content-4"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-content-4","aria-hidden":"true"}},[t._v("#")]),t._v(" 返回值说明(response content)")]),t._v(" "),r("div",{staticClass:"language-json extra-class"},[r("pre",{pre:!0,attrs:{class:"language-json"}},[r("code",[r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //一定要正确返回"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("不要需要告诉你业务逻辑是否出错,你只要接收到了就告诉我你成功接收到了即可。\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reponse message."')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//失败时的信息\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topics"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"topic"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //主题id\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\t//创建时间\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //主题创建者(模块)Id\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribes"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("//订阅者信息\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleId"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //订阅者\n "),r("span",{pre:!0,attrs:{class:"token property"}},[t._v('"subscribeTime"')]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),r("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v(" //订阅时间\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h4",{attrs:{id:"获取事件主题信息-包含该主题上所有事件信息?-每个事件其实我不关心的。"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#获取事件主题信息-包含该主题上所有事件信息?-每个事件其实我不关心的。","aria-hidden":"true"}},[t._v("#")]),t._v(" 获取事件主题信息(包含该主题上所有事件信息?) 每个事件其实我不关心的。")]),t._v(" "),r("blockquote",[r("p",[t._v("cmd : get_topic")])]),t._v(" "),r("h2",{attrs:{id:"四、事件说明"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 四、事件说明")]),t._v(" "),r("blockquote",[r("p",[t._v("不依赖任何事件")])]),t._v(" "),r("h2",{attrs:{id:"五、协议"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 五、协议")]),t._v(" "),r("h3",{attrs:{id:"_5-1-网络通讯协议"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-网络通讯协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.1 网络通讯协议")]),t._v(" "),r("p",[t._v("无")]),t._v(" "),r("h3",{attrs:{id:"_5-2-交易协议"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-交易协议","aria-hidden":"true"}},[t._v("#")]),t._v(" 5.2 交易协议")]),t._v(" "),r("h2",{attrs:{id:"六、模块配置"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置","aria-hidden":"true"}},[t._v("#")]),t._v(" 六、模块配置")]),t._v(" "),r("h3",{attrs:{id:"_6-1-配置说明"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-配置说明","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.1 配置说明")]),t._v(" "),r("blockquote",[r("p",[t._v("一般支持性配置,端口,重试次数,重试时间,默认执行器的线程池大小,网络调用超时配置等。")])]),t._v(" "),r("div",{staticClass:"language-yml extra-class"},[r("pre",{pre:!0,attrs:{class:"language-text"}},[r("code",[t._v("server:\n ip: 127.0.0.1 //本机ip,用于提供服务给其他模块,可以不填,默认自动获取\n port: 8080 //提供服务的端口,可以不填,默认自动获取\n")])])]),r("h3",{attrs:{id:"_6-2-模块依赖关系"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-模块依赖关系","aria-hidden":"true"}},[t._v("#")]),t._v(" 6.2 模块依赖关系")]),t._v(" "),r("ul",[r("li",[t._v("内核模块\n"),r("ul",[r("li",[t._v("模块注册")]),t._v(" "),r("li",[t._v("模块注销")]),t._v(" "),r("li",[t._v("模块状态上报(心跳)")]),t._v(" "),r("li",[t._v("服务接口数据获取及定时更新")])])])]),t._v(" "),r("h2",{attrs:{id:"七、java特有的设计"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[t._v("#")]),t._v(" 七、Java特有的设计")]),t._v(" "),r("blockquote",[r("p",[t._v("核心对象类定义,存储数据结构,......")])]),t._v(" "),r("h2",{attrs:{id:"八、补充内容"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[t._v("#")]),t._v(" 八、补充内容")]),t._v(" "),r("blockquote",[r("p",[t._v("上面未涉及的必须的内容")])])])}],e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},r,!1,null,null,null);n.options.__file="eventBusModuleDesign.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/44.79523177.js b/docs/.vuepress/dist/assets/js/44.79523177.js new file mode 100644 index 00000000..bb789646 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/44.79523177.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{662:function(t,s,a){t.exports=a.p+"assets/img/wpsA8AA.tmp.bc7dd59c.jpg"},663:function(t,s,a){t.exports=a.p+"assets/img/wpsBF9.tmp.94fa7ea2.jpg"},664:function(t,s,a){t.exports=a.p+"assets/img/wps55B5.tmp.31dcd6a9.jpg"},665:function(t,s,a){t.exports=a.p+"assets/img/wps96E5.tmp.56607bda.jpg"},666:function(t,s,a){t.exports=a.p+"assets/img/wpsD101.tmp.21509964.jpg"},667:function(t,s,a){t.exports=a.p+"assets/img/wpsFCF4.tmp.a32293ed.jpg"},809:function(t,s,a){"use strict";a.r(s);var r=[function(){var t=this,s=t.$createElement,r=t._self._c||s;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"社区投票指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#社区投票指南","aria-hidden":"true"}},[t._v("#")]),t._v(" 社区投票指南")]),t._v(" "),r("h3",{attrs:{id:"_1-投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 1 投票")]),t._v(" "),r("p",[t._v("如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(662),alt:"img"}})]),t._v(" "),r("p",[t._v("点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(663),alt:"img"}})]),t._v(" "),r("p",[t._v("若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。")]),t._v(" "),r("p",[t._v("系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。")]),t._v(" "),r("p",[t._v("投票详情的各个选项,可以点击展开详情,查看票数分布情况。")]),t._v(" "),r("h3",{attrs:{id:"_2-更新投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-更新投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 2 更新投票")]),t._v(" "),r("p",[t._v("如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(664),alt:"img"}})]),t._v(" "),r("p",[t._v("同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(665),alt:"img"}})]),t._v(" "),r("h3",{attrs:{id:"_3-查看我的投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-查看我的投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 3 查看我的投票")]),t._v(" "),r("p",[t._v("在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(666),alt:"img"}})]),t._v(" "),r("p",[t._v("点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。")]),t._v(" "),r("h3",{attrs:{id:"_4创建投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_4创建投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 4创建投票")]),t._v(" "),r("p",[t._v("在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。")]),t._v(" "),r("p",[t._v("为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(667),alt:"img"}})]),t._v(" "),r("p",[t._v("创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。")])])}],e=a(0),i=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},r,!1,null,null,null);i.options.__file="toolsGuide.md";s.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/45.52dab45f.js b/docs/.vuepress/dist/assets/js/45.52dab45f.js new file mode 100644 index 00000000..3fba66d1 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/45.52dab45f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{788:function(t,s,a){t.exports=a.p+"assets/img/wpsA8AA.tmp.bc7dd59c.jpg"},789:function(t,s,a){t.exports=a.p+"assets/img/wpsBF9.tmp.94fa7ea2.jpg"},790:function(t,s,a){t.exports=a.p+"assets/img/wps55B5.tmp.31dcd6a9.jpg"},791:function(t,s,a){t.exports=a.p+"assets/img/wps96E5.tmp.56607bda.jpg"},792:function(t,s,a){t.exports=a.p+"assets/img/wpsD101.tmp.21509964.jpg"},793:function(t,s,a){t.exports=a.p+"assets/img/wpsFCF4.tmp.a32293ed.jpg"},808:function(t,s,a){"use strict";a.r(s);var r=[function(){var t=this,s=t.$createElement,r=t._self._c||s;return r("div",{staticClass:"content"},[r("h1",{attrs:{id:"社区投票指南"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#社区投票指南","aria-hidden":"true"}},[t._v("#")]),t._v(" 社区投票指南")]),t._v(" "),r("h3",{attrs:{id:"_1-投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_1-投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 1 投票")]),t._v(" "),r("p",[t._v("如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(788),alt:"img"}})]),t._v(" "),r("p",[t._v("点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(789),alt:"img"}})]),t._v(" "),r("p",[t._v("若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。")]),t._v(" "),r("p",[t._v("系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。")]),t._v(" "),r("p",[t._v("投票详情的各个选项,可以点击展开详情,查看票数分布情况。")]),t._v(" "),r("h3",{attrs:{id:"_2-更新投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2-更新投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 2 更新投票")]),t._v(" "),r("p",[t._v("如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(790),alt:"img"}})]),t._v(" "),r("p",[t._v("同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(791),alt:"img"}})]),t._v(" "),r("h3",{attrs:{id:"_3-查看我的投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-查看我的投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 3 查看我的投票")]),t._v(" "),r("p",[t._v("在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(792),alt:"img"}})]),t._v(" "),r("p",[t._v("点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。")]),t._v(" "),r("h3",{attrs:{id:"_4创建投票"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_4创建投票","aria-hidden":"true"}},[t._v("#")]),t._v(" 4创建投票")]),t._v(" "),r("p",[t._v("在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。")]),t._v(" "),r("p",[t._v("为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。")]),t._v(" "),r("p",[r("img",{attrs:{src:a(793),alt:"img"}})]),t._v(" "),r("p",[t._v("创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。")])])}],e=a(0),i=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},r,!1,null,null,null);i.options.__file="toolsGuide.md";s.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/46.d45f0044.js b/docs/.vuepress/dist/assets/js/46.d45f0044.js new file mode 100644 index 00000000..9d467c11 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/46.d45f0044.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{266:function(t,e,a){t.exports=a.p+"assets/img/consensus-constants.5d3198f1.jpg"},267:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjEAAADzCAIAAAD4stA1AAAa1klEQVR4nO3df28ct53H8T4g+y8/G/1jPZL9S/sU7k9tC8gQrkCBABfEcAs1DRQJKXoXK/ElStw0Oqs5X1M3sS1Zrl0Dxs3v+ZJDznB3hjMc7rt44SCvOBzORMfPksNd/uL9uxsAAELwi8lbAABAjkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAublaHnn1p07t1N3V5eTtOFitVu2Yffgsf9GBnDJGAuZBMzQ8aKjgy5iY+fwwlcbTvZu2TPJrZHDXjKiQCYBc5QNHVo66LwHv7M48deG7BRtmdTZyGEvGVEgk4A5CqCDJpPgAZkEzFEAHTSZBA/IJMCL/HFLau+onEkzLAq4PNipfmWaant8ePdWVWB5XL0uO2ixBCB7gFSfuqqwbkDyiqxTP6PanpIxCcpMEqeTLbyxpIhyRenNGeKSDTXrjcE8kEmAN1USlD1v0X0r/1RjQ+nB855XFqj6X627z7pjeWyxxkFETr1YrqikiB+RCvkrRVeel+9+ZFV1/UUkWFLEdEXNRva45PRmVteS1UwmzRGZBPjT7JTzjjvvZ7VOXP4qlSVW/c88MMphllJzUrLR/+a1ye6++YrWPL21WgN0hrk7NVGMKaJVmAebEtKbXXL6W6Uxx4vWeUUEikwC/DFMXjVHJxWlR24MU5RBjKjZFEg3a2SSFiGiwPqZVAwEm400XlH9Yn7SXpdczOYxNpo7Mgnwx/RAxfg5m8bEWtfHcfKaF0t9uqyyQSZtMndnfDxmHNlYrihvQ3bVPS9ZPLTz+sEseEUmAf7YM6kYJ5WP5cu3/+tlUlpY9OlKgU0yqT6vdQGCXtI4TvKYSW2XXDeg9TsmEDQyCfDHOneXdZd639o+d2et2fzx2M0yKXnF+WO2A87d5S/2vWRLtZgVMgnwp3WNQ2NYoD6/aS5jy1/MO2KlZtMzqo3n7vpkUvuiCesah7KSHpfcWNGw3rUgGGQS4E/x4L3qLpWpLXUldPnBINFl699Zl3bZloc9RW8u+uXmBJftFdFxK49kumbAzGvBW+vXFn83RzMbX7K6fi//LXN3c0QmAf7kb+13qm/R1kYJ8gOqaQdarXTQhhrqserHWtWP7+QzWmq0pH26yyv5GcV3fnfEUlKD+nHg5nIJ08dXlU+2mmre6JKTZiv3mQV4c0UmAf7M6+twjK2d1yVg9sgkwJ85dejZWMSyfq99AR4wHDIJ8GZeq79MS7EtQQX4QiYBXsgPynR/1icQzTUOcwlUxIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMApzsf/hf2BKT/7FtMzIJ8fvHzz99++Tp5+dP+pi8o8RoJv+L3WZkEqL1/MXzoz89bvY4H3zy1fHD78gk2Ez+p7vNyCTEKRkY/eqjh7Kj+c3Hjy5++NvGFU7eUWI0k//1bjMyCRH6+vsftF4mGRi9e3s9ecMAtCOTEJvnL55rI6TTL76fvFUAXMw0k7LtO8UuL7sHj80l803VlC1hFietdZZVZdtr1ke1b2umFb69PLYWzjZJ69yfxmdjij1ybJWUh5v3+1njSqdy//RcBtJvPn7ECAmYi9llkt4nWjt3Qxq1b7AmYqC5s5k9+fSMaTmFvUmNnt1nYzbNpDWudDpJ/Gizdk9/fDZ5qwA4mlcm1cMjrUdOu0uZSaL3V7t7EWl6T1rGwN5C36+6rq3Rj5eBobUn3WNUq99cSdUerWafjdksk9yvdFI/PvuHDKRfffRw8iYBcDenTCo3k26fuboRHb15mq56v6/GlZgPtA9x1B65fZrL1CTDTJ2xEp+N2SST3K90Yo+++6vMpP/49OvJmwTA3XwyqXyf3v0Ao6PPvbEkRBUDxiQzHlK8aH2a5dgkw2+na0xrJnVXPjXtg0R/fHQxeZMAuJtNJhWDJPOKgPVLFv2y7PHLGLAMBYrRlVqtY6u6ihWnFnHrsTGbzd253/9paZmU/HPyJgFwN5dMcn+f7laymP4yDE1sB5YzfurARSxAsJ+xs0nNAv4a0/d5UuCjJTIJmLW5ZFJzJNGzpHVosl4MvLvR18UZRhL6ynWbvpnk1Jgea8FdKp8amQTMGpmkv7J2DCi/NS6PHjGTuhvT8/NJXZVPjUwCZm1mmeQwa+RWcqi5O3O1WmftHqgjNMZ47ZLbEjtb5VMjk4BZm0smrbEWuXga317SvsahVwwoJatOf4NFa/4aM1Am2SqfGpkEzNpcMmmN7s+hZNtHgvrHQDWGqAZGaxzrvzEdlVcDIJfRj6HyiZFJwKzNJpPqpzLdj9bbP9xjC63BY8D0eSNbR3+xWirn9dqYls8Ut3zPhWPlEyOTgFmbUSYp6760N+aWr89p+26hRne/QQyktdm+qk7LTrE0QEsC48ye38aI+9OcvdzZtXxm1rXySZFJwKzNKpPeNZYjtywAa/0OVtNc04YxYDmFYQRj/Q5TQ3nvjSm/qEmTjHhav1vIrfIJkUnArM0tkzLNzt32PKNZ0r7QYLPpMkNn3fpwpVneOPE1SmPMnzeyrXFY90qnQSZtI33qe5tEd+2zzCTAhkzaQsmgP+TvFuHa10ImISpkUrDkpEU9wrZ9OUhjT5Z8tnn3YFV9Aj2vRMxCK1MOjfJiXlqUbLbKdiIPl2BuUv9rnzUyCVEhk0IllskknXjRcR8tRbcr3u8bC+eRUMxXiy3T0sL2LS6L8ln3XZxLO3atEw14CUM1iXESEC4yaQbSgUXWvaYDAjEUqB5hitflz2lfXJWpKmnPpLK8su2n6OsNrbKeaOBLMDdpoGufLzIJUSGTgqUuOMq7VMsgQ1806zGTTK2yZtKwl2DPpAGufb7IJESFTAqUHG3oP6uPYd7l/bLl0xTDZpKlVeYTDX0J9kwa4Nrni0xCVMikQIlOPHuOUv1sfDivdLUnB2JMYxq+2NaerZVJslWdmTTIJViGbsNc+3yRSYgKmRSq+vNty+Ps43dZF2ycOsscWdeY1XFyW6SF/oE5rbyyNXN9rKFVh9YTDXwJliYNcO2zRiYhKmTSjCSdsnyPP8e3/BFcQmjIJESFTJoR6+Lp+YjgEkJDJiEqZNKsKFswz3OEEcElhIVMQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUzy54NPvpL3VnPvwVnLbxGC+6fnk/8VdSKTEBUyyZ/kfk7eBkSPTEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/BsqkYmc8r1+hrWzhilkhkxAVMsmfAcdJvve+UzLpYrXc2i0kZnjtZBKiQib5M6NMmupcoZnjtZNJiAqZ5E/fTDpeFHvf3V0dyr7yYrVbbIu3c3hxIyb3jvIfytdz9R56VQ1Jz1vVfJkPksqf618plRSv7x6slvWpHzdPV1SVyTeQbRx4u9pYtllYuWrRQtNVuzbJ4UClqc1rD9yGmaT9fz4wPmPekEn+7PfKpDRLip4661XLRBH7hSfdd9llZ/172ZOm3friRCtc/VwflZwiLybn7tJixrFCdoqifNZ9F6fTjrW0zXyiRuGkSXVymHdJt9Q8VJO2ZZxEJmFyZNLI9vtkUppDRaf5XnbQ6etl9oif045176g8vOzZ1UqKMlnC1eOS6lcumVSeQnn+JPr6Wp2LatvE64bC4orSjKmOcrhqc5Ncbpca4WQSMJJfH33Z8ttV9n/JpAHt+8qkW2J2a/1MEpVU/e9QmSSn4zozyVTYMk5yuGp7JnXdLjIJmATjpJHt+8qkxjhj3UyqT1EMmIbJJDkG6hwnWQrLp2iX78x3Y40mudwuMgmYBJk0sn1vz5Pq1QoHhgcknc+Tmo+mZIduW3u2ViZlT3dcM0kWPtkzri+wX3XH0K37QK0l25JJQJjIJH/6ZZIyYjjJp7mKbvTIvIZtb7G847DuTk5nZRWK9WZVWqhr4VqX6pXlk2OrZW/Jsdl5sxWDyrintfClZfbPeNVuTeo+UClsuvbAkUmICpnkT99MWoc+LzdPyVXIYcocRy3jI5MQFTLJHzJpXdb137AjkxAVMsmf0TJJn4yasXqezfdX/EWDTEJUyCR/xhwnYWuRSYgKmeQPmYQRkEmICpnkD5mEEZBJiAqZ5A+ZhBGQSYgKmeQPmYQRkEmICpnkz/6Hn7d8rca9B2eTf7UH+rh/ej7539h7MgmRIZP82WecBP/IJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPJnzEwqvhpc366i3DfPuBmrUw0IHZmEqJBJ/ow8TrJtoWTdINy5hu1ysVrOao8MMglRCSmTlL1zFMaOUu7hre+T3Vn49u7Batl+SG8BZtJmNWyV2W1uSyYhKiFlUuZ4oe5NVwaV8u6+mJLS9sm2pJe9cLiZVLX5qJh8u7NzeKFfZhoh4s5kibLSyr8XSaOVb+4EmJVclO8M6hrkTcuyvCrw2Hy6MvjzXWIbB96udo9tFq7/BirVf/r6jYVyNzqb5HCg0lTj5QeLTEJUgsukvPuQCVR2KFWo5B1Hc1fsooNTY8lWOHt9yEx6ef362c83L67qV3qOk7LLKXvGtJsuWquMZpLXZaJ0la/n7uoDj5ayZPlzen8aAa8XKE8npgTFhuV628RZ2gon7amTw7wVuqXmoZrEOAmYzAwySRvo6AMpqRhU6e+4jYXTEw2TSS+uXn/66Prjs6vTr64/+fLqD2dXP7149X6QTKpToe6p2zKpq3zd+Wb3WYtqW83GAsqjKVPhthxt3vnqxbRhYjRTHSVelz93N8nhQNEkMgmY1NwyyTARJ6kzeO2Fk98OkEnPX75O0ujvz9/8q/zf86u3nz66evbzq6Az6Z1hADpIJsnpuM5MMhW2jJP0J4JrZVLHgWQSEIoZZFLRp+RdSWMkpCkeRVS92y2vDwbevblJRkg/vawDKf/f9c3b33/+cvXhwz6Vr5sxa2eSuL35/Rwgk+QYqHOcZClcP0/S/wwM7yHcMqnjQDIJCEXomaS9l1fyyURmUmfh3p6/vPnky6t/mf73p2+uDn73TZ/K5QMPvX8XDz+MD0hcnieVPW/9uGXYTJJP7DozSRY+2TP+J1PS4uTAkMSWoVv3gVpLyCRgMoFmkrIWXLzJDSyTvn/66ou/3CQJ9MH9r/7tl5/lkp+TV86fXP/777/vU7l9FdxR/eJxfo2LpWEF2k39mdlszHFYLypbnMj7nHXN+jK8xqM4rYCyiq++7fUZl8dZO+V5HQpfmif0tAtvLJNra1L3gUrhcpRmHYsHhkxCVALNJOvnOsOau3v286vTr66N46SzP18f/q7X2+3t/LRQctXaqv15jVrGRyYhKnPLpAHXOAzg7ZubP5xdXd+81QLp7Zv0edIvP/qiT+XbmUnW9d+wIJMQlbll0nprwbVPiTar6h9XP/z46rPz65t/vpWBdPbnq7/871WfdXfND7RuDeXrPBgkdSKTEJX5ZVI5+nH7zGzLUOloqO8WuvzbdTJa+vIvr755cv3fF8nPL5NAes/3gmMUZBKiElwmKQ+EbNb6biHTtxPJz1EO4Z+vby6eXn/7JB0e3dy8yl8kkzACMglRCSmTGt/B2j5ttdZ3sNq+Qs0nMgkjIJMQlZAyKTZkEkZAJiEqZJI/ZBJGQCYhKmSSP/sffi7vrebeg7OW32IW7p+eT/5nRiYhKmSSP/uMk+AfmYSokEn+kEkYAZmEqJBJ/pBJGAGZhKhomfSfX//P5E2KBpmEEZBJiMrZt5cyk377Wa/tFSCRSRgBmYSoXP7f32UmHTzotQ0dJDIJIyCTEJU3r6+15a1X1y8mb1UcyCSMgExCbH599CXTdz6EnUneN/LAOMgkxEabvkt8++Tp5K2KQNiZlNreHfMuVstYLpxMQoSOH36nPVVKgmryVs0dmRSsmC6cTEKE3ry+/u1n32ijpSSoktc3rnPy733xx/0ObHz38q03dg+O8hm28ovM669Oz7tUuUOH3MCwPHxVla+3m6q+Iv3u6rDRNTcO3Dm8KGb55C7yxblEzS1nbBZWmqF9U3v9de/F6Ryb5HCg0lT98NkikxCtb588TUZIWv97//T8j48uPj9/sq7Jk2PWmfS+6MqzTjPpvtMuW24EXv+sbJFelKwOL/bvSH8WqVZUknXizeGCPDDrvouOW1QiWtJ9RmPhpBl1cpg3O7fUPFSTGCcB8/D0x2ePvvvrBiG0PZmU5LRLsVX/TNL3Iaz3iKqiqC2T5Ov5sWolxikseaDSBlF5rarZdkZjYbGnYpox1VFyr0Xxc3eTHA4UTSKTgO0zeXL4434H+txApT99F1Ymyem4zkwyFbaMk/R9GtfKpI4DySQAW238TJL9tcdMkmOgznGSpbB8rGUbC67RJIcDySQAW23gTGp5niQek3RkkuPzJOdMyp7uuGaSLHyyZ1xfoKTFyYHhWixDt+4DtZaQSQC2S59MsqwN09fdqS/uHB7nU1iLZXV4nSK3RUgUvzrJZ9VE8p2oB8q1fKKSatnb7eVxdvZsCZ/ljIbCl5bZP+0a9WVybU3qPtB4E+p1gLNFJgFw0nOcFLEkV+QwJaZRy/jIJABOyCQb6/pvrI9MAuCETLKr59n4zr2eyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCk/Uvz7j04m/yL++Di/un55H9LLcgkAE72GSfBPzIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgJN5ZlKxBZ/n7+ouN/pTNtLtoOwwGwatSfUugutcV09kEgAn88yk1Dib7DU2d2+4WC1FM3pkUr3X7bCpZtkbfmXa1t0XMgmAEzKpXWcmDdaMKi287h9Yn2VUZBIAJ30yKZ8F2j04Kt7g553dxWq32ApvJ3snXu2Ml/+z7nDLSaT09bTrL3fPk7/VK0+61HIkcWgMg/rsxcxes+ZmsaIlWfYU5cuOW2aSrZH6VdSdfr0rYN6Y8qJW1et1k9JLW5wUR+2IQcyRUri8A2mF+q023LQT0STZ/jt7C+W/S1mtpywkkwA46TlOyrq5slNLOz7xHr9+S572qsWLeTda9vIne3kvbDyqWbleTyOTmvUYaza8qIyHtDYUr1ur2jXP3cnhTv1zdlH5VWsTfdnc3d2dXSWQ6l/VZzleZFU53jTL3J3ewrSYv83dySQATgbIJDkXlEZF2aWKn9P378UoZHF4nLxeDgia80j1cMFYefGr98ZJM7WArqrZVMwhk4yNtGeSepaqHv1E8mLl0oNiDFTcQHkriiC33OrmAy17JmkJar91vZFJAJwMkEmyyxZzYnJOqR617Imxy/Gi6s2VaSXZTeuVr51Jhpo3zSRTIwfKJGXiLsvv5BX92rObmfyghJZ+q5sh2pJJ9TxhVa0fZBIAJx4yyfh2O+v7joslavlR6ZipSqzqKG3osHYmqRNfxpqbxZrZ08wkcyOHySR1cJM/QNJaWJyonmGz3Oo1M6kYwnqduHtPJgFwNHAmqX30yYHy6GL37kLONe3uiY6y7F6zp/SWTHJ7nqSc3VyzoZHac6D2TJKN1KLR6XlS2zipvjpTtCyWe+otbdzqdTOp+G/hc+LuPZkEwFH/dXfKHF3qyLCozPQ8X3Tl9UdzlsfZ4dmyOkPlYt1dsaJMn3HSzm6o+dLcSLE+8Lh4lrOrfGDIUpVYsSZuiJiIa6y7aywjLIdK1URcuaBD/Vxw+ooaw/pVNP+LyCYt65/lfxp9qOcDmQTAyXw/n4SBJJnUXOk3MDIJgBMyadtpiyn8IJMAOCGTtlbjE74ekUkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMBJkkkt7j04ay+ALXT/9HzdPzMyCYCTfcZJ8I9MAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuAkhExSt/sbsjACQSYBcDJ8Jl2slp2blqplOmJmrcJbzuXmT4FMAuBk8Ew62eveSNulzGaFt1yw94pMAuCkZyYlnWC6L1y5NVz9zzvFdtrFxnGZ5bF6SFZG21muvUJ9G7qL1e6dokDeF2uHa+3cPVgti/JJbY8P796STW1prTiweN1YOHW8qF60NLU4nWOTHA4039jJ/7QkMgmAk16ZlPS/RZ97tLyzOEl/SHtV8VY9/WfRX9eFtTJiOq67Qjl316jccPiNcmD5YtZ9i9S0Vdg4sKtwct46Obrug5cmMU4CMGO9Mil7C18PEVL2bjEdQHTFjEOFamE1eAyH3ygH7h3plbxT+npTa5UD5euGwmkDxGimOkq8Ln/ubpLDgS03NhxkEgAnfZ8nlTNLZVdoipB6Lqtz6ONWoS2TDIffKAd2ZZKptdZMMhW2jJPEHKM+sdmdSR0HkkkA4jHMGod6gKJ2i3JU4TJO6qxQzyTLgxPTgKk7AMyttQSApXD9PElekTE+XTOp40AyCUA8ej5PkqOZ6km7MZOy5yX1z7bnSR0V2h+fnBykz5OahysHOmeSbG1nJqmXZozJRlMdm+RwoNYSMgnAjPV/nlQMC5QusloMVi0kS/55lK4Tq3v/ooxYLbY46apQKZz+9khZe2Y8PKOtx1PW7xX1JxUaWnuoLeRrLXxpmf1732yqa5O6D1QKKzc/IGQSACchfI9DNJJckcOUYEct4yOTADghkwZkXf+99cgkAE7IpEHV82zGtX9bi0wC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABODh48TGLJ5t6Ds5bfYtbun56P9mdGJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAELx/6dlfwtgmE9xAAAAAElFTkSuQmCC"},268:function(t,e,a){t.exports=a.p+"assets/img/coinbase.afeaf0dd.png"},269:function(t,e,a){t.exports=a.p+"assets/img/consensus-flow-5.e1e96c82.png"},270:function(t,e,a){t.exports=a.p+"assets/img/statics_en.4c53a0d1.png"},903:function(t,e,a){"use strict";a.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"consensus-module-design-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#consensus-module-design-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Consensus module design document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1、general-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、General description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Module overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-consensus-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-consensus-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 Why do you have a consensus module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-what-does-the-consensus-module-do"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-does-the-consensus-module-do","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 What does the consensus module do")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Legality verification after block synchronization")])]),t._v(" "),a("li",[a("p",[t._v("Create consensus agents, delegate participation consensus, cancel delegation, and cancel consensus agents ★")])]),t._v(" "),a("li",[a("p",[t._v("Consensus agent packs out blocks")])]),t._v(" "),a("li",[a("p",[t._v("Disbursement of network maintenance incentives")])]),t._v(" "),a("li",[a("p",[t._v("Bad agent punishment ★")]),t._v(" "),a("p",[a("strong",[t._v("PS:Different consensus mechanisms have different consensus algorithms. The above marked ★ is unique to POC consensus.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-《consensus-module》positioning-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《consensus-module》positioning-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《Consensus module》Positioning in the system")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(266),alt:""}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Services:\n"),a("ul",[a("li",[t._v("tx service : Additions, deletions and changes to transactions")]),t._v(" "),a("li",[t._v("consensus service : Consensus activities and state management, functional design")])])]),t._v(" "),a("li",[t._v("Validator\n"),a("ul",[a("li",[t._v("tx Validator: Validator for consensus-related transactions for verifying consensus-related transactions")])])]),t._v(" "),a("li",[t._v("Processor\n"),a("ul",[a("li",[t._v("Tx Processor:Consensus module related transaction processor for submitting rollback detection transactions")])])]),t._v(" "),a("li",[t._v("Task/Thread:\n"),a("ul",[a("li",[t._v("consensus Task: Consensus packaging")]),t._v(" "),a("li",[t._v("Reward Task : Data statistics")])])]),t._v(" "),a("li",[t._v("Storage:Store consensus module related transaction data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-0-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-0-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.0 Functional architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(267),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1consensus-module-functional-requirements-analysis"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1consensus-module-functional-requirements-analysis","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1Consensus module functional requirements analysis")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-1-support-multi-chain-parallelism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-1-support-multi-chain-parallelism","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.1 Support multi-chain parallelism")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-2-poc-consensus-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-2-poc-consensus-mechanism","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.2 POC consensus mechanism")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Consensus mechanism——POC\n\tThe NULS main chain defaults to the credit consensus mechanism POC (Proof-Of-Credit). In the case where the agent credit is up to standard, a certain margin can be locked to join the consensus. After the consensus agent is reordered, each round will flow out of the block, and the margin will be unlocked when the consensus is exited.\n\t\n1、Consensus entry and exit mechanism\n\tAnyone can join the NULS consensus at any time, as long as they meet the conditions and follow the rules, that is, they can continue to receive NULS token rewards. The addition of POC is divided into hard indicators and soft indicators. The hard indicator means that the credit score must reach a certain standard line, and exclude some agents that have been evil. The soft index refers to the need to freeze a certain amount of NULS tokens as a margin, in order to prevent the proliferation of agents and make the whole system more fair. The number of margins can be freely selected by anyone except the minimum value. The amount of the deposit will be tied to the final reward.\n\t\n1.1 Yellow card penalty\n\tDue to the hardware configuration of the agent or the network, the disconnection, crash, etc. during the consensus period cannot be blocked. It is not a violation, but it will affect the whole system. Therefore, the system has a mild warning mechanism for such cases. : lower the agent credit value.\n\t\n1.2 Red card penalty\n\tFor some double-split, repeated block-outs, attempts to fork the system, and malicious human-induced damage that does not comply with system rules, the NULS system is firmly resisted, and all agents can detect this kind of situation; once a malicious agent tries to challenge the system, Then the corresponding margin will be locked for 2 months, and the credit rating will never reach the consensus threshold.\n\t\n2、Credit Rating\n\tIn the NULS system, credit is the credit factor of the account in the system, and the credit of all accounts is automatically calculated by the credit rating algorithm formula in the interval [-1, 1].\n\t\n\tCredit evaluation formula: credit base = capacity coefficient + responsibility coefficient\n\tCapacity factor: calculated based on the number of historical blocks\n\tResponsibility factor: Calculated according to violations and correctness of the block\n\t\n3、Consensus reward\n\tFor the balance and fairness of the entire NULS system, the consensus reward is calculated based on the margin and consensus agent credits submitted by all consensus agents. Consensus reward calculation formula: see (Figure p1)\n\t\n4、Subchain consensus mechanism\n\tThere are two types of sub-chains that access NULS. The first one is accessed through the standard interface protocol of the NULS system, and the second is deployed through the NULS program.\n\t\n\tNULS is a common blockchain underlying infrastructure that does not run any application services on its main chain, and all application services are run by sub-chains. Through the NULS system, NULS-based sub-chains can be quickly deployed, and various operational parameters of the sub-chain can be flexibly customized, including whether to support basic tokens, encryption algorithms, consensus mechanisms, and storage mechanisms.\n\t\n\tNULS defines a standard consensus module to provide interfaces that are compatible with different consensus mechanisms. The NULS community will develop consensus mechanisms such as POW, DPOS, POS, PBFT, and POOL verification pools for users to choose freely.\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("Figure p1: Consensus reward calculation formula:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(268),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"in-the-poc-system-there-are-four-roles-agent-principal-packager-and-rewarder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#in-the-poc-system-there-are-four-roles-agent-principal-packager-and-rewarder","aria-hidden":"true"}},[this._v("#")]),this._v(" In the POC system, there are four roles: agent, principal, packager, and rewarder")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Agent - the consensus agent creator. The NULS holder initiates a transaction to create a consensus agent, which is recorded in the chain and tells everyone that I want to be a consensus agent. The basic condition for agent creation is that 20,000-200,000 NULS need to be locked, and there is no red card penalty record. The purpose of setting up this basic condition is to prove that you are really trying to maintain the basic network of NULS.")]),this._v(" "),e("li",[this._v("Packager- When creating a consensus agent, the agent can specify a packager. This packager can be his own other account, or a friend who knows technology. The most important thing is that the packager can not hold any NULS. Even if the server participating in the consensus is hacked, the user will not have a huge loss, and the loss will only be affected by the earnings after the attack. It should be noted that the packager is a real out-of-the-box account. Each time you package a block, you need to sign the block. Therefore, you must not set a password for the packaged account.")]),this._v(" "),e("li",[this._v("Rewarding people- When creating a consensus agent, an agent can not only specify a packager, but also designate a beneficiary to specify who can get the reward generated by the consensus.")]),this._v(" "),e("li",[this._v("The principal-NULS holder can entrust the NULS he holds to the agent according to the agent's credit value and the influence of the agent, etc., and enjoy the corresponding consensus. Revenue, if the agent agent quality or integrity is found to decrease, the principal may withdraw its entrustment and change to others at any time.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"in-the-poc-system-there-are-four-business-logics-creating-a-proxy-creating-a-consensus-agent-stopping-a-proxy-agent-exiting-consensus-delegating-a-consensus-and-canceling-a-delegation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#in-the-poc-system-there-are-four-business-logics-creating-a-proxy-creating-a-consensus-agent-stopping-a-proxy-agent-exiting-consensus-delegating-a-consensus-and-canceling-a-delegation","aria-hidden":"true"}},[this._v("#")]),this._v(" In the POC system, there are four business logics: creating a proxy (creating a consensus agent), stopping a proxy agent (exiting consensus), delegating a consensus, and canceling a delegation.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Create proxy (create consensus agent): Lock 20,000-200,000 NULS and initiate a registration proxy transaction. After packaging, the whole network can be seen. Others can lock the NULS delegation to the proxy agent.")]),this._v(" "),e("li",[this._v("Stop the agent agent (exit consensus): The agent can stop its agent qualification at any time, initiate a transaction to delete the agent agent, and after the transaction is packaged and confirmed, it will quickly withdraw from the consensus and no longer participate in the production of the new block. The 20,000 NULS locked during the registration of the agent will be unlocked after 72 hours, and the rest of the NULS delegated to the agent will be unlocked immediately.")]),this._v(" "),e("li",[this._v("Delegate consensus: Users with NULS of 2000 or above can choose a proxy agent to commission and obtain the corresponding block revenue. Before exiting, the corresponding delegated NULS will be locked out of use. A proxy agent can accept up to 500,000 NULS delegates.")]),this._v(" "),e("li",[this._v("Cancellation of the delegation: The user can cancel the previous entrustment. After the revocation, the locked NULS will immediately explain and no longer enjoy the corresponding consensus revenue.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"two-punishment-mechanisms-for-poc-systems"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#two-punishment-mechanisms-for-poc-systems","aria-hidden":"true"}},[this._v("#")]),this._v(" Two punishment mechanisms for POC systems")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Yellow card penalty: When the block agent is disconnected from the network, card machine and other uncertain reasons, the block will not be out of the block, or the block is not used, then the yellow card will be punished in the next round. The yellow card penalty will affect the agent's income; when 100 consecutive yellow card penalties are awarded, a red card will be imposed.")]),this._v(" "),e("li",[this._v("Red card penalty: When the block agent makes malicious fork, double flower and other behaviors that seriously endanger the stability of the network, or when it receives 100 yellow card penalties continuously, the system will give a red card penalty. The agent that receives the red card penalty will be forced to stop the consensus. The deposit when the agent is created is frozen for 3 months, and the agent can never be created again; the corresponding agent of the agent that received the red card penalty is immediately unlocked.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"hidden-functional-requirements-of-poc-internal-systems"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hidden-functional-requirements-of-poc-internal-systems","aria-hidden":"true"}},[this._v("#")]),this._v(" Hidden functional requirements of POC internal systems")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Maintain a consensus agent information table and update based on the above four transactions received in real time.")]),this._v(" "),e("li",[this._v("Maintain a round of information table, so that each round of agents who meet the conditions of the outbound block are randomly queued out.")]),this._v(" "),e("li",[this._v("The proxy agent that meets the condition of the outbound condition verifies and packages the transaction of the memory pool, assembles it into a new block and broadcasts it to the whole network.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Module service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-create-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-create-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Create agent")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tCreate an address that specifies the packaged block (the fast address when the consensus agent satisfies the packageable condition), the commission ratio (the commission ratio of other accounts participating in the agent consensus), and the consensus reward settlement address (the reward for the consensus agent) The consensus agent of the home address, waiting for other agents to delegate consensus, when the commissioned consensus amount reaches the standard amount, the agent can package the block to earn the reward.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBy creating a agent interface, the NULS user can initiate the creation of a agent transaction, and after the transaction is confirmed and packaged, the consensus agent can be successfully created.\n")])])])])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgent",\n "version:"1.0",\n "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Request to create a agent account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packing block address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward settlement address (default is the same as the agent address)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create a agent's margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("5")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("6")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n \t"version": 1.0,\n "code":0,\n "msg" :"Success message",\n "result":{\n "value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n \t "code":1,\n \t "msg" :"Error message",\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the generated transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-create-agent-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-create-agent-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Create agent transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Create a validator for agent transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the transaction contains agent information\n- Verify that the trade creator is correct\n- agent address and package address cannot be verified\n- agent reward address and package address cannot be verified\n- Commission proportional validity verification\n- Create a agent's margin validity verification\n- Signature correctness verification\n- CoinData verification (lock time verification)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tThis interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"错误Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-create-a-agent-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-agent-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 Create a agent transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save the created consensus node information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save node information to the database\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save consensus node information to the database\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-4-create-agent-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-create-agent-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 Create agent transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Delete consensus agent information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Delete consensus agent information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Remove consensus agent information from the data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentRollBack",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-5-logout-consensus-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-logout-consensus-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 Logout consensus agent")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tLog out a consensus agent created by yourself, and the consensus amount and consensus bonus of the agents participating in the consensus after unregistering the agent will be thawed after a certain time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBy deregistering the agent interface, the NULS user can initiate a transaction to cancel the agent created by himself. After the transaction is confirmed to be packaged, the consensus agent can be successfully logged out.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgent",\n "version:"1.0",\n "params":["address","password",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the logout agent trading account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chian ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the generated transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-6-logout-agent-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-logout-agent-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 Logout agent transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify the correctness of the logout agent transaction验证注销节点交易的正确性\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the deleted consensus agent exists and that the consensus agent has been logged out\n- Verify that the trade creator is correct\n- CoinData verification (output address must exist)\n- Query all consensus information participating in the consensus agent and the total consensus amount of the agent\n- Check whether the total amount of UTXO spent in the logout agent transaction is equal to the consensus agent entrusted amount in the database query. If not, verify the fail.\n- Verify that each UTXO unlocked in the logout agent transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify that the logout agent transaction is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentValid",\n "version:"1.0",\n "params":["tx",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Logout serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set\n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-7-logout-agent-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-logout-agent-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 Logout agent transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Submit logout agent data transaction\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Set all delegate data under the consensus agent to deleted\n- Set the consensus agent data to deleted\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tLog out the consensus agent and set all the delegate data and consensus agents under the consensus agent to the deleted state.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-8-logout-agent-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-logout-agent-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 Logout agent transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Logout agent transaction data rollback\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Set all delegate data under the consensus agent to not deleted\n- Set the consensus agent data to not deleted\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Rollback logout agent transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Logout serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chian ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-9-apply-to-join-the-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-apply-to-join-the-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 Apply to join the consensus")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tEntrust the specified amount to the consensus agent to participate in the consensus to earn consensus rewards. The entrusted amount and consensus reward will be frozen during the consensus period.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tThrough this interface, users can entrust the specified agent address to join the consensus and earn bonuses.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositToAgent",\n "version:"1.0",\n "params":["address","agentHash",20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply for a consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of participation in the consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply for a password for participating in the consensus account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-10-commissioned-consensus-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-commissioned-consensus-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 Commissioned consensus transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Entrusted consensus transaction correctness verification委托共识交易正确性验证\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the consensus agent to apply for is valid\n- Verify that the consensus agent that applied to join has reached the maximum number allowed to join the consensus\n- Verify that the entrusted amount is valid\n- Verify that the transaction was created by the account that requested the application.\n- Verify that the commission amount is equal to the output UTXO amount, and that the output UTXO lock time is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tVerify the validity of the entrusted agent in the entrusted transaction, verify the correctness of the entrusted amount, verify whether the entrusted transaction creator is correct, and whether the UTXO output by the entrusted transaction is correct. Verify that the logout agent transaction is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for commissioned consensus transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-11-entrusted-consensus-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-entrusted-consensus-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 Entrusted consensus transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Entrusted transaction submission\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save commissioned transaction information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save commissioned transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the block where the commissioned transaction is packaged")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-12-delegate-consensus-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-delegate-consensus-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 Delegate consensus transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Delegate consensus transaction rollback, delete delegate consensus transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Delete delegate consensus transaction information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen the commissioned consensus transaction commits an error, this interface needs to be dropped to delete the delegate consensus transaction data.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositRollback",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for commissioned consensus transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the consigned consensus transaction is packaged")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-13-revoke-commission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-revoke-commission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.13 Revoke commission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tApply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tApply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdraw",\n "version:"1.0",\n "params":["address","txHash","password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply to withdraw from the consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Transaction hash when joining consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-14-exit-consensus-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-exit-consensus-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.14 Exit consensus transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify that the exit consensus transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the consensus to exit has been delegated before and has not exited\n- Verify that the account that created the transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBefore exiting, verify that the account has participated in the delegate and is still in the delegate. Also verify that the transaction creator is the principal.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit serialized data for a trusted transaction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-15-exit-consensus-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15-exit-consensus-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.15 Exit consensus transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tExit the consensus transaction submission, save the data related to the exit consensus transaction\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save exit consensus transaction related data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tSave the transaction-related data by calling the interface after exiting the consensus transaction verification success\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-16-exit-consensus-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-exit-consensus-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.16 Exit consensus transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Exit consensus transaction data rollback\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Rollback exit consensus transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen exiting the consensus transaction submission error, you need to call this interface to roll back the data to ensure the correctness of the data.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit serialized data for a trusted transaction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-17-query-consensus-agent-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-query-consensus-agent-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.17 Query consensus agent list")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get a list of consensus agents on the local primary chain\n- Filter the list of consensus agents to get a list of consensus agents that meet the criteria\n- Consensus agent list sorting\n- Pagination\n- Return to the list of consensus agents\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getAgentList",\n "version:"1.0",\n "params":[1,10,"address","keyword","sortType","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of data per page")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("keyword")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Keyword (agent address, packed address, agent alias, agent ID)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("sortType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The sort type (deposit creates the lock amount of the consensus agent, the commissionRate commission ratio, the creditVal reward amount, the total amount of the total deposit consensus, the comprehensive sort of comprehensive)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "agentHash":"", //agent hash\n "agentAddress";"", //Create the address of the agent\n "packingAddress";"", //Packed address\n "rewardAddress";"", //Reward address\n "deposit";, //Margin\n "commissionRate";, //Commission rate\n "agentName";"", //agent name\n "agentId";"", //agent ID\n "introduction";"", //Introduction\n "time";, //Creation time\n "blockHeight";, //Block height\n "delHeight":, //Block height at which the consensus agent is deleted\n "status":, //status \n "creditVal":, //Reputation value\n "totalDeposit":, //Total amount of participation in the consensus\n "txHash":"", //Transaction hash\n "memberCount":, //Number of people joining the agent consensus\n "version": //version\n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total data volume")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("total pages")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agnet hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the agent")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Introduction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Creation time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the height of the block where the agent is trading")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Write off the height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("status")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reputation value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Transaction hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of orders")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Protocol version")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-18-query-agent-details-basic-information-credit-value-agent-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-query-agent-details-basic-information-credit-value-agent-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.18 Query agent details (basic information, credit value, agent status)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery detailed information of the specified consensus agent, including the creation time of the consensus agent, margin, commission ratio, agent address, package address, consensus status, credit value, commission amount, consensus number, etc.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Get a list of consensus agents on the local primary chain\n- Find the corresponding agent information from the list\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the details of the agent through the agent hash\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgent",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentHash":"", \n "agentAddress";"", \n "packingAddress";"", \n "rewardAddress";"", \n "deposit";, \n "commissionRate";, \n "agentName";"", \n "agentId";"", \n "introduction";"", \n "time";, \n "blockHeight";, \n "delHeight":, \n "status":, \n "creditVal":, \n "totalDeposit":, \n "txHash":"", \n "memberCount":, \n "version": \n }\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the agent")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Introduction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Creation time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the height of the block where the agent is trading")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Write off the height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("status")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reputation value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of orders")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Protocol version")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-19-query-agent-penalty-list-all-red-yellow"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-query-agent-penalty-list-all-red-yellow","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.19 Query agent penalty list (all, red, yellow)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain the penalty record (red card and yellow card penalty) obtained by the consensus agent. The user can customize the query for all penalty records or only the red card or yellow card penalty information.\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get the penalty based on the type of query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the penalty record specifying the block address\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getPunishList",\n "version:"1.0",\n "params":["address",0,"chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Penalty type 1 yellow card, 2 red card, 0 all")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "type",, \n "address","", \n "time","", \n "height",, \n "roundIndex",, \n "reasonCode","" \n },{\n ......\n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("total pages")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("byte")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Type of punishment")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("punishment time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Punish the height of the block")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("roundIndex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("round")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reasonCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reason for punishment")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-20-query-the-list-of-delegates-according-to-the-principal-according-to-the-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-query-the-list-of-delegates-according-to-the-principal-according-to-the-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.20 Query the list of delegates (according to the principal, according to the agent)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("1. Query the list of all delegation information participating in the specified \t address\n2. Query the delegation information of the specified consensus agent participating in the specified account\n3. Query the specified consensus agent trust list information\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get a list of participating consensus information on the local primary chain\n- Filter the consensus list to get the consensus list of the specified account participation or the consensus list information of the specified agent\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\tObtain the consensus list information accepted by the specified account or specified by the consensus agent. When querying all the consensus lists of the specified account, the agentHash field is passed "". When all the delegated lists of the specified agent need to be queried, the address field is passed "".\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getDepositList",\n "version:"1.0",\n "params":[1,10,"address","agentHash","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of data per page")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('The account address of the participating delegation (the entrusted information of the query agent is the designated pass "")')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('Specify the proxy agent ID (this field is passed "" when querying all account delegation information)')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "agentHash":"", \n "address";"", \n "deposit";, \n "time";, \n "blockHeight";, \n "delHeight":, \n "txHash":"", \n "status":, \n "agentName":"", \n "agentAddress":"" \n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("otal data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply to join the consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit the height of the commissioned exchange")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent status (to be agreed, consensus)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-21-query-the-consensus-status-of-the-entire-network"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-query-the-consensus-status-of-the-entire-network","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.21 Query the consensus status of the entire network")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery the overall information of the network consensus, including the number of agents, total mortgage, total number of participating consensus accounts, etc.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Get a list of network-wide consensus agents\n- Filter the list of consensus agents and wait until the list of valid consensus agents\n- Get current package round information\n- According to the current package round information, the total amount of accounts and the total amount of entrusted funds that the current network participates in the consensus\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery the number of agents in the whole network, the total commission amount, the accounts participating in the consensus, and the number of consensus agents that meet the packaging conditions.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getWholeInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentCount":, \n "totalDeposit":, \n "rewardOfDay":, \n "consensusAccountNumber":, \n "packingAgentCount": \n \t}\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of agents")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total amount of entrusted amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward amount within 24 hours")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("consensusAccountNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of accounts participating in the consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current rounded number of consensus agents")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-22-query-individual-account-consensus-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-query-individual-account-consensus-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.22 Query individual account consensus status")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Get a list of network-wide consensus nodes\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getInfo",\n "version:"1.0",\n "params":["address","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentCount":, \n "totalDeposit":, \n "joinAgentCount":, \n "usableBalance":, \n "reward":, \n "rewardOfDay":, \n "agentHash":"" \n \t}\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"错误Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Object")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus information")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The number of agents created by this account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The total commission amount of the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("joinAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The number of consensus agents participating in the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("usableBalance")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reward")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("All rewards for account participation consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus rewards obtained within 24 hours of the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hash of the agent created by the account")])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-23-verify-block-correctness"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-verify-block-correctness","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.23 Verify block correctness")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Verify the block round information, package the person, the transaction information in the block, whether the CoinBase is correct, and verify whether there is red and yellow card transaction generation.\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Verify fork (call block management module interface), generate red card trade with fork\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_validSmallBlock",\n "version:"1.0",\n "params":["SmallBlock","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smallBlock")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("SmallBlock serialization data")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-24-consensus-module-batch-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-24-consensus-module-batch-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.24 Consensus module batch verification")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Consensus module transaction batch verification, verify the correctness of each transaction, verify transaction conflict\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Cycle to verify that each transaction is correct\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("Loop to verify that each transaction in the incoming transaction list is correct and verify that there is a conflicting transaction in the transaction list\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_batchValid",\n "version:"1.0",\n "params":[["tx1","tx2","tx3"],"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1,tx2,tx3......")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t"data":[\t\t\t\t\t\t\t \n \t\t\t\t"tx1_hash",\n \t\t\t\t"tx2_hash",\n \t\t\t\t"tx3_hash"\n \t\t\t ]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Verify the list of transactions that failed")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1_hash,tx2_hash,tx3_hash.....")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Verify the hash of the transaction that failed")])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-25-get-current-round-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-get-current-round-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.25 Get current round information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the package round information of the current network consensus node, including the consensus node of the current network in the packed state, the start end time of the current round of packaging, and the basic information of all the packed nodes in the current round.\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nothing\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the current network consensus node packaging round information\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getRoundInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "totalWeight":, \n "index":, \n "startTime":, \n "endTime":, \n "memberCount":,\n "memberList":[\n {\n "agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"Weight":\n },{\n \n }\n ],\n "myMember":{\n \t"agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"weight":\n }\n \t}\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("totalWeight")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("double")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total weight (used to calculate consensus rewards)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("index")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current round subscript")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("startTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current round start packing time")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("endTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current end of packaging time")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("memberCount")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current number of packaged packages")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("myMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("MeetingMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current agent packing information")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingIndexOfRound")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The consensus agent packs the subscript in the current round")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Credit value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packStartTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent packaging start time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packEndTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent packaging end time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("weight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current consensus agent weight (total commission amount * credit value)")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-26-specify-consensus-agent-status-query"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-specify-consensus-agent-status-query","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.26 Specify consensus agent status query")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the current status of the specified consensus agent (consensus, packaged)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Query whether the agent exists\n- Query agent status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the current status of the specified consensus agent\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgentStatus",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agnet ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "status":1 \n \t}\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent status (0 consensus, 1 package)")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-27-modify-agent-packing-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-modify-agent-packing-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.27 Modify agent packing status")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen the local agent starts, notify the consensus module to package after the block management module synchronizes the block.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Modify agent packing status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Modify agent packing status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_updatePackStatus",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-28-stop-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-stop-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.28 Stop chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Pause a running chain\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Pause a running chain\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopChain",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-29-run-a-new-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-run-a-new-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.29 Run a new chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Run a new subchain locally \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Run a new subchain locally\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_runChain",\n "version:"1.0",\n "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description(待完善)")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("packing_interval")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Packing interval (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("packing_amount")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Minimum amount of the block")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("coinbase_lockHeight")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Bonus lock block number")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("redPublish_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Get red card margin lock time (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("stopAgent_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Logout agent margin lock time (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("commissionRate_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("Commission ratio minimum")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("commissionRate_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("Commission ratio maximum")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("deposit_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Create a agent margin minimum amount")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("deposit_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Create a agent margin maximum amount")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("commission_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Commissioned consensus minimum amount")])]),t._v(" "),a("tr",[a("td",[t._v("11")]),t._v(" "),a("td",[t._v("Commission_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Maximum amount of commissioned consensus")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module internal function")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Consensus module startup process")]),t._v(" "),a("p",[t._v("initialization:")]),t._v(" "),a("ul",[a("li",[t._v("Load consensus module configuration information (out of block interval, bonus lock block number)")]),t._v(" "),a("li",[t._v("Register Consensus Module Transaction, Transaction Verifier, Transaction Processor (registered with Transaction Module)")]),t._v(" "),a("li",[t._v("Register Consensus Module Service Interface (registered with the core module)")]),t._v(" "),a("li",[t._v("Register consensus module event (register with event bus module)")])]),t._v(" "),a("p",[t._v("start up:")]),t._v(" "),a("ul",[a("li",[t._v("Get the latest round of block information in the database and calculate the round information")]),t._v(" "),a("li",[t._v("Get current protocol version information and cache")]),t._v(" "),a("li",[t._v("Start each relevant thread")])])]),t._v(" "),a("li",[a("p",[t._v("Package out process")]),t._v(" "),a("ul",[a("li",[t._v("Determine if the agent meets the requirements for becoming a packed agent")]),t._v(" "),a("li",[t._v("Calculate packaging round information")]),t._v(" "),a("li",[t._v("Waiting for packing out")]),t._v(" "),a("li",[t._v("Receive the latest block. If you wait for 5 seconds and have not received the latest block, the default last block agent does not have a block, and the current agent continues to perform the packing operation.")]),t._v(" "),a("li",[t._v("Verify the transactions that need to be packaged, and eliminate the new package after the duplicate package transaction")]),t._v(" "),a("li",[t._v("Verify the packaged new block and save the relevant data to the database")]),t._v(" "),a("li",[t._v("Broadcast block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(269),alt:""}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",[n("p",[t._v("Consensus reward statistics")]),t._v(" "),n("p",[n("img",{attrs:{src:a(270),alt:""}})]),t._v(" "),n("ul",[n("li",[t._v("Get a list of local accounts")]),t._v(" "),n("li",[t._v("Get a list of blocks within 24 hours")]),t._v(" "),n("li",[t._v("Traverse block list to get CoinBase transactions")]),t._v(" "),n("li",[t._v("According to the CoinBase transaction, update the total reward amount within 24 hours, the accumulated bonus amount of the local account within 24 hours, and the reward details within 24 hours.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_4、event-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、event-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 4、Event description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-1-block-packaging-success-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-block-packaging-success-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.1 Block packaging success event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: This event is released when a new zone is successfully packaged successfully.\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_packing"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "smallBlock":"Serialize a smallBlock object into a hex string"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-2-create-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-2-create-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.2 Create agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the create agent transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_createAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //List of consensus agents created in the packaging block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-3-logout-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-3-logout-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.3 Logout agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the logout agent transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_stopAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //List of consensus agents that are logged out in the packaging block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-4-consensus-agent-state-change-in-the-consensus-out-of-the-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-4-consensus-agent-state-change-in-the-consensus-out-of-the-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.4 Consensus agent state change (in the consensus, out of the block)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event when the consensus agent status changes\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_agentStatusChage"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //The list of consensus agents for the table in the state of the packed block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-5commission-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-5commission-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.5Commission consensus")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the delegate consensus transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_deposit"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //Delegate list in the packaging block\n "deposit1", /Deposit object serialized to a hex string\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-6-exit-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-6-exit-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.6 Exit consensus")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the exit consensus transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_withdraw"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //Exit the delegation list in the packaging block\n "deposit1", //The deposit object is serialized as a hex string\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-7-yellow-card-penalty"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-7-yellow-card-penalty","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.7 Yellow card penalty")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: When there is a consensus agent to get a yellow card penalty is to issue the event\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_yellowPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "yellowPublishList":{ //Yellow card list in the packing block\n "yellowPublish1", //YellowPublish object serialized to a hex string\n "yellowPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-8-red-card-penalty"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-8-red-card-penalty","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.8 Red card penalty")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Obtain the event when there is a consensus agent to get a red card transaction\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_redPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "redPublishList":{ //Red card list in the package block\n "redPublish1", //Serializing a RedPublish object to a hex string\n "redPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nothing\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 Network communication protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"broadblock"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#broadblock","aria-hidden":"true"}},[this._v("#")]),this._v(" broadBlock")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Send a new block (SmallBlock)")]),t._v(" "),a("li",[t._v("Get blocks based on hash")]),t._v(" "),a("li",[t._v("Send a full block")]),t._v(" "),a("li",[t._v("Get multiple blocks based on height")]),t._v(" "),a("li",[t._v("Get a list of transactions based on the trade hash list")]),t._v(" "),a("li",[t._v("Send a list of transactions")]),t._v(" "),a("li",[t._v("Get SmallBlock based on hash")]),t._v(" "),a("li",[t._v("Get block hash list based on height interval")]),t._v(" "),a("li",[t._v("Get the SmallBlock list based on the height interval")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("??")]),t._v(" "),a("td",[t._v("smallBlock")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("SmallBlock object serialized hex string")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、Module configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n {\n "name": "packing_interval",\n "remark": “packaging interval”,\n "changable": "true",\n "default": "10秒"\n },\n {\n \t"name": "packing_amount",\n "remark": “minimum amount of the block”,\n "changable": "true",\n "default": "200000"\n },\n {\n \t"name": "coinbase_unlock_height",\n "remark": “Number of bonus lock blocks”,\n "changable": "true",\n "default": "100"\n },\n {\n \t"name": "redPublish_lockTime",\n "remark": “Get red card margin lock time”,\n "changable": "true",\n "default": "3 months"\n },\n {\n \t"name": "stopAgent_lockTime",\n "remark": “Logout agent margin lock time”,\n "changable": "true",\n "default": "3 days"\n },\n {\n \t"name": "commissionRate_min",\n "remark": “minimum and minimum commission ratio”,\n "changable": "true",\n "default": "10"\n },\n {\n \t"name": "commissionRate_max",\n "remark": “Maximum commission ratio”,\n "changable": "true",\n "default": "80"\n },\n {\n \t"name": "deposit_min",\n "remark": “Create the minimum margin for the agent”,\n "changable": "true",\n "default": "20000"\n },\n {\n \t"name": "deposit_max",\n "remark": “Create the maximum margin for the agent”,\n "changable": "true",\n "default": "700000"\n },\n {\n \t"name": "commission_min",\n "remark": “trust the maximum amount”,\n "changable": "true",\n "default": "2000"\n },\n {\n \t"name": "commission_max",\n "remark": “delegate the minimum amount”,\n "changable": "true",\n "default": "680000"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、java-specific-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、java-specific-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、Java-specific design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"八、to-add-on"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#八、to-add-on","aria-hidden":"true"}},[this._v("#")]),this._v(" 八、to add on")])}],s=a(0),i=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\tAs we all know, the core of the blockchain is the consensus mechanism. Unlike the traditional Internet's clipet-server architecture, the agents of the blockchain are peer-to-peer, without the center, and everyone has the same rights; so in order to make the data consistent, let a network without a center maintain a set of books that everyone agrees with. This is the role of the consensus mechanism.")]),t._v(" "),a("p",[t._v("​\tBroadly speaking, the consensus mechanism is the rule or algorithm that each agent of the blockchain adheres to, and is the basis for mutual trust. In this way, it can achieve decentralized unsupervised and maintain the normal operation of the entire platform.")]),t._v(" "),a("p",[t._v("​\tIn a narrow sense, the consensus mechanism determines the mechanism by which each agent verifies and validates transactions on the blockchain.")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("​\tEach transaction in the blockchain must be approved by each agent, and the transaction is completed only after the entire network has reached a consensus. It is like in a democratic election, the voting method or rules must be recognized by the whole people, based on which the election can be completed. In the blockchain, the main performance of the consensus mechanism is the incentive system, which is the reward for the miners. Under the guarantee of the consensus mechanism, every miner can be rewarded, and the entire blockchain can operate in an orderly manner, providing a fair, transparent and trusting environment. Therefore, the consensus module needs to provide a specific algorithm to maintain, that is, the consensus algorithm.")]),t._v(" "),a("p",[t._v("​\tThere are many public chain consensus mechanisms, and the mainstream is POW, POS, and DPOS. The NULS main network adopts the self-originated POC (Proof Of Credit) consensus mechanism, which inherits the security and high efficiency of the Dpos consensus mechanism. At the same time, it has made great improvements in collaboration, which can be regarded as an upgraded version. Dpos.")]),t._v(" "),a("p",[t._v("​\tPOC Consensus module responsibility:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("​\tThe consensus module is a relatively core piece in the system. It is mainly responsible for packing transactions, verifying block headers, managing consensus agent information in the management system, entrusting information, and penalizing information.")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Description:")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("​\tThe NULS 2.0 design concept is to provide modular services, and each module should support multiple chains of data running at the same time, so the consensus module needs to implement algorithms with different consensus mechanisms. When the consensus module is started, it can simultaneously support multiple chains to run at the same time.")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("​\tThe main network of NULS adopts the independent POC consensus mechanism. To realize POC, you first need to know the design concept and business rules of POC. The following content is taken from the introduction part of the NULS white paper POC consensus. If you are familiar, you can skip it directly.")]),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),a("p",[t._v("The above is a functional analysis of the implementation of the consensus module POC consensus mechanism. The details of each function implementation are described in the next section.")]),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("​\tThe consensus module is the core module of the blockchain. Due to the different consensus mechanisms, the services provided by the outside are not the same. The module service will describe in detail the services shared by the consensus module and the services specific to the POC mechanism.")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),a("ul",[t._m(60),t._v(" "),t._m(61),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(66),t._v(" "),a("tbody",[t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Agent")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent list")])])])]),t._v(" "),a("p",[t._v("Agent:")]),t._v(" "),t._m(71)])])])]),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),a("ul",[t._m(75),t._v(" "),t._m(76),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(81),t._v(" "),a("tbody",[t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Punish")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Penalty list data")])])])]),t._v(" "),a("p",[t._v("Punish:")]),t._v(" "),t._m(86)])])])]),t._v(" "),t._m(87),t._v(" "),a("ul",[t._m(88),t._v(" "),t._m(89),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(94),t._v(" "),a("tbody",[t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Deposit")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Json string of consensus data list")])])])]),t._v(" "),a("p",[t._v("Deposit:")]),t._v(" "),t._m(99)])])])]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),a("p",[t._v("- Check if there is a consensus node created by the account in the consensus node list\n   - Get the current network delegate list\n   - Get the list of delegates participating in the account from the delegate list\n   - Obtain commission information for the account from the delegate list of the account")]),t._v(" "),t._m(104),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),a("p",[t._v("- Verify double flower (call transaction module interface), generate double card transaction with double flower and return to verify fail directly\n   - Generate red card trades and place red card trades in the trading pool to be packaged\n   - Verify block rotation information and packager correct\n   - Verify transaction correctness in the block (call transaction module interface)\n   - Verify CoinBase transactions")]),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("- Verify that there is a conflicting transaction in the transaction list")]),t._v(" "),t._m(114),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),a("ul",[t._m(118),t._v(" "),t._m(119),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(120),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data")]),t._v(" "),a("table",[t._m(124),t._v(" "),a("tbody",[t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberList")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("MeetingMember")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current round packed agent packing information")])]),t._v(" "),t._m(130)])]),t._v(" "),a("p",[t._v("MeetingMember")]),t._v(" "),t._m(131)])])])]),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),a("p",[t._v("​\tThe POC consensus mechanism is to take the agent round out of the block that participates in the consensus, reach a consensus, and jointly maintain a set of books. However, due to network reasons or some consensus agents do evil (send different packing blocks to different agents), there will be bifurcation. For this malicious agent system, different penalties will be given according to the severity, when it is a turn When the agent fails to issue the block at the specified time, the system will give the agent a yellow card penalty. The penalty will lower the credit value of the agent. When the agent credit value drops to -1, the agent will be punished with a red card; The agent will be directly punished with a red card. The agent that receives the red card penalty will stop packing and the agent will never be able to create a consensus agent again, and the margin will be frozen for a certain period of time. The other commissioned amount of the agent will be returned to the client; When a normal block is issued, the agent will receive a block reward, and the account entrusted to the agent will also receive a corresponding proportion of the bonus according to the amount of the commission.")]),t._v(" "),a("p",[t._v("​\tIn addition to providing packaged blocks, the consensus module will also do the statistical work of bonuses, statistics on the total amount of rewards issued within 24 hours, the amount of rewards accumulated in local accounts within 24 hours, and the details of rewards within 24 hours.")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._m(148),t._m(149),t._m(150),t._v(" "),t._m(151),t._m(152),t._m(153),t._m(154),t._v(" "),t._m(155),t._m(156),t._m(157),t._m(158),t._v(" "),t._m(159),t._m(160),t._m(161),t._m(162),t._v(" "),t._m(163),t._m(164),t._m(165),t._m(166),t._v(" "),t._m(167),t._m(168),t._m(169),t._m(170),t._v(" "),t._m(171),t._m(172),t._m(173),t._m(174),t._v(" "),t._m(175),t._m(176),t._m(177),t._m(178),t._v(" "),t._m(179),t._m(180),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),a("p",[t._v("New area for broadcast packaging")]),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),t._m(187),t._v(" "),t._m(188)])},n,!1,null,null,null);i.options.__file="consensusModuleDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/47.66798c19.js b/docs/.vuepress/dist/assets/js/47.66798c19.js new file mode 100644 index 00000000..f148ea02 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/47.66798c19.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{278:function(t,e,a){t.exports=a.p+"assets/img/ledger-arch.865ff93a.png"},279:function(t,e,a){t.exports=a.p+"assets/img/ledger-functions.e4039436.png"},280:function(t,e,a){t.exports=a.p+"assets/img/ledger-service.219cab8a.png"},281:function(t,e,a){t.exports=a.p+"assets/img/eth-transaction-flow.6f3dd253.png"},282:function(t,e,a){t.exports=a.p+"assets/img/trx-validate-flow.fd3d46e4.png"},913:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"account-ledger-module-design-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#account-ledger-module-design-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Account Ledger module design document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1-overall-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Overall description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Module Overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.1 Why do you have a "Ledger module"?')])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The ledger module is the data hub of the blockchain. The balances and transactions of all accounts are saved in the ledger module.\n  A network-wide account ledger is saved on each network node to ensure complete, open and transparent data, while ensuring that data cannot be tampered and traceable.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-what-should-be-done-in-the-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-should-be-done-in-the-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 What should be done in the Ledger Module?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Provide data support for assembly transactions, mainly accounting and auditing, verify the legality of the transaction, such as: whether there is sufficient balance, whether to repeat payment (double flower)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-positioning-of-the-ledger-module-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-the-ledger-module-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.3 Positioning of the "Ledger module" in the system')])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The ledger module is the data hub, which stores the result data of all existing transactions in the system. It does not depend on any business modules, and other modules depend on it as needed.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-4-explanation-of-terms-in-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-4-explanation-of-terms-in-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.4 Explanation of terms in "Ledger module"')])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("The random number of the transaction (nonce, a 32-bit hash value)\n"),a("ul",[a("li",[t._v("nonce: A scalar value equal to the number of transactions sent at this address, which will be included in every transaction initiated by the user.")]),t._v(" "),a("li",[t._v("Each transaction in the account needs to save the nonce (hash) of the previous transaction")]),t._v(" "),a("li",[t._v("Strictly speaking, a nonce is an attribute of the originating address (it only makes sense in the context of the sending address). However, the nonce is not explicitly stored in the blockchain as part of the account status.")]),t._v(" "),a("li",[t._v("The nonce value is also used to prevent incorrect calculation of account balances. For example, suppose an account has 10 NULS balances and signs two transactions, all of which cost 6 NULS with nonce 1 and nonce 2, respectively. Which of the two transactions is valid? In a blockchain distributed system, nodes may receive transactions out of order. Nonce forces transactions of any address to be processed in order, regardless of the interval, regardless of the order in which the nodes receive. This way, all nodes will calculate the same balance. The transaction paying 6 Ethereum will be successfully processed and the account balance will be reduced to 4 ether. Whenever it is received, all nodes believe that the transaction with nonce 2 is invalid. If a node receives a nonce 2 transaction first, it will hold it, but will not verify it until it receives and processes the nonce 1 transaction.")]),t._v(" "),a("li",[t._v('Use nonce to ensure that all nodes calculate the same balance and correctly sort the transactions, which is equivalent to the mechanism used in Bitcoin to prevent "double payment". However, because Ethereum tracks account balances and does not track individual coins separately (called UTXO in Bitcoin), "double payments" occur only when the account balance is incorrectly calculated. The nonce mechanism prevents this from happening.')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The core of the Ledger is assets management and ledger management.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(278),alt:"ledger-arch.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_2-functional-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. functional design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional Architecture")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(279),alt:"ledger-functions.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Module Service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-system-service-of-the-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-system-service-of-the-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 System Service of the Ledger Module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(280),alt:"ledger-service.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The RPC interface call provided by the ledger module. For detailed interface, please refer to the interface design section.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-modifying-system-operating-parameters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-modifying-system-operating-parameters","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Modifying system operating parameters")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module internal function")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-hot-online-transaction-processing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-hot-online-transaction-processing","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 Hot (online) transaction processing")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Module internal work mainly includes asset management, obtaining account address balance and nonce, and verifying transaction coinData.")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("asset Management\n"),a("ul",[a("li",[t._v("Total assets of the account")]),t._v(" "),a("li",[t._v("Available assets")]),t._v(" "),a("li",[t._v("Freeze assets. For locked assets, separate record and locked asset information, including chain ID, asset ID, asset amount, lock time, lock height, etc.")]),t._v(" "),a("li",[t._v("In the asset unlocking process, when the user's locked asset time or height reaches the unlock condition, the account will unlock the asset information, accumulate the available balance, and delete the asset lock record of the local data.")]),t._v(" "),a("li",[t._v("Multi-asset situation, need to join chainId.")])])]),t._v(" "),a("li",[t._v("Get account address balance and nonce\n"),a("ul",[a("li",[t._v("Get account address balance")]),t._v(" "),a("li",[t._v("Get the account address nonce (the nonce is a hash value, meaning that the nonce of the first transaction is 0. Each transaction in the account will contain the nonce value of the previous transaction)")])])]),t._v(" "),a("li",[t._v("Verify the transaction\n"),a("ul",[a("li",[t._v("Double flower verification (nonce mechanism prevents double payment)")]),t._v(" "),a("li",[t._v("Transaction creator verification, verifying that the issuer of the transaction has sufficient balance to verify that the nonce of the transaction creator is legal")]),t._v(" "),a("li",[t._v("Continuous transaction verification")])])]),t._v(" "),a("li",[t._v("Function Interface Management (rpc)\n"),a("ul",[a("li",[t._v("rpc interface for use by other modules")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-cold-offline-transaction-processing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-cold-offline-transaction-processing","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 Cold (offline) transaction processing")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("A cold wallet is an unconnected wallet, also called an offline wallet. A hot wallet is a wallet that keeps online, that is, an online wallet. Cold wallets are not more secure than hot wallets.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Since the cold wallet only signs the transaction information, the signed hex string is transmitted to the server through the hot wallet, and then the server performs unified transaction processing, so the client needs to perform the offline signature function.\nThe offline transaction system maintains the storage information of the nonce. After using a nonce, the nonce is saved in the business system.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-4-ledger-flowcharts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-ledger-flowcharts","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Ledger flowcharts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-1-transfer-transaction-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-1-transfer-transaction-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.1 Transfer Transaction Process")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("User enters the address of the transfer and the transferred address and the transferred amount")]),t._v(" "),a("li",[t._v("The system signs the transfer information by the private key of the transferred address (used to prove that the transaction was actually initiated by me)")]),t._v(" "),a("li",[t._v("The system verifies the transaction information\n"),a("ul",[a("li",[t._v("Balance verification")]),t._v(" "),a("li",[t._v("Fee verification")]),t._v(" "),a("li",[t._v("nonce continuity verification")]),t._v(" "),a("li",[t._v("Signature and input account verification")])])]),t._v(" "),a("li",[t._v("Put this transaction into the local TxPool (that is, the account unconfirmed trading pool)")]),t._v(" "),a("li",[t._v("Broadcast transaction information to other nodes")]),t._v(" "),a("li",[t._v("Packing blocks, verifying blocks")]),t._v(" "),a("li",[t._v("Confirm transaction\n"),a("ul",[a("li",[t._v("Update the balance of all accounts related (transferred or transferred)")]),t._v(" "),a("li",[t._v("Update the nonce corresponding to the account asset")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-2-ordinary-transaction-process-reference-example"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-2-ordinary-transaction-process-reference-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.2 Ordinary transaction process (reference example)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(281),alt:"eth-transaction-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-3-transaction-verification-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-3-transaction-verification-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.3 Transaction verification process")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(282),alt:"trx-validate-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_3-interface-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.Interface design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-1-module-core-interaction-interface"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-module-core-interaction-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 Module core interaction interface")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-1-get-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-get-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 Get account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalance")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("remarks: 1NULS=10^8Na")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("DESC")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",[t._v("freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("freeze")])]),t._v(" "),a("tr",[a("td",[t._v("total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-2-get-the-current-account-nonce-value"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-get-the-current-account-nonce-value","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 Get the current account nonce value")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description(request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxx"')]),t._v(",\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonceType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Spending transaction hash")])]),t._v(" "),a("tr",[a("td",[t._v("nonceType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1The last transaction has been confirmed, 0 the transaction has not been confirmed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-3-get-balance-and-nonce-value"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-get-balance-and-nonce-value","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 Get balance and nonce value")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalanceNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"34"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("User available balance")])]),t._v(" "),a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("A random value of the account that holds the hash of the user's last transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-4-verify-coindata"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-verify-coindata","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.4 Verify coinData")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: validateCoinData")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-4","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("458")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"success"')]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("validateCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 check pass, 2 orphan trade 3 double flower 4 other abnormalities")])]),t._v(" "),a("tr",[a("td",[t._v("validateDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Check return description")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-5-submit-unconfirmed-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-5-submit-unconfirmed-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.5 Submit unconfirmed transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: commitUnconfirmedTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-5","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 submission passed, 0 submission failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-6-batch-verification-notify"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-6-batch-verification-notify","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.6 Batch verification notify")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: bathValidateBegin")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-6"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-6","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链Id")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-4","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1成功,0失败")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-7-receive-batch-verification-one-by-one"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-7-receive-batch-verification-one-by-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.7 Receive batch verification one by one")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: bathValidatePerTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-7"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-7","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-5","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 success, 0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-8-submit-confirmation-transactions-one-by-one"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-8-submit-confirmation-transactions-one-by-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.8 Submit confirmation transactions one by one")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: commitConfirmTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-8"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-8","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-6"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-6","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1Success,0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-9-rollback-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-9-rollback-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.9 Rollback transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: rollBackConfirmTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-9"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-9","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-7"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-7","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1Success,0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-2-other-interface"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-other-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Other interface")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-2-1-obtain-asset-information-based-on-asset-id"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-obtain-asset-information-based-on-asset-id","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2.1 Obtain asset information based on asset id")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getAsset")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-10"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-10","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The chain ID of the initiating call")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain id")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])]),t._v(" "),a("tr",[a("td",[t._v("balance.available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",[t._v("balance.freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Freeze balance")])]),t._v(" "),a("tr",[a("td",[t._v("balance.total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_4-description-of-the-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-description-of-the-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Description of the event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("does not depend on any events")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_5-agreement"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-agreement","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. agreement")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 Network Communication Protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-2-trading-agreement"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-trading-agreement","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 Trading Agreement")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_6-module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Module Configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-1-configuration-instructions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-configuration-instructions","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 Configuration Instructions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-2-module-dependencies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-module-dependencies","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 Module Dependencies")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Kernel module\n"),a("ul",[a("li",[t._v("Module registration")]),t._v(" "),a("li",[t._v("Module logout")]),t._v(" "),a("li",[t._v("Module status escalation (heartbeat)")]),t._v(" "),a("li",[t._v("Service interface data acquisition and timing update")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_7-java-specific-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-specific-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Java-specific design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Core object class definition, storing data structures, ...")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_8-supplementary-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[this._v("#")]),this._v(" 8. supplementary content")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"references-literature"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references-literature","aria-hidden":"true"}},[this._v("#")]),this._v(" References Literature")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n")])])])}],r=a(0),n=Object(r.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),t._m(54),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._m(62),t._v(" "),t._m(63),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._m(78),t._v(" "),t._m(79),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._m(86),t._v(" "),t._m(87),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._m(94),t._v(" "),t._m(95),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._m(102),t._v(" "),t._m(103),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._m(119),t._v(" "),t._m(120),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("NA")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/inoutcode/ethereum_book/blob/master/%E7%AC%AC%E4%B8%83%E7%AB%A0.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Proficient in Ethereum - Chapter 7 Transaction"),a("OutboundLink")],1)])]),t._v(" "),t._m(135)])},s,!1,null,null,null);n.options.__file="ledgerModuleDesign.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/48.2f7186f9.js b/docs/.vuepress/dist/assets/js/48.2f7186f9.js new file mode 100644 index 00000000..cfcf6e53 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/48.2f7186f9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{299:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-ctosatellite.b4831c18.png"},300:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-satellitetoc.361d3fe7.png"},301:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-context.9c43a7b6.png"},302:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-architecture.a6fa2f65.png"},303:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-functional-architecture.10e83f9b.png"},923:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"transaction-management-module-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transaction-management-module-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Transaction Management Module Design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、Overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-transaction-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-transaction-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Transaction Module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-need-transaction-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-need-transaction-management","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.1 Why need "Transaction Management"')])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-transaction-management-what-can-do"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-transaction-management-what-can-do","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.2 "Transaction Management" What can do')])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("一、Handling of ordinary transactions")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Collecting transactions")]),t._v(" "),a("li",[t._v("Local verification")]),t._v(" "),a("li",[t._v("Extract packageable transactions")]),t._v(" "),a("li",[t._v("Submit, rollback transaction")]),t._v(" "),a("li",[t._v("Save unconfirmed, packageable, and confirmed transactions")]),t._v(" "),a("li",[t._v("Provide data query for transactions")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("二、Processing cross-chain transactions")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Friend chain sends a transaction to NULS mainnet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(299),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("The friend chain node initiates a new cross-chain transaction, which is confirmed inside the friend chain. When the friend chain reaches a certain number of confirmation blocks, the friend chain node will send the cross-chain transaction to the NULS mainnet nodes. "),e("strong",[this._v("For example, the friend chain node A sends the cross-chain transaction to the NULS mainnet node S, and the node S sends the transaction to the node other than the node A in the friend chain for verification.")]),this._v(" The NULS mainnet node S will receive the verification result of multiple friend chain nodes, and then calculate the node S's own cross-chain verification result, and then broadcast it to other nodes of the NULS mainnet, so each node of the NULS mainnet will The verification result of all other nodes is received, and finally the final verification result of the NULS mainnet is calculated.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The transaction management module will receive new cross-chain transactions from the friend chain")]),this._v(" "),e("li",[this._v("Verify cross-chain transactions with other nodes in the friend chain")]),this._v(" "),e("li",[this._v("Count the verification results of each node")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"2"}},[e("li",[this._v("NULS mainnet sends a transaction to the friend chain")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(300),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Send cross-chain transactions to the target chain")]),this._v(" "),e("li",[this._v("Receiving the verification request of the target chain node, extracting the corresponding transaction and sending it back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"3"}},[e("li",[this._v("Send a transaction between the friend chain and another friend chain")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-positioning"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 Positioning")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Kernel Module")]),this._v(" "),e("li",[this._v("Network Module")]),this._v(" "),e("li",[this._v("Chain Manager Module")]),this._v(" "),e("li",[this._v("Ledger Module")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(301),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(302),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Functional implementation logic of the interface")]),this._v(" "),e("li",[this._v("Validator manager, call transaction validator as needed")]),this._v(" "),e("li",[this._v("Queue for transaction reception, asynchronous verification processing, and push consensus")]),this._v(" "),e("li",[this._v("Cache, maintain node group, chain data and other basic data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、feature-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、feature-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、Feature Design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional Architecture Diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(303),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-the-core-processes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-the-core-processes","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 The Core Processes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-transaction-management-caches-data-from-other-modules"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-transaction-management-caches-data-from-other-modules","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Transaction management caches data from other modules")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Maintain the basic data of all chains in the chain management module")]),t._v(" "),a("p",[t._v("The way to get the data is:")]),t._v(" "),a("ol",[a("li",[t._v("After the chain management is started, the chain management module interface is called")]),t._v(" "),a("li",[t._v("When a new chain completes registration, it is acquired periodically, event notification")])])]),t._v(" "),a("li",[a("p",[t._v("Maintain a collection correspondence between transaction and its validator, processor submission interface, and rollback interface with the transaction type as the key.")]),t._v(" "),a("p",[t._v("The way to get the data is:")]),t._v(" "),a("p",[t._v("After each module starts, it calls the transaction management module registration transaction interface to register itself.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-collect-new-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-collect-new-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Collect new transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Collect new transactions created by each module of this node")]),t._v(" "),a("p",[t._v("Newly created transactions for each module (including cross-chain transactions), collected via the interface "),a("a",{attrs:{href:"#232-receive-local-new-transactions"}},[t._v("newTx")]),t._v(" provided by the transaction management module, When a new transaction is received, basic verification is performed first, then placed in the local transaction queue to be verified, waiting for the verification process.")]),t._v(" "),a("p",[t._v("Note: There are also cross-chain transactions in the pending local trading queue, which is the local verification process for all transactions.")])]),t._v(" "),a("li",[a("p",[t._v("Collect cross-chain transactions broadcast by other nodes")]),t._v(" "),a("p",[t._v("Cross-chain transactions broadcast by other nodes (provided that the cross-chain transaction has been packaged to confirm a certain height in the chain in which the transaction was created), will be sent by means of network messages, first sent the transaction hash, transaction management module Once received, send a message requesting a full transaction before receiving a full cross-chain transaction. After receiving, the basic verification will also be carried out, and then placed in the cross-chain transaction queue to be verified, waiting for the verification process.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-cross-chain-transaction-detailed-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-cross-chain-transaction-detailed-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 Cross-chain transaction detailed process")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The a address in the A chain is the address of the NULS system format, Start with the A chainId")]),this._v(" "),e("li",[this._v("The b address in the B chain is the address of the NULS system format, Start with the B chainId")]),this._v(" "),e("li",[this._v("When the asset is transferred to the b address, the b address is not allowed to initiate a transaction in the A chain.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(1) Local process of cross-chain Transaction in the A chain")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",[a("li",[a("p",[t._v("The ledger module create the transfer transaction "),a("strong",[t._v("atx")]),t._v(" . If the cross-chain transaction is generated, the cross-chain module needs to be called to create the "),a("strong",[t._v("atx_trans")]),t._v(" of the NULS mainnet protocol and sign.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("According to the NULS mainnet protocol, the type, time, remark, and txData are extracted from the "),a("strong",[t._v("atx")]),t._v(" into the newly generated "),a("strong",[t._v("atx_trans")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v('Extract the CoinData data. If it is a UTXO model, calculate the actual payment amount based on the assets, input, output, and fee, and generate the NULS mainnet protocol (account balance model) "from"')]),t._v(" "),a("p",[t._v("from_total = input_utxo_total - output_utxo(not change) - fee")]),t._v(" "),a("p",[t._v('Recalculate the "to" of the NULS mainnet protocol')]),t._v(" "),a("p",[t._v("to = output_utxo(not change)")]),t._v(" "),a("p",[t._v('Note: Consider multi-address transfer. Calculate "from" to the owner of UTXO in input. If it is utxo of multiple addresses, calculate the multiple inputs and the output as the utxo owner.')]),t._v(" "),a("p",[t._v('For example: input has 3 addresses of utxo, transferred to 2 different addresses (not change),and the "from" of the three account balance models is calculated')]),t._v(" "),a("p",[t._v("from_1 = input_utxo1")]),t._v(" "),a("p",[t._v("from_2 = input_utxo2")]),t._v(" "),a("p",[t._v("from_3 = from_total - input_utxo1 - input_utxo2")]),t._v(" "),a("p",[t._v("to_1 = output(not change)_addr_1")]),t._v(" "),a("p",[t._v("to_2 = output(not change)_addr_2")]),t._v(" "),a("p",[t._v("The end result must be:from_total <= input_utxo_total、to_total = output_utxo(total except for change)。")])]),t._v(" "),a("li",[a("p",[t._v('If it is the account balance model, extract the corresponding "from" and "to", and generate CoinData of the NULS mainnet protocol.')])]),t._v(" "),a("li",[a("p",[t._v("The txData of the "),a("strong",[t._v("atx_trans")]),t._v(" transaction contains the hash of the "),a("strong",[t._v("atx")]),t._v(" transaction.")])]),t._v(" "),a("li",[a("p",[t._v("Finally, sign the "),a("strong",[t._v("atx_trans")]),t._v(" transaction and set up scriptSig")])])])]),t._v(" "),a("li",[a("p",[t._v("The "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction is sent to the transaction management module via the interface "),a("a",{attrs:{href:"#2322-receive-cross-chain-transactions-for-local-new-primary-network-protocols"}},[t._v("newCrossTx")]),t._v(" for broadcast. After the atx transfer transaction is generated in the A chain, it is sent to the transaction management module, and the basic format and legality of the transaction data are basically verified by the "),a("a",{attrs:{href:"#232-receive-local-new-transactions"}},[t._v("newTx")]),t._v(" interface, and then stored in the local transaction queue to be verified.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Receive transaction to deserialize data")])]),t._v(" "),a("li",[a("p",[t._v("Verify the basic format, legality, and integrity of Transaction data")])]),t._v(" "),a("li",[a("p",[t._v("Check the basic format, legality, and integrity of the chain and asset in coinData")])])])]),t._v(" "),a("li",[a("p",[t._v("The task that validates the transaction will take the transaction from the queue. First, the coinData is verified by the ledger module. After the verification, the corresponding transaction validator is found from the cache with the transaction type, and then the verification interface is called to verify. The verified transaction is broadcasted to other nodes in the chain through "),a("a",{attrs:{href:"#59-BroadcastTxMessage"}},[t._v("newHash")]),t._v(", and the transaction "),a("strong",[t._v("atx_trans")]),t._v(" of the mainnet protocol is broadcasted through "),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(", and will be placed in the transaction management module to be packaged in the transaction memory pool, waiting for the consensus package.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Check out the pending transaction at regular intervals")])]),t._v(" "),a("li",[a("p",[t._v("CoinData is verified by calling the account module interface")])]),t._v(" "),a("li",[a("p",[t._v("Verify the transaction by calling the validator interface of the transaction")])]),t._v(" "),a("li",[a("p",[t._v("Verify that the passed transaction is placed in the transaction memory pool to be packaged")])])])]),t._v(" "),a("li",[a("p",[t._v("When the consensus needs to be packaged, the "),a("a",{attrs:{href:"#233-get-packageable-transaction-list"}},[t._v("tx_packableTxs")]),t._v(" interface is called to obtain the packageable transaction set according to the chain id, the specified end packing time, and the maximum capacity value of the transaction data. At this time, the transaction management module obtains the transaction from the transaction memory pool to be packaged, and then performs the transaction. verification.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("First, take a transaction from the transaction memory pool to be packaged, and then perform a separate verification process (which is basically the same as step 2), and then put the corresponding collection by module.")])]),t._v(" "),a("li",[a("p",[t._v("This process is repeated until the specified end packing time or transaction maximum capacity value is reached.")])])])]),t._v(" "),a("li",[a("p",[t._v("According to the unified verifier of the ledger module, the CoinData of all transactions is verified at one time, the unverified transaction is obtained, and the unverified transaction is filtered out. and the transaction set of each module is verified according to each module unified transaction validator, and the unverified verification is obtained. The transaction then summarizes the results and then returns a packageable transaction set to the consensus module.")])]),t._v(" "),a("li",[a("p",[t._v("After the packaged block is verified, the block management module will call the "),a("a",{attrs:{href:"#234-transaction-commit"}},[t._v("tx_commit")]),t._v(" submission interface corresponding to the transaction, call the account module interface to update the balance and other book data, and finally call the save transaction interface "),a("a",{attrs:{href:"#236-save-transaction"}},[t._v("tx_save")]),t._v(", which means that the transaction is blocked. Chain confirmation.")]),t._v(" "),a("p",[t._v("PS: If a transaction is a non-cross-chain transaction, the normal transaction process is completed by this step.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(2) Cross-chain transactions enter the cross-chain process")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",{attrs:{start:"7"}},[a("li",[a("p",[t._v("The transaction management module of the A-chain node will always scan the cross-chain transactions in the blockchain. When the "),a("strong",[t._v("atx")]),t._v(" transaction is confirmed by the blockchain to confirm n heights, the A-chain node transaction management module sends a message to send the "),a("strong",[t._v("atx_trans")]),t._v(" transaction to the connected NULS mainnet nodes")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Send cross-chain transaction process")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("The A-chain node Anode1 broadcasts the hash of the "),a("strong",[t._v("atx_trans")]),t._v(" transaction to the connected NULS mainnet node through the message interface"),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(".")]),t._v(" "),a("li",[t._v("After the transaction management module obtains the transaction hash, it sends a message to acquire the complete cross-chain transaction to the A-chain node Anode1 through "),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v(".")]),t._v(" "),a("li",[t._v("The A-chain node Anode1 receives the request, and then sends the complete "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction to the main network node Mn through "),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v(", and the main network node transaction management module parses and processes the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")])])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet node transaction management module deserializes the atx_trans transaction and then performs a check.")]),t._v(" "),a("ul",[a("li",[t._v("Verify the basic format, legality, and integrity of the transaction data")]),t._v(" "),a("li",[t._v("Check the basic format, legality, and integrity of the chain and assets in coinData.")])])]),t._v(" "),a("li",[a("p",[t._v("For cross-chain verification, the NULS primary network node Mn will send "),a("strong",[t._v("atx_hash")]),t._v(" (transaction hash before protocol conversion) and "),a("strong",[t._v("atx_trans_hash")]),t._v(" (complete transaction hash after protocol conversion received by NULS mainnet) through the message interface "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" to the node except the Anode1 in the node connected to the A chain to verify the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Verification logic of node Anode2 performing verification in A chain")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("After receiving the message, the network module sends the message to the transaction management through the interface "),a("a",{attrs:{href:"#2315-verify-to-the-friend-chain-whether-the-transaction-is-confirmed"}},[t._v("verifyFc")]),t._v(". The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.")]),t._v(" "),a("li",[t._v("The atx transaction is protocol converted to generate a new "),a("strong",[t._v("Anode2_atx_trans")]),t._v(", and then the received "),a("strong",[t._v("atx_trans_hash")]),t._v(" is consistent with "),a("strong",[t._v("Anode2_atx_trans_hash")]),t._v(".")])]),t._v(" "),a("p",[t._v("After the above two verifications, the node Anode2 will send the atx_trans_hash and the acknowledgement height to the NULS mainnet node Mn through "),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v(".")]),t._v(" "),a("p",[a("strong",[t._v("Note")]),t._v(" : When the NULS mainnet node sends the cross-chain verification message "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" to the A-chain node group through the network module, the transaction management will cache the node information of successful transmission and failure. If the number of nodes successfully sent is less than S (the connection between Mn and A-chain) 51% of the number of nodes is resent to the failed node until S is not less than 51%.")])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet node Mn (consensus node) receives the message that the A chain node Anode2 verifies the transaction "),a("strong",[t._v("atx_trans")]),t._v(", and sends it to the transaction management through the transaction management "),a("a",{attrs:{href:"#2317-receive-cross-chain-verification-results"}},[t._v("verifyResult")]),t._v(" interface. The transaction management will store the verification result with the successfully sent node. After Mn receives all the verification results sent by the self, it calculates the percentage of the verification pass. If more than 51% of the nodes of all the link nodes pass the verification, the node Mn determines that the verification of the transaction atx_trans is passed, The node that failed to send is considered as failed to pass the verification.")]),t._v(" "),a("p",[t._v("Summary: The number of verification results received by the node Mn cannot be less than S. If it is less than S, the "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" is resent to the node that has not responded to the result. The ordinary node of the NULS mainnet queries any node of the A chain, and the mainnet consensus node queries all nodes of the A chain. The normal node is deemed to have passed the transaction and forwarded the transaction if it is confirmed by any three nodes.")])]),t._v(" "),a("li",[a("p",[t._v("The consensus node Mn signs the cross-chain transaction "),a("strong",[t._v("atx_trans_hash")]),t._v(" and broadcasts the hash and signature data to the NULS mainnet through the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet consensus nodes receive messages sent by all other consensus nodes, and are collected and summarized by the transaction management module interface "),a("a",{attrs:{href:"#2318-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[t._v("crossNodeRs")]),t._v(". When the signer of a transaction exceeds 80% of the total number of consensus nodes, it is determined that the cross-chain transaction passed the verification of the mainnet, put in the transaction memory pool to be packaged, and wait for the package confirmation.")])]),t._v(" "),a("li",[a("p",[t._v("When the NULS mainnet node consensus module is to be packaged, the transaction module first takes the transaction (similar to step 4) and verifies the number of signatures of the cross-chain transaction atx_trans again (PS: Since the extracted transaction set contains transactions created by the NULS mainnet, such transactions do not have the step of verifying the number of signatures). CoinData is then verified by the ledger module, and if the transaction meets the requirements, the consensus module is sent into the block.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(3) Cross-chain transactions into the process of the B chain")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",{attrs:{start:"14"}},[a("li",[a("p",[t._v("The transaction management module of the NULS mainnet node will always scan the cross-chain transactions in the blockchain. When the "),a("strong",[t._v("atx_trans")]),t._v(" transaction is found to be n heights by the blockchain, the "),a("strong",[t._v("atx_trans")]),t._v(" transaction is sent out to the connected B-chain nodes")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Send a cross-chain transaction process (similar to step 7)")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("The NULS primary network node Mn first broadcasts the hash of the atx_trans transaction to the connected B-chain node via the message "),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(".")]),t._v(" "),a("li",[t._v("The transaction hash obtained by the transaction management module is sent through the "),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v(" to obtain the message of the complete cross-chain transaction to the NULS mainnet node Mn.")]),t._v(" "),a("li",[t._v("After receiving the message, the Mn network module sends the complete "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction to Bnode1 via "),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v(". After receiving the message, Bnode1 needs to use "),a("strong",[a("em",[t._v("the cross-chain module")])]),t._v(" to process the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")])])]),t._v(" "),a("li",[a("p",[t._v("The B-node node Bnode1 transaction management module sends the "),a("strong",[t._v("atx_trans")]),t._v(" transaction hash (which has been obtained in step 14-2) through "),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v(" to the node other than Mn in the node connected to the NULS mainnet to verify the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Verification logic of node Mn2 performing verification in NULS mainnet")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("After receiving the message, the network module sends the message to the transaction management through the interface "),a("a",{attrs:{href:"#2316-verify-to-the-mainnet-whether-the-transaction-is-confirmed"}},[t._v("verifyMn")]),t._v(". The transaction management module first queries the corresponding "),a("strong",[t._v("atx")]),t._v(" transaction from the database through "),a("strong",[t._v("atx_hash")]),t._v(", and verifies that the block in which the transaction is located has been confirmed to be n block heights.")])]),t._v(" "),a("p",[t._v("After verification, node Mn2 will send the atx_trans_hash and the acknowledgement height to the B-chain node Bnode1 via "),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("When the B-chain node sends the cross-chain verification message "),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v(" to the NULS mainnet node group through the network module, the transaction management will cache the node information of the successful transmission and the failure. If the number of successfully sent nodes is smaller than S (S is 51% of the number of nodes connected to the NULS mainnet by Node Bnode1), the information is resent to the failed node. Until S is not less than 51%.")])]),t._v(" "),a("li",[a("p",[t._v("(Similar to step 10) The B-chain node Bnode1 receives the message that the mainnet node Mn verifies the transaction "),a("strong",[t._v("atx_trans")]),t._v(", and sends it to the transaction management through the transaction management "),a("a",{attrs:{href:"#2317-receive-cross-chain-verification-results"}},[t._v("verifyResult")]),t._v(" interface, Transaction management caches the verification results against the successful nodes that were sent. After receiving all the verification results sent by the self, Bnode1 calculates the percentage of the verification pass. If more than 51% of the nodes pass the verification, the node Bnode1 determines that the verification of the transaction atx_trans is passed (The node that failed to send is considered as not passing).")])]),t._v(" "),a("li",[a("p",[t._v("After the verification is passed, the transaction management module calls "),a("strong",[t._v("the cross-chain module")]),t._v(" to convert the "),a("strong",[t._v("atx_trans")]),t._v(" transaction through the protocol to generate the B-chain protocol transaction "),a("strong",[t._v("btx")]),t._v(" and broadcast it to the B-chain network through the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(". If the Bnode1 node is the B-chain nearest x-block outperger (POW needs Adaptation), the transaction needs to be signed and broadcast to the B-chain network via the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("The B-chain node receives the messages sent by other nodes, collects and summarizes the transaction management module interface "),a("a",{attrs:{href:"#2318-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[t._v("crossNodeRs")]),t._v(", and counts the signature of the transaction. When the signer reaches 80% of the latest 20 blockers, the transaction is verified and placed. Enter the packaged transaction memory pool and wait for the package confirmation (The packager also confirms the transaction and the packaged transaction contains all signatures).")])]),t._v(" "),a("li",[a("p",[t._v("(Similar to step 13)When the B-chain node consensus module is packaged, the transaction module first takes out the transaction consistently, verifies the signature number of the transaction btx again, and then verifies the CoinData through the account book module. If the requirements are met, the transaction transmission consensus module is packaged into the block.")])]),t._v(" "),a("li",[a("p",[t._v("When the new block verification is finalized, the entire cross-chain transaction process is completed.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module Service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-registration-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-registration-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 Registration transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description")]),t._v(" "),a("p",[t._v("The transaction type of each module, the corresponding transaction validator and the processor interface are cached.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the NULS mainnet is started, each module needs to register its transaction type, validator and other information with the transaction management module. The transaction management module will cache each transaction and the corresponding validator and processor interface. When a new transaction needs to be verified by the validator, the transaction management module will take out the corresponding validator interface name and call the validator interface for verification.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_register")])]),t._v(" "),a("p",[t._v("Interface description:The registration transaction needs to pass the transaction type, the verifier name, and the processor name to return whether the registration is successful.")])]),t._v(" "),a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_register"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleCode"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleValidateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"validateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commitCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rollbackCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"systemTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unlockTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifySignature"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"validateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commitCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rollbackCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"systemTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unlockTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifySignature"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Module code")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Module unified verifier interface name")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Array")]),t._v(" "),a("td",[t._v("Module transaction registration information list")])])])])]),t._v(" "),a("li",[a("p",[t._v("Object of the module transaction registration information list")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction Type")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Single transaction validator interface name")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor submit interface name")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor rollback interface name")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\t\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Return")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"_2-3-1-1-transaction-validator-processor-interface-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-1-transaction-validator-processor-interface-specification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1.1 Transaction validator, processor interface specification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[a("strong",[t._v("Module unified transaction verifier interface specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chianId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chianId")]),t._v(" "),a("td",[t._v("Chian Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Verify the failed transaction list")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("jsonArray")]),t._v(" "),a("td",[t._v("Verify the failed transaction serialization data array")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction validator interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chainId")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Verify the failed transaction list")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Verification passed return true")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction processor commit interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Commit successfully returns true, failure returns error message")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n\t"code":0,\n "result":{\n "value":true\n\t}\n}\n')])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Commit successfully returns true")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction processor rollback interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Rollback successfully returns true, failure returns error message")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Rollback successfully returns true")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-receive-local-new-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-receive-local-new-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 Receive local new transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Collect newly created transactions from other modules of this node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When other modules in a node have new transactions, you need to call this interface for unified collection and processing. The transaction management module will place the new transaction in the unconfirmed queue and wait for the transaction thread to process it.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Basic verification of transactions, removal of duplicate transactions, illegally discarding")])]),t._v(" "),a("li",[a("p",[t._v("Put in pending verification local transation queue")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newTx")])]),t._v(" "),a("p",[t._v("Interface description:Receive a new transaction serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-3-get-packageable-transaction-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-get-packageable-transaction-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 Get packageable transaction list")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Extract a packaged transaction list based on the packaging end time and transactions total size")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the node needs to be packaged, the packaged transaction is obtained according to the chain id, the specified end packing time and transactions total size. The transaction management module will take out the corresponding transaction set from the transaction memory pool to be packaged, and then verify the coinData of all transactions in the collection from the account module at one time, filter out the unverified transaction, obtain the verified collection, and then unify through each module. The transaction validator verifies the transaction set of the respective module and then summarizes the results back to the packageable transaction list.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_packableTxs")])]),t._v(" "),a("p",[t._v("Interface description:Return a packaged transaction list")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_packableTxs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"endtimestamp"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"maxTxDataSize"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("End packaging timestamp")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transactions total size")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("Transaction")]),t._v(" "),a("td",[t._v("Transaction list")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-4-transaction-commit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-transaction-commit","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 Transaction commit")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Execute the transaction processor commit")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The transaction commit interface is invoked when the transaction is packaged into a block and the block validation passes")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_commit")])]),t._v(" "),a("p",[t._v("Interface description:Call the transaction handler commit interface")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_commit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-5-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 Transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Execute transaction processor rollback")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The transaction rollback interface is invoked when the transaction is packaged into a block and the block verification fails, or the block is rolled back and the transaction is not a cross-chain transaction.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_rollback")])]),t._v(" "),a("p",[t._v("Interface description:Call the transaction handler rollback interface")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_rollback"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-6-save-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-save-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 Save transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Save the transaction in the new block that was verified to the database")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the block management saves the block, the transaction is sent to the transaction management module for saving.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_save")])])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_save"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-7-get-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-get-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 Get transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Get the transaction that have been packaged into the block from the database")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTx")])]),t._v(" "),a("p",[t._v("Interface description:return transaction serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tx"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("tx")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-8-delete-saved-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-delete-saved-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 Delete saved transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Delete transactions that have been packaged into blocks from the database, block rollback, etc.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_delete")])]),t._v(" "),a("p",[t._v("Interface description:return execution result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_delete"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-9-verify-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-verify-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.9 Verify transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Local validation of transactions (including cross-chain transactions), including calling the validator, verifying the coinData. Cross-chain verification of cross-chain transactions is not included.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_verify")])]),t._v(" "),a("p",[t._v("Interface description:return execution result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_verify"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-10-receive-new-transaction-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-receive-new-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.10 Receive new transaction hash")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive a message of a new transaction hash broadcast by other nodes in the chain")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("newHash")]),t._v(" Receive new transaction hash message")]),t._v(" "),a("p",[t._v("Interface description:Receive transaction hash serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-11-receive-new-cross-chain-transaction-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-receive-new-cross-chain-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.11 Receive new cross-chain transaction hash")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive messages for new cross-chain transaction hashes sent by other chains")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When a cross-chain transaction has been confirmed to a certain height within the chain, it will be sent by the transaction module to the target chain (NULS mainnet or the friend chain), and the target chain will receive the transaction for verification. The hash of the transaction is sent first before the transaction is sent, and the interface will receive the hash.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossHash")]),t._v(" Receive new cross transaction hash")]),t._v(" "),a("p",[t._v("Interface description:Receive a new transaction hash hex")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newCrossHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashhex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-12-receive-a-new-cross-chain-transaction-for-the-friend-chain-(deprecated)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-12-receive-a-new-cross-chain-transaction-for-the-friend-chain-(deprecated)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("s",[this._v("2.3.12 Receive a new cross-chain transaction for the friend chain")]),this._v(" (Deprecated)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Processing message for new cross-chain transactions sent from other chains to the NULS mainnet")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the NULS mainnet node receives the cross-chain transaction hash of other chain broadcasts, it will request the complete transaction from the sent hash node. At this time, the node will send the complete transaction and the original hash to the NULS mainnet node.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newFcTx")]),t._v(" Receive new cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Receive a new full cross-chain transaction, and the original hash of the transaction (The hash value of the transaction before the conversion of the friend chain agreement).")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newFcTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Original transaction hash,and transaction serialization data of NULS mainnet protocol after protocol conversion")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-13-receive-a-new-complete-cross-chain-transaction-on-the-mainnet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-13-receive-a-new-complete-cross-chain-transaction-on-the-mainnet","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.13 Receive a new complete cross-chain transaction on the mainnet")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Processing message for new cross-chain transactions sent from the NULS mainnet to the friend chain")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the friend chain node receives the cross-chain transaction hash broadcast by the NULS mainnet, it will request a complete transaction from the sent hash node, and the node will send the complete transaction partner chain node.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newMnTx")]),t._v(" Receive new mainnet cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Transaction serialization data hex")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newMnTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-14-ask-for-a-complete-cross-chain-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-14-ask-for-a-complete-cross-chain-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.14 Ask for a complete cross-chain transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Take a complete cross-chain transaction with a certain height confirmed according to the transaction hash, and then send it back by message.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("NULS mainnet has new cross-chain transactions sent to the target chain (or the ordinary chain has a cross-chain transaction sent to the NULS mainnet), the hash is sent to the target chain first, and the target chain node requests a complete transaction from the NULS mainnet according to the hash, and the interface processes the message.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("askCrossTx")]),t._v(" send cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Receiving the transaction hash sent by the network node")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"askCrossTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-15-verify-to-the-friend-chain-whether-the-transaction-is-confirmed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-15-verify-to-the-friend-chain-whether-the-transaction-is-confirmed","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.15 Verify to the friend chain whether the transaction is confirmed")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("The friend chain node receives the message of the cross-chain verification request of the NULS mainnet node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The NULS mainnet node newly receives the cross-chain transaction, and will verify the transaction to the friend chain (nodes other than the sender) that sent the transaction, and the message to be sent will be processed by the interface.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyFc")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Receive cross-chain transaction hash and original hash of the transaction, return confirmation result through network message")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyFc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("[txOriginalHash] Raw transaction hash (before protocol conversion) , [txCrossHash] Cross-chain transaction hash (after protocol conversion)")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-16-verify-to-the-mainnet-whether-the-transaction-is-confirmed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-16-verify-to-the-mainnet-whether-the-transaction-is-confirmed","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.16 Verify to the mainnet whether the transaction is confirmed")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("The NULS mainnet node receives the message of the cross-chain verification request of the friend chain node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The friend chain node newly receives the cross-chain transaction, and will verify the transaction to the NULS mainnet node (node other than the sender) that sent the transaction, and the message to be sent during the verification is processed by the interface.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyMn")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive cross-chain transaction hash, return confirmation result via network message")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyMn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-17-receive-cross-chain-verification-results"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-17-receive-cross-chain-verification-results","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.17 Receive cross-chain verification results")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Process messages that receive cross - chain transaction validation result")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The NULS mainnet verifies cross - chain transactions to other chain nodes, which send verification results")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyResult")]),t._v(" cross result")])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive cross-chain transaction verification results")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyResult"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash and confirmation of highly serialized data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-18-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-18-receive-in-chain-node-verification-results-for-cross-chain-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.18 Receive in-chain node verification results for cross-chain transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive in-chain node verification results for cross-chain transactions and statistics.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The node performs cross-chain verification on a cross-chain transaction, and obtains the cross-chain verification result of the node for the transaction. The node broadcasts the result to other nodes of the chain, and the other node will invoke the interface after receiving the message.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("crossNodeRs")]),t._v(" cross tx node result")])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive sender's signature, cross-chain transaction hash, node verification result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"crossNodeRs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeRsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Sender's signature, cross-chain transaction hash, node verification result Serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-19-view-transaction-pool-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-19-view-transaction-pool-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.19 View transaction pool information")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("View data in the transaction memory pool")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxsInfo")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Statistics transaction memory pool data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTxsInfo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localTxCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"crossChainTxCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pushingCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("localTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of local transactions")])]),t._v(" "),a("tr",[a("td",[t._v("crossChainTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of cross-chain transactions")])]),t._v(" "),a("tr",[a("td",[t._v("pushingCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of transactions to be packaged")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-20-get-transaction-registration-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-20-get-transaction-registration-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.20 Get transaction registration information")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Returns the relationship list of the transaction and its corresponding commit processor and rollback processor")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxProcessors")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:return "),a("code",[t._v("Map>")]),t._v(" jsonObject")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_getTxProcessors",\n "minVersion": "1.0",\n "params": ["txType"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction type (Fill in NULL to return all types)")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "2":["commitCmd","rollbackCmd"],\n "3":["commitCmd","rollbackCmd"],\n "4":["commitCmd","rollbackCmd"]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Commit interface name")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Rollback interface name")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-21-query-transaction-records"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-21-query-transaction-records","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.21 Query transaction records")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function description:")]),this._v(" "),e("p",[this._v("Query the transaction list based on conditions such as account, chain, asset, and paging information.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("method: "),e("code",[this._v("tx_getTxs")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface description:return "),e("code",[this._v("Page")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Requset")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "tx_getTxs",\n "minVersion": "1.0",\n "params": [\n \t"ChainId",\n \t"assetId",\n \t"type",\n \t"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",\n \t"pageSize",\n \t"pageNumber"\n ]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("AssetId")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction type (Fill in NULL to return all types)")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Address")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Page size")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Page number")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Response")]),this._v(" "),e("p",[this._v("Success")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "pageNumber": 1,\n "pageSize": 10,\n "total": 31,\n "pages": 4,\n "list": []\n }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("parameter")]),this._v(" "),e("th",[this._v("type")]),this._v(" "),e("th",[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pageNumber")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pageSize")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Page size")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("total")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Total number of records")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pages")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Total page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-22-receive-cross-chain-transactions-for-local-new-primary-network-protocols"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-22-receive-cross-chain-transactions-for-local-new-primary-network-protocols","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.22 Receive cross-chain transactions for local new primary network protocols")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Collect a complete transaction for the new NULS mainnet protocol for broadcast")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossTx")])])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "newCrossTx",\n "minVersion": "1.0",\n "params": ["chainId", "txHex"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \tvalue:true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-23-run-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-23-run-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.23 Run chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Run a new subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_runChain")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:run a new subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_runChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-24-stop-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-stop-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.24 Stop chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Stop a running subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_stopChain")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Stop a running subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_stopChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、event-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、event-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、Event description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Chain registration event")]),this._v(" "),e("p",[this._v("Chain information interface for sending verification tx coinData")])]),this._v(" "),e("li",[e("p",[this._v("Chain logout event")]),this._v(" "),e("p",[this._v("Confirmation for terminating the chain transaction")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、network-message-body-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、network-message-body-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、Network message body protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-broadcastcrosstxhashmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-broadcastcrosstxhashmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 BroadcastCrossTxHashMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Broadcast new cross-chain trading hash")])]),this._v(" "),e("li",[e("p",[this._v("Message description:Messages sent when a cross-chain transaction needs to be broadcast to nodes of other nodes or other chains after the chain is confirmed")])]),this._v(" "),e("li",[e("p",[this._v("cmd:newCrossHash")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Hash array")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message processing")]),this._v(" "),e("ul",[e("li",[this._v("Upon receipt of this message, newCrossHash will send askCrossTxMessage to get the complete cross-chain transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-2-receivecrosstxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-receivecrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 ReceiveCrossTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Requesting a complete cross-chain transaction message, for example, the NULS mainnet receives a new cross-chain transaction hash of the friend chain, and the mainnet node will obtain a complete transaction from the friend chain node.")]),this._v(" "),e("li",[this._v("cmd:askCrossTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The message is processed by askCrossTx and will send a SendcrossTxMessage/SendHashcrossTxMessage message to deliver the complete transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-3-sendhashcrosstxmessage-(deprecated)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-sendhashcrosstxmessage-(deprecated)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("s",[this._v("5.3 SendHashCrossTxMessage")]),this._v(" (Deprecated)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The friend chain sends the complete cross-chain transaction converted by the protocol to the NULS mainnet, and the original transaction hash")]),this._v(" "),e("li",[this._v("cmd:newFcTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("originalHash友链原始交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("newFcTx will process the transaction after receiving the message, and then cross-chain verification through the message")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-4-verifycrosswithfcmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-4-verifycrosswithfcmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.4 VerifyCrossWithFCMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Transmit the transaction hash before the protocol conversion, the transaction hash after the protocol conversion, and verify the cross-chain transaction to the friend chain node.")]),this._v(" "),e("li",[this._v("cmd:verifyFc")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Transaction hash after converting NULS mainnet protocol")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Original hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Friends chain original transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyFc processes the message, validates the result and sends it back via VerifyCrossResultMessage")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-5-verifycrossresultmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-5-verifycrossresultmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.5 VerifyCrossResultMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:After the node receives the cross-chain verification request, it sends the verification result back.")]),this._v(" "),e("li",[this._v("cmd:verifyResult")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("hight")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Confirm height")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyResult calculates the result of its own node after receiving the cross-chain verification result")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-6-sendcrosstxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-6-sendcrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.6 SendCrossTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Send a message for a complete cross-chain transaction")]),this._v(" "),e("li",[this._v("cmd:newMnTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("newMnTx will perform a series of verifications after receiving the transaction. If the node that is not the transaction origin chain receives the transaction, it will perform cross-chain verification.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-7-verifycrosswithmainmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-7-verifycrosswithmainmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.7 VerifyCrossWithMainMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The friend chain node sends the cross-chain transaction hash after the protocol conversion, and verifies the cross-chain transaction to the mainnet node.")]),this._v(" "),e("li",[this._v("cmd:verifyMn")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Converted cross-chain transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyMn processes the message to verify that the transaction is confirmed in the NULS mainnet and sends the result back via the VerifyCrossResultMessage message.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-8-broadcastcrossnodersmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-8-broadcastcrossnodersmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.8 BroadcastCrossNodeRsMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Broadcast the verification result of this node for a cross-chain transaction to other nodes in the chain")]),this._v(" "),e("li",[this._v("cmd:crossNodeRs")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("Signature")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("The verified node's signature on the transaction")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("result")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Validation result")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The crossNodeRs receives the message, counts the results of all other nodes, and finally calculates the verification result of the transaction for the transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-9-broadcasttxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-9-broadcasttxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.9 BroadcastTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The transaction created by this node broadcasts the hash to other nodes after the local authentication is completed.")]),this._v(" "),e("li",[this._v("cmd:newHash")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Hash array")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The newHash interface processes the message and sends the full transaction back.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-10-sendtxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-10-sendtxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.10 SendTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Send the transaction to other nodes in the chain")]),this._v(" "),e("li",[this._v("cmd:newTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("Enter a new transaction process")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、module-configuration-item"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、module-configuration-item","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、Module configuration item")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("[tx-manager]\nbootstrap=io.module.TxManagerModuleBootstrap\n")])])])}],n=a(0),r=Object(n.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\tIn the NULS 2.0 ecosystem, transactions are traded within the blockchain or between chains and chains. The nodes of each chain not only deal with transactions within the chain, but also deal with cross-chain transactions. So each node needs to process more and more transactions, and more complex, so we need a single but separate module to handle various transactions. And from the architectural design of NULS 2.0, we need a separate module to collecting transactions, verification, storage and forwarding of transactions. For all transactions, these functions are shared and unified,so we designed the transaction management as a separate module.")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("The core work of transaction management has the following two points:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("The transaction management module needs to perform cross-chain verification on cross-chain transactions, while cross-chain verification involves interaction between different nodes in different chains. There are mainly three types of cross-chain transactions that need to be processed.")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("The NULS main-net node initiates a new cross-chain transaction. When a certain number of confirmation blocks is reached in the NULS mainnet, the transaction management module will take out the cross-chain transaction and send it to the target chain. For example, the NULS mainnet node S sends the transaction to the target chain node A, and the target chain node A will send the transaction to the NULS mainnet except the node S for verification. After the A node obtains the results of multiple NULS mainnet nodes, it calculates the final cross-chain verification result of the A node and broadcasts it to the target chain. The nodes of the target chain will receive the results of all other nodes, and then calculate the final verification result of the target chain.")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("Since the transaction protocol between the friends chain may be incompatible, the transaction between them needs to be transferred by the NULS mainnet. The process of sending a friend chain to another friend chain is actually to complete the transaction of the friend chain to the NULS mainnet, and the NULS mainnet sends the transaction to the friend chain. The transaction management module plays the same role.")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("Transaction management controls the verification and circulation of all transactions throughout the system.")]),t._v(" "),a("p",[t._v("The following modules need to be used during normal operation.")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("The module is divided into three parts: interface, implementation layer, local storage")]),t._v(" "),a("p",[t._v("The implementation layer contains 4 parts:")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("The basic data of other modules needs to be obtained when the module starts")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),a("p",[t._v("For example: initiate a transaction atx from the a address of the A chain, and transfer aCoin to the B chain b address (A --\x3e NULS mainnet --\x3e B)")]),t._v(" "),t._m(31),t._v(" "),a("p",[t._v("That is: other chain addresses cannot initiate transactions in this chain.")]),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),a("ul",[t._m(82),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[t._m(88),t._v(" "),a("tbody",[t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("Page"),a("Transaction")],1),t._v(" "),a("td",[t._v("Records")])])])])])])])]),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),a("p",[t._v("​\tnothing")]),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),t._m(119),t._v(" "),t._m(120),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145)])},s,!1,null,null,null);r.options.__file="transactionModuleDesign.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/49.eeb6792f.js b/docs/.vuepress/dist/assets/js/49.eeb6792f.js new file mode 100644 index 00000000..ab5b7275 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/49.eeb6792f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{344:function(e,a,t){e.exports=t.p+"assets/img/20190327142342.5789d3b1.png"},345:function(e,a,t){e.exports=t.p+"assets/img/20190327143435.6f71ae15.png"},346:function(e,a,t){e.exports=t.p+"assets/img/20190327144549.1cbb469e.png"},347:function(e,a,t){e.exports=t.p+"assets/img/20190327150757.e698a658.png"},348:function(e,a,t){e.exports=t.p+"assets/img/20190327223858.aec0a9b8.png"},937:function(e,a,t){"use strict";t.r(a);var s=[function(){var e=this,a=e.$createElement,s=e._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[e._v("#")]),e._v(" Quick Start")]),e._v(" "),s("h2",{attrs:{id:"install-jdk11"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-jdk11","aria-hidden":"true"}},[e._v("#")]),e._v(" Install JDK11")]),e._v(" "),s("p",[e._v("Download JDK11 to the server and extract it.")]),e._v(" "),s("h3",{attrs:{id:"_1-download-jdk11"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-jdk11","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 download jdk11")]),e._v(" "),s("p",[e._v("Jdk11 download address: [jdk11 download] (https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html)")]),e._v(" "),s("h3",{attrs:{id:"_2-upload-to-the-server-and-extract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-upload-to-the-server-and-extract","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 upload to the server and extract")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz\n")])])]),s("p",[s("img",{attrs:{src:t(344),alt:"20190327142342"}})]),e._v(" "),s("h3",{attrs:{id:"_3-configuration-environment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-configuration-environment","aria-hidden":"true"}},[e._v("#")]),e._v(" 3 configuration environment")]),e._v(" "),s("p",[s("strong",[e._v("vi /ect/profile")])]),e._v(" "),s("p",[e._v("Copy the following code to the file")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("JAVA_HOME=/home/nuls2/jdk-11.0.2\nPATH=$PATH:$JAVA_HOME/bin\nCLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar\nExport JAVA_HOME PATH CLASSPATH\n")])])]),s("p",[s("strong",[e._v("ps")]),e._v(": /home/nuls2/jdk-11.0.2 is the path after jdk is pressurized, please configure according to your actual path.")]),e._v(" "),s("p",[s("strong",[e._v("source /ect/profile")]),e._v(" The configuration of this command takes effect.")]),e._v(" "),s("p",[e._v("View the jdk version via java -version:")]),e._v(" "),s("p",[s("img",{attrs:{src:t(345),alt:"20190327143435"}})]),e._v(" "),s("h2",{attrs:{id:"download-and-install-the-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#download-and-install-the-wallet","aria-hidden":"true"}},[e._v("#")]),e._v(" Download and install the wallet")]),e._v(" "),s("h3",{attrs:{id:"_1-download-nuls-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-nuls-wallet","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 download NULS wallet")]),e._v(" "),s("p",[e._v("Go to GitHub and download the latest version of the NULS2.0 Alpha1 wallet: [download address] (https://github.com/nuls-io/nuls_2.0/releases)")]),e._v(" "),s("h3",{attrs:{id:"_2-upload-to-the-server-and-extract-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-upload-to-the-server-and-extract-2","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 upload to the server and extract")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Tar -zxvf NULS-Walltet-linux64-alpha1.tar.gz\n")])])]),s("p",[s("img",{attrs:{src:t(346),alt:"20190327144549"}})]),e._v(" "),s("h2",{attrs:{id:"enter-the-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#enter-the-cli","aria-hidden":"true"}},[e._v("#")]),e._v(" Enter the CLI")]),e._v(" "),s("h3",{attrs:{id:"_1-start-the-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-start-the-wallet","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 start the wallet")]),e._v(" "),s("p",[e._v("After the wallet is decompressed, go to the start.sh file directory: /home/nuls2/NULS-Walltet-linux64-alpha1/bin")]),e._v(" "),s("p",[s("img",{attrs:{src:t(347),alt:"20190327150757"}})]),e._v(" "),s("p",[e._v("Execute the command: "),s("strong",[e._v("./start.sh -D")])]),e._v(" "),s("h3",{attrs:{id:"_2-enter-the-command-line"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-enter-the-command-line","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 enter the command line")]),e._v(" "),s("p",[e._v("After the wallet is started, execute cmd.sh (./cmd.sh) in the same directory to enter the wallet command line. The NULS command prompts the prompt: "),s("code",[e._v("nuls>gt;>")]),e._v(", enter the NULS wallet operation command, and operate .")]),e._v(" "),s("p",[s("img",{attrs:{src:t(348),alt:"20190327223858"}})]),e._v(" "),s("h2",{attrs:{id:"part-of-instructions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#part-of-instructions","aria-hidden":"true"}},[e._v("#")]),e._v(" Part of Instructions")]),e._v(" "),s("h3",{attrs:{id:"_1-create-an-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-create-an-account","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 create an account")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("create")]),e._v(" [Number]")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Number: The number of account addresses created. The default is 1 and the maximum is 100.\n")])])]),s("h3",{attrs:{id:"_2-backup-keystore"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-backup-keystore","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 Backup keystore")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("backup")]),e._v("
[Path]")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Account address to be backed up (required)\nPath: The directory where the backup file is generated. The default is the current directory (optional)\n")])])]),s("h3",{attrs:{id:"_3-get-the-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-get-the-private-key","aria-hidden":"true"}},[e._v("#")]),e._v(" 3 Get the private key")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("getprikey")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Account address for obtaining the private key (required)\n")])])]),s("h3",{attrs:{id:"_4-remove-the-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-remove-the-account","aria-hidden":"true"}},[e._v("#")]),e._v(" 4 remove the account")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("remove")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: address to be removed (required)\n")])])]),s("h3",{attrs:{id:"_5-modify-the-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-modify-the-account-password","aria-hidden":"true"}},[e._v("#")]),e._v(" 5 modify the account password")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("resetpwd")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Account address to change the password (required)\n")])])]),s("h3",{attrs:{id:"_6-transfer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-transfer","aria-hidden":"true"}},[e._v("#")]),e._v(" 6 Transfer")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("transfer")]),e._v(" [Remark]")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("FormAddress/FormAlias: Transfer the address or export the alias, choose one (required)\nToAddress/ToAlias: Receive address or receive alias, choose one (required)\n")])])]),s("h3",{attrs:{id:"_7-create-a-consensus-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-create-a-consensus-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 7 create a consensus node")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("createagent")]),e._v(" [RewardAddress]")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("AgentAddress: Consensus node creation address (required)\nPackingAddress: The address of the consensus node is packed. The password must be the same as the configuration file. The default is: nuls123456 (required)\nCommissionRate: commission ratio, range: 10-100, maximum decimal place 2 digits (required) Deposit: margin, range: 20000-200000, maximum decimal place 8 digits (required) RewardAddress: reward address, default is node creation address ( Optional)\n")])])]),s("p",[s("strong",[e._v("ps")]),e._v(": Save the hash of the consensus node (or query in ["),s("strong",[e._v("Browser")]),e._v("] (http://alpha.nulscan.io)), join the consensus and query consensus node information needs to be used; Ensure that the consensus node creates an address and a packaged address in one wallet, and one wallet cannot create two consensus nodes at the same time.")]),e._v(" "),s("h3",{attrs:{id:"_8-join-the-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_8-join-the-consensus","aria-hidden":"true"}},[e._v("#")]),e._v(" 8 join the consensus")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("deposit")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Account address to join the consensus (required)\nAgentHash: Create a hash of the consensus node (required)\nDeposit: Join the consensus deposit, 2000-500000, up to 8 decimal places (required)\n")])])]),s("p",[s("strong",[e._v("ps")]),e._v(": Save the consensus hash, you need to use the exit consensus")]),e._v(" "),s("h3",{attrs:{id:"_9-exit-the-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_9-exit-the-consensus","aria-hidden":"true"}},[e._v("#")]),e._v(" 9 Exit the consensus")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("withdraw")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Exit consensus address (required)\nTxHash: transaction hash at the time of delegation (required)\n")])])]),s("h3",{attrs:{id:"_10-stop-consensus-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_10-stop-consensus-node","aria-hidden":"true"}},[e._v("#")]),e._v(" 10 stop consensus node")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("stopagent")]),e._v("
")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("Address: Consensus node creation address (required)\n")])])]),s("h3",{attrs:{id:"_11-query-consensus-node-information"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_11-query-consensus-node-information","aria-hidden":"true"}},[e._v("#")]),e._v(" 11 query consensus node information")]),e._v(" "),s("p",[e._v("Command: "),s("strong",[e._v("getagent")]),e._v("")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("AgentHash: Consensus node creates hash (required)\n")])])])])}],r=t(0),n=Object(r.a)({},function(){this.$createElement;this._self._c;return this._m(0)},s,!1,null,null,null);n.options.__file="quickStart.md";a.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/5.54beffe8.js b/docs/.vuepress/dist/assets/js/5.54beffe8.js new file mode 100644 index 00000000..50198a3a --- /dev/null +++ b/docs/.vuepress/dist/assets/js/5.54beffe8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{447:function(e,a,c){e.exports=c.p+"assets/img/deploy1.0620b80d.jpg"},448:function(e,a,c){e.exports=c.p+"assets/img/deploy2.c581a6ad.jpg"},449:function(e,a,c){e.exports=c.p+"assets/img/deploy3.f8cde6aa.jpg"},450:function(e,a,c){e.exports=c.p+"assets/img/deploy4.e0509949.jpg"},451:function(e,a,c){e.exports=c.p+"assets/img/deploy6.d41305b3.jpg"},452:function(e,a,c){e.exports=c.p+"assets/img/access1.e55b0e87.jpg"},453:function(e,a,c){e.exports=c.p+"assets/img/access2.142e5288.jpg"},454:function(e,a,c){e.exports=c.p+"assets/img/access3.473cdd05.jpg"},455:function(e,a,c){e.exports=c.p+"assets/img/access4.ec334fa4.jpg"},456:function(e,a,c){e.exports=c.p+"assets/img/access5.2eda257e.jpg"},457:function(e,a,c){e.exports=c.p+"assets/img/access6.f24bf883.jpg"},458:function(e,a,c){e.exports=c.p+"assets/img/access7.d4ad0113.jpg"},459:function(e,a,c){e.exports=c.p+"assets/img/myContract1.9dd9d99f.jpg"},460:function(e,a,c){e.exports=c.p+"assets/img/myContract2.01d9687b.jpg"},461:function(e,a,c){e.exports=c.p+"assets/img/myContract3.31870321.jpg"},462:function(e,a,c){e.exports=c.p+"assets/img/myContract4.07a83092.jpg"},463:function(e,a,c){e.exports=c.p+"assets/img/myContract5.912b5882.jpg"},464:function(e,a,c){e.exports=c.p+"assets/img/myContract6.405104a8.jpg"},465:function(e,a,c){e.exports=c.p+"assets/img/assets1.abc7fc62.jpg"},466:function(e,a,c){e.exports=c.p+"assets/img/assets2.a43e834e.jpg"},467:function(e,a,c){e.exports=c.p+"assets/img/assets3.68229e16.jpg"},468:function(e,a,c){e.exports=c.p+"assets/img/assets4.1e09a147.jpg"},936:function(e,a,c){"use strict";c.r(a);var d=[function(){var e=this.$createElement,a=this._self._c||e;return a("h1",{attrs:{id:"user-document-of-wallet-smart-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#user-document-of-wallet-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" User Document of Wallet Smart Contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"deploy-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Deploy contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(447),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(448),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(449),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(450),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(451),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("Click [to call] on the right of table to go to [call contract] page")])]),this._v(" "),a("li",[a("p",[this._v("Click contract address to access to contract overview page")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"review-contract"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#review-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Review contract")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(452),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[this._v("Click [pull-down list] in the panel to select the contract method to call")]),this._v(" "),a("li",[this._v("Click star mark beside the contract address to collect this contract to the list of my contracts")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(453),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("li",[a("p",[this._v("If read-only method, click [call], get the deployment results after network requests met")]),this._v(" "),a("p",[a("img",{attrs:{src:c(454),alt:"access"}})])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(455),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(456),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(457),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(458),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"my-contracts"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#my-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" My contracts")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(459),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("Click contract address to access to contract overview page")]),this._v(" "),a("p",[a("img",{attrs:{src:c(460),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("Click [to call] to access to the [call contract] page")]),this._v(" "),a("p",[a("img",{attrs:{src:c(461),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("Click [cancel collection] to remove this contract from the list of [my contracts]")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(462),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(463),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(464),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"account-multiple-assets"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#account-multiple-assets","aria-hidden":"true"}},[this._v("#")]),this._v(" Account multiple assets")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(465),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(466),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(467),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(468),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("blockquote",[a("p",[this._v("Hex coding of NRC-20 Token")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[this._v("504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000\n\n\n")])])])}],f=c(0),t=Object(f.a)({},function(){var e=this,a=e.$createElement,c=e._self._c||a;return c("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),c("p",[e._v("1 Start wallet, click [contract] and then click [deploy contract] tab page")]),e._v(" "),e._m(2),e._v(" "),c("p",[e._v("2 Insert Hex code of contract in textbox")]),e._v(" "),c("p",[e._v("3 Insert contract construction function parameter, and note the required item and value type. If not, it will fail the table verification.")]),e._v(" "),e._m(3),e._v(" "),c("p",[e._v("4 Click [advanced option] to alter default value of GasLimit and GasPrice. Other additional information can be inserted too. Such filed must be required. (Optional step)")]),e._v(" "),e._m(4),e._v(" "),c("p",[e._v("5 After filling out, click [test contract]. Wallet will conduct a trial deployment for this contract to verify contract legality.")]),e._v(" "),e._m(5),e._v(" "),c("p",[e._v("6 After passing this test, click [deploy contract]. In case of password, insert password, and then click [confirm]. If no password, click [confirm]. Then, the system will go to [my contracts] page on which the confirmation progress of deployed contract can be reviewed.")]),e._v(" "),c("p",[e._v("Review the confirmation progress of deployed contract.")]),e._v(" "),e._m(6),e._v(" "),c("p",[e._v("7 After confirmation completion")]),e._v(" "),e._m(7),e._v(" "),e._m(8),e._v(" "),c("p",[e._v("1 Start wallet, click [contract] and click [review contract] tab page")]),e._v(" "),e._m(9),e._v(" "),c("p",[e._v("2 Insert legal contract address in box, and click [access], showing a panel below it")]),e._v(" "),e._m(10),e._v(" "),e._m(11),e._v(" "),c("p",[e._v("3 Have two cases after selecting a method")]),e._v(" "),c("ul",[e._m(12),e._v(" "),c("li",[c("p",[e._v("If readable method (to be linked), click advanced option to alter default value of GasLimit and GasPrice. After clicking [call], generate a transaction, which will consume nuls. Therefore, in case of account password, insert your password. After transaction confirmation, feedback the results.")]),e._v(" "),c("p",[c("a",{attrs:{href:"http://dev.nuls.io/zh-cn/contract/SmartContractFee.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("View smart contract fee details"),c("OutboundLink")],1)]),e._v(" "),c("p",[e._v("Transaction on calling contract under confirmation")]),e._v(" "),e._m(13),e._v(" "),c("p",[e._v("Transaction on calling contract confirmed")]),e._v(" "),e._m(14)])]),e._v(" "),c("p",[e._v("4 If calling linking method, click TxID in panel, to review the details of this transaction to call contract")]),e._v(" "),e._m(15),e._v(" "),c("p",[e._v("Details of this transaction to call contract")]),e._v(" "),e._m(16),e._v(" "),e._m(17),e._v(" "),c("p",[e._v("1 List of my contracts displays the created and collected contracts")]),e._v(" "),e._m(18),e._v(" "),e._m(19),e._v(" "),c("p",[e._v("3 [Transaction records] display the transactions in this contract. Click TxID to review the details about this transaction.")]),e._v(" "),e._m(20),e._v(" "),c("p",[e._v("4 [Contract details] display all methods of this contract, corresponding parameters and returned value type.")]),e._v(" "),e._m(21),e._v(" "),c("p",[e._v("5 If the contract is created by current account, click [delete] on the top right of contract overview to delete this contract. After that, contract details are also available, but the method of contract cannot be called.")]),e._v(" "),e._m(22),e._v(" "),e._m(23),e._v(" "),c("p",[e._v("After releasing Token via smart contract or transferring in different kinds of Token from other accounts, the account have multiple assets.")]),e._v(" "),c("p",[e._v("1 Access to wallet, to review all kinds of assets under this account address.")]),e._v(" "),e._m(24),e._v(" "),c("p",[e._v("2 Click [transfer] to access to transfer interface of this kind of asset, insert payee address and transfer amount, to finish transfer of such asset.")]),e._v(" "),e._m(25),e._v(" "),c("p",[e._v("3 Click [transaction records] to access to transaction records page of this kind of asset")]),e._v(" "),e._m(26),e._v(" "),c("p",[e._v("4 Click [pull-down list] on [transaction records] page to switch among transaction records of different kinds of assets.")]),e._v(" "),e._m(27),e._v(" "),c("p",[e._v("5 Click TxID to review the details of this transaction.")]),e._v(" "),c("hr"),e._v(" "),e._m(28),e._v(" "),e._m(29)])},d,!1,null,null,null);t.options.__file="GUIForSmartContract.md";a.default=t.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/50.76124638.js b/docs/.vuepress/dist/assets/js/50.76124638.js new file mode 100644 index 00000000..998925da --- /dev/null +++ b/docs/.vuepress/dist/assets/js/50.76124638.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{375:function(t,e,a){t.exports=a.p+"assets/img/consensus-constants.5d3198f1.jpg"},376:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjEAAADzCAIAAAD4stA1AAAa1klEQVR4nO3df28ct53H8T4g+y8/G/1jPZL9S/sU7k9tC8gQrkCBABfEcAs1DRQJKXoXK/ElStw0Oqs5X1M3sS1Zrl0Dxs3v+ZJDznB3hjMc7rt44SCvOBzORMfPksNd/uL9uxsAAELwi8lbAABAjkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAublaHnn1p07t1N3V5eTtOFitVu2Yffgsf9GBnDJGAuZBMzQ8aKjgy5iY+fwwlcbTvZu2TPJrZHDXjKiQCYBc5QNHVo66LwHv7M48deG7BRtmdTZyGEvGVEgk4A5CqCDJpPgAZkEzFEAHTSZBA/IJMCL/HFLau+onEkzLAq4PNipfmWaant8ePdWVWB5XL0uO2ixBCB7gFSfuqqwbkDyiqxTP6PanpIxCcpMEqeTLbyxpIhyRenNGeKSDTXrjcE8kEmAN1USlD1v0X0r/1RjQ+nB855XFqj6X627z7pjeWyxxkFETr1YrqikiB+RCvkrRVeel+9+ZFV1/UUkWFLEdEXNRva45PRmVteS1UwmzRGZBPjT7JTzjjvvZ7VOXP4qlSVW/c88MMphllJzUrLR/+a1ye6++YrWPL21WgN0hrk7NVGMKaJVmAebEtKbXXL6W6Uxx4vWeUUEikwC/DFMXjVHJxWlR24MU5RBjKjZFEg3a2SSFiGiwPqZVAwEm400XlH9Yn7SXpdczOYxNpo7Mgnwx/RAxfg5m8bEWtfHcfKaF0t9uqyyQSZtMndnfDxmHNlYrihvQ3bVPS9ZPLTz+sEseEUmAf7YM6kYJ5WP5cu3/+tlUlpY9OlKgU0yqT6vdQGCXtI4TvKYSW2XXDeg9TsmEDQyCfDHOneXdZd639o+d2et2fzx2M0yKXnF+WO2A87d5S/2vWRLtZgVMgnwp3WNQ2NYoD6/aS5jy1/MO2KlZtMzqo3n7vpkUvuiCesah7KSHpfcWNGw3rUgGGQS4E/x4L3qLpWpLXUldPnBINFl699Zl3bZloc9RW8u+uXmBJftFdFxK49kumbAzGvBW+vXFn83RzMbX7K6fi//LXN3c0QmAf7kb+13qm/R1kYJ8gOqaQdarXTQhhrqserHWtWP7+QzWmq0pH26yyv5GcV3fnfEUlKD+nHg5nIJ08dXlU+2mmre6JKTZiv3mQV4c0UmAf7M6+twjK2d1yVg9sgkwJ85dejZWMSyfq99AR4wHDIJ8GZeq79MS7EtQQX4QiYBXsgPynR/1icQzTUOcwlUxIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMApzsf/hf2BKT/7FtMzIJ8fvHzz99++Tp5+dP+pi8o8RoJv+L3WZkEqL1/MXzoz89bvY4H3zy1fHD78gk2Ez+p7vNyCTEKRkY/eqjh7Kj+c3Hjy5++NvGFU7eUWI0k//1bjMyCRH6+vsftF4mGRi9e3s9ecMAtCOTEJvnL55rI6TTL76fvFUAXMw0k7LtO8UuL7sHj80l803VlC1hFietdZZVZdtr1ke1b2umFb69PLYWzjZJ69yfxmdjij1ybJWUh5v3+1njSqdy//RcBtJvPn7ECAmYi9llkt4nWjt3Qxq1b7AmYqC5s5k9+fSMaTmFvUmNnt1nYzbNpDWudDpJ/Gizdk9/fDZ5qwA4mlcm1cMjrUdOu0uZSaL3V7t7EWl6T1rGwN5C36+6rq3Rj5eBobUn3WNUq99cSdUerWafjdksk9yvdFI/PvuHDKRfffRw8iYBcDenTCo3k26fuboRHb15mq56v6/GlZgPtA9x1B65fZrL1CTDTJ2xEp+N2SST3K90Yo+++6vMpP/49OvJmwTA3XwyqXyf3v0Ao6PPvbEkRBUDxiQzHlK8aH2a5dgkw2+na0xrJnVXPjXtg0R/fHQxeZMAuJtNJhWDJPOKgPVLFv2y7PHLGLAMBYrRlVqtY6u6ihWnFnHrsTGbzd253/9paZmU/HPyJgFwN5dMcn+f7laymP4yDE1sB5YzfurARSxAsJ+xs0nNAv4a0/d5UuCjJTIJmLW5ZFJzJNGzpHVosl4MvLvR18UZRhL6ynWbvpnk1Jgea8FdKp8amQTMGpmkv7J2DCi/NS6PHjGTuhvT8/NJXZVPjUwCZm1mmeQwa+RWcqi5O3O1WmftHqgjNMZ47ZLbEjtb5VMjk4BZm0smrbEWuXga317SvsahVwwoJatOf4NFa/4aM1Am2SqfGpkEzNpcMmmN7s+hZNtHgvrHQDWGqAZGaxzrvzEdlVcDIJfRj6HyiZFJwKzNJpPqpzLdj9bbP9xjC63BY8D0eSNbR3+xWirn9dqYls8Ut3zPhWPlEyOTgFmbUSYp6760N+aWr89p+26hRne/QQyktdm+qk7LTrE0QEsC48ye38aI+9OcvdzZtXxm1rXySZFJwKzNKpPeNZYjtywAa/0OVtNc04YxYDmFYQRj/Q5TQ3nvjSm/qEmTjHhav1vIrfIJkUnArM0tkzLNzt32PKNZ0r7QYLPpMkNn3fpwpVneOPE1SmPMnzeyrXFY90qnQSZtI33qe5tEd+2zzCTAhkzaQsmgP+TvFuHa10ImISpkUrDkpEU9wrZ9OUhjT5Z8tnn3YFV9Aj2vRMxCK1MOjfJiXlqUbLbKdiIPl2BuUv9rnzUyCVEhk0IllskknXjRcR8tRbcr3u8bC+eRUMxXiy3T0sL2LS6L8ln3XZxLO3atEw14CUM1iXESEC4yaQbSgUXWvaYDAjEUqB5hitflz2lfXJWpKmnPpLK8su2n6OsNrbKeaOBLMDdpoGufLzIJUSGTgqUuOMq7VMsgQ1806zGTTK2yZtKwl2DPpAGufb7IJESFTAqUHG3oP6uPYd7l/bLl0xTDZpKlVeYTDX0J9kwa4Nrni0xCVMikQIlOPHuOUv1sfDivdLUnB2JMYxq+2NaerZVJslWdmTTIJViGbsNc+3yRSYgKmRSq+vNty+Ps43dZF2ycOsscWdeY1XFyW6SF/oE5rbyyNXN9rKFVh9YTDXwJliYNcO2zRiYhKmTSjCSdsnyPP8e3/BFcQmjIJESFTJoR6+Lp+YjgEkJDJiEqZNKsKFswz3OEEcElhIVMQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUzy54NPvpL3VnPvwVnLbxGC+6fnk/8VdSKTEBUyyZ/kfk7eBkSPTEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/BsqkYmc8r1+hrWzhilkhkxAVMsmfAcdJvve+UzLpYrXc2i0kZnjtZBKiQib5M6NMmupcoZnjtZNJiAqZ5E/fTDpeFHvf3V0dyr7yYrVbbIu3c3hxIyb3jvIfytdz9R56VQ1Jz1vVfJkPksqf618plRSv7x6slvWpHzdPV1SVyTeQbRx4u9pYtllYuWrRQtNVuzbJ4UClqc1rD9yGmaT9fz4wPmPekEn+7PfKpDRLip4661XLRBH7hSfdd9llZ/172ZOm3friRCtc/VwflZwiLybn7tJixrFCdoqifNZ9F6fTjrW0zXyiRuGkSXVymHdJt9Q8VJO2ZZxEJmFyZNLI9vtkUppDRaf5XnbQ6etl9oif045176g8vOzZ1UqKMlnC1eOS6lcumVSeQnn+JPr6Wp2LatvE64bC4orSjKmOcrhqc5Ncbpca4WQSMJJfH33Z8ttV9n/JpAHt+8qkW2J2a/1MEpVU/e9QmSSn4zozyVTYMk5yuGp7JnXdLjIJmATjpJHt+8qkxjhj3UyqT1EMmIbJJDkG6hwnWQrLp2iX78x3Y40mudwuMgmYBJk0sn1vz5Pq1QoHhgcknc+Tmo+mZIduW3u2ViZlT3dcM0kWPtkzri+wX3XH0K37QK0l25JJQJjIJH/6ZZIyYjjJp7mKbvTIvIZtb7G847DuTk5nZRWK9WZVWqhr4VqX6pXlk2OrZW/Jsdl5sxWDyrintfClZfbPeNVuTeo+UClsuvbAkUmICpnkT99MWoc+LzdPyVXIYcocRy3jI5MQFTLJHzJpXdb137AjkxAVMsmf0TJJn4yasXqezfdX/EWDTEJUyCR/xhwnYWuRSYgKmeQPmYQRkEmICpnkD5mEEZBJiAqZ5A+ZhBGQSYgKmeQPmYQRkEmICpnkz/6Hn7d8rca9B2eTf7UH+rh/ej7539h7MgmRIZP82WecBP/IJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPJnzEwqvhpc366i3DfPuBmrUw0IHZmEqJBJ/ow8TrJtoWTdINy5hu1ysVrOao8MMglRCSmTlL1zFMaOUu7hre+T3Vn49u7Batl+SG8BZtJmNWyV2W1uSyYhKiFlUuZ4oe5NVwaV8u6+mJLS9sm2pJe9cLiZVLX5qJh8u7NzeKFfZhoh4s5kibLSyr8XSaOVb+4EmJVclO8M6hrkTcuyvCrw2Hy6MvjzXWIbB96udo9tFq7/BirVf/r6jYVyNzqb5HCg0lTj5QeLTEJUgsukvPuQCVR2KFWo5B1Hc1fsooNTY8lWOHt9yEx6ef362c83L67qV3qOk7LLKXvGtJsuWquMZpLXZaJ0la/n7uoDj5ayZPlzen8aAa8XKE8npgTFhuV628RZ2gon7amTw7wVuqXmoZrEOAmYzAwySRvo6AMpqRhU6e+4jYXTEw2TSS+uXn/66Prjs6vTr64/+fLqD2dXP7149X6QTKpToe6p2zKpq3zd+Wb3WYtqW83GAsqjKVPhthxt3vnqxbRhYjRTHSVelz93N8nhQNEkMgmY1NwyyTARJ6kzeO2Fk98OkEnPX75O0ujvz9/8q/zf86u3nz66evbzq6Az6Z1hADpIJsnpuM5MMhW2jJP0J4JrZVLHgWQSEIoZZFLRp+RdSWMkpCkeRVS92y2vDwbevblJRkg/vawDKf/f9c3b33/+cvXhwz6Vr5sxa2eSuL35/Rwgk+QYqHOcZClcP0/S/wwM7yHcMqnjQDIJCEXomaS9l1fyyURmUmfh3p6/vPnky6t/mf73p2+uDn73TZ/K5QMPvX8XDz+MD0hcnieVPW/9uGXYTJJP7DozSRY+2TP+J1PS4uTAkMSWoVv3gVpLyCRgMoFmkrIWXLzJDSyTvn/66ou/3CQJ9MH9r/7tl5/lkp+TV86fXP/777/vU7l9FdxR/eJxfo2LpWEF2k39mdlszHFYLypbnMj7nHXN+jK8xqM4rYCyiq++7fUZl8dZO+V5HQpfmif0tAtvLJNra1L3gUrhcpRmHYsHhkxCVALNJOvnOsOau3v286vTr66N46SzP18f/q7X2+3t/LRQctXaqv15jVrGRyYhKnPLpAHXOAzg7ZubP5xdXd+81QLp7Zv0edIvP/qiT+XbmUnW9d+wIJMQlbll0nprwbVPiTar6h9XP/z46rPz65t/vpWBdPbnq7/871WfdXfND7RuDeXrPBgkdSKTEJX5ZVI5+nH7zGzLUOloqO8WuvzbdTJa+vIvr755cv3fF8nPL5NAes/3gmMUZBKiElwmKQ+EbNb6biHTtxPJz1EO4Z+vby6eXn/7JB0e3dy8yl8kkzACMglRCSmTGt/B2j5ttdZ3sNq+Qs0nMgkjIJMQlZAyKTZkEkZAJiEqZJI/ZBJGQCYhKmSSP/sffi7vrebeg7OW32IW7p+eT/5nRiYhKmSSP/uMk+AfmYSokEn+kEkYAZmEqJBJ/pBJGAGZhKhomfSfX//P5E2KBpmEEZBJiMrZt5cyk377Wa/tFSCRSRgBmYSoXP7f32UmHTzotQ0dJDIJIyCTEJU3r6+15a1X1y8mb1UcyCSMgExCbH599CXTdz6EnUneN/LAOMgkxEabvkt8++Tp5K2KQNiZlNreHfMuVstYLpxMQoSOH36nPVVKgmryVs0dmRSsmC6cTEKE3ry+/u1n32ijpSSoktc3rnPy733xx/0ObHz38q03dg+O8hm28ovM669Oz7tUuUOH3MCwPHxVla+3m6q+Iv3u6rDRNTcO3Dm8KGb55C7yxblEzS1nbBZWmqF9U3v9de/F6Ryb5HCg0lT98NkikxCtb588TUZIWv97//T8j48uPj9/sq7Jk2PWmfS+6MqzTjPpvtMuW24EXv+sbJFelKwOL/bvSH8WqVZUknXizeGCPDDrvouOW1QiWtJ9RmPhpBl1cpg3O7fUPFSTGCcB8/D0x2ePvvvrBiG0PZmU5LRLsVX/TNL3Iaz3iKqiqC2T5Ov5sWolxikseaDSBlF5rarZdkZjYbGnYpox1VFyr0Xxc3eTHA4UTSKTgO0zeXL4434H+txApT99F1Ymyem4zkwyFbaMk/R9GtfKpI4DySQAW238TJL9tcdMkmOgznGSpbB8rGUbC67RJIcDySQAW23gTGp5niQek3RkkuPzJOdMyp7uuGaSLHyyZ1xfoKTFyYHhWixDt+4DtZaQSQC2S59MsqwN09fdqS/uHB7nU1iLZXV4nSK3RUgUvzrJZ9VE8p2oB8q1fKKSatnb7eVxdvZsCZ/ljIbCl5bZP+0a9WVybU3qPtB4E+p1gLNFJgFw0nOcFLEkV+QwJaZRy/jIJABOyCQb6/pvrI9MAuCETLKr59n4zr2eyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCk/Uvz7j04m/yL++Di/un55H9LLcgkAE72GSfBPzIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgJN5ZlKxBZ/n7+ouN/pTNtLtoOwwGwatSfUugutcV09kEgAn88yk1Dib7DU2d2+4WC1FM3pkUr3X7bCpZtkbfmXa1t0XMgmAEzKpXWcmDdaMKi287h9Yn2VUZBIAJ30yKZ8F2j04Kt7g553dxWq32ApvJ3snXu2Ml/+z7nDLSaT09bTrL3fPk7/VK0+61HIkcWgMg/rsxcxes+ZmsaIlWfYU5cuOW2aSrZH6VdSdfr0rYN6Y8qJW1et1k9JLW5wUR+2IQcyRUri8A2mF+q023LQT0STZ/jt7C+W/S1mtpywkkwA46TlOyrq5slNLOz7xHr9+S572qsWLeTda9vIne3kvbDyqWbleTyOTmvUYaza8qIyHtDYUr1ur2jXP3cnhTv1zdlH5VWsTfdnc3d2dXSWQ6l/VZzleZFU53jTL3J3ewrSYv83dySQATgbIJDkXlEZF2aWKn9P378UoZHF4nLxeDgia80j1cMFYefGr98ZJM7WArqrZVMwhk4yNtGeSepaqHv1E8mLl0oNiDFTcQHkriiC33OrmAy17JmkJar91vZFJAJwMkEmyyxZzYnJOqR617Imxy/Gi6s2VaSXZTeuVr51Jhpo3zSRTIwfKJGXiLsvv5BX92rObmfyghJZ+q5sh2pJJ9TxhVa0fZBIAJx4yyfh2O+v7joslavlR6ZipSqzqKG3osHYmqRNfxpqbxZrZ08wkcyOHySR1cJM/QNJaWJyonmGz3Oo1M6kYwnqduHtPJgFwNHAmqX30yYHy6GL37kLONe3uiY6y7F6zp/SWTHJ7nqSc3VyzoZHac6D2TJKN1KLR6XlS2zipvjpTtCyWe+otbdzqdTOp+G/hc+LuPZkEwFH/dXfKHF3qyLCozPQ8X3Tl9UdzlsfZ4dmyOkPlYt1dsaJMn3HSzm6o+dLcSLE+8Lh4lrOrfGDIUpVYsSZuiJiIa6y7aywjLIdK1URcuaBD/Vxw+ooaw/pVNP+LyCYt65/lfxp9qOcDmQTAyXw/n4SBJJnUXOk3MDIJgBMyadtpiyn8IJMAOCGTtlbjE74ekUkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMBJkkkt7j04ay+ALXT/9HzdPzMyCYCTfcZJ8I9MAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuAkhExSt/sbsjACQSYBcDJ8Jl2slp2blqplOmJmrcJbzuXmT4FMAuBk8Ew62eveSNulzGaFt1yw94pMAuCkZyYlnWC6L1y5NVz9zzvFdtrFxnGZ5bF6SFZG21muvUJ9G7qL1e6dokDeF2uHa+3cPVgti/JJbY8P796STW1prTiweN1YOHW8qF60NLU4nWOTHA4039jJ/7QkMgmAk16ZlPS/RZ97tLyzOEl/SHtV8VY9/WfRX9eFtTJiOq67Qjl316jccPiNcmD5YtZ9i9S0Vdg4sKtwct46Obrug5cmMU4CMGO9Mil7C18PEVL2bjEdQHTFjEOFamE1eAyH3ygH7h3plbxT+npTa5UD5euGwmkDxGimOkq8Ln/ubpLDgS03NhxkEgAnfZ8nlTNLZVdoipB6Lqtz6ONWoS2TDIffKAd2ZZKptdZMMhW2jJPEHKM+sdmdSR0HkkkA4jHMGod6gKJ2i3JU4TJO6qxQzyTLgxPTgKk7AMyttQSApXD9PElekTE+XTOp40AyCUA8ej5PkqOZ6km7MZOy5yX1z7bnSR0V2h+fnBykz5OahysHOmeSbG1nJqmXZozJRlMdm+RwoNYSMgnAjPV/nlQMC5QusloMVi0kS/55lK4Tq3v/ooxYLbY46apQKZz+9khZe2Y8PKOtx1PW7xX1JxUaWnuoLeRrLXxpmf1732yqa5O6D1QKKzc/IGQSACchfI9DNJJckcOUYEct4yOTADghkwZkXf+99cgkAE7IpEHV82zGtX9bi0wC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABODh48TGLJ5t6Ds5bfYtbun56P9mdGJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAELx/6dlfwtgmE9xAAAAAElFTkSuQmCC"},377:function(t,e,a){t.exports=a.p+"assets/img/coinbase.afeaf0dd.png"},378:function(t,e,a){t.exports=a.p+"assets/img/consensus-flow-5.e1e96c82.png"},379:function(t,e,a){t.exports=a.p+"assets/img/statics_en.4c53a0d1.png"},951:function(t,e,a){"use strict";a.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"consensus-module-design-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#consensus-module-design-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Consensus module design document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1、general-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、general-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、General description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Module overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-consensus-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-consensus-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 Why do you have a consensus module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-what-does-the-consensus-module-do"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-does-the-consensus-module-do","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 What does the consensus module do")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Legality verification after block synchronization")])]),t._v(" "),a("li",[a("p",[t._v("Create consensus agents, delegate participation consensus, cancel delegation, and cancel consensus agents ★")])]),t._v(" "),a("li",[a("p",[t._v("Consensus agent packs out blocks")])]),t._v(" "),a("li",[a("p",[t._v("Disbursement of network maintenance incentives")])]),t._v(" "),a("li",[a("p",[t._v("Bad agent punishment ★")]),t._v(" "),a("p",[a("strong",[t._v("PS:Different consensus mechanisms have different consensus algorithms. The above marked ★ is unique to POC consensus.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-《consensus-module》positioning-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《consensus-module》positioning-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《Consensus module》Positioning in the system")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(375),alt:""}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Services:\n"),a("ul",[a("li",[t._v("tx service : Additions, deletions and changes to transactions")]),t._v(" "),a("li",[t._v("consensus service : Consensus activities and state management, functional design")])])]),t._v(" "),a("li",[t._v("Validator\n"),a("ul",[a("li",[t._v("tx Validator: Validator for consensus-related transactions for verifying consensus-related transactions")])])]),t._v(" "),a("li",[t._v("Processor\n"),a("ul",[a("li",[t._v("Tx Processor:Consensus module related transaction processor for submitting rollback detection transactions")])])]),t._v(" "),a("li",[t._v("Task/Thread:\n"),a("ul",[a("li",[t._v("consensus Task: Consensus packaging")]),t._v(" "),a("li",[t._v("Reward Task : Data statistics")])])]),t._v(" "),a("li",[t._v("Storage:Store consensus module related transaction data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-0-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-0-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.0 Functional architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(376),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1consensus-module-functional-requirements-analysis"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1consensus-module-functional-requirements-analysis","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1Consensus module functional requirements analysis")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-1-support-multi-chain-parallelism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-1-support-multi-chain-parallelism","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.1 Support multi-chain parallelism")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-2-poc-consensus-mechanism"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-2-poc-consensus-mechanism","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.2 POC consensus mechanism")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Consensus mechanism——POC\n\tThe NULS main chain defaults to the credit consensus mechanism POC (Proof-Of-Credit). In the case where the agent credit is up to standard, a certain margin can be locked to join the consensus. After the consensus agent is reordered, each round will flow out of the block, and the margin will be unlocked when the consensus is exited.\n\t\n1、Consensus entry and exit mechanism\n\tAnyone can join the NULS consensus at any time, as long as they meet the conditions and follow the rules, that is, they can continue to receive NULS token rewards. The addition of POC is divided into hard indicators and soft indicators. The hard indicator means that the credit score must reach a certain standard line, and exclude some agents that have been evil. The soft index refers to the need to freeze a certain amount of NULS tokens as a margin, in order to prevent the proliferation of agents and make the whole system more fair. The number of margins can be freely selected by anyone except the minimum value. The amount of the deposit will be tied to the final reward.\n\t\n1.1 Yellow card penalty\n\tDue to the hardware configuration of the agent or the network, the disconnection, crash, etc. during the consensus period cannot be blocked. It is not a violation, but it will affect the whole system. Therefore, the system has a mild warning mechanism for such cases. : lower the agent credit value.\n\t\n1.2 Red card penalty\n\tFor some double-split, repeated block-outs, attempts to fork the system, and malicious human-induced damage that does not comply with system rules, the NULS system is firmly resisted, and all agents can detect this kind of situation; once a malicious agent tries to challenge the system, Then the corresponding margin will be locked for 2 months, and the credit rating will never reach the consensus threshold.\n\t\n2、Credit Rating\n\tIn the NULS system, credit is the credit factor of the account in the system, and the credit of all accounts is automatically calculated by the credit rating algorithm formula in the interval [-1, 1].\n\t\n\tCredit evaluation formula: credit base = capacity coefficient + responsibility coefficient\n\tCapacity factor: calculated based on the number of historical blocks\n\tResponsibility factor: Calculated according to violations and correctness of the block\n\t\n3、Consensus reward\n\tFor the balance and fairness of the entire NULS system, the consensus reward is calculated based on the margin and consensus agent credits submitted by all consensus agents. Consensus reward calculation formula: see (Figure p1)\n\t\n4、Subchain consensus mechanism\n\tThere are two types of sub-chains that access NULS. The first one is accessed through the standard interface protocol of the NULS system, and the second is deployed through the NULS program.\n\t\n\tNULS is a common blockchain underlying infrastructure that does not run any application services on its main chain, and all application services are run by sub-chains. Through the NULS system, NULS-based sub-chains can be quickly deployed, and various operational parameters of the sub-chain can be flexibly customized, including whether to support basic tokens, encryption algorithms, consensus mechanisms, and storage mechanisms.\n\t\n\tNULS defines a standard consensus module to provide interfaces that are compatible with different consensus mechanisms. The NULS community will develop consensus mechanisms such as POW, DPOS, POS, PBFT, and POOL verification pools for users to choose freely.\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("Figure p1: Consensus reward calculation formula:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(377),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"in-the-poc-system-there-are-four-roles-agent-principal-packager-and-rewarder"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#in-the-poc-system-there-are-four-roles-agent-principal-packager-and-rewarder","aria-hidden":"true"}},[this._v("#")]),this._v(" In the POC system, there are four roles: agent, principal, packager, and rewarder")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Agent - the consensus agent creator. The NULS holder initiates a transaction to create a consensus agent, which is recorded in the chain and tells everyone that I want to be a consensus agent. The basic condition for agent creation is that 20,000-200,000 NULS need to be locked, and there is no red card penalty record. The purpose of setting up this basic condition is to prove that you are really trying to maintain the basic network of NULS.")]),this._v(" "),e("li",[this._v("Packager- When creating a consensus agent, the agent can specify a packager. This packager can be his own other account, or a friend who knows technology. The most important thing is that the packager can not hold any NULS. Even if the server participating in the consensus is hacked, the user will not have a huge loss, and the loss will only be affected by the earnings after the attack. It should be noted that the packager is a real out-of-the-box account. Each time you package a block, you need to sign the block. Therefore, you must not set a password for the packaged account.")]),this._v(" "),e("li",[this._v("Rewarding people- When creating a consensus agent, an agent can not only specify a packager, but also designate a beneficiary to specify who can get the reward generated by the consensus.")]),this._v(" "),e("li",[this._v("The principal-NULS holder can entrust the NULS he holds to the agent according to the agent's credit value and the influence of the agent, etc., and enjoy the corresponding consensus. Revenue, if the agent agent quality or integrity is found to decrease, the principal may withdraw its entrustment and change to others at any time.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"in-the-poc-system-there-are-four-business-logics-creating-a-proxy-creating-a-consensus-agent-stopping-a-proxy-agent-exiting-consensus-delegating-a-consensus-and-canceling-a-delegation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#in-the-poc-system-there-are-four-business-logics-creating-a-proxy-creating-a-consensus-agent-stopping-a-proxy-agent-exiting-consensus-delegating-a-consensus-and-canceling-a-delegation","aria-hidden":"true"}},[this._v("#")]),this._v(" In the POC system, there are four business logics: creating a proxy (creating a consensus agent), stopping a proxy agent (exiting consensus), delegating a consensus, and canceling a delegation.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Create proxy (create consensus agent): Lock 20,000-200,000 NULS and initiate a registration proxy transaction. After packaging, the whole network can be seen. Others can lock the NULS delegation to the proxy agent.")]),this._v(" "),e("li",[this._v("Stop the agent agent (exit consensus): The agent can stop its agent qualification at any time, initiate a transaction to delete the agent agent, and after the transaction is packaged and confirmed, it will quickly withdraw from the consensus and no longer participate in the production of the new block. The 20,000 NULS locked during the registration of the agent will be unlocked after 72 hours, and the rest of the NULS delegated to the agent will be unlocked immediately.")]),this._v(" "),e("li",[this._v("Delegate consensus: Users with NULS of 2000 or above can choose a proxy agent to commission and obtain the corresponding block revenue. Before exiting, the corresponding delegated NULS will be locked out of use. A proxy agent can accept up to 500,000 NULS delegates.")]),this._v(" "),e("li",[this._v("Cancellation of the delegation: The user can cancel the previous entrustment. After the revocation, the locked NULS will immediately explain and no longer enjoy the corresponding consensus revenue.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"two-punishment-mechanisms-for-poc-systems"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#two-punishment-mechanisms-for-poc-systems","aria-hidden":"true"}},[this._v("#")]),this._v(" Two punishment mechanisms for POC systems")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Yellow card penalty: When the block agent is disconnected from the network, card machine and other uncertain reasons, the block will not be out of the block, or the block is not used, then the yellow card will be punished in the next round. The yellow card penalty will affect the agent's income; when 100 consecutive yellow card penalties are awarded, a red card will be imposed.")]),this._v(" "),e("li",[this._v("Red card penalty: When the block agent makes malicious fork, double flower and other behaviors that seriously endanger the stability of the network, or when it receives 100 yellow card penalties continuously, the system will give a red card penalty. The agent that receives the red card penalty will be forced to stop the consensus. The deposit when the agent is created is frozen for 3 months, and the agent can never be created again; the corresponding agent of the agent that received the red card penalty is immediately unlocked.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"hidden-functional-requirements-of-poc-internal-systems"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hidden-functional-requirements-of-poc-internal-systems","aria-hidden":"true"}},[this._v("#")]),this._v(" Hidden functional requirements of POC internal systems")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Maintain a consensus agent information table and update based on the above four transactions received in real time.")]),this._v(" "),e("li",[this._v("Maintain a round of information table, so that each round of agents who meet the conditions of the outbound block are randomly queued out.")]),this._v(" "),e("li",[this._v("The proxy agent that meets the condition of the outbound condition verifies and packages the transaction of the memory pool, assembles it into a new block and broadcasts it to the whole network.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Module service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-create-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-create-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Create agent")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tCreate an address that specifies the packaged block (the fast address when the consensus agent satisfies the packageable condition), the commission ratio (the commission ratio of other accounts participating in the agent consensus), and the consensus reward settlement address (the reward for the consensus agent) The consensus agent of the home address, waiting for other agents to delegate consensus, when the commissioned consensus amount reaches the standard amount, the agent can package the block to earn the reward.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBy creating a agent interface, the NULS user can initiate the creation of a agent transaction, and after the transaction is confirmed and packaged, the consensus agent can be successfully created.\n")])])])])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgent",\n "version:"1.0",\n "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Request to create a agent account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packing block address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward settlement address (default is the same as the agent address)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create a agent's margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("5")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("6")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n \t"version": 1.0,\n "code":0,\n "msg" :"Success message",\n "result":{\n "value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n \t "code":1,\n \t "msg" :"Error message",\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the generated transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-create-agent-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-create-agent-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Create agent transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Create a validator for agent transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the transaction contains agent information\n- Verify that the trade creator is correct\n- agent address and package address cannot be verified\n- agent reward address and package address cannot be verified\n- Commission proportional validity verification\n- Create a agent's margin validity verification\n- Signature correctness verification\n- CoinData verification (lock time verification)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tThis interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"错误Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-create-a-agent-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-create-a-agent-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 Create a agent transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save the created consensus node information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save node information to the database\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save consensus node information to the database\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-4-create-agent-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-create-agent-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 Create agent transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Delete consensus agent information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Delete consensus agent information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Remove consensus agent information from the data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentRollBack",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-5-logout-consensus-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-logout-consensus-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 Logout consensus agent")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tLog out a consensus agent created by yourself, and the consensus amount and consensus bonus of the agents participating in the consensus after unregistering the agent will be thawed after a certain time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBy deregistering the agent interface, the NULS user can initiate a transaction to cancel the agent created by himself. After the transaction is confirmed to be packaged, the consensus agent can be successfully logged out.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgent",\n "version:"1.0",\n "params":["address","password",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the logout agent trading account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chian ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the generated transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-6-logout-agent-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-logout-agent-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 Logout agent transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify the correctness of the logout agent transaction验证注销节点交易的正确性\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the deleted consensus agent exists and that the consensus agent has been logged out\n- Verify that the trade creator is correct\n- CoinData verification (output address must exist)\n- Query all consensus information participating in the consensus agent and the total consensus amount of the agent\n- Check whether the total amount of UTXO spent in the logout agent transaction is equal to the consensus agent entrusted amount in the database query. If not, verify the fail.\n- Verify that each UTXO unlocked in the logout agent transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify that the logout agent transaction is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentValid",\n "version:"1.0",\n "params":["tx",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Logout serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set\n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-7-logout-agent-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-logout-agent-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 Logout agent transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Submit logout agent data transaction\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Set all delegate data under the consensus agent to deleted\n- Set the consensus agent data to deleted\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tLog out the consensus agent and set all the delegate data and consensus agents under the consensus agent to the deleted state.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-8-logout-agent-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-logout-agent-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 Logout agent transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Logout agent transaction data rollback\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Set all delegate data under the consensus agent to not deleted\n- Set the consensus agent data to not deleted\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Rollback logout agent transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Logout serialized data for agent transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chian ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-9-apply-to-join-the-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-apply-to-join-the-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 Apply to join the consensus")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tEntrust the specified amount to the consensus agent to participate in the consensus to earn consensus rewards. The entrusted amount and consensus reward will be frozen during the consensus period.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tThrough this interface, users can entrust the specified agent address to join the consensus and earn bonuses.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositToAgent",\n "version:"1.0",\n "params":["address","agentHash",20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply for a consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of participation in the consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply for a password for participating in the consensus account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-10-commissioned-consensus-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-commissioned-consensus-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 Commissioned consensus transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Entrusted consensus transaction correctness verification委托共识交易正确性验证\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the consensus agent to apply for is valid\n- Verify that the consensus agent that applied to join has reached the maximum number allowed to join the consensus\n- Verify that the entrusted amount is valid\n- Verify that the transaction was created by the account that requested the application.\n- Verify that the commission amount is equal to the output UTXO amount, and that the output UTXO lock time is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tVerify the validity of the entrusted agent in the entrusted transaction, verify the correctness of the entrusted amount, verify whether the entrusted transaction creator is correct, and whether the UTXO output by the entrusted transaction is correct. Verify that the logout agent transaction is correct.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for commissioned consensus transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-11-entrusted-consensus-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-entrusted-consensus-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 Entrusted consensus transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Entrusted transaction submission\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save commissioned transaction information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Save commissioned transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the block where the commissioned transaction is packaged")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-12-delegate-consensus-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-delegate-consensus-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 Delegate consensus transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Delegate consensus transaction rollback, delete delegate consensus transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Delete delegate consensus transaction information\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen the commissioned consensus transaction commits an error, this interface needs to be dropped to delete the delegate consensus transaction data.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositRollback",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for commissioned consensus transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the consigned consensus transaction is packaged")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-13-revoke-commission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-revoke-commission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.13 Revoke commission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tApply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Create a transaction\n- Determine if the account balance is sufficient\n- Verify the transaction\n- Save the transaction\n- Broadcasting transactions\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tApply for withdrawal from the consensus, after the transaction is verified, the deposit and reward will be released after the specified time.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdraw",\n "version:"1.0",\n "params":["address","txHash","password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply to withdraw from the consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Transaction hash when joining consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t"value":"tx.getHash().getDigestHex()" //Generated transaction hash value\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hex string of the transaction hash value")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-14-exit-consensus-transaction-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-exit-consensus-transaction-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.14 Exit consensus transaction verification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Verify that the exit consensus transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify that the consensus to exit has been delegated before and has not exited\n- Verify that the account that created the transaction is correct\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tBefore exiting, verify that the account has participated in the delegate and is still in the delegate. Also verify that the transaction creator is the principal.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit serialized data for a trusted transaction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-15-exit-consensus-transaction-submission"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15-exit-consensus-transaction-submission","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.15 Exit consensus transaction submission")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tExit the consensus transaction submission, save the data related to the exit consensus transaction\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Save exit consensus transaction related data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tSave the transaction-related data by calling the interface after exiting the consensus transaction verification success\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-16-exit-consensus-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-exit-consensus-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.16 Exit consensus transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Exit consensus transaction data rollback\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Rollback exit consensus transaction data\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen exiting the consensus transaction submission error, you need to call this interface to roll back the data to ensure the correctness of the data.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit serialized data for a trusted transaction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block header hex string")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message\n "result": { //Returned business data set \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-17-query-consensus-agent-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-query-consensus-agent-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.17 Query consensus agent list")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get a list of consensus agents on the local primary chain\n- Filter the list of consensus agents to get a list of consensus agents that meet the criteria\n- Consensus agent list sorting\n- Pagination\n- Return to the list of consensus agents\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain all the consensus agent lists that you have joined or the whole network, support keyword query, sort, page query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getAgentList",\n "version:"1.0",\n "params":[1,10,"address","keyword","sortType","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of data per page")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("keyword")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Keyword (agent address, packed address, agent alias, agent ID)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("sortType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The sort type (deposit creates the lock amount of the consensus agent, the commissionRate commission ratio, the creditVal reward amount, the total amount of the total deposit consensus, the comprehensive sort of comprehensive)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "agentHash":"", //agent hash\n "agentAddress";"", //Create the address of the agent\n "packingAddress";"", //Packed address\n "rewardAddress";"", //Reward address\n "deposit";, //Margin\n "commissionRate";, //Commission rate\n "agentName";"", //agent name\n "agentId";"", //agent ID\n "introduction";"", //Introduction\n "time";, //Creation time\n "blockHeight";, //Block height\n "delHeight":, //Block height at which the consensus agent is deleted\n "status":, //status \n "creditVal":, //Reputation value\n "totalDeposit":, //Total amount of participation in the consensus\n "txHash":"", //Transaction hash\n "memberCount":, //Number of people joining the agent consensus\n "version": //version\n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total data volume")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("total pages")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agnet hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the agent")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Introduction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Creation time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the height of the block where the agent is trading")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Write off the height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("status")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reputation value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Transaction hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of orders")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Protocol version")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-18-query-agent-details-basic-information-credit-value-agent-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-query-agent-details-basic-information-credit-value-agent-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.18 Query agent details (basic information, credit value, agent status)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery detailed information of the specified consensus agent, including the creation time of the consensus agent, margin, commission ratio, agent address, package address, consensus status, credit value, commission amount, consensus number, etc.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Verify parameter correctness\n- Get a list of consensus agents on the local primary chain\n- Find the corresponding agent information from the list\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the details of the agent through the agent hash\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgent",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentHash":"", \n "agentAddress";"", \n "packingAddress";"", \n "rewardAddress";"", \n "deposit";, \n "commissionRate";, \n "agentName";"", \n "agentId";"", \n "introduction";"", \n "time";, \n "blockHeight";, \n "delHeight":, \n "status":, \n "creditVal":, \n "totalDeposit":, \n "txHash":"", \n "memberCount":, \n "version": \n }\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the address of the agent")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Margin")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission rate")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Introduction")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Creation time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Create the height of the block where the agent is trading")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Write off the height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("status")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reputation value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of orders")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Protocol version")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-19-query-agent-penalty-list-all-red-yellow"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-query-agent-penalty-list-all-red-yellow","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.19 Query agent penalty list (all, red, yellow)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\tObtain the penalty record (red card and yellow card penalty) obtained by the consensus agent. The user can customize the query for all penalty records or only the red card or yellow card penalty information.\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get the penalty based on the type of query\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the penalty record specifying the block address\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getPunishList",\n "version:"1.0",\n "params":["address",0,"chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Block address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Penalty type 1 yellow card, 2 red card, 0 all")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "type",, \n "address","", \n "time","", \n "height",, \n "roundIndex",, \n "reasonCode","" \n },{\n ......\n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("total pages")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("byte")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Type of punishment")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("punishment time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Punish the height of the block")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("roundIndex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("round")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reasonCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reason for punishment")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-20-query-the-list-of-delegates-according-to-the-principal-according-to-the-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-query-the-list-of-delegates-according-to-the-principal-according-to-the-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.20 Query the list of delegates (according to the principal, according to the agent)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("1. Query the list of all delegation information participating in the specified \t address\n2. Query the delegation information of the specified consensus agent participating in the specified account\n3. Query the specified consensus agent trust list information\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- Verify parameter correctness\n- Get a list of participating consensus information on the local primary chain\n- Filter the consensus list to get the consensus list of the specified account participation or the consensus list information of the specified agent\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\tObtain the consensus list information accepted by the specified account or specified by the consensus agent. When querying all the consensus lists of the specified account, the agentHash field is passed "". When all the delegated lists of the specified agent need to be queried, the address field is passed "".\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getDepositList",\n "version:"1.0",\n "params":[1,10,"address","agentHash","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Amount of data per page")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('The account address of the participating delegation (the entrusted information of the query agent is the designated pass "")')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('Specify the proxy agent ID (this field is passed "" when querying all account delegation information)')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"pageNumber":1, //page number \n \t"pageSize":10, //Amount of data per page\n \t"total":100, //Total data volume\n \t"pages",10, //total pages\n \t"data":[\n {\n "agentHash":"", \n "address";"", \n "deposit";, \n "time";, \n "blockHeight";, \n "delHeight":, \n "txHash":"", \n "status":, \n "agentName":"", \n "agentAddress":"" \n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Amount of data per page")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("otal data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("page number")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Apply to join the consensus account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Commission time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The height of the block where the transaction is located")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Exit the height of the commissioned exchange")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent status (to be agreed, consensus)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-21-query-the-consensus-status-of-the-entire-network"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-query-the-consensus-status-of-the-entire-network","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.21 Query the consensus status of the entire network")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery the overall information of the network consensus, including the number of agents, total mortgage, total number of participating consensus accounts, etc.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Get a list of network-wide consensus agents\n- Filter the list of consensus agents and wait until the list of valid consensus agents\n- Get current package round information\n- According to the current package round information, the total amount of accounts and the total amount of entrusted funds that the current network participates in the consensus\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tQuery the number of agents in the whole network, the total commission amount, the accounts participating in the consensus, and the number of consensus agents that meet the packaging conditions.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getWholeInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentCount":, \n "totalDeposit":, \n "rewardOfDay":, \n "consensusAccountNumber":, \n "packingAgentCount": \n \t}\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of agents")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Total amount of entrusted amount")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Reward amount within 24 hours")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("consensusAccountNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Number of accounts participating in the consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current rounded number of consensus agents")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-22-query-individual-account-consensus-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-query-individual-account-consensus-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.22 Query individual account consensus status")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Get a list of network-wide consensus nodes\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("Query the consensus information of the specified account, including the number of consensus nodes created by the account and the node hash, the total amount of participation in the consensus, the number of consensus nodes participating in the account, the available balance, the consensus bonus, and the consensus bonus obtained within 24 hours.\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getInfo",\n "version:"1.0",\n "params":["address","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Account address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "agentCount":, \n "totalDeposit":, \n "joinAgentCount":, \n "usableBalance":, \n "reward":, \n "rewardOfDay":, \n "agentHash":"" \n \t}\n }\n}\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"错误Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Object")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus information")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The number of agents created by this account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The total commission amount of the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("joinAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The number of consensus agents participating in the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("usableBalance")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reward")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("All rewards for account participation consensus")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus rewards obtained within 24 hours of the account")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The hash of the agent created by the account")])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-23-verify-block-correctness"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-verify-block-correctness","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.23 Verify block correctness")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Verify the block round information, package the person, the transaction information in the block, whether the CoinBase is correct, and verify whether there is red and yellow card transaction generation.\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Verify fork (call block management module interface), generate red card trade with fork\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("This interface is mainly to verify the block round information, the packager, the transaction in the block and whether the CoinBase is correct, and verify whether there is a red and yellow card penalty.\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_validSmallBlock",\n "version:"1.0",\n "params":["SmallBlock","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smallBlock")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("SmallBlock serialization data")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-24-consensus-module-batch-verification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-24-consensus-module-batch-verification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.24 Consensus module batch verification")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Consensus module transaction batch verification, verify the correctness of each transaction, verify transaction conflict\n")])])])]),this._v(" "),e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" - Cycle to verify that each transaction is correct\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n- Interface definition\n\n- Interface Description\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("Loop to verify that each transaction in the incoming transaction list is correct and verify that there is a conflicting transaction in the transaction list\n```\n")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_batchValid",\n "version:"1.0",\n "params":[["tx1","tx2","tx3"],"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1,tx2,tx3......")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Serialized data for transactions")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //error code\n "msg": "Prompt message", //Prompt message \n "result": { //Returned business data set \n \t\t"data":[\t\t\t\t\t\t\t \n \t\t\t\t"tx1_hash",\n \t\t\t\t"tx2_hash",\n \t\t\t\t"tx3_hash"\n \t\t\t ]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Verify the list of transactions that failed")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1_hash,tx2_hash,tx3_hash.....")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Verify the hash of the transaction that failed")])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-25-get-current-round-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-get-current-round-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.25 Get current round information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function Description:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the package round information of the current network consensus node, including the consensus node of the current network in the packed state, the start end time of the current round of packaging, and the basic information of all the packed nodes in the current round.\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Process description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nothing\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface Description")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Query the current network consensus node packaging round information\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Request example")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getRoundInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "totalWeight":, \n "index":, \n "startTime":, \n "endTime":, \n "memberCount":,\n "memberList":[\n {\n "agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"Weight":\n },{\n \n }\n ],\n "myMember":{\n \t"agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"weight":\n }\n \t}\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("totalWeight")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("double")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Total weight (used to calculate consensus rewards)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("index")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current round subscript")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("startTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current round start packing time")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("endTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current end of packaging time")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("memberCount")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current number of packaged packages")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("myMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("MeetingMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("Current agent packing information")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Packed address")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingIndexOfRound")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("The consensus agent packs the subscript in the current round")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Credit value")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packStartTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent packaging start time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packEndTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent packaging end time")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("weight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current consensus agent weight (total commission amount * credit value)")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-26-specify-consensus-agent-status-query"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-specify-consensus-agent-status-query","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.26 Specify consensus agent status query")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the current status of the specified consensus agent (consensus, packaged)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Query whether the agent exists\n- Query agent status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Query the current status of the specified consensus agent\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgentStatus",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agnet ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t"data":{\n "status":1 \n \t}\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agent status (0 consensus, 1 package)")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-27-modify-agent-packing-status"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-modify-agent-packing-status","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.27 Modify agent packing status")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("\tWhen the local agent starts, notify the consensus module to package after the block management module synchronizes the block.\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- Modify agent packing status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Modify agent packing status\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_updatePackStatus",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-28-stop-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-stop-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.28 Stop chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Pause a running chain\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Pause a running chain\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopChain",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("chain ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-29-run-a-new-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-run-a-new-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.29 Run a new chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function Description:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Run a new subchain locally \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("nothing\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface Description")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("Run a new subchain locally\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_runChain",\n "version:"1.0",\n "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter description(待完善)")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("packing_interval")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Packing interval (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("packing_amount")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Minimum amount of the block")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("coinbase_lockHeight")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Bonus lock block number")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("redPublish_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Get red card margin lock time (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("stopAgent_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("Logout agent margin lock time (unit: s)")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("commissionRate_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("Commission ratio minimum")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("commissionRate_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("Commission ratio maximum")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("deposit_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Create a agent margin minimum amount")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("deposit_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Create a agent margin maximum amount")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("commission_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Commissioned consensus minimum amount")])]),t._v(" "),a("tr",[a("td",[t._v("11")]),t._v(" "),a("td",[t._v("Commission_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Maximum amount of commissioned consensus")])])])])]),t._v(" "),a("li",[a("p",[t._v("Return example")]),t._v(" "),a("p",[t._v("success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //error code\n "msg": "success", //Prompt message\n "version":"1.0", \n "result": { //Returned business data set \n \t\n }\n}\n\n\n')])])]),a("p",[t._v("fail")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //error code\n \t "msg" :"Prompt message", //Prompt message\n "result":{\n \n \t }\n}\n\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Return parameter description")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module internal function")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Consensus module startup process")]),t._v(" "),a("p",[t._v("initialization:")]),t._v(" "),a("ul",[a("li",[t._v("Load consensus module configuration information (out of block interval, bonus lock block number)")]),t._v(" "),a("li",[t._v("Register Consensus Module Transaction, Transaction Verifier, Transaction Processor (registered with Transaction Module)")]),t._v(" "),a("li",[t._v("Register Consensus Module Service Interface (registered with the core module)")]),t._v(" "),a("li",[t._v("Register consensus module event (register with event bus module)")])]),t._v(" "),a("p",[t._v("start up:")]),t._v(" "),a("ul",[a("li",[t._v("Get the latest round of block information in the database and calculate the round information")]),t._v(" "),a("li",[t._v("Get current protocol version information and cache")]),t._v(" "),a("li",[t._v("Start each relevant thread")])])]),t._v(" "),a("li",[a("p",[t._v("Package out process")]),t._v(" "),a("ul",[a("li",[t._v("Determine if the agent meets the requirements for becoming a packed agent")]),t._v(" "),a("li",[t._v("Calculate packaging round information")]),t._v(" "),a("li",[t._v("Waiting for packing out")]),t._v(" "),a("li",[t._v("Receive the latest block. If you wait for 5 seconds and have not received the latest block, the default last block agent does not have a block, and the current agent continues to perform the packing operation.")]),t._v(" "),a("li",[t._v("Verify the transactions that need to be packaged, and eliminate the new package after the duplicate package transaction")]),t._v(" "),a("li",[t._v("Verify the packaged new block and save the relevant data to the database")]),t._v(" "),a("li",[t._v("Broadcast block")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(378),alt:""}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",[n("p",[t._v("Consensus reward statistics")]),t._v(" "),n("p",[n("img",{attrs:{src:a(379),alt:""}})]),t._v(" "),n("ul",[n("li",[t._v("Get a list of local accounts")]),t._v(" "),n("li",[t._v("Get a list of blocks within 24 hours")]),t._v(" "),n("li",[t._v("Traverse block list to get CoinBase transactions")]),t._v(" "),n("li",[t._v("According to the CoinBase transaction, update the total reward amount within 24 hours, the accumulated bonus amount of the local account within 24 hours, and the reward details within 24 hours.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_4、event-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、event-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 4、Event description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-1-block-packaging-success-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-block-packaging-success-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.1 Block packaging success event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: This event is released when a new zone is successfully packaged successfully.\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_packing"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "smallBlock":"Serialize a smallBlock object into a hex string"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-2-create-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-2-create-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.2 Create agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the create agent transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_createAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //List of consensus agents created in the packaging block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-3-logout-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-3-logout-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.3 Logout agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the logout agent transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_stopAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //List of consensus agents that are logged out in the packaging block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-4-consensus-agent-state-change-in-the-consensus-out-of-the-block"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-4-consensus-agent-state-change-in-the-consensus-out-of-the-block","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.4 Consensus agent state change (in the consensus, out of the block)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event when the consensus agent status changes\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_agentStatusChage"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //The list of consensus agents for the table in the state of the packed block\n "agent1", //Serialization of the Agent object to a hex string\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-5commission-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-5commission-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.5Commission consensus")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the delegate consensus transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_deposit"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //Delegate list in the packaging block\n "deposit1", /Deposit object serialized to a hex string\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-6-exit-consensus"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-6-exit-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.6 Exit consensus")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Issue the event after the exit consensus transaction is confirmed and packaged into the block\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_withdraw"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //Exit the delegation list in the packaging block\n "deposit1", //The deposit object is serialized as a hex string\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-7-yellow-card-penalty"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-7-yellow-card-penalty","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.7 Yellow card penalty")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: When there is a consensus agent to get a yellow card penalty is to issue the event\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_yellowPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "yellowPublishList":{ //Yellow card list in the packing block\n "yellowPublish1", //YellowPublish object serialized to a hex string\n "yellowPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-8-red-card-penalty"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-8-red-card-penalty","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.8 Red card penalty")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Description: Obtain the event when there is a consensus agent to get a red card transaction\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_redPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "redPublishList":{ //Red card list in the package block\n "redPublish1", //Serializing a RedPublish object to a hex string\n "redPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nothing\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 Network communication protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"broadblock"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#broadblock","aria-hidden":"true"}},[this._v("#")]),this._v(" broadBlock")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Send a new block (SmallBlock)")]),t._v(" "),a("li",[t._v("Get blocks based on hash")]),t._v(" "),a("li",[t._v("Send a full block")]),t._v(" "),a("li",[t._v("Get multiple blocks based on height")]),t._v(" "),a("li",[t._v("Get a list of transactions based on the trade hash list")]),t._v(" "),a("li",[t._v("Send a list of transactions")]),t._v(" "),a("li",[t._v("Get SmallBlock based on hash")]),t._v(" "),a("li",[t._v("Get block hash list based on height interval")]),t._v(" "),a("li",[t._v("Get the SmallBlock list based on the height interval")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("??")]),t._v(" "),a("td",[t._v("smallBlock")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("SmallBlock object serialized hex string")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、Module configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n {\n "name": "packing_interval",\n "remark": “packaging interval”,\n "changable": "true",\n "default": "10秒"\n },\n {\n \t"name": "packing_amount",\n "remark": “minimum amount of the block”,\n "changable": "true",\n "default": "200000"\n },\n {\n \t"name": "coinbase_unlock_height",\n "remark": “Number of bonus lock blocks”,\n "changable": "true",\n "default": "100"\n },\n {\n \t"name": "redPublish_lockTime",\n "remark": “Get red card margin lock time”,\n "changable": "true",\n "default": "3 months"\n },\n {\n \t"name": "stopAgent_lockTime",\n "remark": “Logout agent margin lock time”,\n "changable": "true",\n "default": "3 days"\n },\n {\n \t"name": "commissionRate_min",\n "remark": “minimum and minimum commission ratio”,\n "changable": "true",\n "default": "10"\n },\n {\n \t"name": "commissionRate_max",\n "remark": “Maximum commission ratio”,\n "changable": "true",\n "default": "80"\n },\n {\n \t"name": "deposit_min",\n "remark": “Create the minimum margin for the agent”,\n "changable": "true",\n "default": "20000"\n },\n {\n \t"name": "deposit_max",\n "remark": “Create the maximum margin for the agent”,\n "changable": "true",\n "default": "700000"\n },\n {\n \t"name": "commission_min",\n "remark": “trust the maximum amount”,\n "changable": "true",\n "default": "2000"\n },\n {\n \t"name": "commission_max",\n "remark": “delegate the minimum amount”,\n "changable": "true",\n "default": "680000"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、java-specific-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、java-specific-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、Java-specific design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"八、to-add-on"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#八、to-add-on","aria-hidden":"true"}},[this._v("#")]),this._v(" 八、to add on")])}],s=a(0),i=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\tAs we all know, the core of the blockchain is the consensus mechanism. Unlike the traditional Internet's clipet-server architecture, the agents of the blockchain are peer-to-peer, without the center, and everyone has the same rights; so in order to make the data consistent, let a network without a center maintain a set of books that everyone agrees with. This is the role of the consensus mechanism.")]),t._v(" "),a("p",[t._v("​\tBroadly speaking, the consensus mechanism is the rule or algorithm that each agent of the blockchain adheres to, and is the basis for mutual trust. In this way, it can achieve decentralized unsupervised and maintain the normal operation of the entire platform.")]),t._v(" "),a("p",[t._v("​\tIn a narrow sense, the consensus mechanism determines the mechanism by which each agent verifies and validates transactions on the blockchain.")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("​\tEach transaction in the blockchain must be approved by each agent, and the transaction is completed only after the entire network has reached a consensus. It is like in a democratic election, the voting method or rules must be recognized by the whole people, based on which the election can be completed. In the blockchain, the main performance of the consensus mechanism is the incentive system, which is the reward for the miners. Under the guarantee of the consensus mechanism, every miner can be rewarded, and the entire blockchain can operate in an orderly manner, providing a fair, transparent and trusting environment. Therefore, the consensus module needs to provide a specific algorithm to maintain, that is, the consensus algorithm.")]),t._v(" "),a("p",[t._v("​\tThere are many public chain consensus mechanisms, and the mainstream is POW, POS, and DPOS. The NULS main network adopts the self-originated POC (Proof Of Credit) consensus mechanism, which inherits the security and high efficiency of the Dpos consensus mechanism. At the same time, it has made great improvements in collaboration, which can be regarded as an upgraded version. Dpos.")]),t._v(" "),a("p",[t._v("​\tPOC Consensus module responsibility:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("​\tThe consensus module is a relatively core piece in the system. It is mainly responsible for packing transactions, verifying block headers, managing consensus agent information in the management system, entrusting information, and penalizing information.")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Description:")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("​\tThe NULS 2.0 design concept is to provide modular services, and each module should support multiple chains of data running at the same time, so the consensus module needs to implement algorithms with different consensus mechanisms. When the consensus module is started, it can simultaneously support multiple chains to run at the same time.")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("​\tThe main network of NULS adopts the independent POC consensus mechanism. To realize POC, you first need to know the design concept and business rules of POC. The following content is taken from the introduction part of the NULS white paper POC consensus. If you are familiar, you can skip it directly.")]),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),a("p",[t._v("The above is a functional analysis of the implementation of the consensus module POC consensus mechanism. The details of each function implementation are described in the next section.")]),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("​\tThe consensus module is the core module of the blockchain. Due to the different consensus mechanisms, the services provided by the outside are not the same. The module service will describe in detail the services shared by the consensus module and the services specific to the POC mechanism.")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),a("ul",[t._m(60),t._v(" "),t._m(61),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(66),t._v(" "),a("tbody",[t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Agent")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Consensus agent list")])])])]),t._v(" "),a("p",[t._v("Agent:")]),t._v(" "),t._m(71)])])])]),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),a("ul",[t._m(75),t._v(" "),t._m(76),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(81),t._v(" "),a("tbody",[t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Punish")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Penalty list data")])])])]),t._v(" "),a("p",[t._v("Punish:")]),t._v(" "),t._m(86)])])])]),t._v(" "),t._m(87),t._v(" "),a("ul",[t._m(88),t._v(" "),t._m(89),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(94),t._v(" "),a("tbody",[t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Deposit")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Json string of consensus data list")])])])]),t._v(" "),a("p",[t._v("Deposit:")]),t._v(" "),t._m(99)])])])]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),a("p",[t._v("- Check if there is a consensus node created by the account in the consensus node list\n   - Get the current network delegate list\n   - Get the list of delegates participating in the account from the delegate list\n   - Obtain commission information for the account from the delegate list of the account")]),t._v(" "),t._m(104),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),a("p",[t._v("- Verify double flower (call transaction module interface), generate double card transaction with double flower and return to verify fail directly\n   - Generate red card trades and place red card trades in the trading pool to be packaged\n   - Verify block rotation information and packager correct\n   - Verify transaction correctness in the block (call transaction module interface)\n   - Verify CoinBase transactions")]),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("- Verify that there is a conflicting transaction in the transaction list")]),t._v(" "),t._m(114),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),a("ul",[t._m(118),t._v(" "),t._m(119),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(120),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),a("li",[a("p",[t._v("Return parameter description")]),t._v(" "),a("p",[t._v("data")]),t._v(" "),a("table",[t._m(124),t._v(" "),a("tbody",[t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberList")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("MeetingMember")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Current round packed agent packing information")])]),t._v(" "),t._m(130)])]),t._v(" "),a("p",[t._v("MeetingMember")]),t._v(" "),t._m(131)])])])]),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),a("p",[t._v("​\tThe POC consensus mechanism is to take the agent round out of the block that participates in the consensus, reach a consensus, and jointly maintain a set of books. However, due to network reasons or some consensus agents do evil (send different packing blocks to different agents), there will be bifurcation. For this malicious agent system, different penalties will be given according to the severity, when it is a turn When the agent fails to issue the block at the specified time, the system will give the agent a yellow card penalty. The penalty will lower the credit value of the agent. When the agent credit value drops to -1, the agent will be punished with a red card; The agent will be directly punished with a red card. The agent that receives the red card penalty will stop packing and the agent will never be able to create a consensus agent again, and the margin will be frozen for a certain period of time. The other commissioned amount of the agent will be returned to the client; When a normal block is issued, the agent will receive a block reward, and the account entrusted to the agent will also receive a corresponding proportion of the bonus according to the amount of the commission.")]),t._v(" "),a("p",[t._v("​\tIn addition to providing packaged blocks, the consensus module will also do the statistical work of bonuses, statistics on the total amount of rewards issued within 24 hours, the amount of rewards accumulated in local accounts within 24 hours, and the details of rewards within 24 hours.")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._m(148),t._m(149),t._m(150),t._v(" "),t._m(151),t._m(152),t._m(153),t._m(154),t._v(" "),t._m(155),t._m(156),t._m(157),t._m(158),t._v(" "),t._m(159),t._m(160),t._m(161),t._m(162),t._v(" "),t._m(163),t._m(164),t._m(165),t._m(166),t._v(" "),t._m(167),t._m(168),t._m(169),t._m(170),t._v(" "),t._m(171),t._m(172),t._m(173),t._m(174),t._v(" "),t._m(175),t._m(176),t._m(177),t._m(178),t._v(" "),t._m(179),t._m(180),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),a("p",[t._v("New area for broadcast packaging")]),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),t._m(186),t._m(187),t._v(" "),t._m(188)])},n,!1,null,null,null);i.options.__file="consensusModuleDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/51.b430df64.js b/docs/.vuepress/dist/assets/js/51.b430df64.js new file mode 100644 index 00000000..dbfb107d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/51.b430df64.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{387:function(t,e,a){t.exports=a.p+"assets/img/ledger-arch.865ff93a.png"},388:function(t,e,a){t.exports=a.p+"assets/img/ledger-functions.e4039436.png"},389:function(t,e,a){t.exports=a.p+"assets/img/ledger-service.219cab8a.png"},390:function(t,e,a){t.exports=a.p+"assets/img/eth-transaction-flow.6f3dd253.png"},391:function(t,e,a){t.exports=a.p+"assets/img/trx-validate-flow.fd3d46e4.png"},961:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"account-ledger-module-design-document"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#account-ledger-module-design-document","aria-hidden":"true"}},[this._v("#")]),this._v(" Account Ledger module design document")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_1-overall-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Overall description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-module-overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-module-overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Module Overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-do-you-have-a-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-do-you-have-a-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.1 Why do you have a "Ledger module"?')])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The ledger module is the data hub of the blockchain. The balances and transactions of all accounts are saved in the ledger module.\n  A network-wide account ledger is saved on each network node to ensure complete, open and transparent data, while ensuring that data cannot be tampered and traceable.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-what-should-be-done-in-the-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-should-be-done-in-the-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 What should be done in the Ledger Module?")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Provide data support for assembly transactions, mainly accounting and auditing, verify the legality of the transaction, such as: whether there is sufficient balance, whether to repeat payment (double flower)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-positioning-of-the-ledger-module-in-the-system"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning-of-the-ledger-module-in-the-system","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.3 Positioning of the "Ledger module" in the system')])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The ledger module is the data hub, which stores the result data of all existing transactions in the system. It does not depend on any business modules, and other modules depend on it as needed.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-4-explanation-of-terms-in-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-4-explanation-of-terms-in-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.4 Explanation of terms in "Ledger module"')])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("The random number of the transaction (nonce, a 32-bit hash value)\n"),a("ul",[a("li",[t._v("nonce: A scalar value equal to the number of transactions sent at this address, which will be included in every transaction initiated by the user.")]),t._v(" "),a("li",[t._v("Each transaction in the account needs to save the nonce (hash) of the previous transaction")]),t._v(" "),a("li",[t._v("Strictly speaking, a nonce is an attribute of the originating address (it only makes sense in the context of the sending address). However, the nonce is not explicitly stored in the blockchain as part of the account status.")]),t._v(" "),a("li",[t._v("The nonce value is also used to prevent incorrect calculation of account balances. For example, suppose an account has 10 NULS balances and signs two transactions, all of which cost 6 NULS with nonce 1 and nonce 2, respectively. Which of the two transactions is valid? In a blockchain distributed system, nodes may receive transactions out of order. Nonce forces transactions of any address to be processed in order, regardless of the interval, regardless of the order in which the nodes receive. This way, all nodes will calculate the same balance. The transaction paying 6 Ethereum will be successfully processed and the account balance will be reduced to 4 ether. Whenever it is received, all nodes believe that the transaction with nonce 2 is invalid. If a node receives a nonce 2 transaction first, it will hold it, but will not verify it until it receives and processes the nonce 1 transaction.")]),t._v(" "),a("li",[t._v('Use nonce to ensure that all nodes calculate the same balance and correctly sort the transactions, which is equivalent to the mechanism used in Bitcoin to prevent "double payment". However, because Ethereum tracks account balances and does not track individual coins separately (called UTXO in Bitcoin), "double payments" occur only when the account balance is incorrectly calculated. The nonce mechanism prevents this from happening.')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The core of the Ledger is assets management and ledger management.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(387),alt:"ledger-arch.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_2-functional-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. functional design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional Architecture")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(388),alt:"ledger-functions.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Module Service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-system-service-of-the-ledger-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-system-service-of-the-ledger-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 System Service of the Ledger Module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(389),alt:"ledger-service.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("The RPC interface call provided by the ledger module. For detailed interface, please refer to the interface design section.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-modifying-system-operating-parameters"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-modifying-system-operating-parameters","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Modifying system operating parameters")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Only rely on the core system, the core system can start, stop, modify parameters, etc. of the event module system,")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-internal-function"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-internal-function","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module internal function")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-hot-online-transaction-processing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-hot-online-transaction-processing","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 Hot (online) transaction processing")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Module internal work mainly includes asset management, obtaining account address balance and nonce, and verifying transaction coinData.")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("asset Management\n"),a("ul",[a("li",[t._v("Total assets of the account")]),t._v(" "),a("li",[t._v("Available assets")]),t._v(" "),a("li",[t._v("Freeze assets. For locked assets, separate record and locked asset information, including chain ID, asset ID, asset amount, lock time, lock height, etc.")]),t._v(" "),a("li",[t._v("In the asset unlocking process, when the user's locked asset time or height reaches the unlock condition, the account will unlock the asset information, accumulate the available balance, and delete the asset lock record of the local data.")]),t._v(" "),a("li",[t._v("Multi-asset situation, need to join chainId.")])])]),t._v(" "),a("li",[t._v("Get account address balance and nonce\n"),a("ul",[a("li",[t._v("Get account address balance")]),t._v(" "),a("li",[t._v("Get the account address nonce (the nonce is a hash value, meaning that the nonce of the first transaction is 0. Each transaction in the account will contain the nonce value of the previous transaction)")])])]),t._v(" "),a("li",[t._v("Verify the transaction\n"),a("ul",[a("li",[t._v("Double flower verification (nonce mechanism prevents double payment)")]),t._v(" "),a("li",[t._v("Transaction creator verification, verifying that the issuer of the transaction has sufficient balance to verify that the nonce of the transaction creator is legal")]),t._v(" "),a("li",[t._v("Continuous transaction verification")])])]),t._v(" "),a("li",[t._v("Function Interface Management (rpc)\n"),a("ul",[a("li",[t._v("rpc interface for use by other modules")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-cold-offline-transaction-processing"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-cold-offline-transaction-processing","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 Cold (offline) transaction processing")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("A cold wallet is an unconnected wallet, also called an offline wallet. A hot wallet is a wallet that keeps online, that is, an online wallet. Cold wallets are not more secure than hot wallets.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Since the cold wallet only signs the transaction information, the signed hex string is transmitted to the server through the hot wallet, and then the server performs unified transaction processing, so the client needs to perform the offline signature function.\nThe offline transaction system maintains the storage information of the nonce. After using a nonce, the nonce is saved in the business system.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-4-ledger-flowcharts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-ledger-flowcharts","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Ledger flowcharts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-1-transfer-transaction-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-1-transfer-transaction-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.1 Transfer Transaction Process")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("User enters the address of the transfer and the transferred address and the transferred amount")]),t._v(" "),a("li",[t._v("The system signs the transfer information by the private key of the transferred address (used to prove that the transaction was actually initiated by me)")]),t._v(" "),a("li",[t._v("The system verifies the transaction information\n"),a("ul",[a("li",[t._v("Balance verification")]),t._v(" "),a("li",[t._v("Fee verification")]),t._v(" "),a("li",[t._v("nonce continuity verification")]),t._v(" "),a("li",[t._v("Signature and input account verification")])])]),t._v(" "),a("li",[t._v("Put this transaction into the local TxPool (that is, the account unconfirmed trading pool)")]),t._v(" "),a("li",[t._v("Broadcast transaction information to other nodes")]),t._v(" "),a("li",[t._v("Packing blocks, verifying blocks")]),t._v(" "),a("li",[t._v("Confirm transaction\n"),a("ul",[a("li",[t._v("Update the balance of all accounts related (transferred or transferred)")]),t._v(" "),a("li",[t._v("Update the nonce corresponding to the account asset")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-2-ordinary-transaction-process-reference-example"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-2-ordinary-transaction-process-reference-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.2 Ordinary transaction process (reference example)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(390),alt:"eth-transaction-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-3-transaction-verification-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-3-transaction-verification-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.3 Transaction verification process")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(391),alt:"trx-validate-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_3-interface-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.Interface design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-1-module-core-interaction-interface"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-module-core-interaction-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 Module core interaction interface")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-1-get-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-get-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 Get account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalance")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("remarks: 1NULS=10^8Na")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("DESC")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",[t._v("freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("freeze")])]),t._v(" "),a("tr",[a("td",[t._v("total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-2-get-the-current-account-nonce-value"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-get-the-current-account-nonce-value","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 Get the current account nonce value")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description(request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxx"')]),t._v(",\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonceType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Spending transaction hash")])]),t._v(" "),a("tr",[a("td",[t._v("nonceType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1The last transaction has been confirmed, 0 the transaction has not been confirmed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-3-get-balance-and-nonce-value"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-get-balance-and-nonce-value","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 Get balance and nonce value")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalanceNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:""}},[e("a",{staticClass:"header-anchor",attrs:{href:"#","aria-hidden":"true"}},[this._v("#")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The address to check the balance")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"34"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("User available balance")])]),t._v(" "),a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("A random value of the account that holds the hash of the user's last transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-4-verify-coindata"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-verify-coindata","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.4 Verify coinData")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: validateCoinData")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-4","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("458")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"success"')]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("validateCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 check pass, 2 orphan trade 3 double flower 4 other abnormalities")])]),t._v(" "),a("tr",[a("td",[t._v("validateDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Check return description")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-5-submit-unconfirmed-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-5-submit-unconfirmed-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.5 Submit unconfirmed transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: commitUnconfirmedTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-5","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 submission passed, 0 submission failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-6-batch-verification-notify"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-6-batch-verification-notify","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.6 Batch verification notify")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: bathValidateBegin")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-6"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-6","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链Id")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-4","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("1成功,0失败")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-7-receive-batch-verification-one-by-one"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-7-receive-batch-verification-one-by-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.7 Receive batch verification one by one")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: bathValidatePerTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-7"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-7","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-5","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1 success, 0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-8-submit-confirmation-transactions-one-by-one"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-8-submit-confirmation-transactions-one-by-one","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.8 Submit confirmation transactions one by one")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: commitConfirmTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-8"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-8","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-6"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-6","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1Success,0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-9-rollback-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-9-rollback-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.9 Rollback transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: rollBackConfirmTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-9"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-9","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Transaction hex stream")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description:-response-7"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description:-response-7","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1Success,0 failed")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-2-other-interface"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-other-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Other interface")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-2-1-obtain-asset-information-based-on-asset-id"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-obtain-asset-information-based-on-asset-id","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2.1 Obtain asset information based on asset id")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getAsset")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"parameter-description-request-10"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#parameter-description-request-10","aria-hidden":"true"}},[this._v("#")]),this._v(" Parameter Description (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Required or not")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Chain id of the interface call chain")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"return-value-description-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#return-value-description-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" Return value description (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Field")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("Desc")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("The chain ID of the initiating call")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset-initiated chain id")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Asset ID")])]),t._v(" "),a("tr",[a("td",[t._v("balance.available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Available Balance")])]),t._v(" "),a("tr",[a("td",[t._v("balance.freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("Freeze balance")])]),t._v(" "),a("tr",[a("td",[t._v("balance.total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_4-description-of-the-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-description-of-the-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Description of the event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("does not depend on any events")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_5-agreement"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-agreement","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. agreement")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-network-communication-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-network-communication-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 Network Communication Protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-2-trading-agreement"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-trading-agreement","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 Trading Agreement")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_6-module-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-module-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Module Configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-1-configuration-instructions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-configuration-instructions","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 Configuration Instructions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-2-module-dependencies"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-module-dependencies","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 Module Dependencies")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Kernel module\n"),a("ul",[a("li",[t._v("Module registration")]),t._v(" "),a("li",[t._v("Module logout")]),t._v(" "),a("li",[t._v("Module status escalation (heartbeat)")]),t._v(" "),a("li",[t._v("Service interface data acquisition and timing update")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_7-java-specific-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-specific-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Java-specific design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("Core object class definition, storing data structures, ...")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"_8-supplementary-content"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[this._v("#")]),this._v(" 8. supplementary content")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"references-literature"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#references-literature","aria-hidden":"true"}},[this._v("#")]),this._v(" References Literature")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("\n")])])])}],r=a(0),n=Object(r.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),t._m(54),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._m(62),t._v(" "),t._m(63),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._m(78),t._v(" "),t._m(79),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._m(86),t._v(" "),t._m(87),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._m(94),t._v(" "),t._m(95),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._m(102),t._v(" "),t._m(103),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._m(110),t._v(" "),t._m(111),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._m(119),t._v(" "),t._m(120),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),a("p",[t._v("NA")]),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/inoutcode/ethereum_book/blob/master/%E7%AC%AC%E4%B8%83%E7%AB%A0.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Proficient in Ethereum - Chapter 7 Transaction"),a("OutboundLink")],1)])]),t._v(" "),t._m(135)])},s,!1,null,null,null);n.options.__file="ledgerModuleDesign.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/52.dc55c14c.js b/docs/.vuepress/dist/assets/js/52.dc55c14c.js new file mode 100644 index 00000000..e08bb78d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/52.dc55c14c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{408:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-ctosatellite.b4831c18.png"},409:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-satellitetoc.361d3fe7.png"},410:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-context.9c43a7b6.png"},411:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-architecture.a6fa2f65.png"},412:function(t,e,a){t.exports=a.p+"assets/img/tx-manager-functional-architecture.10e83f9b.png"},971:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"transaction-management-module-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transaction-management-module-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Transaction Management Module Design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、overview"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、overview","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、Overview")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-transaction-module"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-transaction-module","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Transaction Module")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-why-need-transaction-management"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-why-need-transaction-management","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.1 Why need "Transaction Management"')])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-transaction-management-what-can-do"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-transaction-management-what-can-do","aria-hidden":"true"}},[this._v("#")]),this._v(' 1.1.2 "Transaction Management" What can do')])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("一、Handling of ordinary transactions")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Collecting transactions")]),t._v(" "),a("li",[t._v("Local verification")]),t._v(" "),a("li",[t._v("Extract packageable transactions")]),t._v(" "),a("li",[t._v("Submit, rollback transaction")]),t._v(" "),a("li",[t._v("Save unconfirmed, packageable, and confirmed transactions")]),t._v(" "),a("li",[t._v("Provide data query for transactions")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("二、Processing cross-chain transactions")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",[e("li",[this._v("Friend chain sends a transaction to NULS mainnet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(408),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("The friend chain node initiates a new cross-chain transaction, which is confirmed inside the friend chain. When the friend chain reaches a certain number of confirmation blocks, the friend chain node will send the cross-chain transaction to the NULS mainnet nodes. "),e("strong",[this._v("For example, the friend chain node A sends the cross-chain transaction to the NULS mainnet node S, and the node S sends the transaction to the node other than the node A in the friend chain for verification.")]),this._v(" The NULS mainnet node S will receive the verification result of multiple friend chain nodes, and then calculate the node S's own cross-chain verification result, and then broadcast it to other nodes of the NULS mainnet, so each node of the NULS mainnet will The verification result of all other nodes is received, and finally the final verification result of the NULS mainnet is calculated.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The transaction management module will receive new cross-chain transactions from the friend chain")]),this._v(" "),e("li",[this._v("Verify cross-chain transactions with other nodes in the friend chain")]),this._v(" "),e("li",[this._v("Count the verification results of each node")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"2"}},[e("li",[this._v("NULS mainnet sends a transaction to the friend chain")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(409),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Send cross-chain transactions to the target chain")]),this._v(" "),e("li",[this._v("Receiving the verification request of the target chain node, extracting the corresponding transaction and sending it back")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ol",{attrs:{start:"3"}},[e("li",[this._v("Send a transaction between the friend chain and another friend chain")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-positioning"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-positioning","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 Positioning")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Kernel Module")]),this._v(" "),e("li",[this._v("Network Module")]),this._v(" "),e("li",[this._v("Chain Manager Module")]),this._v(" "),e("li",[this._v("Ledger Module")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(410),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Architecture diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(411),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Functional implementation logic of the interface")]),this._v(" "),e("li",[this._v("Validator manager, call transaction validator as needed")]),this._v(" "),e("li",[this._v("Queue for transaction reception, asynchronous verification processing, and push consensus")]),this._v(" "),e("li",[this._v("Cache, maintain node group, chain data and other basic data")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、feature-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、feature-design","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、Feature Design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-functional-architecture-diagram"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-functional-architecture-diagram","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Functional Architecture Diagram")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(412),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-the-core-processes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-the-core-processes","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 The Core Processes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-transaction-management-caches-data-from-other-modules"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-transaction-management-caches-data-from-other-modules","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 Transaction management caches data from other modules")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Maintain the basic data of all chains in the chain management module")]),t._v(" "),a("p",[t._v("The way to get the data is:")]),t._v(" "),a("ol",[a("li",[t._v("After the chain management is started, the chain management module interface is called")]),t._v(" "),a("li",[t._v("When a new chain completes registration, it is acquired periodically, event notification")])])]),t._v(" "),a("li",[a("p",[t._v("Maintain a collection correspondence between transaction and its validator, processor submission interface, and rollback interface with the transaction type as the key.")]),t._v(" "),a("p",[t._v("The way to get the data is:")]),t._v(" "),a("p",[t._v("After each module starts, it calls the transaction management module registration transaction interface to register itself.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-collect-new-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-collect-new-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 Collect new transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Collect new transactions created by each module of this node")]),t._v(" "),a("p",[t._v("Newly created transactions for each module (including cross-chain transactions), collected via the interface "),a("a",{attrs:{href:"#232-receive-local-new-transactions"}},[t._v("newTx")]),t._v(" provided by the transaction management module, When a new transaction is received, basic verification is performed first, then placed in the local transaction queue to be verified, waiting for the verification process.")]),t._v(" "),a("p",[t._v("Note: There are also cross-chain transactions in the pending local trading queue, which is the local verification process for all transactions.")])]),t._v(" "),a("li",[a("p",[t._v("Collect cross-chain transactions broadcast by other nodes")]),t._v(" "),a("p",[t._v("Cross-chain transactions broadcast by other nodes (provided that the cross-chain transaction has been packaged to confirm a certain height in the chain in which the transaction was created), will be sent by means of network messages, first sent the transaction hash, transaction management module Once received, send a message requesting a full transaction before receiving a full cross-chain transaction. After receiving, the basic verification will also be carried out, and then placed in the cross-chain transaction queue to be verified, waiting for the verification process.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-cross-chain-transaction-detailed-process"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-cross-chain-transaction-detailed-process","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 Cross-chain transaction detailed process")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("The a address in the A chain is the address of the NULS system format, Start with the A chainId")]),this._v(" "),e("li",[this._v("The b address in the B chain is the address of the NULS system format, Start with the B chainId")]),this._v(" "),e("li",[this._v("When the asset is transferred to the b address, the b address is not allowed to initiate a transaction in the A chain.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(1) Local process of cross-chain Transaction in the A chain")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",[a("li",[a("p",[t._v("The ledger module create the transfer transaction "),a("strong",[t._v("atx")]),t._v(" . If the cross-chain transaction is generated, the cross-chain module needs to be called to create the "),a("strong",[t._v("atx_trans")]),t._v(" of the NULS mainnet protocol and sign.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("According to the NULS mainnet protocol, the type, time, remark, and txData are extracted from the "),a("strong",[t._v("atx")]),t._v(" into the newly generated "),a("strong",[t._v("atx_trans")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v('Extract the CoinData data. If it is a UTXO model, calculate the actual payment amount based on the assets, input, output, and fee, and generate the NULS mainnet protocol (account balance model) "from"')]),t._v(" "),a("p",[t._v("from_total = input_utxo_total - output_utxo(not change) - fee")]),t._v(" "),a("p",[t._v('Recalculate the "to" of the NULS mainnet protocol')]),t._v(" "),a("p",[t._v("to = output_utxo(not change)")]),t._v(" "),a("p",[t._v('Note: Consider multi-address transfer. Calculate "from" to the owner of UTXO in input. If it is utxo of multiple addresses, calculate the multiple inputs and the output as the utxo owner.')]),t._v(" "),a("p",[t._v('For example: input has 3 addresses of utxo, transferred to 2 different addresses (not change),and the "from" of the three account balance models is calculated')]),t._v(" "),a("p",[t._v("from_1 = input_utxo1")]),t._v(" "),a("p",[t._v("from_2 = input_utxo2")]),t._v(" "),a("p",[t._v("from_3 = from_total - input_utxo1 - input_utxo2")]),t._v(" "),a("p",[t._v("to_1 = output(not change)_addr_1")]),t._v(" "),a("p",[t._v("to_2 = output(not change)_addr_2")]),t._v(" "),a("p",[t._v("The end result must be:from_total <= input_utxo_total、to_total = output_utxo(total except for change)。")])]),t._v(" "),a("li",[a("p",[t._v('If it is the account balance model, extract the corresponding "from" and "to", and generate CoinData of the NULS mainnet protocol.')])]),t._v(" "),a("li",[a("p",[t._v("The txData of the "),a("strong",[t._v("atx_trans")]),t._v(" transaction contains the hash of the "),a("strong",[t._v("atx")]),t._v(" transaction.")])]),t._v(" "),a("li",[a("p",[t._v("Finally, sign the "),a("strong",[t._v("atx_trans")]),t._v(" transaction and set up scriptSig")])])])]),t._v(" "),a("li",[a("p",[t._v("The "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction is sent to the transaction management module via the interface "),a("a",{attrs:{href:"#2322-receive-cross-chain-transactions-for-local-new-primary-network-protocols"}},[t._v("newCrossTx")]),t._v(" for broadcast. After the atx transfer transaction is generated in the A chain, it is sent to the transaction management module, and the basic format and legality of the transaction data are basically verified by the "),a("a",{attrs:{href:"#232-receive-local-new-transactions"}},[t._v("newTx")]),t._v(" interface, and then stored in the local transaction queue to be verified.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Receive transaction to deserialize data")])]),t._v(" "),a("li",[a("p",[t._v("Verify the basic format, legality, and integrity of Transaction data")])]),t._v(" "),a("li",[a("p",[t._v("Check the basic format, legality, and integrity of the chain and asset in coinData")])])])]),t._v(" "),a("li",[a("p",[t._v("The task that validates the transaction will take the transaction from the queue. First, the coinData is verified by the ledger module. After the verification, the corresponding transaction validator is found from the cache with the transaction type, and then the verification interface is called to verify. The verified transaction is broadcasted to other nodes in the chain through "),a("a",{attrs:{href:"#59-BroadcastTxMessage"}},[t._v("newHash")]),t._v(", and the transaction "),a("strong",[t._v("atx_trans")]),t._v(" of the mainnet protocol is broadcasted through "),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(", and will be placed in the transaction management module to be packaged in the transaction memory pool, waiting for the consensus package.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Check out the pending transaction at regular intervals")])]),t._v(" "),a("li",[a("p",[t._v("CoinData is verified by calling the account module interface")])]),t._v(" "),a("li",[a("p",[t._v("Verify the transaction by calling the validator interface of the transaction")])]),t._v(" "),a("li",[a("p",[t._v("Verify that the passed transaction is placed in the transaction memory pool to be packaged")])])])]),t._v(" "),a("li",[a("p",[t._v("When the consensus needs to be packaged, the "),a("a",{attrs:{href:"#233-get-packageable-transaction-list"}},[t._v("tx_packableTxs")]),t._v(" interface is called to obtain the packageable transaction set according to the chain id, the specified end packing time, and the maximum capacity value of the transaction data. At this time, the transaction management module obtains the transaction from the transaction memory pool to be packaged, and then performs the transaction. verification.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("First, take a transaction from the transaction memory pool to be packaged, and then perform a separate verification process (which is basically the same as step 2), and then put the corresponding collection by module.")])]),t._v(" "),a("li",[a("p",[t._v("This process is repeated until the specified end packing time or transaction maximum capacity value is reached.")])])])]),t._v(" "),a("li",[a("p",[t._v("According to the unified verifier of the ledger module, the CoinData of all transactions is verified at one time, the unverified transaction is obtained, and the unverified transaction is filtered out. and the transaction set of each module is verified according to each module unified transaction validator, and the unverified verification is obtained. The transaction then summarizes the results and then returns a packageable transaction set to the consensus module.")])]),t._v(" "),a("li",[a("p",[t._v("After the packaged block is verified, the block management module will call the "),a("a",{attrs:{href:"#234-transaction-commit"}},[t._v("tx_commit")]),t._v(" submission interface corresponding to the transaction, call the account module interface to update the balance and other book data, and finally call the save transaction interface "),a("a",{attrs:{href:"#236-save-transaction"}},[t._v("tx_save")]),t._v(", which means that the transaction is blocked. Chain confirmation.")]),t._v(" "),a("p",[t._v("PS: If a transaction is a non-cross-chain transaction, the normal transaction process is completed by this step.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(2) Cross-chain transactions enter the cross-chain process")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",{attrs:{start:"7"}},[a("li",[a("p",[t._v("The transaction management module of the A-chain node will always scan the cross-chain transactions in the blockchain. When the "),a("strong",[t._v("atx")]),t._v(" transaction is confirmed by the blockchain to confirm n heights, the A-chain node transaction management module sends a message to send the "),a("strong",[t._v("atx_trans")]),t._v(" transaction to the connected NULS mainnet nodes")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Send cross-chain transaction process")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("The A-chain node Anode1 broadcasts the hash of the "),a("strong",[t._v("atx_trans")]),t._v(" transaction to the connected NULS mainnet node through the message interface"),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(".")]),t._v(" "),a("li",[t._v("After the transaction management module obtains the transaction hash, it sends a message to acquire the complete cross-chain transaction to the A-chain node Anode1 through "),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v(".")]),t._v(" "),a("li",[t._v("The A-chain node Anode1 receives the request, and then sends the complete "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction to the main network node Mn through "),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v(", and the main network node transaction management module parses and processes the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")])])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet node transaction management module deserializes the atx_trans transaction and then performs a check.")]),t._v(" "),a("ul",[a("li",[t._v("Verify the basic format, legality, and integrity of the transaction data")]),t._v(" "),a("li",[t._v("Check the basic format, legality, and integrity of the chain and assets in coinData.")])])]),t._v(" "),a("li",[a("p",[t._v("For cross-chain verification, the NULS primary network node Mn will send "),a("strong",[t._v("atx_hash")]),t._v(" (transaction hash before protocol conversion) and "),a("strong",[t._v("atx_trans_hash")]),t._v(" (complete transaction hash after protocol conversion received by NULS mainnet) through the message interface "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" to the node except the Anode1 in the node connected to the A chain to verify the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Verification logic of node Anode2 performing verification in A chain")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("After receiving the message, the network module sends the message to the transaction management through the interface "),a("a",{attrs:{href:"#2315-verify-to-the-friend-chain-whether-the-transaction-is-confirmed"}},[t._v("verifyFc")]),t._v(". The transaction management module first queries the corresponding atx transaction from the database through atx_hash, and verifies that the block in which the transaction is located has been confirmed to be n block heights.")]),t._v(" "),a("li",[t._v("The atx transaction is protocol converted to generate a new "),a("strong",[t._v("Anode2_atx_trans")]),t._v(", and then the received "),a("strong",[t._v("atx_trans_hash")]),t._v(" is consistent with "),a("strong",[t._v("Anode2_atx_trans_hash")]),t._v(".")])]),t._v(" "),a("p",[t._v("After the above two verifications, the node Anode2 will send the atx_trans_hash and the acknowledgement height to the NULS mainnet node Mn through "),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v(".")]),t._v(" "),a("p",[a("strong",[t._v("Note")]),t._v(" : When the NULS mainnet node sends the cross-chain verification message "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" to the A-chain node group through the network module, the transaction management will cache the node information of successful transmission and failure. If the number of nodes successfully sent is less than S (the connection between Mn and A-chain) 51% of the number of nodes is resent to the failed node until S is not less than 51%.")])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet node Mn (consensus node) receives the message that the A chain node Anode2 verifies the transaction "),a("strong",[t._v("atx_trans")]),t._v(", and sends it to the transaction management through the transaction management "),a("a",{attrs:{href:"#2317-receive-cross-chain-verification-results"}},[t._v("verifyResult")]),t._v(" interface. The transaction management will store the verification result with the successfully sent node. After Mn receives all the verification results sent by the self, it calculates the percentage of the verification pass. If more than 51% of the nodes of all the link nodes pass the verification, the node Mn determines that the verification of the transaction atx_trans is passed, The node that failed to send is considered as failed to pass the verification.")]),t._v(" "),a("p",[t._v("Summary: The number of verification results received by the node Mn cannot be less than S. If it is less than S, the "),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v(" is resent to the node that has not responded to the result. The ordinary node of the NULS mainnet queries any node of the A chain, and the mainnet consensus node queries all nodes of the A chain. The normal node is deemed to have passed the transaction and forwarded the transaction if it is confirmed by any three nodes.")])]),t._v(" "),a("li",[a("p",[t._v("The consensus node Mn signs the cross-chain transaction "),a("strong",[t._v("atx_trans_hash")]),t._v(" and broadcasts the hash and signature data to the NULS mainnet through the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("The NULS mainnet consensus nodes receive messages sent by all other consensus nodes, and are collected and summarized by the transaction management module interface "),a("a",{attrs:{href:"#2318-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[t._v("crossNodeRs")]),t._v(". When the signer of a transaction exceeds 80% of the total number of consensus nodes, it is determined that the cross-chain transaction passed the verification of the mainnet, put in the transaction memory pool to be packaged, and wait for the package confirmation.")])]),t._v(" "),a("li",[a("p",[t._v("When the NULS mainnet node consensus module is to be packaged, the transaction module first takes the transaction (similar to step 4) and verifies the number of signatures of the cross-chain transaction atx_trans again (PS: Since the extracted transaction set contains transactions created by the NULS mainnet, such transactions do not have the step of verifying the number of signatures). CoinData is then verified by the ledger module, and if the transaction meets the requirements, the consensus module is sent into the block.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("(3) Cross-chain transactions into the process of the B chain")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ol",{attrs:{start:"14"}},[a("li",[a("p",[t._v("The transaction management module of the NULS mainnet node will always scan the cross-chain transactions in the blockchain. When the "),a("strong",[t._v("atx_trans")]),t._v(" transaction is found to be n heights by the blockchain, the "),a("strong",[t._v("atx_trans")]),t._v(" transaction is sent out to the connected B-chain nodes")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Send a cross-chain transaction process (similar to step 7)")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("The NULS primary network node Mn first broadcasts the hash of the atx_trans transaction to the connected B-chain node via the message "),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v(".")]),t._v(" "),a("li",[t._v("The transaction hash obtained by the transaction management module is sent through the "),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v(" to obtain the message of the complete cross-chain transaction to the NULS mainnet node Mn.")]),t._v(" "),a("li",[t._v("After receiving the message, the Mn network module sends the complete "),a("strong",[t._v("atx_trans")]),t._v(" cross-chain transaction to Bnode1 via "),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v(". After receiving the message, Bnode1 needs to use "),a("strong",[a("em",[t._v("the cross-chain module")])]),t._v(" to process the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")])])]),t._v(" "),a("li",[a("p",[t._v("The B-node node Bnode1 transaction management module sends the "),a("strong",[t._v("atx_trans")]),t._v(" transaction hash (which has been obtained in step 14-2) through "),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v(" to the node other than Mn in the node connected to the NULS mainnet to verify the "),a("strong",[t._v("atx_trans")]),t._v(" transaction.")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("Verification logic of node Mn2 performing verification in NULS mainnet")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("After receiving the message, the network module sends the message to the transaction management through the interface "),a("a",{attrs:{href:"#2316-verify-to-the-mainnet-whether-the-transaction-is-confirmed"}},[t._v("verifyMn")]),t._v(". The transaction management module first queries the corresponding "),a("strong",[t._v("atx")]),t._v(" transaction from the database through "),a("strong",[t._v("atx_hash")]),t._v(", and verifies that the block in which the transaction is located has been confirmed to be n block heights.")])]),t._v(" "),a("p",[t._v("After verification, node Mn2 will send the atx_trans_hash and the acknowledgement height to the B-chain node Bnode1 via "),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("When the B-chain node sends the cross-chain verification message "),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v(" to the NULS mainnet node group through the network module, the transaction management will cache the node information of the successful transmission and the failure. If the number of successfully sent nodes is smaller than S (S is 51% of the number of nodes connected to the NULS mainnet by Node Bnode1), the information is resent to the failed node. Until S is not less than 51%.")])]),t._v(" "),a("li",[a("p",[t._v("(Similar to step 10) The B-chain node Bnode1 receives the message that the mainnet node Mn verifies the transaction "),a("strong",[t._v("atx_trans")]),t._v(", and sends it to the transaction management through the transaction management "),a("a",{attrs:{href:"#2317-receive-cross-chain-verification-results"}},[t._v("verifyResult")]),t._v(" interface, Transaction management caches the verification results against the successful nodes that were sent. After receiving all the verification results sent by the self, Bnode1 calculates the percentage of the verification pass. If more than 51% of the nodes pass the verification, the node Bnode1 determines that the verification of the transaction atx_trans is passed (The node that failed to send is considered as not passing).")])]),t._v(" "),a("li",[a("p",[t._v("After the verification is passed, the transaction management module calls "),a("strong",[t._v("the cross-chain module")]),t._v(" to convert the "),a("strong",[t._v("atx_trans")]),t._v(" transaction through the protocol to generate the B-chain protocol transaction "),a("strong",[t._v("btx")]),t._v(" and broadcast it to the B-chain network through the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(". If the Bnode1 node is the B-chain nearest x-block outperger (POW needs Adaptation), the transaction needs to be signed and broadcast to the B-chain network via the "),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("The B-chain node receives the messages sent by other nodes, collects and summarizes the transaction management module interface "),a("a",{attrs:{href:"#2318-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[t._v("crossNodeRs")]),t._v(", and counts the signature of the transaction. When the signer reaches 80% of the latest 20 blockers, the transaction is verified and placed. Enter the packaged transaction memory pool and wait for the package confirmation (The packager also confirms the transaction and the packaged transaction contains all signatures).")])]),t._v(" "),a("li",[a("p",[t._v("(Similar to step 13)When the B-chain node consensus module is packaged, the transaction module first takes out the transaction consistently, verifies the signature number of the transaction btx again, and then verifies the CoinData through the account book module. If the requirements are met, the transaction transmission consensus module is packaged into the block.")])]),t._v(" "),a("li",[a("p",[t._v("When the new block verification is finalized, the entire cross-chain transaction process is completed.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-module-service"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-module-service","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Module Service")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-registration-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-registration-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 Registration transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description")]),t._v(" "),a("p",[t._v("The transaction type of each module, the corresponding transaction validator and the processor interface are cached.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the NULS mainnet is started, each module needs to register its transaction type, validator and other information with the transaction management module. The transaction management module will cache each transaction and the corresponding validator and processor interface. When a new transaction needs to be verified by the validator, the transaction management module will take out the corresponding validator interface name and call the validator interface for verification.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_register")])]),t._v(" "),a("p",[t._v("Interface description:The registration transaction needs to pass the transaction type, the verifier name, and the processor name to return whether the registration is successful.")])]),t._v(" "),a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_register"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleCode"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleValidateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"validateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commitCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rollbackCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"systemTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unlockTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifySignature"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txType"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"validateCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commitCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rollbackCmd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"systemTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"unlockTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifySignature"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Module code")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Module unified verifier interface name")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Array")]),t._v(" "),a("td",[t._v("Module transaction registration information list")])])])])]),t._v(" "),a("li",[a("p",[t._v("Object of the module transaction registration information list")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction Type")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Single transaction validator interface name")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor submit interface name")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor rollback interface name")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\t\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Return")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"_2-3-1-1-transaction-validator-processor-interface-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-1-transaction-validator-processor-interface-specification","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1.1 Transaction validator, processor interface specification")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[a("strong",[t._v("Module unified transaction verifier interface specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chianId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chianId")]),t._v(" "),a("td",[t._v("Chian Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Verify the failed transaction list")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("jsonArray")]),t._v(" "),a("td",[t._v("Verify the failed transaction serialization data array")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction validator interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chainId")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Verify the failed transaction list")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Verification passed return true")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction processor commit interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Commit successfully returns true, failure returns error message")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n\t"code":0,\n "result":{\n "value":true\n\t}\n}\n')])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Commit successfully returns true")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("Transaction processor rollback interface uniform specification")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("ul",[a("li",[t._v("result:Rollback successfully returns true, failure returns error message")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Rollback successfully returns true")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-receive-local-new-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-receive-local-new-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 Receive local new transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Collect newly created transactions from other modules of this node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When other modules in a node have new transactions, you need to call this interface for unified collection and processing. The transaction management module will place the new transaction in the unconfirmed queue and wait for the transaction thread to process it.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Basic verification of transactions, removal of duplicate transactions, illegally discarding")])]),t._v(" "),a("li",[a("p",[t._v("Put in pending verification local transation queue")])])])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newTx")])]),t._v(" "),a("p",[t._v("Interface description:Receive a new transaction serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-3-get-packageable-transaction-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-get-packageable-transaction-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 Get packageable transaction list")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Extract a packaged transaction list based on the packaging end time and transactions total size")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the node needs to be packaged, the packaged transaction is obtained according to the chain id, the specified end packing time and transactions total size. The transaction management module will take out the corresponding transaction set from the transaction memory pool to be packaged, and then verify the coinData of all transactions in the collection from the account module at one time, filter out the unverified transaction, obtain the verified collection, and then unify through each module. The transaction validator verifies the transaction set of the respective module and then summarizes the results back to the packageable transaction list.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_packableTxs")])]),t._v(" "),a("p",[t._v("Interface description:Return a packaged transaction list")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_packableTxs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"endtimestamp"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"maxTxDataSize"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("End packaging timestamp")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transactions total size")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("Transaction")]),t._v(" "),a("td",[t._v("Transaction list")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-4-transaction-commit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-transaction-commit","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 Transaction commit")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Execute the transaction processor commit")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The transaction commit interface is invoked when the transaction is packaged into a block and the block validation passes")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_commit")])]),t._v(" "),a("p",[t._v("Interface description:Call the transaction handler commit interface")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_commit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-5-transaction-rollback"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-transaction-rollback","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 Transaction rollback")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Execute transaction processor rollback")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The transaction rollback interface is invoked when the transaction is packaged into a block and the block verification fails, or the block is rolled back and the transaction is not a cross-chain transaction.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_rollback")])]),t._v(" "),a("p",[t._v("Interface description:Call the transaction handler rollback interface")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_rollback"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Block header hash, height, time serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-6-save-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-save-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 Save transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Save the transaction in the new block that was verified to the database")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the block management saves the block, the transaction is sent to the transaction management module for saving.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_save")])])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_save"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("Transaction serialization data array")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-7-get-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-get-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 Get transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Get the transaction that have been packaged into the block from the database")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTx")])]),t._v(" "),a("p",[t._v("Interface description:return transaction serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tx"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("tx")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-8-delete-saved-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-delete-saved-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 Delete saved transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Delete transactions that have been packaged into blocks from the database, block rollback, etc.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_delete")])]),t._v(" "),a("p",[t._v("Interface description:return execution result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_delete"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-9-verify-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-verify-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.9 Verify transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Local validation of transactions (including cross-chain transactions), including calling the validator, verifying the coinData. Cross-chain verification of cross-chain transactions is not included.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_verify")])]),t._v(" "),a("p",[t._v("Interface description:return execution result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_verify"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-10-receive-new-transaction-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-receive-new-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.10 Receive new transaction hash")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive a message of a new transaction hash broadcast by other nodes in the chain")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("newHash")]),t._v(" Receive new transaction hash message")]),t._v(" "),a("p",[t._v("Interface description:Receive transaction hash serialization data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-11-receive-new-cross-chain-transaction-hash"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-receive-new-cross-chain-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.11 Receive new cross-chain transaction hash")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive messages for new cross-chain transaction hashes sent by other chains")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When a cross-chain transaction has been confirmed to a certain height within the chain, it will be sent by the transaction module to the target chain (NULS mainnet or the friend chain), and the target chain will receive the transaction for verification. The hash of the transaction is sent first before the transaction is sent, and the interface will receive the hash.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossHash")]),t._v(" Receive new cross transaction hash")]),t._v(" "),a("p",[t._v("Interface description:Receive a new transaction hash hex")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newCrossHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashhex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-12-receive-a-new-cross-chain-transaction-for-the-friend-chain-(deprecated)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-12-receive-a-new-cross-chain-transaction-for-the-friend-chain-(deprecated)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("s",[this._v("2.3.12 Receive a new cross-chain transaction for the friend chain")]),this._v(" (Deprecated)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Processing message for new cross-chain transactions sent from other chains to the NULS mainnet")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the NULS mainnet node receives the cross-chain transaction hash of other chain broadcasts, it will request the complete transaction from the sent hash node. At this time, the node will send the complete transaction and the original hash to the NULS mainnet node.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newFcTx")]),t._v(" Receive new cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Receive a new full cross-chain transaction, and the original hash of the transaction (The hash value of the transaction before the conversion of the friend chain agreement).")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newFcTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Original transaction hash,and transaction serialization data of NULS mainnet protocol after protocol conversion")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-13-receive-a-new-complete-cross-chain-transaction-on-the-mainnet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-13-receive-a-new-complete-cross-chain-transaction-on-the-mainnet","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.13 Receive a new complete cross-chain transaction on the mainnet")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Processing message for new cross-chain transactions sent from the NULS mainnet to the friend chain")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("When the friend chain node receives the cross-chain transaction hash broadcast by the NULS mainnet, it will request a complete transaction from the sent hash node, and the node will send the complete transaction partner chain node.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newMnTx")]),t._v(" Receive new mainnet cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Transaction serialization data hex")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newMnTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-14-ask-for-a-complete-cross-chain-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-14-ask-for-a-complete-cross-chain-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.14 Ask for a complete cross-chain transaction")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Take a complete cross-chain transaction with a certain height confirmed according to the transaction hash, and then send it back by message.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("NULS mainnet has new cross-chain transactions sent to the target chain (or the ordinary chain has a cross-chain transaction sent to the NULS mainnet), the hash is sent to the target chain first, and the target chain node requests a complete transaction from the NULS mainnet according to the hash, and the interface processes the message.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("askCrossTx")]),t._v(" send cross transaction")]),t._v(" "),a("p",[t._v("Interface description:Receiving the transaction hash sent by the network node")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"askCrossTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-15-verify-to-the-friend-chain-whether-the-transaction-is-confirmed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-15-verify-to-the-friend-chain-whether-the-transaction-is-confirmed","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.15 Verify to the friend chain whether the transaction is confirmed")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("The friend chain node receives the message of the cross-chain verification request of the NULS mainnet node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The NULS mainnet node newly receives the cross-chain transaction, and will verify the transaction to the friend chain (nodes other than the sender) that sent the transaction, and the message to be sent will be processed by the interface.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyFc")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Receive cross-chain transaction hash and original hash of the transaction, return confirmation result through network message")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyFc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("[txOriginalHash] Raw transaction hash (before protocol conversion) , [txCrossHash] Cross-chain transaction hash (after protocol conversion)")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-16-verify-to-the-mainnet-whether-the-transaction-is-confirmed"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-16-verify-to-the-mainnet-whether-the-transaction-is-confirmed","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.16 Verify to the mainnet whether the transaction is confirmed")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("The NULS mainnet node receives the message of the cross-chain verification request of the friend chain node")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The friend chain node newly receives the cross-chain transaction, and will verify the transaction to the NULS mainnet node (node other than the sender) that sent the transaction, and the message to be sent during the verification is processed by the interface.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyMn")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive cross-chain transaction hash, return confirmation result via network message")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyMn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash hex data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-17-receive-cross-chain-verification-results"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-17-receive-cross-chain-verification-results","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.17 Receive cross-chain verification results")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Process messages that receive cross - chain transaction validation result")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The NULS mainnet verifies cross - chain transactions to other chain nodes, which send verification results")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyResult")]),t._v(" cross result")])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive cross-chain transaction verification results")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyResult"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction hash and confirmation of highly serialized data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-18-receive-in-chain-node-verification-results-for-cross-chain-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-18-receive-in-chain-node-verification-results-for-cross-chain-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.18 Receive in-chain node verification results for cross-chain transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Receive in-chain node verification results for cross-chain transactions and statistics.")])]),t._v(" "),a("li",[a("p",[t._v("Process description")]),t._v(" "),a("p",[t._v("The node performs cross-chain verification on a cross-chain transaction, and obtains the cross-chain verification result of the node for the transaction. The node broadcasts the result to other nodes of the chain, and the other node will invoke the interface after receiving the message.")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("crossNodeRs")]),t._v(" cross tx node result")])]),t._v(" "),a("li",[a("p",[t._v("Interface description:receive sender's signature, cross-chain transaction hash, node verification result")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"crossNodeRs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeRsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Node Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Sender's signature, cross-chain transaction hash, node verification result Serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-19-view-transaction-pool-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-19-view-transaction-pool-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.19 View transaction pool information")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("View data in the transaction memory pool")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxsInfo")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Statistics transaction memory pool data")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTxsInfo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("Chain Id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localTxCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"crossChainTxCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pushingCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("111")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("localTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of local transactions")])]),t._v(" "),a("tr",[a("td",[t._v("crossChainTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of cross-chain transactions")])]),t._v(" "),a("tr",[a("td",[t._v("pushingCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Number of transactions to be packaged")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-20-get-transaction-registration-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-20-get-transaction-registration-information","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.20 Get transaction registration information")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Returns the relationship list of the transaction and its corresponding commit processor and rollback processor")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxProcessors")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:return "),a("code",[t._v("Map>")]),t._v(" jsonObject")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_getTxProcessors",\n "minVersion": "1.0",\n "params": ["txType"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction type (Fill in NULL to return all types)")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "2":["commitCmd","rollbackCmd"],\n "3":["commitCmd","rollbackCmd"],\n "4":["commitCmd","rollbackCmd"]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Commit interface name")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Rollback interface name")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-21-query-transaction-records"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-21-query-transaction-records","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.21 Query transaction records")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Function description:")]),this._v(" "),e("p",[this._v("Query the transaction list based on conditions such as account, chain, asset, and paging information.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("method: "),e("code",[this._v("tx_getTxs")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Interface description:return "),e("code",[this._v("Page")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Requset")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "cmd": "tx_getTxs",\n "minVersion": "1.0",\n "params": [\n \t"ChainId",\n \t"assetId",\n \t"type",\n \t"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",\n \t"pageSize",\n \t"pageNumber"\n ]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("AssetId")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Transaction type (Fill in NULL to return all types)")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Address")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Page size")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Page number")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("Response")]),this._v(" "),e("p",[this._v("Success")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "pageNumber": 1,\n "pageSize": 10,\n "total": 31,\n "pages": 4,\n "list": []\n }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",[this._v("parameter")]),this._v(" "),e("th",[this._v("type")]),this._v(" "),e("th",[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pageNumber")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pageSize")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Page size")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("total")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Total number of records")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",[this._v("pages")]),this._v(" "),e("td",[this._v("int")]),this._v(" "),e("td",[this._v("Total page number")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-22-receive-cross-chain-transactions-for-local-new-primary-network-protocols"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-22-receive-cross-chain-transactions-for-local-new-primary-network-protocols","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.22 Receive cross-chain transactions for local new primary network protocols")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Collect a complete transaction for the new NULS mainnet protocol for broadcast")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossTx")])])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "newCrossTx",\n "minVersion": "1.0",\n "params": ["chainId", "txHex"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction serialization data")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \tvalue:true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-23-run-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-23-run-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.23 Run chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Run a new subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_runChain")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:run a new subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_runChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-24-stop-chain"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-stop-chain","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.24 Stop chain")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("Function description:")]),t._v(" "),a("p",[t._v("Stop a running subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_stopChain")])])]),t._v(" "),a("li",[a("p",[t._v("Interface description:Stop a running subchain locally")])]),t._v(" "),a("li",[a("p",[t._v("Requset")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_stopChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Requset parameter")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Success")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、event-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、event-description","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、Event description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-published-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-published-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Published event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-subscribed-event"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-subscribed-event","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Subscribed event")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Chain registration event")]),this._v(" "),e("p",[this._v("Chain information interface for sending verification tx coinData")])]),this._v(" "),e("li",[e("p",[this._v("Chain logout event")]),this._v(" "),e("p",[this._v("Confirmation for terminating the chain transaction")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、network-message-body-protocol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、network-message-body-protocol","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、Network message body protocol")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-broadcastcrosstxhashmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-broadcastcrosstxhashmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 BroadcastCrossTxHashMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Broadcast new cross-chain trading hash")])]),this._v(" "),e("li",[e("p",[this._v("Message description:Messages sent when a cross-chain transaction needs to be broadcast to nodes of other nodes or other chains after the chain is confirmed")])]),this._v(" "),e("li",[e("p",[this._v("cmd:newCrossHash")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Hash array")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Message processing")]),this._v(" "),e("ul",[e("li",[this._v("Upon receipt of this message, newCrossHash will send askCrossTxMessage to get the complete cross-chain transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-2-receivecrosstxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-receivecrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 ReceiveCrossTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Requesting a complete cross-chain transaction message, for example, the NULS mainnet receives a new cross-chain transaction hash of the friend chain, and the mainnet node will obtain a complete transaction from the friend chain node.")]),this._v(" "),e("li",[this._v("cmd:askCrossTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The message is processed by askCrossTx and will send a SendcrossTxMessage/SendHashcrossTxMessage message to deliver the complete transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-3-sendhashcrosstxmessage-(deprecated)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-sendhashcrosstxmessage-(deprecated)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),e("s",[this._v("5.3 SendHashCrossTxMessage")]),this._v(" (Deprecated)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The friend chain sends the complete cross-chain transaction converted by the protocol to the NULS mainnet, and the original transaction hash")]),this._v(" "),e("li",[this._v("cmd:newFcTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("originalHash友链原始交易hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("newFcTx will process the transaction after receiving the message, and then cross-chain verification through the message")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-4-verifycrosswithfcmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-4-verifycrosswithfcmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.4 VerifyCrossWithFCMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Transmit the transaction hash before the protocol conversion, the transaction hash after the protocol conversion, and verify the cross-chain transaction to the friend chain node.")]),this._v(" "),e("li",[this._v("cmd:verifyFc")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Transaction hash after converting NULS mainnet protocol")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Original hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Friends chain original transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyFc processes the message, validates the result and sends it back via VerifyCrossResultMessage")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-5-verifycrossresultmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-5-verifycrossresultmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.5 VerifyCrossResultMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:After the node receives the cross-chain verification request, it sends the verification result back.")]),this._v(" "),e("li",[this._v("cmd:verifyResult")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("hight")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Confirm height")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyResult calculates the result of its own node after receiving the cross-chain verification result")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-6-sendcrosstxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-6-sendcrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.6 SendCrossTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Send a message for a complete cross-chain transaction")]),this._v(" "),e("li",[this._v("cmd:newMnTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("newMnTx will perform a series of verifications after receiving the transaction. If the node that is not the transaction origin chain receives the transaction, it will perform cross-chain verification.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-7-verifycrosswithmainmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-7-verifycrosswithmainmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.7 VerifyCrossWithMainMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The friend chain node sends the cross-chain transaction hash after the protocol conversion, and verifies the cross-chain transaction to the mainnet node.")]),this._v(" "),e("li",[this._v("cmd:verifyMn")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Converted cross-chain transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("verifyMn processes the message to verify that the transaction is confirmed in the NULS mainnet and sends the result back via the VerifyCrossResultMessage message.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-8-broadcastcrossnodersmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-8-broadcastcrossnodersmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.8 BroadcastCrossNodeRsMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Broadcast the verification result of this node for a cross-chain transaction to other nodes in the chain")]),this._v(" "),e("li",[this._v("cmd:crossNodeRs")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("Signature")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("The verified node's signature on the transaction")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("result")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("Validation result")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The crossNodeRs receives the message, counts the results of all other nodes, and finally calculates the verification result of the transaction for the transaction.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-9-broadcasttxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-9-broadcasttxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.9 BroadcastTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:The transaction created by this node broadcasts the hash to other nodes after the local authentication is completed.")]),this._v(" "),e("li",[this._v("cmd:newHash")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("Abstract algorithm identifier")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Hash array length")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("Hash array")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("The newHash interface processes the message and sends the full transaction back.")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-10-sendtxmessage"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-10-sendtxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.10 SendTxMessage")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message description:Send the transaction to other nodes in the chain")]),this._v(" "),e("li",[this._v("cmd:newTx")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("Transaction type")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Transaction date")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction txData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Transaction coinData")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("Remark")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("Digital script or transaction signature")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Message processing\n"),e("ul",[e("li",[this._v("Enter a new transaction process")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、module-configuration-item"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、module-configuration-item","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、Module configuration item")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("[tx-manager]\nbootstrap=io.module.TxManagerModuleBootstrap\n")])])])}],n=a(0),r=Object(n.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\tIn the NULS 2.0 ecosystem, transactions are traded within the blockchain or between chains and chains. The nodes of each chain not only deal with transactions within the chain, but also deal with cross-chain transactions. So each node needs to process more and more transactions, and more complex, so we need a single but separate module to handle various transactions. And from the architectural design of NULS 2.0, we need a separate module to collecting transactions, verification, storage and forwarding of transactions. For all transactions, these functions are shared and unified,so we designed the transaction management as a separate module.")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("The core work of transaction management has the following two points:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("The transaction management module needs to perform cross-chain verification on cross-chain transactions, while cross-chain verification involves interaction between different nodes in different chains. There are mainly three types of cross-chain transactions that need to be processed.")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("The NULS main-net node initiates a new cross-chain transaction. When a certain number of confirmation blocks is reached in the NULS mainnet, the transaction management module will take out the cross-chain transaction and send it to the target chain. For example, the NULS mainnet node S sends the transaction to the target chain node A, and the target chain node A will send the transaction to the NULS mainnet except the node S for verification. After the A node obtains the results of multiple NULS mainnet nodes, it calculates the final cross-chain verification result of the A node and broadcasts it to the target chain. The nodes of the target chain will receive the results of all other nodes, and then calculate the final verification result of the target chain.")]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("Since the transaction protocol between the friends chain may be incompatible, the transaction between them needs to be transferred by the NULS mainnet. The process of sending a friend chain to another friend chain is actually to complete the transaction of the friend chain to the NULS mainnet, and the NULS mainnet sends the transaction to the friend chain. The transaction management module plays the same role.")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("Transaction management controls the verification and circulation of all transactions throughout the system.")]),t._v(" "),a("p",[t._v("The following modules need to be used during normal operation.")]),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("The module is divided into three parts: interface, implementation layer, local storage")]),t._v(" "),a("p",[t._v("The implementation layer contains 4 parts:")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("The basic data of other modules needs to be obtained when the module starts")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),a("p",[t._v("For example: initiate a transaction atx from the a address of the A chain, and transfer aCoin to the B chain b address (A --\x3e NULS mainnet --\x3e B)")]),t._v(" "),t._m(31),t._v(" "),a("p",[t._v("That is: other chain addresses cannot initiate transactions in this chain.")]),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),a("ul",[t._m(82),t._v(" "),a("li",[a("p",[t._v("Interface definition")]),t._v(" "),a("ul",[t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),a("li",[a("p",[t._v("Result")]),t._v(" "),a("table",[t._m(88),t._v(" "),a("tbody",[t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("Page"),a("Transaction")],1),t._v(" "),a("td",[t._v("Records")])])])])])])])]),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),a("p",[t._v("​\tnothing")]),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),t._m(119),t._v(" "),t._m(120),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145)])},s,!1,null,null,null);r.options.__file="transactionModuleDesign.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/53.336f003c.js b/docs/.vuepress/dist/assets/js/53.336f003c.js new file mode 100644 index 00000000..11b4b07e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/53.336f003c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{591:function(t,e,s){t.exports=s.p+"assets/img/20190327142342.5789d3b1.png"},592:function(t,e,s){t.exports=s.p+"assets/img/20190327143435.6f71ae15.png"},593:function(t,e,s){t.exports=s.p+"assets/img/20190327144549.1cbb469e.png"},594:function(t,e,s){t.exports=s.p+"assets/img/20190327150757.e698a658.png"},595:function(t,e,s){t.exports=s.p+"assets/img/20190327223858.aec0a9b8.png"},858:function(t,e,s){"use strict";s.r(e);var r=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"快速开始"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#快速开始","aria-hidden":"true"}},[this._v("#")]),this._v(" 快速开始")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、安装jdk11"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、安装jdk11","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、安装JDK11")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、下载jdk11"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、下载jdk11","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、下载jdk11")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、上传至服务器并解压"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、上传至服务器并解压","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、上传至服务器并解压")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(591),alt:"20190327142342"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、配置环境"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、配置环境","aria-hidden":"true"}},[this._v("#")]),this._v(" 3、配置环境")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("vi /ect/profile")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("JAVA_HOME=/home/nuls2/jdk-11.0.2\nPATH=$PATH:$JAVA_HOME/bin\nCLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar\nexport JAVA_HOME PATH CLASSPATH\t\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("ps")]),this._v(":/home/nuls2/jdk-11.0.2为jdk加压之后的路径,请根据自己的实际路径配置。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("source /ect/profile")]),this._v(" 执行该命令配置生效。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(592),alt:"20190327143435"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、下载、安装客户端"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、下载、安装客户端","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、下载、安装客户端")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、下载nuls钱包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、下载nuls钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、下载NULS钱包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、上传至服务器并解压-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、上传至服务器并解压-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、上传至服务器并解压")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("tar -zxvf NULS-Walltet-linux64-alpha1.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(593),alt:"20190327144549"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、进入cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、进入cli","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、进入CLI")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、启动钱包"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、启动钱包","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、启动钱包")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(594),alt:"20190327150757"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("执行命令:"),e("strong",[this._v("./start.sh -D")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、进入命令行"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、进入命令行","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、进入命令行")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("钱包启动之后,执行同目录下的cmd.sh(./cmd.sh)进入钱包命令行,将会提示NULS命令输入提示符:"),e("code",[this._v("nuls>>>")]),this._v(",输入NULS钱包操作命令,进行操作。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:s(595),alt:"20190327223858"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、部分操作命令说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、部分操作命令说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、部分操作命令说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1、创建账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1、创建账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 1、创建账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("create")]),this._v(" [Number]")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Number:创建账户地址的数量,默认为1,最大为100\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2、备份keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2、备份keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" 2、备份keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("backup")]),this._v("
[Path]")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:待备份的账户地址(必填)\nPath:生成备份文件的目录,默认为当前目录(可选)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3、获取私钥"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3、获取私钥","aria-hidden":"true"}},[this._v("#")]),this._v(" 3、获取私钥")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("getprikey")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:获取私钥的账户地址(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4、移除账户"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4、移除账户","aria-hidden":"true"}},[this._v("#")]),this._v(" 4、移除账户")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("remove")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:待移除地址(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5、修改账户密码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5、修改账户密码","aria-hidden":"true"}},[this._v("#")]),this._v(" 5、修改账户密码")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("resetpwd")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:修改密码的账户地址(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6、转账"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6、转账","aria-hidden":"true"}},[this._v("#")]),this._v(" 6、转账")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("transfer")]),this._v(" [Remark]")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("FormAddress/FormAlias:转出地址或转出别名,二者选一(必填)\nToAddress/ToAlias:接收地址或接收别名,二选一(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_7、创建共识节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_7、创建共识节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 7、创建共识节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("createagent")]),this._v(" [RewardAddress]")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("AgentAddress:共识节点创建地址(必填)\nPackingAddress:共识节点打包地址,密码必须与配置文件中一致,默认为:nuls123456(必填)\nCommissionRate:佣金比例,范围:10-100,最多小数位2位(必填)Deposit:保证金,范围:20000-200000,最多小数位8位(必填)RewardAddress:奖励地址,默认为节点创建地址(选填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_8、加入共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_8、加入共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 8、加入共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("deposit")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:加入共识的账户地址(必填)\nAgentHash:创建共识节点的hash(必填)\nDeposit:加入共识保证金,2000-500000,最多8位小数(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("ps")]),this._v(":保存好加入共识的hash,退出共识需要使用")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_9、退出共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_9、退出共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 9、退出共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("withdraw")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:退出共识地址(必填)\nTxHash:委托时的交易hash(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_10、停止共识节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_10、停止共识节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 10、停止共识节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("stopagent")]),this._v("
")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Address:共识节点创建地址(必填)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_11、查询共识节点信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_11、查询共识节点信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 11、查询共识节点信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("命令:"),e("strong",[this._v("getagent")]),this._v("")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("AgentHash:共识节点创建hash(必填)\n")])])])}],a=s(0),i=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("下载JDK11到服务器并解压。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("jdk11下载地址:"),s("a",{attrs:{href:"https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("jdk11下载"),s("OutboundLink")],1)]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),s("p",[t._v("将下面的代码复制写入文件")]),t._v(" "),t._m(8),t._m(9),t._v(" "),t._m(10),t._v(" "),s("p",[t._v("通过java -version查看jdk版本:")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),s("p",[t._v("进入GitHub下载最新版的NULS2.0 Alpha1钱包:"),s("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0/releases",target:"_blank",rel:"noopener noreferrer"}},[t._v("下载地址"),s("OutboundLink")],1)]),t._v(" "),t._m(14),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),s("p",[t._v("钱包解压之后,进入start.sh文件目录:/home/nuls2/NULS-Walltet-linux64-alpha1/bin")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),s("p",[s("strong",[t._v("ps")]),t._v(":保存好创建共识节点的hash(或者在"),s("a",{attrs:{href:"http://alpha.nulscan.io",target:"_blank",rel:"noopener noreferrer"}},[s("strong",[t._v("浏览器")]),s("OutboundLink")],1),t._v("中查询),加入共识和查询共识节点信息需要使用;必须保证共识节点创建地址与打包地址在一个钱包内,一个钱包不能同时创建两个共识节点。")]),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58)])},r,!1,null,null,null);i.options.__file="quickStart.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/54.5f4ba8e6.js b/docs/.vuepress/dist/assets/js/54.5f4ba8e6.js new file mode 100644 index 00000000..186b8120 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/54.5f4ba8e6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{623:function(t,e,a){t.exports=a.p+"assets/img/consensus-constants.5d3198f1.jpg"},624:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAjEAAADzCAIAAAD4stA1AAAa1klEQVR4nO3df28ct53H8T4g+y8/G/1jPZL9S/sU7k9tC8gQrkCBABfEcAs1DRQJKXoXK/ElStw0Oqs5X1M3sS1Zrl0Dxs3v+ZJDznB3hjMc7rt44SCvOBzORMfPksNd/uL9uxsAAELwi8lbAABAjkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAublaHnn1p07t1N3V5eTtOFitVu2Yffgsf9GBnDJGAuZBMzQ8aKjgy5iY+fwwlcbTvZu2TPJrZHDXjKiQCYBc5QNHVo66LwHv7M48deG7BRtmdTZyGEvGVEgk4A5CqCDJpPgAZkEzFEAHTSZBA/IJMCL/HFLau+onEkzLAq4PNipfmWaant8ePdWVWB5XL0uO2ixBCB7gFSfuqqwbkDyiqxTP6PanpIxCcpMEqeTLbyxpIhyRenNGeKSDTXrjcE8kEmAN1USlD1v0X0r/1RjQ+nB855XFqj6X627z7pjeWyxxkFETr1YrqikiB+RCvkrRVeel+9+ZFV1/UUkWFLEdEXNRva45PRmVteS1UwmzRGZBPjT7JTzjjvvZ7VOXP4qlSVW/c88MMphllJzUrLR/+a1ye6++YrWPL21WgN0hrk7NVGMKaJVmAebEtKbXXL6W6Uxx4vWeUUEikwC/DFMXjVHJxWlR24MU5RBjKjZFEg3a2SSFiGiwPqZVAwEm400XlH9Yn7SXpdczOYxNpo7Mgnwx/RAxfg5m8bEWtfHcfKaF0t9uqyyQSZtMndnfDxmHNlYrihvQ3bVPS9ZPLTz+sEseEUmAf7YM6kYJ5WP5cu3/+tlUlpY9OlKgU0yqT6vdQGCXtI4TvKYSW2XXDeg9TsmEDQyCfDHOneXdZd639o+d2et2fzx2M0yKXnF+WO2A87d5S/2vWRLtZgVMgnwp3WNQ2NYoD6/aS5jy1/MO2KlZtMzqo3n7vpkUvuiCesah7KSHpfcWNGw3rUgGGQS4E/x4L3qLpWpLXUldPnBINFl699Zl3bZloc9RW8u+uXmBJftFdFxK49kumbAzGvBW+vXFn83RzMbX7K6fi//LXN3c0QmAf7kb+13qm/R1kYJ8gOqaQdarXTQhhrqserHWtWP7+QzWmq0pH26yyv5GcV3fnfEUlKD+nHg5nIJ08dXlU+2mmre6JKTZiv3mQV4c0UmAf7M6+twjK2d1yVg9sgkwJ85dejZWMSyfq99AR4wHDIJ8GZeq79MS7EtQQX4QiYBXsgPynR/1icQzTUOcwlUxIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMAgCEgkwCAISCTAIAhIJMApzsf/hf2BKT/7FtMzIJ8fvHzz99++Tp5+dP+pi8o8RoJv+L3WZkEqL1/MXzoz89bvY4H3zy1fHD78gk2Ez+p7vNyCTEKRkY/eqjh7Kj+c3Hjy5++NvGFU7eUWI0k//1bjMyCRH6+vsftF4mGRi9e3s9ecMAtCOTEJvnL55rI6TTL76fvFUAXMw0k7LtO8UuL7sHj80l803VlC1hFietdZZVZdtr1ke1b2umFb69PLYWzjZJ69yfxmdjij1ybJWUh5v3+1njSqdy//RcBtJvPn7ECAmYi9llkt4nWjt3Qxq1b7AmYqC5s5k9+fSMaTmFvUmNnt1nYzbNpDWudDpJ/Gizdk9/fDZ5qwA4mlcm1cMjrUdOu0uZSaL3V7t7EWl6T1rGwN5C36+6rq3Rj5eBobUn3WNUq99cSdUerWafjdksk9yvdFI/PvuHDKRfffRw8iYBcDenTCo3k26fuboRHb15mq56v6/GlZgPtA9x1B65fZrL1CTDTJ2xEp+N2SST3K90Yo+++6vMpP/49OvJmwTA3XwyqXyf3v0Ao6PPvbEkRBUDxiQzHlK8aH2a5dgkw2+na0xrJnVXPjXtg0R/fHQxeZMAuJtNJhWDJPOKgPVLFv2y7PHLGLAMBYrRlVqtY6u6ihWnFnHrsTGbzd253/9paZmU/HPyJgFwN5dMcn+f7laymP4yDE1sB5YzfurARSxAsJ+xs0nNAv4a0/d5UuCjJTIJmLW5ZFJzJNGzpHVosl4MvLvR18UZRhL6ynWbvpnk1Jgea8FdKp8amQTMGpmkv7J2DCi/NS6PHjGTuhvT8/NJXZVPjUwCZm1mmeQwa+RWcqi5O3O1WmftHqgjNMZ47ZLbEjtb5VMjk4BZm0smrbEWuXga317SvsahVwwoJatOf4NFa/4aM1Am2SqfGpkEzNpcMmmN7s+hZNtHgvrHQDWGqAZGaxzrvzEdlVcDIJfRj6HyiZFJwKzNJpPqpzLdj9bbP9xjC63BY8D0eSNbR3+xWirn9dqYls8Ut3zPhWPlEyOTgFmbUSYp6760N+aWr89p+26hRne/QQyktdm+qk7LTrE0QEsC48ye38aI+9OcvdzZtXxm1rXySZFJwKzNKpPeNZYjtywAa/0OVtNc04YxYDmFYQRj/Q5TQ3nvjSm/qEmTjHhav1vIrfIJkUnArM0tkzLNzt32PKNZ0r7QYLPpMkNn3fpwpVneOPE1SmPMnzeyrXFY90qnQSZtI33qe5tEd+2zzCTAhkzaQsmgP+TvFuHa10ImISpkUrDkpEU9wrZ9OUhjT5Z8tnn3YFV9Aj2vRMxCK1MOjfJiXlqUbLbKdiIPl2BuUv9rnzUyCVEhk0IllskknXjRcR8tRbcr3u8bC+eRUMxXiy3T0sL2LS6L8ln3XZxLO3atEw14CUM1iXESEC4yaQbSgUXWvaYDAjEUqB5hitflz2lfXJWpKmnPpLK8su2n6OsNrbKeaOBLMDdpoGufLzIJUSGTgqUuOMq7VMsgQ1806zGTTK2yZtKwl2DPpAGufb7IJESFTAqUHG3oP6uPYd7l/bLl0xTDZpKlVeYTDX0J9kwa4Nrni0xCVMikQIlOPHuOUv1sfDivdLUnB2JMYxq+2NaerZVJslWdmTTIJViGbsNc+3yRSYgKmRSq+vNty+Ps43dZF2ycOsscWdeY1XFyW6SF/oE5rbyyNXN9rKFVh9YTDXwJliYNcO2zRiYhKmTSjCSdsnyPP8e3/BFcQmjIJESFTJoR6+Lp+YjgEkJDJiEqZNKsKFswz3OEEcElhIVMQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUwCZo1MQlTIJGDWyCREhUzy54NPvpL3VnPvwVnLbxGC+6fnk/8VdSKTEBUyyZ/kfk7eBkSPTEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/yCSMgExCVMgkf8gkjIBMQlTIJH/IJIyATEJUyCR/BsqkYmc8r1+hrWzhilkhkxAVMsmfAcdJvve+UzLpYrXc2i0kZnjtZBKiQib5M6NMmupcoZnjtZNJiAqZ5E/fTDpeFHvf3V0dyr7yYrVbbIu3c3hxIyb3jvIfytdz9R56VQ1Jz1vVfJkPksqf618plRSv7x6slvWpHzdPV1SVyTeQbRx4u9pYtllYuWrRQtNVuzbJ4UClqc1rD9yGmaT9fz4wPmPekEn+7PfKpDRLip4661XLRBH7hSfdd9llZ/172ZOm3friRCtc/VwflZwiLybn7tJixrFCdoqifNZ9F6fTjrW0zXyiRuGkSXVymHdJt9Q8VJO2ZZxEJmFyZNLI9vtkUppDRaf5XnbQ6etl9oif045176g8vOzZ1UqKMlnC1eOS6lcumVSeQnn+JPr6Wp2LatvE64bC4orSjKmOcrhqc5Ncbpca4WQSMJJfH33Z8ttV9n/JpAHt+8qkW2J2a/1MEpVU/e9QmSSn4zozyVTYMk5yuGp7JnXdLjIJmATjpJHt+8qkxjhj3UyqT1EMmIbJJDkG6hwnWQrLp2iX78x3Y40mudwuMgmYBJk0sn1vz5Pq1QoHhgcknc+Tmo+mZIduW3u2ViZlT3dcM0kWPtkzri+wX3XH0K37QK0l25JJQJjIJH/6ZZIyYjjJp7mKbvTIvIZtb7G847DuTk5nZRWK9WZVWqhr4VqX6pXlk2OrZW/Jsdl5sxWDyrintfClZfbPeNVuTeo+UClsuvbAkUmICpnkT99MWoc+LzdPyVXIYcocRy3jI5MQFTLJHzJpXdb137AjkxAVMsmf0TJJn4yasXqezfdX/EWDTEJUyCR/xhwnYWuRSYgKmeQPmYQRkEmICpnkD5mEEZBJiAqZ5A+ZhBGQSYgKmeQPmYQRkEmICpnkz/6Hn7d8rca9B2eTf7UH+rh/ej7539h7MgmRIZP82WecBP/IJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPKHTMIIyCREhUzyh0zCCMgkRIVM8odMwgjIJESFTPJnzEwqvhpc366i3DfPuBmrUw0IHZmEqJBJ/ow8TrJtoWTdINy5hu1ysVrOao8MMglRCSmTlL1zFMaOUu7hre+T3Vn49u7Batl+SG8BZtJmNWyV2W1uSyYhKiFlUuZ4oe5NVwaV8u6+mJLS9sm2pJe9cLiZVLX5qJh8u7NzeKFfZhoh4s5kibLSyr8XSaOVb+4EmJVclO8M6hrkTcuyvCrw2Hy6MvjzXWIbB96udo9tFq7/BirVf/r6jYVyNzqb5HCg0lTj5QeLTEJUgsukvPuQCVR2KFWo5B1Hc1fsooNTY8lWOHt9yEx6ef362c83L67qV3qOk7LLKXvGtJsuWquMZpLXZaJ0la/n7uoDj5ayZPlzen8aAa8XKE8npgTFhuV628RZ2gon7amTw7wVuqXmoZrEOAmYzAwySRvo6AMpqRhU6e+4jYXTEw2TSS+uXn/66Prjs6vTr64/+fLqD2dXP7149X6QTKpToe6p2zKpq3zd+Wb3WYtqW83GAsqjKVPhthxt3vnqxbRhYjRTHSVelz93N8nhQNEkMgmY1NwyyTARJ6kzeO2Fk98OkEnPX75O0ujvz9/8q/zf86u3nz66evbzq6Az6Z1hADpIJsnpuM5MMhW2jJP0J4JrZVLHgWQSEIoZZFLRp+RdSWMkpCkeRVS92y2vDwbevblJRkg/vawDKf/f9c3b33/+cvXhwz6Vr5sxa2eSuL35/Rwgk+QYqHOcZClcP0/S/wwM7yHcMqnjQDIJCEXomaS9l1fyyURmUmfh3p6/vPnky6t/mf73p2+uDn73TZ/K5QMPvX8XDz+MD0hcnieVPW/9uGXYTJJP7DozSRY+2TP+J1PS4uTAkMSWoVv3gVpLyCRgMoFmkrIWXLzJDSyTvn/66ou/3CQJ9MH9r/7tl5/lkp+TV86fXP/777/vU7l9FdxR/eJxfo2LpWEF2k39mdlszHFYLypbnMj7nHXN+jK8xqM4rYCyiq++7fUZl8dZO+V5HQpfmif0tAtvLJNra1L3gUrhcpRmHYsHhkxCVALNJOvnOsOau3v286vTr66N46SzP18f/q7X2+3t/LRQctXaqv15jVrGRyYhKnPLpAHXOAzg7ZubP5xdXd+81QLp7Zv0edIvP/qiT+XbmUnW9d+wIJMQlbll0nprwbVPiTar6h9XP/z46rPz65t/vpWBdPbnq7/871WfdXfND7RuDeXrPBgkdSKTEJX5ZVI5+nH7zGzLUOloqO8WuvzbdTJa+vIvr755cv3fF8nPL5NAes/3gmMUZBKiElwmKQ+EbNb6biHTtxPJz1EO4Z+vby6eXn/7JB0e3dy8yl8kkzACMglRCSmTGt/B2j5ttdZ3sNq+Qs0nMgkjIJMQlZAyKTZkEkZAJiEqZJI/ZBJGQCYhKmSSP/sffi7vrebeg7OW32IW7p+eT/5nRiYhKmSSP/uMk+AfmYSokEn+kEkYAZmEqJBJ/pBJGAGZhKhomfSfX//P5E2KBpmEEZBJiMrZt5cyk377Wa/tFSCRSRgBmYSoXP7f32UmHTzotQ0dJDIJIyCTEJU3r6+15a1X1y8mb1UcyCSMgExCbH599CXTdz6EnUneN/LAOMgkxEabvkt8++Tp5K2KQNiZlNreHfMuVstYLpxMQoSOH36nPVVKgmryVs0dmRSsmC6cTEKE3ry+/u1n32ijpSSoktc3rnPy733xx/0ObHz38q03dg+O8hm28ovM669Oz7tUuUOH3MCwPHxVla+3m6q+Iv3u6rDRNTcO3Dm8KGb55C7yxblEzS1nbBZWmqF9U3v9de/F6Ryb5HCg0lT98NkikxCtb588TUZIWv97//T8j48uPj9/sq7Jk2PWmfS+6MqzTjPpvtMuW24EXv+sbJFelKwOL/bvSH8WqVZUknXizeGCPDDrvouOW1QiWtJ9RmPhpBl1cpg3O7fUPFSTGCcB8/D0x2ePvvvrBiG0PZmU5LRLsVX/TNL3Iaz3iKqiqC2T5Ov5sWolxikseaDSBlF5rarZdkZjYbGnYpox1VFyr0Xxc3eTHA4UTSKTgO0zeXL4434H+txApT99F1Ymyem4zkwyFbaMk/R9GtfKpI4DySQAW238TJL9tcdMkmOgznGSpbB8rGUbC67RJIcDySQAW23gTGp5niQek3RkkuPzJOdMyp7uuGaSLHyyZ1xfoKTFyYHhWixDt+4DtZaQSQC2S59MsqwN09fdqS/uHB7nU1iLZXV4nSK3RUgUvzrJZ9VE8p2oB8q1fKKSatnb7eVxdvZsCZ/ljIbCl5bZP+0a9WVybU3qPtB4E+p1gLNFJgFw0nOcFLEkV+QwJaZRy/jIJABOyCQb6/pvrI9MAuCETLKr59n4zr2eyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCk/Uvz7j04m/yL++Di/un55H9LLcgkAE72GSfBPzIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgBMyCSMgkwA4IZMwAjIJgJN5ZlKxBZ/n7+ouN/pTNtLtoOwwGwatSfUugutcV09kEgAn88yk1Dib7DU2d2+4WC1FM3pkUr3X7bCpZtkbfmXa1t0XMgmAEzKpXWcmDdaMKi287h9Yn2VUZBIAJ30yKZ8F2j04Kt7g553dxWq32ApvJ3snXu2Ml/+z7nDLSaT09bTrL3fPk7/VK0+61HIkcWgMg/rsxcxes+ZmsaIlWfYU5cuOW2aSrZH6VdSdfr0rYN6Y8qJW1et1k9JLW5wUR+2IQcyRUri8A2mF+q023LQT0STZ/jt7C+W/S1mtpywkkwA46TlOyrq5slNLOz7xHr9+S572qsWLeTda9vIne3kvbDyqWbleTyOTmvUYaza8qIyHtDYUr1ur2jXP3cnhTv1zdlH5VWsTfdnc3d2dXSWQ6l/VZzleZFU53jTL3J3ewrSYv83dySQATgbIJDkXlEZF2aWKn9P378UoZHF4nLxeDgia80j1cMFYefGr98ZJM7WArqrZVMwhk4yNtGeSepaqHv1E8mLl0oNiDFTcQHkriiC33OrmAy17JmkJar91vZFJAJwMkEmyyxZzYnJOqR617Imxy/Gi6s2VaSXZTeuVr51Jhpo3zSRTIwfKJGXiLsvv5BX92rObmfyghJZ+q5sh2pJJ9TxhVa0fZBIAJx4yyfh2O+v7joslavlR6ZipSqzqKG3osHYmqRNfxpqbxZrZ08wkcyOHySR1cJM/QNJaWJyonmGz3Oo1M6kYwnqduHtPJgFwNHAmqX30yYHy6GL37kLONe3uiY6y7F6zp/SWTHJ7nqSc3VyzoZHac6D2TJKN1KLR6XlS2zipvjpTtCyWe+otbdzqdTOp+G/hc+LuPZkEwFH/dXfKHF3qyLCozPQ8X3Tl9UdzlsfZ4dmyOkPlYt1dsaJMn3HSzm6o+dLcSLE+8Lh4lrOrfGDIUpVYsSZuiJiIa6y7aywjLIdK1URcuaBD/Vxw+ooaw/pVNP+LyCYt65/lfxp9qOcDmQTAyXw/n4SBJJnUXOk3MDIJgBMyadtpiyn8IJMAOCGTtlbjE74ekUkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMAJmYQRkEkAnJBJGAGZBMBJkkkt7j04ay+ALXT/9HzdPzMyCYCTfcZJ8I9MAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuCETMIIyCQATsgkjIBMAuAkhExSt/sbsjACQSYBcDJ8Jl2slp2blqplOmJmrcJbzuXmT4FMAuBk8Ew62eveSNulzGaFt1yw94pMAuCkZyYlnWC6L1y5NVz9zzvFdtrFxnGZ5bF6SFZG21muvUJ9G7qL1e6dokDeF2uHa+3cPVgti/JJbY8P796STW1prTiweN1YOHW8qF60NLU4nWOTHA4039jJ/7QkMgmAk16ZlPS/RZ97tLyzOEl/SHtV8VY9/WfRX9eFtTJiOq67Qjl316jccPiNcmD5YtZ9i9S0Vdg4sKtwct46Obrug5cmMU4CMGO9Mil7C18PEVL2bjEdQHTFjEOFamE1eAyH3ygH7h3plbxT+npTa5UD5euGwmkDxGimOkq8Ln/ubpLDgS03NhxkEgAnfZ8nlTNLZVdoipB6Lqtz6ONWoS2TDIffKAd2ZZKptdZMMhW2jJPEHKM+sdmdSR0HkkkA4jHMGod6gKJ2i3JU4TJO6qxQzyTLgxPTgKk7AMyttQSApXD9PElekTE+XTOp40AyCUA8ej5PkqOZ6km7MZOy5yX1z7bnSR0V2h+fnBykz5OahysHOmeSbG1nJqmXZozJRlMdm+RwoNYSMgnAjPV/nlQMC5QusloMVi0kS/55lK4Tq3v/ooxYLbY46apQKZz+9khZe2Y8PKOtx1PW7xX1JxUaWnuoLeRrLXxpmf1732yqa5O6D1QKKzc/IGQSACchfI9DNJJckcOUYEct4yOTADghkwZkXf+99cgkAE7IpEHV82zGtX9bi0wC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABOyCSMgEwC4IRMwgjIJABODh48TGLJ5t6Ds5bfYtbun56P9mdGJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAEJBJgEAQkEmAQBCQSYBAELx/6dlfwtgmE9xAAAAAElFTkSuQmCC"},625:function(t,e,a){t.exports=a.p+"assets/img/coinbase.afeaf0dd.png"},626:function(t,e,a){t.exports=a.p+"assets/img/consensus-flow-5.e1e96c82.png"},627:function(t,e,a){t.exports=a.p+"assets/img/consensus-staticsReward.0738cb87.jpg"},846:function(t,e,a){"use strict";a.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"共识模块设计文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#共识模块设计文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 共识模块设计文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、总体描述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、总体描述")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-模块概述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 模块概述")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-为什么要有共识模块"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有共识模块","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 为什么要有共识模块")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-共识模块要做什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-共识模块要做什么","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 共识模块要做什么")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("区块同步后的合法性验证")])]),t._v(" "),a("li",[a("p",[t._v("创建共识节点、委托参与共识、取消委托、注销共识节点★")])]),t._v(" "),a("li",[a("p",[t._v("共识节点打包出块")])]),t._v(" "),a("li",[a("p",[t._v("网络维护激励的发放")])]),t._v(" "),a("li",[a("p",[t._v("作恶节点惩罚★")]),t._v(" "),a("p",[a("strong",[t._v("PS:不同的共识机制其共识算法不尽相同,以上有标记★的为POC共识特有")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-《共识模块》在系统中的定位"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《共识模块》在系统中的定位","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《共识模块》在系统中的定位")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 架构图")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(623),alt:""}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("Services 层:\n"),a("ul",[a("li",[t._v("tx service : 交易的增删改查")]),t._v(" "),a("li",[t._v("consensus service : 共识活动及状态管理二、功能设计")])])]),t._v(" "),a("li",[t._v("Validator\n"),a("ul",[a("li",[t._v("tx Validator: 共识相关交易的验证器,用于验证共识相关交易")])])]),t._v(" "),a("li",[t._v("Processor\n"),a("ul",[a("li",[t._v("Tx Processor:共识模块相关交易处理器,用于提交回滚检测交易")])])]),t._v(" "),a("li",[t._v("Task/Thread层:定时任务\n"),a("ul",[a("li",[t._v("consensus Task: 共识打包")]),t._v(" "),a("li",[t._v("Reward Task : 数据统计")])])]),t._v(" "),a("li",[t._v("Storage层:存储共识模块相关交易数据")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-0-功能架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-0-功能架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.0 功能架构图")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(624),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1共识模块功能需求分析"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1共识模块功能需求分析","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1共识模块功能需求分析")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-1-支持多链并行"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-1-支持多链并行","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.1 支持多链并行")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-1-2-poc的共识机制"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-2-poc的共识机制","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1.2 POC的共识机制")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("共识机制——POC\n\tNULS主链默认采用信用共识机制 POC(Proof-Of-Credit)。节点信用达标的情况下,锁定一定保证金即可加入共识,共识节点重新排序后每轮轮流出块,退出共识时保证金解锁。\n1、共识进入与退出机制\n\t任何人都可以随时加入NULS的共识之中,只要满足条件,遵守规则,即可持续获得NULS代币奖励。POC的加入分为硬性指标和软性指标。硬性指标指的是信用分值必须达到一定标准线,排除掉一部分曾经作恶的节点。软性指标指的是必须冻结一定量的NULS代币作为保证金,为杜绝节点的泛滥,同时让整个系统更加公平,保证金的数量除了有一个最低值的限制外,任何人可自由选择保证金的数量,保证金的数量会和最终的奖励挂钩。\n1.1黄牌警告\n\t由于节点硬件配置或者网络原因,造成的共识期间掉线、死机等无法出块的,不属于违规情况,但对整个系统会造成一定影响,所以对这类情况,系统有一个轻度的警告机制:降低节点信用值,\n1.2红牌警告\n\t对于一些双花、重复出块、尝试分叉系统、不遵守系统规则的恶意人为破坏情况,NULS系统坚决抵制,所有节点都可以检测到这类情况的发生;一旦有恶意节点确实试图挑战系统,那么对应的保证金将会被锁定2个月,且再次信用评级,将永远达不到共识门槛。\n2、信用评级\n\t在 NULS 系统里,信用是账户在系统中的诚信系数,所有账户的信用会在区间[-1,1]内,通过信用评级算法公式自动计算。\n\t信用评估公式:信用基数=能力系数+责任系数\n\t能力系数:根据历史出块数量计算\n\t责任系数:根据违规情况和出块正确性计算\n3、共识奖励\n\t为了整个 NULS 系统的平衡与公平,共识奖励根据所有共识节点所提交保证金与共识节点信用综合计算。共识奖励计算公式:见(图p1)\n4、子链共识机制\n\t接入 NULS 的子链分为两种类型,第一种是通过 NULS 系统的标准接口协议接入,第二种是通过 NULS 的程序部署接入。\n\tNULS 是一套通用的区块链底层基础设施,在其主链上不运行任何应用业务,所有应用业务由子链运行。通过 NULS 的系统,能快速的部署基于 NULS 的子链,且可灵活定制子链的各种运行参数,包括是否支持基础代币、加密算法、共识机制、存储机制等。\n\tNULS 定义了标准共识模块,以提供接口兼容不同的共识机制。NULS 社区会陆续开发 POW、DPOS、POS、PBFT、POOL 验证池等共识机制,以供用户自由选择。\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("图p1:共识奖励计算公式:")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(625),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"在poc系统中,有代理人、委托人、打包人、奖励人这四个角色。"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#在poc系统中,有代理人、委托人、打包人、奖励人这四个角色。","aria-hidden":"true"}},[this._v("#")]),this._v(" 在POC系统中,有代理人、委托人、打包人、奖励人这四个角色。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("代理人————即共识节点创建人。NULS持有人发起一笔创建共识节点的交易,记录到链中,告诉所有人我要做共识节点。节点创建的基本条件是需要锁定20,000—200,000个NULS,且没有红牌惩罚记录,设立这个基本条件的目的是证明你是真心实意的想维护好NULS的基础网络。")]),this._v(" "),e("li",[this._v("打包人————代理人在创建共识节点时,可指定一个打包人,这个打包人可以是自己的其他账户,也可以是懂技术的朋友,最重要的是打包人可以不持有任何NULS,即使参与共识的服务器被黑客攻破,用户也不会有巨大损失,损失的仅仅是被攻击后的收益影响。需要注意的是打包人是真正出块的账户,每次打包区块后都需要对区块签名,因此打包账户一定不要设置密码。")]),this._v(" "),e("li",[this._v("奖励人————代理人在创建共识节点时,不仅仅可以指定一个打包人,还可以指定一个受益人,指定谁可以获得共识所产出的奖励")]),this._v(" "),e("li",[this._v("委托人————NULS持有人,可根据代理人的信用值情况,以及代理人的影响力等等因素,把自己所持有的NULS委托给该代理人进行共识,同时享受相应的共识收益,若发现代理人节点质量或者诚信有所下降,委托人可随时撤掉其委托改投他人。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"在poc系统中,有创建代理(创建共识节点)、停止代理节点(退出共识)、委托共识、取消委托四种业务逻辑。"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#在poc系统中,有创建代理(创建共识节点)、停止代理节点(退出共识)、委托共识、取消委托四种业务逻辑。","aria-hidden":"true"}},[this._v("#")]),this._v(" 在POC系统中,有创建代理(创建共识节点)、停止代理节点(退出共识)、委托共识、取消委托四种业务逻辑。")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("创建代理(创建共识节点):锁定20,000—200,000个NULS,发起一笔注册代理交易,打包之后全网可见,其它人可锁定NULS委托到该代理人节点之上。")]),this._v(" "),e("li",[this._v("停止代理节点(退出共识):代理人可随时停止其代理资格,发起交易删除代理节点,交易被打包确认之后,很快就会退出共识,不再参与新区块的生产。注册代理时锁定的2万个NULS会72小时之后解锁,其余委托人委托到该节点的NULS立即解锁。")]),this._v(" "),e("li",[this._v("委托共识:持有2000及以上NULS的用户,可以选择一个代理节点进行委托,获得相应的出块收益。在退出之前,相应委托的NULS将被锁定不可用。一个代理节点最高可接受500,000NULS的委托。")]),this._v(" "),e("li",[this._v("取消委托:用户可对之前进行的委托进行撤销,撤销之后锁定的NULS马上解释,不再享受相应的共识收益。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"poc系统的两种处罚机制"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#poc系统的两种处罚机制","aria-hidden":"true"}},[this._v("#")]),this._v(" POC系统的两种处罚机制")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("黄牌处罚:当出块节点因断网,卡机等各种不确定原因,导致该出块时没有出块,或者出的块没有被采用,那么将在下一轮获得黄牌处罚。黄牌处罚会影响节点的收益;当连续获得100个黄牌处罚时,会被进行红牌处罚。")]),this._v(" "),e("li",[this._v("红牌处罚:当出块节点作出恶意分叉、双花等严重危害网络稳定的行为时,或者连续获得100个黄牌处罚时,系统会给予红牌处罚。获得红牌处罚的节点会被强制停止共识,创建代理时的押金被冻结3个月,且永远不可再次创建节点;获得红牌处罚的节点对应的委托立即解锁。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"poc内部系统的隐藏功能需求"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#poc内部系统的隐藏功能需求","aria-hidden":"true"}},[this._v("#")]),this._v(" POC内部系统的隐藏功能需求")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("维护一张共识节点信息表,并根据实时接收到的以上四种交易进行更新。")]),this._v(" "),e("li",[this._v("维护一个轮次信息表,让每个轮次符合出块条件的代理人随机排队出块。")]),this._v(" "),e("li",[this._v("符合出块条件的代理节点,对内存池的交易进行验证打包,组装成新区块并广播到全网。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-模块服务"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 模块服务")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 创建节点")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("创建一个指定打包区块的地址(当共识节点满足可打包条件后的处快地址),佣金比例(其他账户参与该节点共识的佣金比例),共识奖励结算地址(该共识节点出块的奖励金归属地址)的共识节点,等待其他节点委托共识,当委托共识金额达到标准金额时,该节点可以打包出块赚取奖励金\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证参数正确性\n- 创建交易\n- 判断账户余额是否足够\n- 验证交易\n- 保存交易\n- 广播交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("通过创建节点接口,NULS用户可以发起创建节点交易,交易被确认打包后,即可成功创建共识节点。\n")])])])])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgent",\n "version:"1.0",\n "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("申请创建节点账户的地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("打包区块地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("奖励结算地址(默认与节点地址一致)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("佣金比例")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点的保证金")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("5")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("6")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n \t"version": 1.0,\n "code":0,\n "msg" :"成功提示信息",\n "result":{\n "value":"tx.getHash().getDigestHex()" //生成的交易hash值\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n \t "code":1,\n \t "msg" :"错误提示信息",\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("生成的交易hash值的十六进制字符串")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-创建节点交易验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-创建节点交易验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 创建节点交易验证")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("创建节点交易的验证器\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证交易中是否包含节点信息\n- 验证交易创建者是否正确\n- 节点地址与打包地址不能相同验证\n- 节点奖励地址与打包地址不能相同验证\n- 佣金比例有效性验证\n- 创建节点的保证金有效性验证\n- 签名正确性验证\n- CoinData验证(锁定时间验证)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("这个接口主要是验证区块轮次信息,打包人,区块中的交易以及CoinBase是否正确,并验证是否有红黄牌惩罚。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-3-创建节点交易提交"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-创建节点交易提交","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 创建节点交易提交")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("保存创建的共识节点信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 保存节点信息到数据库\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("保存共识节点信息到数据库\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-4-创建节点交易回滚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-4-创建节点交易回滚","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.4 创建节点交易回滚")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("删除共识节点信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 删除共识节点信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("从数据中删除共识节点信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_createAgentRollBack",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-5-注销共识节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-5-注销共识节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.5 注销共识节点")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("注销一个自己创建的共识节点,注销节点后参与共识的节点的共识金额及共识奖金会在一定时间后解冻\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证参数正确性\n- 创建交易\n- 判断账户余额是否足够\n- 验证交易\n- 保存交易\n- 广播交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("通过注销节点接口,NULS用户可以发起注销自己创建的节点的交易,交易被确认打包后,即可成功注销共识节点。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgent",\n "version:"1.0",\n "params":["address","password",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建注销节点交易账户的地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t"value":"tx.getHash().getDigestHex()" //生成的交易hash值\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("生成的交易hash值的十六进制字符串")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-6-注销节点交易验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-6-注销节点交易验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.6 注销节点交易验证")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("验证注销节点交易的正确性\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证删除的共识节点是否存在和该共识节点是否已经被注销\n- 验证交易创建者是否正确\n- CoinData验证(输出地址必须存在)\n- 查询出所有参与该共识节点的共识信息和该节点总的共识金额\n- 检查注销节点交易中花费的UTXO总额与数据库查询出的共识节点委托金额是否相等,如果不等则验证失败\n- 验证注销节点交易中解锁的每笔UTXO是否正确\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("验证注销节点交易是否正确。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentValid",\n "version:"1.0",\n "params":["tx",chainId]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("注销节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-7-注销节点交易提交"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-7-注销节点交易提交","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.7 注销节点交易提交")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("提交注销节点数据交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 把该共识节点下所有的委托数据设为已删除\n- 把该共识节点数据设为已删除\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("注销共识节点,把该共识节点下的所有委托数据设和共识节点设为已删除状态\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-8-注销节点交易回滚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-8-注销节点交易回滚","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.8 注销节点交易回滚")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("注销节点交易数据回滚\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 把该共识节点下所有的委托数据设为未删除\n- 把该共识节点数据设为未删除\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("回滚注销节点交易数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopAgentRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("注销节点交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-9-申请加入共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-9-申请加入共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.9 申请加入共识")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("委托指定金额到共识节点参与共识赚取共识奖励,加入共识期间委托金额和共识奖励会被冻结\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证参数正确性\n- 创建交易\n- 判断账户余额是否足够\n- 验证交易\n- 保存交易\n- 广播交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("通过该接口,用户可以委托指定节点地址加入共识,赚取奖金。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositToAgent",\n "version:"1.0",\n "params":["address","agentHash",20000,"password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("申请参与共识账户地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参与共识的金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("申请参与共识账户的密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t"value":"tx.getHash().getDigestHex()" //生成的交易hash值\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash值的十六进制字符串")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-10-委托共识交易验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-10-委托共识交易验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.10 委托共识交易验证")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("委托共识交易正确性验证\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证申请加入的共识节点是否有效\n- 验证申请加入的共识节点是否已经达到允许加入共识的最大数量\n- 验证委托金额是否有效\n- 验证交易是否为申请委托的账户自己创建\n- 验证委托金额与输出的UTXO金额是否相等,输出的UTXO锁定时间是否正确\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("验证委托交易中委托节点有效性的验证,委托金额正确性验证,委托交易创建者是否正确,委托交易输出的UTXO是否正确等。验证注销节点交易是否正确。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托共识交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-11-委托共识交易提交"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-11-委托共识交易提交","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.11 委托共识交易提交")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("委托交易提交\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 保存委托交易信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("保存委托交易数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托交易被打包的区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-12-委托共识交易回滚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-12-委托共识交易回滚","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.12 委托共识交易回滚")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("委托共识交易回滚,删除委托共识交易数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 删除委托共识交易信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("当委托共识交易提交出错时,需要掉此接口来删除委托共识交易数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositRollback",\n "version:"1.0",\n "params":["tx",1000000,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托共识交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托共识交易被打包区块的高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-13-撤销委托"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-13-撤销委托","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.13 撤销委托")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("申请退出共识,交易验证通过后在指定时间之后加入共识的押金和奖励会解冻\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证参数正确性\n- 创建交易\n- 判断账户余额是否足够\n- 验证交易\n- 保存交易\n- 广播交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("申请退出共识,交易验证通过后在指定时间之后加入共识的押金和奖励会解冻\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdraw",\n "version:"1.0",\n "params":["address","txHash","password","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("申请退出共识账户地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("加入共识时的交易hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("密码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t"value":"tx.getHash().getDigestHex()" //生成的交易hash值\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash值的十六进制字符串")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-14-退出共识交易验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-14-退出共识交易验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.14 退出共识交易验证")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("验证退出共识交易是否正确\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证要退出的共识之前是否已经委托且没有退出\n- 验证创建该交易的账户是否正确\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("在退出之前要验证该账户是否参与过该委托且现在还是在委托中。还要验证交易创建者是否为委托人本人。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawValid",\n "version:"1.0",\n "params":["tx","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("退出委托交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-15-退出共识交易提交"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-15-退出共识交易提交","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.15 退出共识交易提交")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("退出共识交易提交,保存退出共识交易相关数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 保存退出共识交易相关数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("当退出共识交易验证成功之后通过调用该接口来保存交易相关数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_depositCommit",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-16-退出共识交易回滚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-16-退出共识交易回滚","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.16 退出共识交易回滚")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("退出共识交易数据回滚\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 回滚退出共识交易数据\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("当退出共识交易提交出错时,需要调用此接口来回滚数据,保证数据的正确性。\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_withdrawRollback",\n "version:"1.0",\n "params":["tx","blockHeader","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("退出委托交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeader")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("区块头的十六进制字符串")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-17-查询共识节点列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-17-查询共识节点列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.17 查询共识节点列表")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("功能说明:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("获取自己加入的或全网所有的共识节点列表,支持关键字查询,排序,分页查询\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("流程描述")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- 验证参数正确性\n- 获取本地主链上共识节点列表\n- 过滤共识节点列表,得到满足条件的共识节点列表\n- 共识节点列表排序\n- 分页\n- 返回共识节点列表\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("接口说明")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("获取自己加入的或全网所有的共识节点列表,支持关键字查询,排序,分页查询\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("请求示例")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getAgentList",\n "version:"1.0",\n "params":[1,10,"address","keyword","sortType","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("页码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("每页数据量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("keyword")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("关键字(节点地址,打包地址,节点别名,节点ID)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("sortType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("排序类型(deposit创建共识节点的锁定金额,commissionRate佣金比 例,creditVal奖励金额,totalDeposit参与共识的总金额,comprehensive综合排序)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"pageNumber":1, //页码 \n \t"pageSize":10, //每页数据量\n \t"total":100, //总数据量\n \t"pages",10, //总页数\n \t"data":[\n {\n "agentHash":"", //节点hash\n "agentAddress";"", //创建节点的地址\n "packingAddress";"", //打包地址\n "rewardAddress";"", //奖励地址\n "deposit";, //保证金\n "commissionRate";, //佣金比例\n "agentName";"", //节点名称\n "agentId";"", //节点ID\n "introduction";"", //简介\n "time";, //创建时间\n "blockHeight";, //所在区块高度\n "delHeight":, //共识节点被删除的区块高度\n "status":, //状态 \n "creditVal":, //信誉值\n "totalDeposit":, //参与共识总金额\n "txHash":"", //交易hash\n "memberCount":, //加入该节点共识的人数\n "version": //版本\n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("页码")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("每页数据量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("总数据量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("总页数")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点的地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("打包地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("奖励地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("保证金")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("佣金比例")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点名称")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("简介")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建该节点的交易所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("注销交易所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("状态")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("信誉值")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("总委托金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托数量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("协议版本")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-18-查询节点明细(基本信息、信用值、节点状态)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-18-查询节点明细(基本信息、信用值、节点状态)","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.18 查询节点明细(基本信息、信用值、节点状态)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定共识节点详细信息,包括共识节点的创建时间,保证金,佣金比例,节点地址,打包地址,共识状态,信用值,委托金额,共识人数等信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证参数正确性\n- 获取本地主链上共识节点列表\n- 从列表中找出对应的节点信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("通过节点hash查询该节点的详细信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgent",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点id")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"data":{\n "agentHash":"", //节点hash\n "agentAddress";"", //创建节点的地址\n "packingAddress";"", //打包地址\n "rewardAddress";"", //奖励地址\n "deposit";, //保证经\n "commissionRate";, //佣金比例\n "agentName";"", //节点名称\n "agentId";"", //节点ID\n "introduction";"", //简介\n "time";, //创建时间\n "blockHeight";, //所在区块高度\n "delHeight":, //共识节点被删除的区块高度\n "status":, //状态 \n "creditVal":, //信用值\n "totalDeposit":, //参与共识总金额\n "txHash":"", //交易hash\n "memberCount":, //加入该节点共识的人数\n "version": //版本\n }\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建节点的地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("打包地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("奖励地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("保证金")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("commissionRate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("佣金比例")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点名称")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("introduction")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("简介")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("创建该节点的交易所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("注销交易所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("状态")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("信誉值")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("总委托金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托数量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("version")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("协议版本")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-19-查询节点惩罚列表(全部、红牌、黄牌)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-19-查询节点惩罚列表(全部、红牌、黄牌)","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.19 查询节点惩罚列表(全部、红牌、黄牌)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("功能说明:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("获取共识节点以前获得的惩罚记录(红牌和黄牌惩罚),用户可自定义查询全部惩罚记录还是只获取红牌或则黄牌惩罚信息\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("流程描述")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- 验证参数正确性\n- 根据查询类型获取相应惩罚\n")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定出块地址的惩罚记录\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getPunishList",\n "version:"1.0",\n "params":["address",0,"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("出块地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚类型 1黄牌,2红牌,0全部")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"pageNumber":1, //页码 \n \t"pageSize":10, //每页数据量\n \t"total":100, //总数据量\n \t"pages",10, //总页数\n \t"data":[\n {\n "type",, //惩罚类型\n "address","", //出块地址\n "time","", //惩罚时间\n "height",, //区块高度\n "roundIndex",, //轮次 \n "reasonCode","" //惩罚原因\n },{\n ......\n }\n \t]\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("页码")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("每页数据量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("数据总量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("数据总页数")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("byte")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚类型")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("height")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("roundIndex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("轮次")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reasonCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚原因")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-20-查询委托列表(根据委托人、根据节点)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-20-查询委托列表(根据委托人、根据节点)","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.20 查询委托列表(根据委托人、根据节点)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("功能说明:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("1.查询指定地址参与的所有委托信息列表\n2.查询指定账户参与的指定共识节点的委托信息\n3.查询指定共识节点受托列表信息\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("流程描述")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("- 验证参数正确性\n- 获取本地主链上参与共识信息列表\n- 过滤共识列表,获取指定账户参与的共识列表或指定节点受委托的共识列表信息\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("接口说明")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('获取指定账户参与的或指定共识节点接受的共识列表信息,当查询指定账户参与的所有共识列表时agentHash字段传"",当需要查询指定节点的所有受委托列表时address字段传""\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("请求示例")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getDepositList",\n "version:"1.0",\n "params":[1,10,"address","agentHash","chainId"]\n}\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("页码")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("pageSize")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("每页数据量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("2")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('参与委托的账户地址(查询节点受委托信息是该指定传"")')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("3")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("false")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v('指定代理节点标识(当查询账户所有委托信息时该字段传"")')])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"pageNumber":1, //页码 \n \t"pageSize":10, //每页数据量\n \t"total":100, //总数据量\n \t"pages",10, //总页数\n \t"data":[\n {\n "agentHash":"", //节点hash\n "address";"", //申请加入共识账户地址\n "deposit";, //委托金额\n "time";, //委托时间\n "blockHeight";, //委托所在区块高度\n "delHeight":, //共识节点被删除的区块高度 \n "txHash":"", //交易hash\n "status":, //共识节点状态(待共识,共识中)\n "agentName":"", //共识节点名称\n "agentAddress":"" //共识节点地址\n },{\n \n }\n \t]\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageNumber")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("页码")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pageSize")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("每页数据量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("total")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("数据总量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("pages")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("总页码")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("申请加入共识账户地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("deposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("time")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("blockHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托交易所在区块高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("delHeight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("退出委托交易所在高度")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("txHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易hash")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点状态(待共识,共识中)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentName")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点名称")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点地址")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-21-查询全网共识状态"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-21-查询全网共识状态","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.21 查询全网共识状态")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询全网共识总体信息,包括节点数量,总抵押,参与共识账户总数量等信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 获取全网共识节点列表\n- 过滤共识节点列表,等到合法的共识节点列表\n- 获取当前打包轮次信息\n- 根据当前打包轮次信息获取,当前网络参与共识的账户总量及委托金额总量\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询全网节点数量,总委托金额,参与共识的账户两及满足打包条件的共识节点数量\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getWholeInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"data":{\n "agentCount":, //节点数量\n "totalDeposit":, //委托金额总量\n "rewardOfDay":, //24小时内的奖励金额\n "consensusAccountNumber":, //参与共识的账户数量\n "packingAgentCount": //当前轮次打包共识节点数量\n \t}\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点数量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("委托金额总量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("24小时内的奖励金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("consensusAccountNumber")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("参与共识的账户数量")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("当前轮次打包共识节点数量")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-22-查询单个账户共识状态"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-22-查询单个账户共识状态","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.22 查询单个账户共识状态")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定账户共识信息,包括该账户自己创建的共识节点个数及节点hash,参与共识的总金额,该账户参与的共识节点个数,可用余额,共识奖金,24小时内获取的共识奖金\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 获取全网网络共识节点列表\n- 查看共识节点列表中是否有该账户创建的共识节点\n- 获取当前网络委托列表\n- 从委托列表中获取该账户参与的委托列表\n- 从该账户的委托列表获取该账户的委托信息\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定账户共识信息,包括该账户自己创建的共识节点个数及节点hash,参与共识的总金额,该账户参与的共识节点个数,可用余额,共识奖金,24小时内获取的共识奖金\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getInfo",\n "version:"1.0",\n "params":["address","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"data":{\n "agentCount":, //该账户创建的节点个数\n "totalDeposit":, //该账户总的委托金额\n "joinAgentCount":, //该账户参与的共识节点个数\n "usableBalance":, //账户可用余额\n "reward":, //账户参与共识的所有奖励\n "rewardOfDay":, //账户24小时内获取的共识奖励\n "agentHash":"" //账户创建的节点的hash\n \t}\n }\n}\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Object")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识信息")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("该账户创建的节点个数")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("totalDeposit")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("该账户总的委托金额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("joinAgentCount")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("该账户参与的共识节点个数")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("usableBalance")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("可用余额")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("reward")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("账户参与共识的所有奖励")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("rewardOfDay")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("账户24小时内获取的共识奖励")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("账户创建的节点的hash")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-23-验证区块正确性"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-23-验证区块正确性","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.23 验证区块正确性")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("验证区块轮次信息,打包人,区块中交易信息,CoinBase是否正确,并验证是否有红黄牌交易生成\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 验证分叉(调用区块管理模块接口),有分叉则生成红牌交易\n- 验证双花(调用交易模块接口),有双花则生成红牌交易并直接返回验证失败\n- 生成红牌交易,将红牌交易放入待打包交易池\n- 验证区块轮次信息及打包人是否正确\n- 验证区块中交易正确性(调用交易模块接口)\n- 验证CoinBase交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("这个接口主要是验证区块轮次信息,打包人,区块中的交易以及CoinBase是否正确,并验证是否有红黄牌惩罚\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_validSmallBlock",\n "version:"1.0",\n "params":["SmallBlock","chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smallBlock")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("SmallBlock的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-24-共识模块批量验证"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-24-共识模块批量验证","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.24 共识模块批量验证")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("共识模块交易批量验证,验证每笔交易正确性,验证交易冲突\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 循环验证每笔交易是否正确\n- 验证交易列表的是否存在冲突交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("循环验证传入的交易列表中的每笔交易是否正确,并验证交易列表中是否存在冲突交易\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_batchValid",\n "version:"1.0",\n "params":[["tx1","tx2","tx3"],"chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1,tx2,tx3......")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("交易的序列化数据")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链id")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version":"1.0", \n "code": 0, //错误码\n "msg": "提示信息", //提示信息 \n "result": { //返回的业务数据集 \n \t\t"data":[\t\t\t\t\t\t\t //验证不通过的交易列表\n \t\t\t\t"tx1_hash",\n \t\t\t\t"tx2_hash",\n \t\t\t\t"tx3_hash"\n \t\t\t ]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("验证不通过的交易列表")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("tx1_hash,tx2_hash,tx3_hash.....")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("验证没通过的交易的hash")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-25-获取当前轮次信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-25-获取当前轮次信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.25 获取当前轮次信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("功能说明:")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("查询当前网络共识节点的打包轮次信息,包括当前网络有多少处于打包状态的共识节点,本轮次打包的开始结束时间,本轮次所有打包节点的基本信息\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("流程描述")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("无\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("接口说明")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("查询当前网络共识节点打包轮次信息\n")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("请求示例")]),this._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "method":"cs_getRoundInfo",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"data":{\n "totalWeight":, \n "index":, \n "startTime":, \n "endTime":, \n "memberCount":,\n "memberList":[\n {\n "agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"Weight":\n },{\n \n }\n ],\n "myMember":{\n \t"agentAddress":"",\n "packingAddress":"",\n "agentHash":"",\n "packingIndexOfRound":,\n "creditVal":,\n "packStartTime":,\n "packEndTime":,\n\t\t\t\t\t"weight":\n }\n \t}\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n\n')])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"center"}},[this._v("parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("type")]),this._v(" "),e("th",{staticStyle:{"text-align":"center"}},[this._v("description")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("totalWeight")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("double")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("总权重(用于计算共识奖励)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("index")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("当前轮次下标")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("startTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("当前轮次开始打包时间")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("endTime")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("long")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("当前伦次打包结束时间")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("memberCount")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("int")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("当前打包轮次打包节点数量")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("tr",[e("td",{staticStyle:{"text-align":"center"}},[this._v("myMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("MeetingMember")]),this._v(" "),e("td",{staticStyle:{"text-align":"center"}},[this._v("当前节点打包信息")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingAddress")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("打包地址")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packingIndexOfRound")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点在当前轮次中打包下标")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("creditVal")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("信用值")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packStartTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点打包开始时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("packEndTime")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点打包结束时间")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("weight")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("double")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("当前共识节点权重(总委托金额*信用值)")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-26-指定共识节点状态查询"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-26-指定共识节点状态查询","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.26 指定共识节点状态查询")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定共识节点当前状态(共识中,打包中)\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 查询节点是否存在\n- 查询节点状态\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("查询指定共识节点当前状态\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_getAgentStatus",\n "version:"1.0",\n "params":["agentHash","chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("agentHash")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点ID")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t"data":{\n "status":1 //节点状态 \n \t}\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("status")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("节点状态(0共识中,1打包中)")])])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-27-修改节点打包状态"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-27-修改节点打包状态","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.27 修改节点打包状态")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("本地节点启动时当区块管理模块同步完区块之后通知共识模块打包\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("- 修改节点打包状态\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("修改节点打包状态\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_updatePackStatus",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-28-停止链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-28-停止链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.28 停止链")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("暂停某条正在运行的链\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("暂停某条正在运行的链\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_stopChain",\n "version:"1.0",\n "params":["chainId"]\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("链ID")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t\n }\n}\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-29-运行链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-29-运行链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.29 运行链")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("在本地运行一条新的子链\n")])])])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("无\n")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接口说明")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("在本地运行一条新的子链\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "method":"cs_runChain",\n "version:"1.0",\n "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明(待完善)")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("链ID")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("packing_interval")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("打包间隔时间(单位:s)")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("packing_amount")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("出块最小金额")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("coinbase_lockHeight")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("奖励金锁定块数")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("redPublish_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("获得红牌保证金锁定时间(单位:s)")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("stopAgent_lockTime")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("注销节点保证金锁定时间(单位:s)")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("commissionRate_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("佣金比列最小值")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("commissionRate_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("double")]),t._v(" "),a("td",[t._v("佣金比列最大值")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("deposit_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("创建节点保证金最小金额")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("deposit_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("创建节点保证金最大金额")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("commission_min")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("委托共识最小金额")])]),t._v(" "),a("tr",[a("td",[t._v("11")]),t._v(" "),a("td",[t._v("Commission_max")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("委托共识最大金额")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("成功")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code": 0, //错误码\n "msg": "success", //错误提示信息\n "version":"1.0", \n "result": { //返回的业务数据集 \n \t\n }\n}\n\n\n')])])]),a("p",[t._v("失败")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "version": 1.0,\n \t "code":1, //错误码\n \t "msg" :"错误提示信息", //提示信息\n "result":{\n \n \t }\n}\n\n\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回参数说明")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-模块内部功能"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 模块内部功能")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[a("p",[t._v("共识模块启动流程")]),t._v(" "),a("p",[t._v("初始化:")]),t._v(" "),a("ul",[a("li",[t._v("1.加载共识模块配置信息(出块间隔时间,奖励金锁定块数)")]),t._v(" "),a("li",[t._v("2.注册共识模块交易、交易验证器、交易处理器(向交易模块注册)")]),t._v(" "),a("li",[t._v("3.注册共识模块服务接口(向核心模块注册)")]),t._v(" "),a("li",[t._v("4.注册共识模块事件(向事件总线模块注册)")])]),t._v(" "),a("p",[t._v("启动:")]),t._v(" "),a("ul",[a("li",[t._v("获取数据库最新一轮区块信息,计算轮次信息")]),t._v(" "),a("li",[t._v("获取当前协议版本信息并缓存")]),t._v(" "),a("li",[t._v("启动各个相关线程")])])]),t._v(" "),a("li",[a("p",[t._v("打包出块流程")]),t._v(" "),a("ul",[a("li",[t._v("判断节点是否满足成为打包节点要求")]),t._v(" "),a("li",[t._v("计算打包轮次信息")]),t._v(" "),a("li",[t._v("等待打包出块")]),t._v(" "),a("li",[t._v("接收最新区块,如果等待5秒还没有收到最新的区块,则默认上一个出块节点没有出块,当前节点继续执行打包操作")]),t._v(" "),a("li",[t._v("校验需打包的交易,剔除重复打包交易后打包新区块")]),t._v(" "),a("li",[t._v("校验打包的新区块,并保存相关数据到数据库")]),t._v(" "),a("li",[t._v("广播区块")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(626),alt:""}})])},function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",[n("p",[t._v("共识奖励统计")]),t._v(" "),n("p",[n("img",{attrs:{src:a(627),alt:""}})]),t._v(" "),n("ul",[n("li",[t._v("获取本地账户列表")]),t._v(" "),n("li",[t._v("获取24小时内的区块列表")]),t._v(" "),n("li",[t._v("遍历区块列表获取CoinBase交易")]),t._v(" "),n("li",[t._v("根据CoinBase交易,更新24小时内总的奖励金额,24小时内本地账户累计的奖励金额,24小时内的奖励明细")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、事件说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、事件说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-1-发布的事件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-发布的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 发布的事件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-1-区块打包成功事件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-区块打包成功事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.1 区块打包成功事件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当一个新区快打包成功之后发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_packing"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "smallBlock":"smallBlock对象序列化成十六进制字符串"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-2-创建节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-2-创建节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.2 创建节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当创建节点交易被确认并打包进块之后发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_createAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //打包区块中创建的共识节点列表\n "agent1", //Agent对象的序列化为十六进制字符串\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-3-注销节点"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-3-注销节点","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.3 注销节点")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当注销节点交易被确认并打包进块之后发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_stopAgent"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //打包区块中注销的共识节点列表\n "agent1", //Agent对象的序列化为十六进制字符串\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-4-共识节点状态改变(共识中,出块中)"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-4-共识节点状态改变(共识中,出块中)","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.4 共识节点状态改变(共识中,出块中)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当共识节点状态改变时发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_agentStatusChage"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "agentList":{ //打包区块中状态该表的共识节点列表\n "agent1", //Agent对象的序列化为十六进制字符串\n "agent2",\n "agent3"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-5-委托共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-5-委托共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.5 委托共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当委托共识交易被确认并打包进块之后发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_deposit"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //打包区块中委托列表\n "deposit1", //Deposit对象序列化为十六进制字符串\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-6-退出共识"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-6-退出共识","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.6 退出共识")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当退出共识交易被确认并打包进块之后发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_withdraw"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "depositList":{ //打包区块中退出委托列表\n "deposit1", //Deposit对象序列化为十六进制字符串\n "deposit2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-7-黄牌惩罚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-7-黄牌惩罚","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.7 黄牌惩罚")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当有共识节点获得黄牌惩罚是发布该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_yellowPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "yellowPublishList":{ //打包区块中黄牌列表\n "yellowPublish1", //YellowPublish对象序列化为十六进制字符串\n "yellowPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-1-8-红牌惩罚"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-8-红牌惩罚","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1.8 红牌惩罚")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("说明:当有共识节点获得红牌交易时获得该事件\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' event_topic : "evt_cs_redPublish"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('data:{\n "chainId":88,\n "redPublishList":{ //打包区块中红牌列表\n "redPublish1", //RedPublish对象序列化为十六进制字符串\n "redPublish2"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_4-2-订阅的事件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-订阅的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 订阅的事件")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("无\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-网络通讯协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-网络通讯协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 网络通讯协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"broadblock"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#broadblock","aria-hidden":"true"}},[this._v("#")]),this._v(" broadBlock")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("发送新区块(SmallBlock)")]),t._v(" "),a("li",[t._v("根据hash获取区块")]),t._v(" "),a("li",[t._v("发送完整区块")]),t._v(" "),a("li",[t._v("根据高度获取多个区块")]),t._v(" "),a("li",[t._v("根据交易hash列表获取交易列表")]),t._v(" "),a("li",[t._v("发送交易列表")]),t._v(" "),a("li",[t._v("根据hash获取SmallBlock")]),t._v(" "),a("li",[t._v("根据高度区间获取区块hash列表")]),t._v(" "),a("li",[t._v("根据高度区间获取SmallBlock列表")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链ID")])]),t._v(" "),a("tr",[a("td",[t._v("??")]),t._v(" "),a("td",[t._v("smallBlock")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("SmallBlock对象序列化的十六进制字符串")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、模块配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、模块配置")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n {\n "name": "packing_interval",\n "remark": "打包间隔时间",\n "changable": "true",\n "default": "10秒"\n },\n {\n \t"name": "packing_amount",\n "remark": "出块最小金额",\n "changable": "true",\n "default": "200000"\n },\n {\n \t"name": "coinbase_unlock_height",\n "remark": "奖励金锁定块数",\n "changable": "true",\n "default": "100"\n },\n {\n \t"name": "redPublish_lockTime",\n "remark": "获得红牌保证金锁定时间",\n "changable": "true",\n "default": "3个月"\n },\n {\n \t"name": "stopAgent_lockTime",\n "remark": "注销节点保证金锁定时间",\n "changable": "true",\n "default": "3天"\n },\n {\n \t"name": "commissionRate_min",\n "remark": "佣金比例的最小值",\n "changable": "true",\n "default": "10"\n },\n {\n \t"name": "commissionRate_max",\n "remark": "佣金比例的最大值",\n "changable": "true",\n "default": "80"\n },\n {\n \t"name": "deposit_min",\n "remark": "创建节点的保证金最小值",\n "changable": "true",\n "default": "20000"\n },\n {\n \t"name": "deposit_max",\n "remark": "创建节点的保证金最大值",\n "changable": "true",\n "default": "700000"\n },\n {\n \t"name": "commission_min",\n "remark": "委托最小值",\n "changable": "true",\n "default": "2000"\n },\n {\n \t"name": "commission_max",\n "remark": "委托最大值",\n "changable": "true",\n "default": "680000"\n }\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、java特有的设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、Java特有的设计")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"八、补充内容"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[this._v("#")]),this._v(" 八、补充内容")])}],s=a(0),i=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\t众所周知,区块链的核心是共识机制。和传统互联网的cliet-server架构不同,区块链的节点是对等的,没有中心,大家权利一样;所以为了使数据达到一致性,让一个没有中心的网络维护一套大家都认同的账本,这就是共识机制的作用。")]),t._v(" "),a("p",[t._v("​\t从广义上来说,共识机制就是区块链每个节点共同遵守的规则或算法,是实现互信的基础,如此才能实现去中心化的无监管,维持整个平台的正常运转。")]),t._v(" "),a("p",[t._v("​\t从狭义来说,共识机制决定了每个节点对区块链上交易的验证和确认的机制。")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("​\t区块链的每次交易,都必须获得每个节点的认可,只有全网都达成共识后,交易才算完成。就好像民主选举中,投票方式或规则必须被全民认可,基于此才能完成选举。而在区块链中,共识机制的主要表现就是激励制度,也就是给矿工的奖励。在共识机制的保障下,每个矿工都能获得奖励,整个区块链才能有序的运转,提供公平、透明及互信的环境。因此共识模块就需要提供特定的算法来维持,即共识算法。")]),t._v(" "),a("p",[t._v("​\t公链共识机制有多种,主流的有POW、POS、DPOS。NULS主网采用自主原创的POC(Proof Of Credit)共识机制,一种继承了Dpos共识机制的安全性和高效率,同时在协作方面进行了非常大的改进,可以看成是一种升级版的Dpos。")]),t._v(" "),a("p",[t._v("​\tPOC共识模块职责:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("​\t共识模块在系统中是比较核心的一块,主要负责打包交易出块,验证区块头,管理系统中的共识节点信息,委托信息,处罚信息等。")]),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("(注意:区块下载属于区块管理模块,重新画图)")]),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("说明:")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("NULS2.0设计理念是提供模块化的服务,并且每个模块都应该支持多条链的数据同时运行,因此共识模块需要实现不同共识机制的算法。当共识模块启动运行后,可同时支持多条链同时运行。")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("NULS的主网采用自主的POC共识机制,要实现POC,首先需要知道POC的设计理念和业务规则,以下内容摘自NULS白皮书POC共识介绍部分,如果熟悉可直接跳过。")]),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),a("p",[t._v("以上是对共识模块POC共识机制实现的功能分析,在下一章节会介绍每个功能实现的细节。")]),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("共识模块为区块链的核心模块,由于共识机制的不同,导致对外提供的服务也不尽相同。模块服务会对共识模块共有的服务和POC机制特有的服务做详细描述。")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),a("ul",[t._m(60),t._v(" "),t._m(61),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(66),t._v(" "),a("tbody",[t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Agent")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识节点列表")])])])]),t._v(" "),a("p",[t._v("Agent:")]),t._v(" "),t._m(71)])])])]),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),a("ul",[t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(79),t._v(" "),a("tbody",[t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Punish")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("惩罚列表数据")])])])]),t._v(" "),a("p",[t._v("Punish:")]),t._v(" "),t._m(84)])]),t._v(" "),t._m(85),t._v(" "),a("ul",[t._m(86),t._v(" "),t._m(87),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("p",[t._v("data:")]),t._v(" "),a("table",[t._m(92),t._v(" "),a("tbody",[t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("data")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("Deposit")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("共识数据列表的json字符串")])])])]),t._v(" "),a("p",[t._v("Deposit:")]),t._v(" "),t._m(97)])])])]),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),a("ul",[t._m(107),t._v(" "),t._m(108),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),a("li",[a("p",[t._v("返回参数说明")]),t._v(" "),a("p",[t._v("data")]),t._v(" "),a("table",[t._m(113),t._v(" "),a("tbody",[t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("memberList")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("List"),a("MeetingMember")],1),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("当前轮次打包节点打包信息")])]),t._v(" "),t._m(119)])]),t._v(" "),a("p",[t._v("MeetingMember")]),t._v(" "),t._m(120)])])])]),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),a("p",[t._v("​\tPOC共识机制是由参与共识出块的节点轮流出块,达成共识,共同维护一套账本。但由于网络原因或者是有的共识节点作恶(向不同的节点发送不同的打包块),会出现分叉的情况,对于这种恶意节点系统会根据恶劣程度给与不同的处罚,当轮到某节点出块时未按规定时间出块时系统会给与节点黄牌处罚,该处罚会降低节点的信用值,当节点信用值降到-1时,该节点会被处以红牌惩罚;对于作恶程度恶劣的节点会直接处以红牌惩罚,获得红牌惩罚的节点将会停止打包且该节点永久不能再创建共识节点,且保证金会被冻结一定时间,其他委托该节点的委托金额会返还给委托人;当节点正常出块时,节点会获得出块奖励,委托该节点的账户也会根据委托金额的多少获取相应比例的奖励金。")]),t._v(" "),a("p",[t._v("​\t共识模块除了提供打包出块外,还会做奖励金的统计工作,统计24小时内发放的总的奖励金额,24小时内本地账户累计的奖励金额,24小时内的奖励明细等")]),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._m(137),t._m(138),t._m(139),t._v(" "),t._m(140),t._m(141),t._m(142),t._m(143),t._v(" "),t._m(144),t._m(145),t._m(146),t._m(147),t._v(" "),t._m(148),t._m(149),t._m(150),t._m(151),t._v(" "),t._m(152),t._m(153),t._m(154),t._m(155),t._v(" "),t._m(156),t._m(157),t._m(158),t._m(159),t._v(" "),t._m(160),t._m(161),t._m(162),t._m(163),t._v(" "),t._m(164),t._m(165),t._m(166),t._m(167),t._v(" "),t._m(168),t._m(169),t._v(" "),t._m(170),t._v(" "),t._m(171),t._v(" "),t._m(172),t._v(" "),a("p",[t._v("用于广播打包的新区快")]),t._v(" "),t._m(173),t._v(" "),t._m(174),t._v(" "),t._m(175),t._m(176),t._v(" "),t._m(177)])},n,!1,null,null,null);i.options.__file="consensusModuleDesign.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/55.07cb4238.js b/docs/.vuepress/dist/assets/js/55.07cb4238.js new file mode 100644 index 00000000..3f5aefd3 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/55.07cb4238.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{635:function(t,e,a){t.exports=a.p+"assets/img/ledger-arch.865ff93a.png"},636:function(t,e,a){t.exports=a.p+"assets/img/ledger-functions.e4039436.png"},637:function(t,e,a){t.exports=a.p+"assets/img/ledger-service.219cab8a.png"},638:function(t,e,a){t.exports=a.p+"assets/img/eth-transaction-flow.6f3dd253.png"},639:function(t,e,a){t.exports=a.p+"assets/img/trx-validate-flow.fd3d46e4.png"},831:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"账本模块设计文档"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#账本模块设计文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 账本模块设计文档")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"一、总体描述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、总体描述","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、总体描述")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-1-模块概述"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 模块概述")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-1-为什么要有《账本模块》"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《账本模块》","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 为什么要有《账本模块》")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("账本模块是区块链的数据中枢,所有账户的余额、交易都保存在账本模块中,\n每一个全网节点上都会保存一个全网账本,保证了数据的完整、公开、透明,同时保证了数据不可篡改、可追溯")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-2-《账本模块》要做什么"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-《账本模块》要做什么","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2 《账本模块》要做什么")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("为组装交易提供数据支撑,主要就是记账和查账,验证交易的合法性,如:是否有充足的余额,是否重复支付(双花)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-3-《账本模块》在系统中的定位"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《账本模块》在系统中的定位","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《账本模块》在系统中的定位")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("账本模块是数据中枢,保存系统所有存在交易的结果数据,它不依赖任何业务模块,其他模块按需依赖它。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-1-4-《账本模块》中名词解释"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-4-《账本模块》中名词解释","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.4 《账本模块》中名词解释")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("交易的随机数(nonce,一个32位hash值)\n"),a("ul",[a("li",[t._v("nonce:与此地址发送的交易数量相等的标量值,用户发起的每一笔交易中都会包含该nonce。")]),t._v(" "),a("li",[t._v("在该账户每笔交易都需要保存前一笔交易的nonce(hash)")]),t._v(" "),a("li",[t._v("严格地说,nonce是始发地址的一个属性(它只在发送地址的上下文中有意义)。但是,该nonce并未作为账户状态的一部分显式存储在区块链中。")]),t._v(" "),a("li",[t._v("nonce值也用于防止帐户余额的错误计算。例如,假设一个账户有10个NULS的余额,并且签署了两个交易,都花费6个NULS,分别具有nonce 1和nonce 2。这两笔交易中哪一笔有效?在区块链分布式系统中,节点可能无序地接收交易。nonce强制任何地址的交易按顺序处理,不管间隔时间如何,无论节点接收到的顺序如何。这样,所有节点都会计算相同的余额。支付6以太币的交易将被成功处理,账户余额减少到4 ether。无论什么时候收到,所有节点都认为与带有nonce 2的交易无效。如果一个节点先收到nonce 2的交易,会持有它,但在收到并处理完nonce 1的交易之前不会验证它。")]),t._v(" "),a("li",[t._v("使用nonce确保所有节点计算相同的余额,并正确地对交易进行排序,相当于比特币中用于防止“双重支付”的机制。但是,因为以太坊跟踪账户余额并且不会单独跟踪独立的币(在比特币中称为UTXO),所以只有在账户余额计算错误时才会发生“双重支付”。nonce机制可以防止这种情况发生。")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_1-2-架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 架构图")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("账本的核心还是资产管理和记账管理。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(635),alt:"ledger-arch.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"二、功能设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、功能设计")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-1-功能架构图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 功能架构图")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(636),alt:"ledger-functions.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-2-模块服务"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-模块服务","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 模块服务")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-1-账本模块的系统服务"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-账本模块的系统服务","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 账本模块的系统服务")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(637),alt:"ledger-service.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("账本模块提供的RPC的接口调用,详细接口请参照接口设计部分。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-2-2-修改系统运行参数"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-修改系统运行参数","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 修改系统运行参数")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("只依赖核心系统,核心系统可以对事件模块系统的启动,停止,参数修改等,")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-3-模块内部功能"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块内部功能","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 模块内部功能")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-1-热-在线-交易处理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-热-在线-交易处理","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 热(在线)交易处理")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("模块内部工能主要包含,资产管理,获取账户地址余额和nonce,验证交易coinData。")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("资产管理\n"),a("ul",[a("li",[t._v("账户的总资产")]),t._v(" "),a("li",[t._v("可用资产")]),t._v(" "),a("li",[t._v("冻结资产,对于有锁定的资产,需要单独记录以及锁定的资产信息,包含链ID,资产ID,资产金额,锁定时间,锁定高度等")]),t._v(" "),a("li",[t._v("资产解锁流程,当用户的锁定资产时间或者高度达到解锁条件,账本会把该资产信息解锁,累计到可用余额,并删除本地数据的资产锁定记录。")]),t._v(" "),a("li",[t._v("多资产情况,需要加入chainId.")])])]),t._v(" "),a("li",[t._v("获取账户地址余额和nonce\n"),a("ul",[a("li",[t._v("获取账户地址余额")]),t._v(" "),a("li",[t._v("获取账户地址nonce(该nonce是一个hash值,意味着第一个交易的nonce是0.以后该账户的每一笔交易都会包含前一笔交易的nonce值 )")])])]),t._v(" "),a("li",[t._v("验证交易\n"),a("ul",[a("li",[t._v("双花验证(nonce机制阻止双重支付)")]),t._v(" "),a("li",[t._v("交易创建者验证,验证交易发出者是否拥有足够的余额,验证交易创建者的nonce是否合法")]),t._v(" "),a("li",[t._v("连续交易验证")])])]),t._v(" "),a("li",[t._v("功能接口管理(rpc)\n"),a("ul",[a("li",[t._v("提供给其他模块使用的rpc接口")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-3-2-冷-离线-交易处理"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-冷-离线-交易处理","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 冷(离线)交易处理")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("冷钱包就是不连网的钱包,也叫离线钱包。热钱包就是保持联网上线的钱包,也就是在线钱包。冷钱包不联网会比热钱包更安全。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("由于冷钱包只对交易信息进行签名,在通过热钱包传输签名后的hex字符串到服务端, 然后服务端再进行统一的交易处理, 所以客户端就需要做到离线签名的功能,\n离线交易系统中维护nonce的存储信息,使用一个nonce之后,在业务系统中对nonce进行保存处理。")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("离线交易大部分都是有交易所自己处理,我们需要存储全网账户的账本数据")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_2-4-账本流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-账本流程","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 账本流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-1-转账交易流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-1-转账交易流程","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.1 转账交易流程")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("用户输入转账的地址和转入的地址和转出的金额")]),t._v(" "),a("li",[t._v("系统通过转出的地址的私钥对转账信息进行签名(用于证明这笔交易确实有本人发起)")]),t._v(" "),a("li",[t._v("系统对交易信息进行验证\n"),a("ul",[a("li",[t._v("余额验证")]),t._v(" "),a("li",[t._v("手续费验证")]),t._v(" "),a("li",[t._v("nonce连续性验证")]),t._v(" "),a("li",[t._v("签名与input账户验证")])])]),t._v(" "),a("li",[t._v("把这笔交易入到本地的TxPool中(就是账本未确认交易池)")]),t._v(" "),a("li",[t._v("把交易信息广播给其它节点")]),t._v(" "),a("li",[t._v("打包区块,验证区块")]),t._v(" "),a("li",[t._v("确认交易\n"),a("ul",[a("li",[t._v("更新相关(转入或者转出)的所有账户的余额")]),t._v(" "),a("li",[t._v("更新账户资产对应的nonce")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-2-普通交易流程-参考实例"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-2-普通交易流程-参考实例","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.2 普通交易流程(参考实例)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(638),alt:"eth-transaction-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-4-3-交易验证流程"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-3-交易验证流程","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4.3 交易验证流程")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(639),alt:"trx-validate-flow.png"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"三、接口设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、接口设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 三、接口设计")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-1-模块核心交互接口"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-模块核心交互接口","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 模块核心交互接口")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-1-获取账户余额"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-获取账户余额","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.1 获取账户余额")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalance")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链id")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("要查询余额的地址")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产发起的链ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明 (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("说明: 1NULS=10^8Na")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("可用余额")])]),t._v(" "),a("tr",[a("td",[t._v("freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("冻结余额")])]),t._v(" "),a("tr",[a("td",[t._v("total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("总资产余额 total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-2-获取当前账户nonce值"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-获取当前账户nonce值","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.2 获取当前账户nonce值")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链id")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("要查询余额的地址")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产发起的链ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("34")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明 (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxx"')]),t._v(",\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonceType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("上笔支出交易hash")])]),t._v(" "),a("tr",[a("td",[t._v("nonceType")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1上笔交易已确认,0上笔交易未确认")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-3-获取余额与nonce值"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-获取余额与nonce值","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.3 获取余额与nonce值")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getBalanceNonce")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-3","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链id")])]),t._v(" "),a("tr",[a("td",[t._v("address")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("要查询余额的地址")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产发起的链ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0x407d73d8a49eeb85d32cf465507dd71d507100c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"34"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明:-response"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxx"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("用户可用余额")])]),t._v(" "),a("tr",[a("td",[t._v("nonce")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("账户的随机值,保存用户上一笔交易的hash。")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-4-验证coindata"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-验证coindata","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.4 验证coinData")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: validateCoinData")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-4","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链id")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("交易16进制流")])]),t._v(" "),a("tr",[a("td",[t._v("isBatchValidate")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("boolean")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("true 交易的批量校验,false 单笔的未确认校验")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("458")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isBatchValidate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"false"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明:-response-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response-2","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"validateDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"success"')]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("validateCode")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1校验通过,2孤儿交易 3双花 4 其他异常")])]),t._v(" "),a("tr",[a("td",[t._v("validateDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("校验返回描述")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-5-批量校验通知"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-5-批量校验通知","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.5 批量校验通知")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: bathValidateBegin")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-5","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链Id")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明:-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1成功,0失败")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-6-提交交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-6-提交交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.6 提交交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: commitTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-6"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-6","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链Id")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("交易16进制流")])]),t._v(" "),a("tr",[a("td",[t._v("isConfirmTx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("boolean")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("true 已确认交易 false 为确认交易回滚")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isConfirmTx"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"false"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明:-response-4"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response-4","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1成功,0失败")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-1-7-回滚交易"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-7-回滚交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1.7 回滚交易")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: rollBackTx")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-7"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-7","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否必填")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用链的链Id")])]),t._v(" "),a("tr",[a("td",[t._v("txHex")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("String")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("交易16进制流")])]),t._v(" "),a("tr",[a("td",[t._v("isConfirmTx")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("boolean")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("true 已确认交易 false 为确认交易回滚")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isConfirmTx"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"true"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明:-response-5"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明:-response-5","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明:(response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("1成功,0失败")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_3-2-其他接口"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-其他接口","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 其他接口")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-2-1-根据资产id获取资产信息"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-根据资产id获取资产信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2.1 根据资产id获取资产信息")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("cmd: getAsset")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"参数说明-request-8"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参数说明-request-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 参数说明 (request)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("是否可选")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("接口调用所在链链Id")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产发起链的链ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Y")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产ID")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h5",{attrs:{id:"返回值说明-response-3"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#返回值说明-response-3","aria-hidden":"true"}},[this._v("#")]),this._v(" 返回值说明 (response)")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetChainId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("41")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"200000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"12000000000"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("数据类型")]),t._v(" "),a("th",{staticStyle:{"text-align":"right"}},[t._v("描述信息")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("chainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("发起调用的链ID")])]),t._v(" "),a("tr",[a("td",[t._v("assetChainId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产发起的链链id")])]),t._v(" "),a("tr",[a("td",[t._v("assetId")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("int")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("资产ID")])]),t._v(" "),a("tr",[a("td",[t._v("balance.available")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("可用余额")])]),t._v(" "),a("tr",[a("td",[t._v("balance.freeze")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("冻结余额")])]),t._v(" "),a("tr",[a("td",[t._v("balance.total")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("BigInteger")]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},[t._v("总资产余额 total = available+freeze")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"四、事件说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、事件说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("不依赖任何事件")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"五、协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五、协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-1-网络通讯协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-网络通讯协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 网络通讯协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_5-2-交易协议"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-交易协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 交易协议")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"六、模块配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、模块配置")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-1-配置说明"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-配置说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 配置说明")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"_6-2-模块依赖关系"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-模块依赖关系","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 模块依赖关系")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ul",[a("li",[t._v("内核模块\n"),a("ul",[a("li",[t._v("模块注册")]),t._v(" "),a("li",[t._v("模块注销")]),t._v(" "),a("li",[t._v("模块状态上报(心跳)")]),t._v(" "),a("li",[t._v("服务接口数据获取及定时更新")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"七、java特有的设计"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#七、java特有的设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 七、Java特有的设计")])},function(){var t=this.$createElement,e=this._self._c||t;return e("blockquote",[e("p",[this._v("核心对象类定义,存储数据结构,......")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"八、补充内容"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#八、补充内容","aria-hidden":"true"}},[this._v("#")]),this._v(" 八、补充内容")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"参考资料文献资料"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#参考资料文献资料","aria-hidden":"true"}},[this._v("#")]),this._v(" 参考资料文献资料")])}],r=a(0),n=Object(r.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),t._m(43),t._v(" "),t._m(44),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._m(54),t._v(" "),t._m(55),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._m(62),t._v(" "),t._m(63),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._m(78),t._v(" "),t._m(79),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._m(86),t._v(" "),t._m(87),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._m(94),t._v(" "),t._m(95),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),a("p",[t._v("无")]),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://github.com/inoutcode/ethereum_book/blob/master/%E7%AC%AC%E4%B8%83%E7%AB%A0.asciidoc",target:"_blank",rel:"noopener noreferrer"}},[t._v("精通以太坊-第七章 交易"),a("OutboundLink")],1)])])])},s,!1,null,null,null);n.options.__file="ledgerModuleDesign.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/56.051d4b4e.js b/docs/.vuepress/dist/assets/js/56.051d4b4e.js new file mode 100644 index 00000000..d890dcf5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/56.051d4b4e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{657:function(t,s,a){t.exports=a.p+"assets/img/tx-manager-ctosatellite.b4831c18.png"},658:function(t,s,a){t.exports=a.p+"assets/img/tx-manager-satellitetoc.361d3fe7.png"},659:function(t,s,a){t.exports=a.p+"assets/img/tx-manager-context.9c43a7b6.png"},660:function(t,s,a){t.exports=a.p+"assets/img/tx-manager-architecture.a6fa2f65.png"},661:function(t,s,a){t.exports=a.p+"assets/img/tx-manager-functional-architecture.10e83f9b.png"},821:function(t,s,a){"use strict";a.r(s);var e=[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"交易管理模块设计文档"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#交易管理模块设计文档","aria-hidden":"true"}},[this._v("#")]),this._v(" 交易管理模块设计文档")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"一、总体概览"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、总体概览","aria-hidden":"true"}},[this._v("#")]),this._v(" 一、总体概览")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-1-模块概述"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-模块概述","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 模块概述")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-1-为什么要有《交易管理》模块"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-为什么要有《交易管理》模块","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.1 为什么要有《交易管理》模块")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-2《交易管理》模块要做什么"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2《交易管理》模块要做什么","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.2《交易管理》模块要做什么")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("一、对本地交易进行处理")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("收集交易")]),t._v(" "),a("li",[t._v("本地验证")]),t._v(" "),a("li",[t._v("提取可打包的交易")]),t._v(" "),a("li",[t._v("提交、回滚交易")]),t._v(" "),a("li",[t._v("保存未确认的、可打包的以及已确认的交易")]),t._v(" "),a("li",[t._v("提供交易的数据查询")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("二、对跨链交易的处理")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ol",[s("li",[this._v("友链向NULS主网发送交易")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("img",{attrs:{src:a(657),alt:""}})])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("​\t首先友链节点发起一笔新的跨链交易,在友链内部进行确认,当在该友链达到一定确认块数后,友链节点将向NULS主网节点发送这笔跨链交易。 "),s("strong",[this._v("例如友链节点A向NULS主网节点S发送了这笔跨链交易,NULS主网节点S会向友链中除节点A以外的节点发送该笔交易进行验证。")]),this._v(" NULS主网节点S将会收到多个友链节点的验证结果,然后进行计算得出节点S自己的跨链验证结果,然后广播给NULS主网其他节点,因此NULS主网的每个节点都会收到其他所有节点的验证结果,最后计算出NULS主网最终的验证结果。")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("在这个过程中NULS主网的交易管理模块将会"),a("strong",[t._v("接收来自友链的新的跨链交易")])]),t._v(" "),a("li",[t._v("交易管理模块在对新的跨链交易做基础验证后"),a("strong",[t._v("向友链其他节点进行验证")]),t._v(",计算出结果后广播结果到NULS主网")]),t._v(" "),a("li",[t._v("NULS主网各个节点会在交易管理模块中"),a("strong",[t._v("统计各个节点的验证结果")]),t._v(",并计算NULS主网最终结果")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ol",{attrs:{start:"2"}},[s("li",[this._v("NULS主网向友链发送交易")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("img",{attrs:{src:a(658),alt:""}})])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("​\t当NULS主网节点发起一笔新的跨链交易时,首先要在交易管理模块中对跨链交易进行本地验证,然后发送共识模块打包确认,当在NULS主网中达到一定的确认块数时,交易管理模块将取出该跨链交易发送到目标链。 "),s("strong",[this._v("例如NULS主网节点S向目标链节点A发送了该笔交易,目标链节点A将会向NULS主网除S节点以外的节点发送该交易进行验证。")]),this._v(" A节点得到多个NULS主网节点的结果后进行计算,得到A节点的最终跨链验证结果并广播到目标链。目标链的节点都会收到其他所有节点的结果,然后再计算出目标链最终验证结果。")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("交易管理模块从已确认的块中取出跨链交易,"),s("strong",[this._v("发送跨链交易给目标链")])]),this._v(" "),s("li",[this._v("交易管理模块"),s("strong",[this._v("接收目标链节点的验证请求")]),this._v(",提取对应的交易发送回去")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ol",{attrs:{start:"3"}},[s("li",[this._v("友链向友链发送交易")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-3-《交易管理》在系统中的定位"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-《交易管理》在系统中的定位","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1.3 《交易管理》在系统中的定位")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("核心模块")]),this._v(" "),s("li",[this._v("网络模块")]),this._v(" "),s("li",[this._v("链管理模块")]),this._v(" "),s("li",[this._v("账本模块")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("img",{attrs:{src:a(659),alt:""}})])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-2-架构图"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 架构图")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("img",{attrs:{src:a(660),alt:""}})])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("接口的功能实现逻辑")]),this._v(" "),s("li",[this._v("验证器管理器,根据需要来调用交易验证器")]),this._v(" "),s("li",[this._v("各种队列,用于交易接收、异步验证处理以及推送共识等操作")]),this._v(" "),s("li",[this._v("缓存,维护节点组,链数据等基础数据")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"二、功能设计"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、功能设计","aria-hidden":"true"}},[this._v("#")]),this._v(" 二、功能设计")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-功能架构图"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-功能架构图","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 功能架构图")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("img",{attrs:{src:a(661),alt:""}})])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-核心流程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-核心流程","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 核心流程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-1-交易管理缓存其他模块的数据"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-1-交易管理缓存其他模块的数据","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.1 交易管理缓存其他模块的数据")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("维护链管理模块中所有链的基础数据")]),t._v(" "),a("p",[t._v("获取数据的方式:")]),t._v(" "),a("ol",[a("li",[t._v("链管理后启动完成后,调用链管理模块接口")]),t._v(" "),a("li",[t._v("有新的链完成注册时,定时获取,事件通知")])])]),t._v(" "),a("li",[a("p",[t._v("维护一个以交易类型为key的交易与其验证器、处理器提交接口、回滚接口的对应关系。")]),t._v(" "),a("p",[t._v("获取数据的方式:各模块启动后自行调用交易管理模块注册交易接口进行注册")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-2-收集新交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-2-收集新交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.2 收集新交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("由本节点各模块新创建的交易")]),t._v(" "),a("p",[t._v("各模块新创建的交易(包含跨链交易),通过交易管理模块提供的接口"),a("a",{attrs:{href:"#232-%E6%8E%A5%E6%94%B6%E6%9C%AC%E5%9C%B0%E6%96%B0%E4%BA%A4%E6%98%93"}},[t._v("newTx")]),t._v("进行收集,模块收到一个新交易后将会进行基本的验证,然后放到待验证本地交易队列中,等待进行验证流程。")]),t._v(" "),a("p",[t._v("注意:待验证本地交易队列中也会存在跨链交易,这是所有交易的本地验证流程。")])]),t._v(" "),a("li",[a("p",[t._v("由其他节点广播的跨链交易")]),t._v(" "),a("p",[t._v("其他节点广播的跨链交易(前提是该跨链交易在创建该交易的链中已打包确认一定的高度),将会通过网络消息的方式进行发送,首先发送的是交易的hash,交易管理模块收到后再发送索取完整交易的消息,之后才会接收到完整的跨链交易。收到后同样会进行基础的验证,然后放入待验证跨链交易队列中,等待进行验证流程。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-3-跨链交易详细流程"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-3-跨链交易详细流程","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2.3 跨链交易详细流程")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("例如:"),s("strong",[s("em",[this._v("从A链的a地址发起一笔交易atx,转移aCoin到B链b地址中 (A --\x3eNULS主网 --\x3e B)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("A链中a地址以A链链id(ChainId)起始的NULS体系格式的地址")]),this._v(" "),s("li",[this._v("B链中b地址是以B链链id起始的NULS体系格式的地址")]),this._v(" "),s("li",[this._v("当资产转移到b地址后,b地址不允许在A链中发起交易")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("(1) 跨链交易在A链中的本地流程")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ol",[a("li",[a("p",[t._v("账本模块生成转账交易"),a("strong",[t._v("atx")]),t._v(",如果生成的是跨链交易,需要同时调用跨链模块生成NULS主网协议的"),a("strong",[t._v("atx_trans")]),t._v("并签名。")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("根据NULS主网协议,从"),a("strong",[t._v("atx")]),t._v("提取type、time、remark、txData放入新生成的"),a("strong",[t._v("atx_trans")]),t._v("中。")])]),t._v(" "),a("li",[a("p",[t._v("提取CoinData数据,如果是UTXO模型,则需要根据资产、input、output以及手续费,计算出实际的支付金额,生成NULS主网协议(账户余额模型)的from。")]),t._v(" "),a("p",[t._v("from总额 = input_utxo总额 - output_utxo(非找零部分) - 手续费")]),t._v(" "),a("p",[t._v("再计算NULS主网协议的to")]),t._v(" "),a("p",[t._v("to = output_utxo(非找零部分)")]),t._v(" "),a("p",[t._v("注意:考虑多地址转账,计算from要以input中UTXO的所有者为单位,如果是多个地址的utxo,要以utxo的所有者为单位,计算出多个input,output也是如此。")]),t._v(" "),a("p",[t._v("例如:input有3个地址的utxo,转出给2个不同的地址(非找零地址),将计算出3个账户余额模型的from")]),t._v(" "),a("p",[t._v("from_1 = input_utxo1")]),t._v(" "),a("p",[t._v("from_2 = input_utxo2")]),t._v(" "),a("p",[t._v("from_3 = from总额 - input_utxo1 - input_utxo2")]),t._v(" "),a("p",[t._v("to_1 =output中(非找零部分)_addr_1")]),t._v(" "),a("p",[t._v("to_2 =output中(非找零部分)_addr_2")]),t._v(" "),a("p",[t._v("最终结果必须满足:from总额 <= input_utxo总额、to总额 = output_utxo(非找零部分之和)。")])]),t._v(" "),a("li",[a("p",[t._v("如果是账户余额模型,则提取对应的from和to,生成NULS主网协议的CoinData")])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("atx_trans")]),t._v(" 交易的txData中包含"),a("strong",[t._v("atx")]),t._v("交易的hash")])]),t._v(" "),a("li",[a("p",[t._v("最后对 "),a("strong",[t._v("atx_trans")]),t._v(" 交易进行签名,设置scriptSig")])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("atx_trans")]),t._v("跨链交易通过接口"),a("a",{attrs:{href:"#2322-%E6%8E%A5%E6%94%B6%E6%9C%AC%E5%9C%B0%E6%96%B0%E7%9A%84%E4%B8%BB%E7%BD%91%E5%8D%8F%E8%AE%AE%E7%9A%84%E8%B7%A8%E9%93%BE%E4%BA%A4%E6%98%93"}},[t._v("newCrossTx")]),t._v("发送到交易管理模块等待广播; "),a("strong",[t._v("atx")]),t._v("转账交易在A链中生成后,发送到交易管理模块中,通过"),a("a",{attrs:{href:"#232-%E6%8E%A5%E6%94%B6%E6%9C%AC%E5%9C%B0%E6%96%B0%E4%BA%A4%E6%98%93"}},[t._v("newTx")]),t._v("接口对交易数据的基本格式以及合法性进行基础验证,然后存放到待验证本地交易队列中。")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("接收交易对交易数据反序列化成Transaction")])]),t._v(" "),a("li",[a("p",[t._v("对Transaction 数据的基本格式,合法性,和完整性进行校验")])]),t._v(" "),a("li",[a("p",[t._v("对coinData中链和资产的基本格式,合法性,和完整性进行校验")])])])]),t._v(" "),a("li",[a("p",[t._v("验证交易的定时任务Task将会从该队列中取出交易,首先通过账本模块验证coinData,验证通过之后跟交易类型从缓存中找到对应的交易验证器,再调用验证接口进行验证,验证通过的交易通过"),a("a",{attrs:{href:"#59-BroadcastTxMessage"}},[t._v("newHash")]),t._v("广播给链内其他节点,同时通过"),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v("广播主网协议的交易"),a("strong",[t._v("atx_trans")]),t._v(",并将放入交易管理模块待打包交易内存池,等待共识打包。")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("定时取出待确认交易")])]),t._v(" "),a("li",[a("p",[t._v("通过调用账本模块接口对CoinData进行验证")])]),t._v(" "),a("li",[a("p",[t._v("通过调用交易的验证器接口对交易进行验证")])]),t._v(" "),a("li",[a("p",[t._v("验证通过的交易放入待打包交易内存池")])])])]),t._v(" "),a("li",[a("p",[t._v("当共识需要打包的时候会根据链id、规定的结束打包时间、交易数据最大容量值来调用"),a("a",{attrs:{href:"#233-%E8%8E%B7%E5%8F%96%E5%8F%AF%E6%89%93%E5%8C%85%E4%BA%A4%E6%98%93%E9%9B%86%E5%90%88"}},[t._v("tx_packableTxs")]),t._v("接口获取可打包交易集合,这时交易管理模块将从待打包交易内存池中获取交易,再进行验证。")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("首先从待打包交易内存池中拿出一个交易,再进行单独的验证流程(与步骤2基本一致),然后按模块放对应的集合。")])]),t._v(" "),a("li",[a("p",[t._v("重复这个过程直到达到规定结束打包时间或交易最大容量值。")])])])]),t._v(" "),a("li",[a("p",[t._v("根据账本模块的统一验证器一次性验证所有交易的CoinData,得到未通过验证的交易,过滤掉未通过验证的交易;再根据各模块统一交易验证器来验证各自模块的交易集合,得到未通过验证的交易再汇总结果,然后返回可打包的交易集合给共识模块。")])]),t._v(" "),a("li",[a("p",[t._v("当打包的区块在验证通过后,区块管理模块将调用交易对应的"),a("a",{attrs:{href:"#234-%E4%BA%A4%E6%98%93%E7%A1%AE%E8%AE%A4%E6%8F%90%E4%BA%A4"}},[t._v("tx_commit")]),t._v("提交接口,调用账本模块接口更新余额等账本数据,最后再调用保存交易接口"),a("a",{attrs:{href:"#236-%E4%BF%9D%E5%AD%98%E4%BA%A4%E6%98%93"}},[t._v("tx_save")]),t._v(",完成后则意味着交易被区块链确认。")]),t._v(" "),a("p",[t._v("PS:如果一个交易为非跨链交易,到这一步时正常交易流程已完成。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("(2) 跨链交易进入跨链流程")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ol",{attrs:{start:"7"}},[a("li",[a("p",[t._v("A链节点的交易管理模块将会一直扫描区块链中的跨链交易,当发现"),a("strong",[t._v("atx")]),t._v("交易被区块链确认n个高度后,A链节点交易管理模块发送消息将"),a("strong",[t._v("atx_trans")]),t._v("交易发送给连接的NULS主网节点(多个)")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("发送跨链交易流程")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("A链节点Anode1先通过消息接口"),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v("广播"),a("strong",[t._v("atx_trans")]),t._v("交易的hash给连接的NULS主网节点。")]),t._v(" "),a("li",[t._v("交易管理模块获得的交易hash后,再通过"),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v("发送获取完整跨链交易的消息到A链节点Anode1。")]),t._v(" "),a("li",[t._v("A链节点Anode1收到该请求,再将完整的"),a("strong",[t._v("atx_trans")]),t._v("跨链交易通过"),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v("发送给主网节点Mn,主网节点交易管理模块解析处理"),a("strong",[t._v("atx_trans")]),t._v("交易。")])])]),t._v(" "),a("li",[a("p",[t._v("NULS主网节点交易管理模块先反序列化"),a("strong",[t._v("atx_trans")]),t._v("交易,然后进行校验。")]),t._v(" "),a("ul",[a("li",[t._v("对交易数据的基本格式,合法性,和完整性进行校验;")]),t._v(" "),a("li",[t._v("对coinData里链和资产的基本格式,合法性,和完整性进行校验。")])])]),t._v(" "),a("li",[a("p",[t._v("进行跨链验证,NULS主网节点Mn将通过消息接口"),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v("发送atx_hash(协议转换前的交易hash)、atx_trans_hash(NULS主网收到的协议转换后的完整交易hash)给与A链连接的节点中"),a("strong",[t._v("除Anode1之外的节点")]),t._v("验证"),a("strong",[t._v("atx_trans")]),t._v("交易。")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("A链中执行验证的节点Anode2的验证逻辑")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("网络模块接收消息后,通过接口"),a("a",{attrs:{href:"#2315-%E6%A0%B9%E6%8D%AE%E5%8E%9F%E5%A7%8B%E4%BA%A4%E6%98%93%E5%92%8C%E8%B7%A8%E9%93%BE%E4%BA%A4%E6%98%93hash%E5%90%91%E5%8F%8B%E9%93%BE%E8%8A%82%E7%82%B9%E9%AA%8C%E8%AF%81%E8%AF%A5%E4%BA%A4%E6%98%93%E6%98%AF%E5%90%A6%E8%A2%AB%E7%A1%AE%E8%AE%A4"}},[t._v("verifyFc")]),t._v("将消息发送给交易管理,交易管理模块先通过atx_hash从数据库中查询对应的atx交易,并且验证该交易所在的区块已经被确认n个区块高度。")]),t._v(" "),a("li",[t._v("将atx交易进行协议转换生成新的"),a("strong",[t._v("Anode2_atx_trans")]),t._v(",再验证接收到的atx_trans_hash与"),a("strong",[t._v("Anode2_atx_trans_hash")]),t._v("一致。")])]),t._v(" "),a("p",[t._v("通过以上两个验证之后,节点Anode2将通过"),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v("将atx_trans_hash和确认高度发送给NULS主网节点Mn。")]),t._v(" "),a("p",[a("strong",[a("em",[t._v("注意")])]),t._v(":NULS主网节点通过网络模块向A链节点组发送跨链验证消息"),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v("时,交易管理将会缓存发送成功和失败的节点信息,如果成功发送的节点数小于S(Mn与A链连接的节点数的51%),则重新发送给失败的节点,直到S不小于51%。")])]),t._v(" "),a("li",[a("p",[t._v("NULS主网节点Mn(共识节点)收到A链节点Anode2对交易"),a("strong",[t._v("atx_trans")]),t._v("的验证结果的消息,通过交易管理"),a("a",{attrs:{href:"#2317-%E6%8E%A5%E6%94%B6%E8%B7%A8%E9%93%BE%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C"}},[t._v("verifyResult")]),t._v("接口发送到交易管理中,交易管理会将验证结果与发送的成功的节点对应着缓存起来。Mn收到所有自己发出的求证的回应结果后,计算出验证通过的百分比,如果超过全部链接节点51%的节点验证通过(发送失败的节点视为不通过),则节点Mn判定交易"),a("strong",[t._v("atx_trans")]),t._v("的验证通过。")]),t._v(" "),a("p",[t._v("小结:节点Mn收到的验证结果数量不能小于S,如果小于S则重新发送"),a("a",{attrs:{href:"#54-verifycrosswithfcmessage"}},[t._v("verifyFc")]),t._v("给未回应结果的节点,NULS主网的普通节点询问A链任意个节点,主网共识节点询问A链全部节点,普通节点在任意3个节点确认的情况下就视为该交易验证通过并转发该交易。")])]),t._v(" "),a("li",[a("p",[t._v("共识节点Mn对跨链交易atx_trans_hash签名,并将hash和签名数据通过"),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v("广播到NULS主网网络中。")])]),t._v(" "),a("li",[a("p",[t._v("NULS主网共识节点互相收到所有其他共识节点发出的消息,由交易管理模块接口"),a("a",{attrs:{href:"#2318-%E6%8E%A5%E6%94%B6%E8%B7%A8%E9%93%BE%E4%BA%A4%E6%98%93%E7%9A%84%E9%93%BE%E5%86%85%E8%8A%82%E7%82%B9%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C"}},[t._v("crossNodeRs")]),t._v("进行收集汇总,当一个交易的签名者超过共识节点总数的80%,判定该跨链交易通过NULS主网的验证,放入待打包交易内存池,等待打包确认。")])]),t._v(" "),a("li",[a("p",[t._v("NULS主网节点共识模块打包的时,交易模块先取出交易(与 "),a("strong",[a("em",[t._v("步骤 4")])]),t._v(" 类似),再次验证跨链交易atx_trans的签名数量(PS:由于提取出来的交易集合包含NULS主网创建的交易,这类交易没有验证签名数量步骤),然后通过账本模块验证CoinData(转出资产总余额等),符合要求则将交易发送共识模块打包进区块。")]),t._v(" "),a("p",[t._v("区块确认逻辑:验证区块中包含的跨链交易时,验证签名数量和转出链的资产余额,符合要求就确认该交易。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("(3) 跨链交易进入B链中的流程")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ol",{attrs:{start:"14"}},[a("li",[a("p",[t._v("NULS主网节点的交易管理模块将会一直扫描区块链中的跨链交易,当发现"),a("strong",[t._v("atx_trans")]),t._v("交易被区块链确认n个高度后,取出"),a("strong",[t._v("atx_trans")]),t._v("交易发送给连接的B链节点(多个)")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("发送跨链交易流程")]),t._v("(与 "),a("strong",[a("em",[t._v("步骤 7")])]),t._v(" 类似):")]),t._v(" "),a("ol",[a("li",[t._v("NULS主网节点Mn先通过消息"),a("a",{attrs:{href:"#51-broadcastcrosstxhashmessage"}},[t._v("newCrossHash")]),t._v("广播"),a("strong",[t._v("atx_trans")]),t._v("交易的hash给连接的B链节点。")]),t._v(" "),a("li",[t._v("交易管理模块获得的交易hash,再通过"),a("a",{attrs:{href:"#52-receivecrosstxmessage"}},[t._v("askCrossTx")]),t._v("发送获取完整跨链交易的消息到NULS主网节点Mn。")]),t._v(" "),a("li",[t._v("Mn的网络模块收到该消息后,再将完整的"),a("strong",[t._v("atx_trans")]),t._v("跨链交易通过"),a("a",{attrs:{href:"#56-sendcrosstxmessage"}},[t._v("newMnTx")]),t._v("发送给Bnode1,Bnode1收到该消息后,需要借助 "),a("strong",[a("em",[t._v("跨链模块")])]),t._v(" 来处理 "),a("strong",[t._v("atx_trans")]),t._v(" 交易。")])])]),t._v(" "),a("li",[a("p",[t._v("B链节点Bnode1交易管理模块通过"),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v("发送 "),a("strong",[t._v("atx_trans")]),t._v("的交易hash( "),a("strong",[a("em",[t._v("步骤14-2")])]),t._v(" 已获得)给与NULS主网连接的节点中"),a("strong",[t._v("除Mn之外的节点")]),t._v("验证"),a("strong",[t._v("atx_trans")]),t._v("交易。")]),t._v(" "),a("p",[t._v("​\t"),a("em",[t._v("NULS主网中执行验证的节点Mn2的验证逻辑")]),t._v(":")]),t._v(" "),a("ol",[a("li",[t._v("网络模块接收到消息后,通过接口"),a("a",{attrs:{href:"#2316-%E6%A0%B9%E6%8D%AE%E8%B7%A8%E9%93%BE%E4%BA%A4%E6%98%93hash%E5%90%91%E4%B8%BB%E7%BD%91%E9%AA%8C%E8%AF%81%E8%AF%A5%E4%BA%A4%E6%98%93%E6%98%AF%E5%90%A6%E8%A2%AB%E7%A1%AE%E8%AE%A4"}},[t._v("verifyMn")]),t._v("将消息发送给交易管理,交易管理模块先通过atx_hash从数据库中查询对应的atx交易,并且验证该交易所在的区块已经被确认n个区块高度。")])]),t._v(" "),a("p",[t._v("通过验证之后,节点Mn2将通过"),a("a",{attrs:{href:"#55-verifycrossresultmessage"}},[t._v("verifyResult")]),t._v("将atx_trans_hash和确认高度发送给B链节点Bnode1。")])]),t._v(" "),a("li",[a("p",[t._v("B链节点通过网络模块向NULS主网节点组发送跨链验证消息"),a("a",{attrs:{href:"#57-verifycrosswithmainmessage"}},[t._v("verifyMn")]),t._v("时,交易管理将会缓存发送成功和失败的节点信息,如果成功发送的节点数小于S(节点Bnode1与NULS主网连接的节点数的51%),则重新发送给失败的节点,直到S不小于51%。")])]),t._v(" "),a("li",[a("p",[t._v("(与 "),a("strong",[a("em",[t._v("步骤10")])]),t._v(" 类似)B链节点Bnode1收到主网节点Mn对交易"),a("strong",[t._v("atx_trans")]),t._v("的验证结果的消息,通过交易管理"),a("a",{attrs:{href:"#2317-%E6%8E%A5%E6%94%B6%E8%B7%A8%E9%93%BE%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C"}},[t._v("verifyResult")]),t._v("接口发送到交易管理中,交易管理会将验证结果与发送的成功的节点对应着缓存起来。Bnode1收到所有自己发出的求证的回应结果后,计算出验证通过的百分比,如果超过51%的节点验证通过(发送失败的节点视为不通过),则节点Bnode1判定交易"),a("strong",[t._v("atx_trans")]),t._v("的验证通过。")])]),t._v(" "),a("li",[a("p",[t._v("验证通过后,交易管理模块调用"),a("strong",[t._v("跨链模块")]),t._v("将"),a("strong",[t._v("atx_trans")]),t._v("交易通过协议转换生成B链协议的交易"),a("strong",[t._v("btx")]),t._v("并通过"),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v("广播到B链网络中,如果Bnode1节点是B链最近x块的出块者(POW需要适配),则需要对该交易进行签名,通过"),a("a",{attrs:{href:"#58-broadcastcrossnodersmessage"}},[t._v("crossNodeRs")]),t._v("广播到B链网络中。")])]),t._v(" "),a("li",[a("p",[t._v("B链节点收到其他节点发出的消息,由交易管理模块接口"),a("a",{attrs:{href:"#2318-%E6%8E%A5%E6%94%B6%E8%B7%A8%E9%93%BE%E4%BA%A4%E6%98%93%E7%9A%84%E9%93%BE%E5%86%85%E8%8A%82%E7%82%B9%E9%AA%8C%E8%AF%81%E7%BB%93%E6%9E%9C"}},[t._v("crossNodeRs")]),t._v("进行收集汇总,统计该交易的签名,当签名者达到了最近20块的出块者的80%时,该交易可以被打包(打包者也要确认该交易且打包的交易中包含所有签名),放入待打包交易内存池,等待打包确认。")])]),t._v(" "),a("li",[a("p",[t._v("(与 "),a("strong",[a("em",[t._v("步骤 13")])]),t._v(" 类似)B链节点共识模块打包的时,交易模块先取出交易一致,再次验证交易 "),a("strong",[t._v("btx")]),t._v(" 的签名数量,然后通过账本模块验证CoinData,符合要求则将交易发送共识模块打包进区块。")])]),t._v(" "),a("li",[a("p",[t._v("当新区块验证通过得到最终确认后,整个跨链交易流程结束。")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-模块服务"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-模块服务","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 模块服务")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-1-注册交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-注册交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1 注册交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("将各个模块的交易类型、对应的交易验证器和处理器接口缓存起来。")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("NULS主网启动时,各个模块需要向交易管理模块注册自己的交易类型,验证器等信息。交易管理模块将缓存各个交易以及对应的验证器、处理器接口,当有新交易需要用验证器验证时,交易管理模块将取出对应的验证器接口名称,并调用验证器接口进行验证。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_register")])]),t._v(" "),a("p",[t._v("接口说明:注册交易需要传交易类型、验证器名称、处理器名称,返回是否注册成功。")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_register",\n "minVersion": "1.0",\n "params":[\n "moduleCode", \n "moduleValidateCmd",\n [\n [\n "txType",\n "validateCmd",\n "commitCmd",\n "rollbackCmd",\n "systemTx",\n "unlockTx",\n "verifySignature"\n ],\n [\n "txType",\n "validateDeposit",\n "depositCommit",\n "depositRollback"\n "systemTx",\n "unlockTx",\n "verifySignature"\n ]\n ]\n ]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("模块Code")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Module validate 模块统一验证器 接口名称")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Array")]),t._v(" "),a("td",[t._v("模块交易注册信息集合")])])])])]),t._v(" "),a("li",[a("p",[t._v("模块交易集合元素")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Type 交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction validator 单个交易验证器接口名称")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor commit 交易处理器提交接口名称")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("Transaction processor rollback 交易处理器回滚接口名称")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否是系统产生的交易(打包节点产生,用于出块奖励结算、红黄牌惩罚)")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("是否是解锁交易")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("该交易是否需要在账本中验证签名,所有系统产生的交易和一些特殊交易,不需要按照普通交易的方式验证签名,会提供额外的逻辑进行验证。")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"_2-3-1-1-交易验证器、处理器接口规范"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-1-1-交易验证器、处理器接口规范","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.1.1 交易验证器、处理器接口规范")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[a("strong",[t._v("模块统一交易验证器接口规范 Module validate")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chianId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("chianId")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("交易序列化数据数组")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果")]),t._v(" "),a("ul",[a("li",[t._v("result说明:返回不合法的交易hash列表")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("jsonArray")]),t._v(" "),a("td",[t._v("不合法交易序列化数据数组")])])])])])])]),t._v(" "),a("li",[a("p",[t._v("**交易验证器接口统一规范 Transaction validate **")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chainId")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果")]),t._v(" "),a("ul",[a("li",[t._v("result说明:返回不合法的交易列表")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("验证成功返回true")])])])])])])]),t._v(" "),a("li",[a("p",[t._v("**交易处理器commit接口参数统一规范 Transaction processor commit **")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("区块头的hash,高度,时间的序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果")]),t._v(" "),a("ul",[a("li",[t._v("result说明:提交成功返回true,失败返回错误信息")])]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n\t"version": 1.0,\n\t"code":0,\n "result":{\n "value":true\n\t}\n}\n')])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("提交成功返回true")])])])])])])]),t._v(" "),a("li",[a("p",[a("strong",[t._v("交易处理器rollback接口参数统一规范 Transaction processor rollback")])]),t._v(" "),a("ul",[a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryDataHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("Chain Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("secondaryData 区块头的hash,高度,时间的序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果")]),t._v(" "),a("ul",[a("li",[t._v("result说明:回滚成功返回true,失败返回错误信息")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("回滚成功返回true")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-2-接收本地新交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-2-接收本地新交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.2 接收本地新交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("收集本节点其他模块新产生的交易")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当一个节点中其他模块有新交易产生时,需要调用交易管理模块的新交易接口进行统一的收集和处理;交易管理模块将会把新的交易放到未确认队列中等待,处理交易的线程来处理。")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("对交易进行基本验证、去重等,不合法直接丢弃")])]),t._v(" "),a("li",[a("p",[t._v("待验证本地交易队列中")])])])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newTx")])]),t._v(" "),a("p",[t._v("接口说明:接收一个新的交易")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" \n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-3-获取可打包交易集合"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-3-获取可打包交易集合","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.3 获取可打包交易集合")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("根据打包结束时间和交易容量最大值提取可打包的交易集合(给共识打包)")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当节点需要打包时,要根据链id、规定的结束打包时间和交易数据最大容量值,来获取可打包的交易。交易管理模块将会从待打包交易内存池取出对应的交易集合,然后一次性从账本模块验证集合中所有交易的coinData,过滤掉未通过验证的交易,得到验证通过的集合,然后通过各模块统一交易验证器来验证各自模块的交易集合,再汇总结果返回可打包的交易集合。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_packableTxs")])]),t._v(" "),a("p",[t._v("接口说明:返回可打包的交易集合")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_packableTxs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"endtimestamp"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"maxTxDataSize"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("long")]),t._v(" "),a("td",[t._v("endtimestamp 结束打包的时间")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("maxTxDataSize 交易数据最大容量值")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("List")]),t._v(" "),a("td",[t._v("Transaction")]),t._v(" "),a("td",[t._v("返回交易集合")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-4-交易确认提交"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-4-交易确认提交","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.4 交易确认提交")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("执行交易处理器commit")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当交易被打包到区块中,并且区块验证通过后,将调用交易commit接口")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_commit")])]),t._v(" "),a("p",[t._v("接口说明:调用交易处理器提交接口")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_commit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("区块头的hash,高度,时间的序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-5-交易回滚"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-5-交易回滚","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.5 交易回滚")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("执行交易处理器rollback")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当交易被打包到区块中,并且区块验证不通过,或者区块回滚且交易不为跨链交易时,将调用交易rollback接口。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_rollback")])]),t._v(" "),a("p",[t._v("接口说明:调用交易处理器回滚接口")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_rollback"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"secondaryData"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("!!!(区块头的hash,高度,时间)")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-6-保存交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-6-保存交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.6 保存交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("将验证通过的新区块中的交易保存到数据库")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("区块管理保存区块时将交易发送到交易管理模块进行保存")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_save")])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_save"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("交易序列化数据数组")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-7-获取已保存的交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-7-获取已保存的交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.7 获取已保存的交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("从数据库中获取已经打包到区块中的交易")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTx")])]),t._v(" "),a("p",[t._v("接口说明:返回交易序列化数据")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tx"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("tx")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-8-删除已保存的交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-8-删除已保存的交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.8 删除已保存的交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("从数据库中删除已经打包到区块中的交易,区块回滚等")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_delete")])]),t._v(" "),a("p",[t._v("接口说明:返回交易序列化数据")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_delete"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \tvalue:true\n \t}\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-9-验证交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-9-验证交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.9 验证交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("对交易(包含跨链交易)进行本地验证,包括调用验证器,验证coinData等,不包括对跨链交易进行跨链验证。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("tx_verify")])]),t._v(" "),a("p",[t._v("接口说明:返回验证结果")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_verify"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-10-接收新交易hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-10-接收新交易hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.10 接收新交易hash")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("接收链内其他节点广播的新交易hash的消息")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method:"),a("code",[t._v("newHash")]),t._v(" Receive new transaction hash message")]),t._v(" "),a("p",[t._v("接口说明:接收交易hash序列化数据")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHashHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-11-接收新的跨链交易hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-11-接收新的跨链交易hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.11 接收新的跨链交易hash")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("接收由其他链发送的新跨链交易hash的message")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当一个跨链交易在该链内部已确认一定高度以后,将由交易模块发送到目标链(NULS主网或者普通链)中,目标链将接收该交易进行验证。在发送该交易前首先发送该交易的hash,本接口将接收该hash。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossHash")]),t._v(" Receive new cross transaction hash")]),t._v(" "),a("p",[t._v("接口说明:接收一个新的交易hash")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newCrossHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txHash 交易hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-12-接收友链新的完整跨链交易-(废弃)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-12-接收友链新的完整跨链交易-(废弃)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("s",[this._v("2.3.12 接收友链新的完整跨链交易")]),this._v(" (废弃)")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("处理由其他链发送到NULS主网的新跨链交易的message")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当其NULS主网节点收到其他链广播的跨链交易hash时,会向发送的hash节点索取完整的交易,这时该节点会发送完整的交易和原始hash到NULS主网节点,NULS主网再进行处理")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newFcTx")]),t._v(" Receive new cross transaction")]),t._v(" "),a("p",[t._v("接口说明:接收一个新的完整跨链交易,和该交易原始hash(友链协议转换前该交易的hash值)")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newFcTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txHex 原始交易hash,协议转换后NULS主网协议的交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-13-接收主网新的完整跨链交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-13-接收主网新的完整跨链交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.13 接收主网新的完整跨链交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("处理由NULS主网发送到友链的新跨链交易的message")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("当其友链节点收到NULS主网广播的跨链交易hash时,会向发送的hash节点索取完整的交易,这时该节点会发送完整的交易友链节点。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newMnTx")]),t._v(" Receive new mainnet cross transaction")]),t._v(" "),a("p",[t._v("接口说明:接收一个主网发送的新的完整跨链交易")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"newMnTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txHex NULS主网协议的交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-14-索取完整跨链交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-14-索取完整跨链交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.14 索取完整跨链交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("根据交易hash取出已确认一定高度的完整跨链交易,然后通过消息发送回去")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("NULS主网有新的跨链交易发送给目标链时(或者是普通链有跨链交易发送给NULS主网),先发送hash给目标链,目标链节点会根据hash向NULS主网索取完整交易,本接口处理该消息。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("askCrossTx")]),t._v(" send cross transaction")]),t._v(" "),a("p",[t._v("接口说明:接收网络节点发送的交易hash,通过网络消息发送完整交易回去")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"askCrossTx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txhash 交易hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "value":true\n \t}\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-15-根据原始交易和跨链交易hash向友链节点验证该交易是否被确认"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-15-根据原始交易和跨链交易hash向友链节点验证该交易是否被确认","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.15 根据原始交易和跨链交易hash向友链节点验证该交易是否被确认")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("友链节点接收NULS主网节点的跨链验证请求的消息")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("NULS主网节点新收到跨链交易,将会向发送该交易的友链(除发送者以外的节点)求证该交易,求证时将发送的消息由本接口处理。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyFc")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:接收跨链交易hash和该交易原始hash,通过网络消息返回确认结果")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyFc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txOriginalHash 原始交易的hash(协议转换前)、txCrossHash跨链交易hash(协议转换后)")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-16-根据跨链交易hash向主网验证该交易是否被确认"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-16-根据跨链交易hash向主网验证该交易是否被确认","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.16 根据跨链交易hash向主网验证该交易是否被确认")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("NULS主网节点接收友链节点的跨链验证请求的消息")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("友链节点新收到跨链交易,将会向发送该交易的NULS主网节点(除发送者以外的节点)求证该交易,求证时将发送的消息由本接口处理。")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyMn")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:接收跨链交易hash,通过网络消息返回确认结果")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyMn"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("txHash 跨链交易hash")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-17-接收跨链验证结果"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-17-接收跨链验证结果","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.17 接收跨链验证结果")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("处理接收跨链交易验证结果的消息")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("NULS主网向其他链节点验证跨链交易,该节点发送的验证结果")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("verifyResult")]),t._v(" cross result")])]),t._v(" "),a("li",[a("p",[t._v("接口说明:接收跨链交易验证结果")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"verifyResult"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易hash和确认高度的序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-18-接收跨链交易的链内节点验证结果"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-18-接收跨链交易的链内节点验证结果","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.18 接收跨链交易的链内节点验证结果")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("接收跨链交易的链内节点验证结果,进行统计。")])]),t._v(" "),a("li",[a("p",[t._v("流程描述")]),t._v(" "),a("p",[t._v("节点对某个跨链交易进行跨链验证,得到这个节点对于该交易的跨链验证结果,该节点将此结果广播给本链的其他节点,其他节点收到该消息后会调用本接口")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("crossNodeRs")]),t._v(" cross tx node result")])]),t._v(" "),a("li",[a("p",[t._v("接口说明:接收发出者的签名、跨链交易的hash、节点验证结果")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"crossNodeRs"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nodeRsHex"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("nodeId 节点id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("接收发出者的签名、跨链交易的hash、节点验证结果 序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-19-查看交易池信息"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-19-查看交易池信息","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.19 查看交易池信息")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("查看交易内存池的数据")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxsInfo")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:统计交易内存池的数据")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"tx_getTxsInfo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"chainId"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Int")]),t._v(" "),a("td",[t._v("chainId 链id")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "localTxCount":111,\t//本地交易数量\n "crossChainTxCount":111,//跨链交易数量\n "pushingCount":111\t//已确认待打包交易数量\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("localTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("本地交易数量")])]),t._v(" "),a("tr",[a("td",[t._v("crossChainTxCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("跨链交易数量")])]),t._v(" "),a("tr",[a("td",[t._v("pushingCount")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("已确认待打包交易数量")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-20-获取所有交易与其对应的处理器的关系列表"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-20-获取所有交易与其对应的处理器的关系列表","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.20 获取所有交易与其对应的处理器的关系列表")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("返回所有交易与其对应的commit处理器、rollback处理器的关系列表")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_getTxProcessors")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:返回"),a("code",[t._v("Map>")]),t._v(" 结构jsonObject")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_getTxProcessors",\n "minVersion": "1.0",\n "params": ["txType"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("交易类型(不填返回全部)")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "2":["commitCmd","rollbackCmd"],\n "3":["commitCmd","rollbackCmd"],\n "4":["commitCmd","rollbackCmd"]\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("commit处理器接口")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("rollback处理器接口")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-21-根据账户地址查询交易记录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-21-根据账户地址查询交易记录","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.21 根据账户地址查询交易记录")])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("功能说明:")]),this._v(" "),s("p",[this._v("根据账户、链、资产、分页信息等条件查询交易列表")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("method: "),s("code",[this._v("tx_getTxs")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("接口说明:返回 "),s("code",[this._v("Page")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("请求示例")]),this._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('{\n "cmd": "tx_getTxs",\n "minVersion": "1.0",\n "params": [\n \t"ChainId",\n \t"assetId",\n \t"type",\n \t"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",\n \t"pageSize",\n \t"pageNumber"\n ]\n}\n')])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("资产Id标识")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("交易类型(不填返回全部)")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("账户地址")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("每一页数据条数")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("页码")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("li",[s("p",[this._v("返回示例")]),this._v(" "),s("p",[this._v("Success")]),this._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "pageNumber": 1,\n "pageSize": 10,\n "total": 31,\n "pages": 4,\n "list": []\n }\n}\n')])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("thead",[s("tr",[s("th",[this._v("parameter")]),this._v(" "),s("th",[this._v("type")]),this._v(" "),s("th",[this._v("description")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",[this._v("pageNumber")]),this._v(" "),s("td",[this._v("int")]),this._v(" "),s("td",[this._v("页码")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",[this._v("pageSize")]),this._v(" "),s("td",[this._v("int")]),this._v(" "),s("td",[this._v("每页显示条数")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",[this._v("total")]),this._v(" "),s("td",[this._v("int")]),this._v(" "),s("td",[this._v("数据总数")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",[this._v("pages")]),this._v(" "),s("td",[this._v("int")]),this._v(" "),s("td",[this._v("总页数")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-22-接收本地新的主网协议的跨链交易"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-22-接收本地新的主网协议的跨链交易","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.22 接收本地新的主网协议的跨链交易")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("收集新的NULS主网协议的完整交易用于广播")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("newCrossTx")])])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "newCrossTx",\n "minVersion": "1.0",\n "params": ["chainId", "txHex"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("String")]),t._v(" "),a("td",[t._v("交易序列化数据")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n \t"value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-23-运行链"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-23-运行链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.23 运行链")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("运行一条链")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_runChain")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:运行一条注册的链")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_runChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("chainId")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-24-停止链"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-24-停止链","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3.24 停止链")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[a("p",[t._v("功能说明:")]),t._v(" "),a("p",[t._v("停止一条运行中的链")])]),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("method: "),a("code",[t._v("tx_stopChain")])])]),t._v(" "),a("li",[a("p",[t._v("接口说明:停止运行一条链")])]),t._v(" "),a("li",[a("p",[t._v("请求示例")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "tx_stopChain",\n "minVersion": "1.0",\n "params": ["chainId"]\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("请求参数说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("链Id")])])])])]),t._v(" "),a("li",[a("p",[t._v("返回示例")]),t._v(" "),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "version": 1.0,\n "msg": "Success",\n "result": {\n "value":true\n }\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("value")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("成功")])])])])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"四、事件说明"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#四、事件说明","aria-hidden":"true"}},[this._v("#")]),this._v(" 四、事件说明")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_4-1-发布的事件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-发布的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 发布的事件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_4-2-订阅的事件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-订阅的事件","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 订阅的事件")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("链注册事件")]),this._v(" "),s("p",[this._v("用于发送验证tx coinData的链信息接口")])]),this._v(" "),s("li",[s("p",[this._v("链注销事件")]),this._v(" "),s("p",[this._v("用于终止该链交易的确认")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"五、网络消息体协议"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#五、网络消息体协议","aria-hidden":"true"}},[this._v("#")]),this._v(" 五、网络消息体协议")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-1-broadcastcrosstxhashmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-1-broadcastcrosstxhashmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.1 BroadcastCrossTxHashMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("广播新的跨链交易hash")])]),this._v(" "),s("li",[s("p",[this._v("消息说明:用于跨链交易在本链确认后需要广播给其他节点或其他链的节点时发送的消息")])]),this._v(" "),s("li",[s("p",[this._v("cmd:newCrossHash")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[s("p",[this._v("消息处理")]),this._v(" "),s("ul",[s("li",[this._v("收到该消息后newCrossHash将会发送askCrossTxMessage来获取完整的跨链交易")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-2-receivecrosstxmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-2-receivecrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.2 ReceiveCrossTxMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:请求获取完整的跨链交易的消息,例如NULS主网收到友链新的跨链交易hash,主网节点将向友链节点获取完整的交易。")]),this._v(" "),s("li",[this._v("cmd:askCrossTx")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("该消息由askCrossTx处理将会发送SendcrossTxMessage/SendHashcrossTxMessage消息来传送完整的交易")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-3-sendhashcrosstxmessage(废弃)"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-3-sendhashcrosstxmessage(废弃)","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("s",[this._v("5.3 SendHashCrossTxMessage")]),this._v("(废弃)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:友链向NULS主网发送经过协议转换的完整跨链交易,和原始交易hash")]),this._v(" "),s("li",[this._v("cmd:newFcTx")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("交易时间")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易输入和输出")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("数字脚本与交易签名")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("originalHash友链原始交易hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("newFcTx接收消息后将会处理该交易,然后通过消息进行跨链验证")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-4-verifycrosswithfcmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-4-verifycrosswithfcmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.4 VerifyCrossWithFCMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:发送协议转换前的交易hash、协议转换后的交易hash,向友链节点验证跨链交易")]),this._v(" "),s("li",[this._v("cmd:verifyFc")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("转换NULS主网协议后交易hash")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("originalHashDigestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("originalHash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("友链原始交易hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("verifyFc处理该消息,验证后将结果通过VerifyCrossResultMessage发送回去")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-5-verifycrossresultmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-5-verifycrossresultmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.5 VerifyCrossResultMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:节点收到跨链验证请求后,将验证结果发送回去")]),this._v(" "),s("li",[this._v("cmd:verifyResult")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("hight")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("确认高度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("signature")]),t._v(" "),a("td",[t._v("varByte")]),t._v(" "),a("td",[t._v("签名?")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("verifyResult接收到跨链验证结果后会计算出自己节点的结果")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-6-sendcrosstxmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-6-sendcrosstxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.6 SendCrossTxMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:发送完整的跨链交易的消息")]),this._v(" "),s("li",[this._v("cmd:newMnTx")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("交易时间")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易输入和输出")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("数字脚本与交易签名")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("newMnTx接收交易后将会进行一系列的验证,如果不是交易原产地链的节点收到该交易后会进行跨链验证")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-7-verifycrosswithmainmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-7-verifycrosswithmainmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.7 VerifyCrossWithMainMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:友链节点发送协议转换后的跨链交易hash,向主网节点验证跨链交易")]),this._v(" "),s("li",[this._v("cmd:verifyMn")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("转换后的跨链交易hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("verifyMn处理该消息验证NULS主网中该交易是否被确认,将结果通过VerifyCrossResultMessage消息发送回去。")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-8-broadcastcrossnodersmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-8-broadcastcrossnodersmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.8 BroadcastCrossNodeRsMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:向链内其他节点广播本节点对于某个跨链交易的验证结果")]),this._v(" "),s("li",[this._v("cmd:crossNodeRs")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("Signature")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("对验证的节点对交易的签名")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("result")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("验证结果")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("crossNodeRs接收该消息,同时统计其他所有节点的结果,最后计算本链对该交易的验证结果。")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-9-broadcasttxmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-9-broadcasttxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.9 BroadcastTxMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:本节点创建的交易完成本地验证后广播hash给其他节点")]),this._v(" "),s("li",[this._v("cmd:newHash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("chainId")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("链Id")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("digestAlgType")]),t._v(" "),a("td",[t._v("byte")]),t._v(" "),a("td",[t._v("摘要算法标识")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hashLength")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("数组长度")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("hash")]),t._v(" "),a("td",[t._v("byte[]")]),t._v(" "),a("td",[t._v("hash")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("newHash接口处理该消息,发送完整交易回去")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_5-10-sendtxmessage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-10-sendtxmessage","aria-hidden":"true"}},[this._v("#")]),this._v(" 5.10 SendTxMessage")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息说明:向链内其他节点发送的完整交易")]),this._v(" "),s("li",[this._v("cmd:newTx")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",[t._v("Length")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("交易时间")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("交易输入和输出")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("scriptSig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("数字脚本与交易签名")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("消息处理\n"),s("ul",[s("li",[this._v("进入新的交易流程")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"六、模块配置项"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#六、模块配置项","aria-hidden":"true"}},[this._v("#")]),this._v(" 六、模块配置项")])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[this._v("[tx-manager]\nbootstrap=io.module.TxManagerModuleBootstrap\n")])])])}],_=a(0),r=Object(_.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),a("p",[t._v("​\t在NULS2.0的生态体系中,交易会在链中或者链与链之间流转,各条链的节点不仅要处理链内的交易,可能还会处理跨链的交易,于是每个节点需要处理的交易会越来越多,并且更复杂,因此我们需要一个但单独的模块来统一处理各种交易。而从NULS2.0的架构设计来看,我们需要一个独立的模块来处理交易的收集、验证、存储以及转发等功能,对于所有交易来说,这些功能具有共用性、统一性,因此我们把交易管理作为一个独立的模块来运行。")]),t._v(" "),t._m(4),t._v(" "),a("p",[t._v("交易管理最核心的工作主要从两个方面来看:")]),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("交易管理模块需要对跨链交易进行跨链验证,而跨链验证涉及到不同链不同节点之间的交互,主要有以下三种跨链交易需要处理:")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("由于友链之间的协议可能是不兼容的,所以他们之间的交易需要由NULS主网来中转,友链向友链发送交易的流程,其实就是先后完成了友链向NULS主网发送交易,NULS主网向友链发送交易这两个流程,其中交易管理模块起到的作用是基本相同的。")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("在整个系统中,交易管理控制着所有交易的验证和流转")]),t._v(" "),a("p",[t._v("正常运行时需要依赖")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),a("p",[t._v("整个模块大致分为3个部分: 接口、实现层、本地存储")]),t._v(" "),a("p",[t._v("实现层中含有4个部分")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("模块启动时需要获得其他模块的基础数据")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),a("p",[t._v("即:其他链地址不能在本链发起交易。")]),t._v(" "),t._m(34),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),t._m(38),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),t._m(42),t._v(" "),a("p",[t._v("}\n```")]),t._v(" "),t._m(43),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),a("ul",[t._m(85),t._v(" "),a("li",[a("p",[t._v("接口定义")]),t._v(" "),a("ul",[t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),a("li",[a("p",[t._v("返回结果说明")]),t._v(" "),a("table",[t._m(91),t._v(" "),a("tbody",[t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),a("tr",[a("td",[t._v("list")]),t._v(" "),a("td",[t._v("Page"),a("Transaction")],1),t._v(" "),a("td",[t._v("交易记录数据集合")])])])])])])])]),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._v(" "),t._m(103),t._v(" "),a("p",[t._v("无")]),t._v(" "),t._m(104),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),t._m(109),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),t._m(119),t._v(" "),t._m(120),t._v(" "),t._m(121),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),t._m(124),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),t._m(129),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),t._m(132),t._v(" "),t._m(133),t._v(" "),t._m(134),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),t._m(138),t._v(" "),t._m(139),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),t._m(143),t._v(" "),t._m(144),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),t._m(148)])},e,!1,null,null,null);r.options.__file="transactionModuleDesign.md";s.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/57.bd3f6e79.js b/docs/.vuepress/dist/assets/js/57.bd3f6e79.js new file mode 100644 index 00000000..cdb0030a --- /dev/null +++ b/docs/.vuepress/dist/assets/js/57.bd3f6e79.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{167:function(t,a,s){},210:function(t,a,s){"use strict";var l=s(167);s.n(l).a},795:function(t,a,s){"use strict";s.r(a);var l={name:""},i=(s(210),s(0)),r=Object(i.a)(l,function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"nav"},[s("div",{staticClass:"title"},[s("p",[t._v("官方")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/",target:"_blank"}},[t._v("官网")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://wallet.nuls.io/",target:"_blank"}},[t._v("网页轻钱包")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/newWallet",target:"_blank"}},[t._v("客户端钱包")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nulscan.io/",target:"_blank"}},[t._v("区块链浏览器")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank"}},[t._v("Github")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NULS_whitepaper_zh_V1.0.pdf",target:"_blank"}},[t._v("白皮书")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank"}},[t._v("黄皮书")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://nuls.community",target:"_blank"}},[t._v("Community")])])])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("社区")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://medium.com/@nuls",target:"_blank"}},[t._v("Medium")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://twitter.com/nulsservice",target:"_blank"}},[t._v("Twitter")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://steemit.com/@nuls",target:"_blank"}},[t._v("Steemit")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.reddit.com/r/nulsservice/",target:"_blank"}},[t._v("Reddit")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://discordapp.com/invite/uZ3QcxW",target:"_blank"}},[t._v("Discord")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.slack.com/join/shared_invite/enQtMjQ4MTM4ODAyNTI4LWJjNGMwYTE0YjRlYmFlZGUwM2JhOGE4MDIwZmE4MzA2MDg1YzUyMmVkN2RhZjkyNWMzZjY5ZDU5ZmViMjZjNGQ",target:"_blank"}},[t._v("Slack")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.facebook.com/nulscommunity",target:"_blank"}},[t._v("Facebook")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://gitter.im/nuls_io",target:"_blank"}},[t._v("Gitter")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://bitcointalk.org/index.php?topic=2253487.0;topicseen",target:"_blank"}},[t._v("BitcoinTalk")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://weibo.com/nulsio",target:"_blank"}},[t._v("微博")])]),t._v(" "),s("li",{staticClass:"li"}),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("常用")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.world/",target:"_blank"}},[t._v("nuls.world")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://apiserver.nuls.io/nuls/assets/get",target:"_blank"}},[t._v("Assets API")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://coinmarketcap.com/currencies/nuls",target:"_blank"}},[t._v("CoinMarketCap")])]),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("媒体信息")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://info.binance.com/en/currencies/nuls",target:"_blank"}},[t._v("币安信息")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.huobi.br.com/change#nUnu2i",target:"_blank"}},[t._v("火币项目中心")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.jinse.com/search/nuls",target:"_blank"}},[t._v("金色财经")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.zdpvt.com/web/tagDetail/5a98c81a5e3b6679aa33120d/quota",target:"_blank"}},[t._v("支点社区")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://www.7234.cn/nuls",target:"_blank"}},[t._v("链世界专栏")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.coingogo.com/article/nuls",target:"_blank"}},[t._v("币源社区专栏")])]),t._v(" "),s("li",{staticClass:"li"}),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("交易所")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.binance.com",target:"_blank"}},[t._v("币安")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.okex.com",target:"_blank"}},[t._v("OKEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.hbg.com",target:"_blank"}},[t._v("火币")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.huobi.co.kr",target:"_blank"}},[t._v("火币韩国")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://bit-z.com",target:"_blank"}},[t._v("Bit-Z")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.chaoex.com",target:"_blank"}},[t._v("炒客网")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.kucoin.com",target:"_blank"}},[t._v("KuCoin")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://wazirx.com",target:"_blank"}},[t._v("wazirx")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.qbtc.com",target:"_blank"}},[t._v("QBTC")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bibr.com",target:"_blank"}},[t._v("币和")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.ktrade.io",target:"_blank"}},[t._v("KTRADE")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://indacoin.com",target:"_blank"}},[t._v("Indacoin")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.7ebit.com",target:"_blank"}},[t._v("7EBIT")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.coinspot.com.au",target:"_blank"}},[t._v("Coinspot")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bloex.com",target:"_blank"}},[t._v("BLOEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bbaex.com",target:"_blank"}},[t._v("BBAEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://ceo.bi",target:"_blank"}},[t._v("CEO")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://www.coin918.cc",target:"_blank"}},[t._v("Coin918")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.idax.mn",target:"_blank"}},[t._v("IDAX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.tokok.com",target:"_blank"}},[t._v("TOKOK")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.qubi.com",target:"_blank"}},[t._v("趣币")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://dragonex.im",target:"_blank"}},[t._v("DragonEx")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.park.one/",target:"_blank"}},[t._v("PARK.ONE")])]),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"})])}],!1,null,"29630791",null);r.options.__file="NavBar.vue";a.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/58.220ce9c8.js b/docs/.vuepress/dist/assets/js/58.220ce9c8.js new file mode 100644 index 00000000..1ac7274d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/58.220ce9c8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{168:function(t,a,s){},211:function(t,a,s){"use strict";var i=s(168);s.n(i).a},796:function(t,a,s){"use strict";s.r(a);var i={name:""},l=(s(211),s(0)),e=Object(l.a)(i,function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"nav"},[s("div",{staticClass:"title"},[s("p",[t._v("Official")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/",target:"_blank"}},[t._v("Official Website")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://wallet.nuls.io/",target:"_blank"}},[t._v("Light Wallet")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/newWallet",target:"_blank"}},[t._v("Client Wallet")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nulscan.io/",target:"_blank"}},[t._v("Explorer")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://github.com/nuls-io",target:"_blank"}},[t._v("Github")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/white/NULS_whitepaper_zh_V1.0.pdf",target:"_blank"}},[t._v("Whitepaper")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf",target:"_blank"}},[t._v("Yellowpaper")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://nuls.community",target:"_blank"}},[t._v("Community")])])])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("Community")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://medium.com/@nuls",target:"_blank"}},[t._v("Medium")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://twitter.com/nulsservice",target:"_blank"}},[t._v("Twitter")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://steemit.com/@nuls",target:"_blank"}},[t._v("Steemit")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.reddit.com/r/nulsservice/",target:"_blank"}},[t._v("Reddit")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://discordapp.com/invite/uZ3QcxW",target:"_blank"}},[t._v("Discord")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.slack.com/join/shared_invite/enQtMjQ4MTM4ODAyNTI4LWJjNGMwYTE0YjRlYmFlZGUwM2JhOGE4MDIwZmE4MzA2MDg1YzUyMmVkN2RhZjkyNWMzZjY5ZDU5ZmViMjZjNGQ",target:"_blank"}},[t._v("Slack")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.facebook.com/nulscommunity",target:"_blank"}},[t._v("Facebook")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://gitter.im/nuls_io",target:"_blank"}},[t._v("Gitter")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://bitcointalk.org/index.php?topic=2253487.0;topicseen",target:"_blank"}},[t._v("BitcoinTalk")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://weibo.com/nulsio",target:"_blank"}},[t._v("Weibo")])]),t._v(" "),s("li",{staticClass:"li"}),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("General")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://nuls.world/",target:"_blank"}},[t._v("nuls.world")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://apiserver.nuls.io/nuls/assets/get",target:"_blank"}},[t._v("Assets API")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://coinmarketcap.com/currencies/nuls",target:"_blank"}},[t._v("CoinMarketCap")])]),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("Media information")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://info.binance.com/en/currencies/nuls",target:"_blank"}},[t._v("Binance Information")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.huobi.br.com/change#nUnu2i",target:"_blank"}},[t._v("huobi Global")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.jinse.com/search/nuls",target:"_blank"}},[t._v("金色财经")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.zdpvt.com/web/tagDetail/5a98c81a5e3b6679aa33120d/quota",target:"_blank"}},[t._v("支点社区")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://www.7234.cn/nuls",target:"_blank"}},[t._v("链世界专栏")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.coingogo.com/article/nuls",target:"_blank"}},[t._v("币源社区专栏")])]),t._v(" "),s("li",{staticClass:"li"}),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"}),t._v(" "),s("div",{staticClass:"title"},[s("p",[t._v("Exchange")]),t._v(" "),s("ul",[s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.binance.com",target:"_blank"}},[t._v("Binance")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.okex.com",target:"_blank"}},[t._v("OKEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.hbg.com",target:"_blank"}},[t._v("Huobi")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.huobi.co.kr",target:"_blank"}},[t._v("Huobi Korea")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://bit-z.com",target:"_blank"}},[t._v("Bit-Z")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.chaoex.com",target:"_blank"}},[t._v("CHAOEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.kucoin.com",target:"_blank"}},[t._v("KuCoin")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://wazirx.com",target:"_blank"}},[t._v("wazirx")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.qbtc.com",target:"_blank"}},[t._v("QBTC")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bibr.com",target:"_blank"}},[t._v("BIBR")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.ktrade.io",target:"_blank"}},[t._v("KTRADE")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://indacoin.com",target:"_blank"}},[t._v("Indacoin")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.7ebit.com",target:"_blank"}},[t._v("7EBIT")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.coinspot.com.au",target:"_blank"}},[t._v("Coinspot")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bloex.com",target:"_blank"}},[t._v("BLOEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.bbaex.com",target:"_blank"}},[t._v("BBAEX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://ceo.bi",target:"_blank"}},[t._v("CEO")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"http://www.coin918.cc",target:"_blank"}},[t._v("Coin918")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.idax.mn",target:"_blank"}},[t._v("IDAX")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.tokok.com",target:"_blank"}},[t._v("TOKOK")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.qubi.com",target:"_blank"}},[t._v("QUBI")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://dragonex.im",target:"_blank"}},[t._v("DragonEx")])]),t._v(" "),s("li",{staticClass:"li"},[s("a",{attrs:{href:"https://www.park.one/",target:"_blank"}},[t._v("PARK.ONE")])]),t._v(" "),s("li",{staticClass:"li"})])]),t._v(" "),s("div",{staticClass:"cb"})])}],!1,null,"69667123",null);e.options.__file="NavBars.vue";a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/59.896c6030.js b/docs/.vuepress/dist/assets/js/59.896c6030.js new file mode 100644 index 00000000..7d9ab288 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/59.896c6030.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{166:function(t,e,n){},209:function(t,e,n){"use strict";var a=n(166);n.n(a).a},896:function(t,e,n){"use strict";n.r(e);var a={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,a=e.slots;return t("span",{class:["badge",n.type,n.vertical]},n.text||a().default)}},i=(n(209),n(0)),o=Object(i.a)(a,void 0,void 0,!1,null,"099ab69c",null);o.options.__file="Badge.vue";e.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/6.0c2e36a1.js b/docs/.vuepress/dist/assets/js/6.0c2e36a1.js new file mode 100644 index 00000000..bce2f6e5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/6.0c2e36a1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{493:function(e,a,c){e.exports=c.p+"assets/img/deploy1.0620b80d.jpg"},494:function(e,a,c){e.exports=c.p+"assets/img/deploy2.c581a6ad.jpg"},495:function(e,a,c){e.exports=c.p+"assets/img/deploy3.f8cde6aa.jpg"},496:function(e,a,c){e.exports=c.p+"assets/img/deploy4.e0509949.jpg"},497:function(e,a,c){e.exports=c.p+"assets/img/deploy6.d41305b3.jpg"},498:function(e,a,c){e.exports=c.p+"assets/img/access1.e55b0e87.jpg"},499:function(e,a,c){e.exports=c.p+"assets/img/access2.142e5288.jpg"},500:function(e,a,c){e.exports=c.p+"assets/img/access3.473cdd05.jpg"},501:function(e,a,c){e.exports=c.p+"assets/img/access4.ec334fa4.jpg"},502:function(e,a,c){e.exports=c.p+"assets/img/access5.2eda257e.jpg"},503:function(e,a,c){e.exports=c.p+"assets/img/access6.f24bf883.jpg"},504:function(e,a,c){e.exports=c.p+"assets/img/access7.d4ad0113.jpg"},505:function(e,a,c){e.exports=c.p+"assets/img/myContract1.9dd9d99f.jpg"},506:function(e,a,c){e.exports=c.p+"assets/img/myContract2.01d9687b.jpg"},507:function(e,a,c){e.exports=c.p+"assets/img/myContract3.31870321.jpg"},508:function(e,a,c){e.exports=c.p+"assets/img/myContract4.07a83092.jpg"},509:function(e,a,c){e.exports=c.p+"assets/img/myContract5.912b5882.jpg"},510:function(e,a,c){e.exports=c.p+"assets/img/myContract6.405104a8.jpg"},511:function(e,a,c){e.exports=c.p+"assets/img/assets1.abc7fc62.jpg"},512:function(e,a,c){e.exports=c.p+"assets/img/assets2.a43e834e.jpg"},513:function(e,a,c){e.exports=c.p+"assets/img/assets3.68229e16.jpg"},514:function(e,a,c){e.exports=c.p+"assets/img/assets4.1e09a147.jpg"},912:function(e,a,c){"use strict";c.r(a);var f=[function(){var e=this.$createElement,a=this._self._c||e;return a("h1",{attrs:{id:"智能合约钱包操作手册"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#智能合约钱包操作手册","aria-hidden":"true"}},[this._v("#")]),this._v(" 智能合约钱包操作手册")])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"部署合约"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#部署合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 部署合约")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(493),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("blockquote",[a("p",[this._v("文章底部有发行NRC-20Token的合约hex编码示例")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(494),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(495),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(496),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(497),alt:"deploy"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("点击表格右方的操作【去调用】可直接进入【调用合约】页面")])]),this._v(" "),a("li",[a("p",[this._v("点击合约地址可直接进入合约概览的页面")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"查看合约"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#查看合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 查看合约")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(498),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[this._v("点击面板中的【下拉列表】,可以选择要调用的合约方法")]),this._v(" "),a("li",[this._v("点击合约地址旁的星星图标,可以收藏该合约至我的合约列表")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(499),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("li",[a("p",[this._v("方法为只读方法,点击【调用】则会在网络请求完成后立即返回调用结果")]),this._v(" "),a("p",[a("img",{attrs:{src:c(500),alt:"access"}})])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(501),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(502),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(503),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(504),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"我的合约"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#我的合约","aria-hidden":"true"}},[this._v("#")]),this._v(" 我的合约")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(505),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("ul",[a("li",[a("p",[this._v("点击合约地址,可进入合约概览页面")]),this._v(" "),a("p",[a("img",{attrs:{src:c(506),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("点击去调用,可进入该合约的【调用合约】页面")]),this._v(" "),a("p",[a("img",{attrs:{src:c(507),alt:"access"}})])]),this._v(" "),a("li",[a("p",[this._v("点击【取消收藏】可将该合约从【我的合约】列表中移除")])])])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(508),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(509),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(510),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("h2",{attrs:{id:"账户多资产"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#账户多资产","aria-hidden":"true"}},[this._v("#")]),this._v(" 账户多资产")])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(511),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(512),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(513),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("p",[a("img",{attrs:{src:c(514),alt:"access"}})])},function(){var e=this.$createElement,a=this._self._c||e;return a("blockquote",[a("p",[this._v("发行NRC-20 Token的合约hex编码示例")])])},function(){var e=this.$createElement,a=this._self._c||e;return a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[this._v("504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000\n\n\n")])])])}],d=c(0),b=Object(d.a)({},function(){var e=this,a=e.$createElement,c=e._self._c||a;return c("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),c("p",[e._v("1 启动钱包,点击【合约】,点击【部署合约】tab页")]),e._v(" "),e._m(2),e._v(" "),c("p",[e._v("2 在文本框中填入合约的Hex编码")]),e._v(" "),e._m(3),e._v(" "),c("p",[e._v("3 填写合约构造函数参数,注意必填项和值类型,否则表单校验无法通过")]),e._v(" "),e._m(4),e._v(" "),c("p",[e._v("4 点击【高级选项】,可更改GasLimit和GasPrice的默认值,还可继续填写附加信息,该字段为非必填项。(此步骤为可选操作)")]),e._v(" "),e._m(5),e._v(" "),c("p",[e._v("5 表单填写完成后,点击【测试合约】,钱包将对该合约进行一次测试部署,验证合约的合法性。")]),e._v(" "),e._m(6),e._v(" "),c("p",[e._v("6 测试通过后,点击【部署合约】,若当前账户有密码则输入密码,然后点击【确认】。无密码,则直接点击【确认】。此时系统会跳转到【我的合约】页面,可在此页面查看部署合约的确认进度。")]),e._v(" "),c("p",[e._v("查看部署合约的确认进度")]),e._v(" "),e._m(7),e._v(" "),c("p",[e._v("7 确认完成后")]),e._v(" "),e._m(8),e._v(" "),e._m(9),e._v(" "),c("p",[e._v("1 启动钱包,点击【合约】,点击【查看合约】tab页")]),e._v(" "),e._m(10),e._v(" "),c("p",[e._v("2 在输入框中输入合法的合约地址,点击【访问】,下方会出现一个面板")]),e._v(" "),e._m(11),e._v(" "),e._m(12),e._v(" "),c("p",[e._v("3 选择某一个方法后有以下两种情况")]),e._v(" "),c("ul",[e._m(13),e._v(" "),c("li",[c("p",[e._v("方法为可写方法(需上链),可点击高级选项,更改GasLimit和GasPrice的默认值,点击【调用】后,该操作会发起一个交易,需要消耗nuls,因此若设置了账户密码,则需要输入密码。交易确认后,返回调用结果。")]),e._v(" "),c("p",[c("a",{attrs:{href:"http://dev.nuls.io/zh-cn/contract/SmartContractFee.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("查看智能合约手续费详情"),c("OutboundLink")],1)]),e._v(" "),c("p",[e._v("调用合约交易确认中")]),e._v(" "),e._m(14),e._v(" "),c("p",[e._v("调用合约交易已确认")]),e._v(" "),e._m(15)])]),e._v(" "),c("p",[e._v("4 若调用的上链方法,可点击面板中的TxID查看本次调用合约交易的详情")]),e._v(" "),e._m(16),e._v(" "),c("p",[e._v("调用合约交易详情")]),e._v(" "),e._m(17),e._v(" "),e._m(18),e._v(" "),c("p",[e._v("1 我的合约列表中展示了当前账户创建的合约和收藏的合约")]),e._v(" "),e._m(19),e._v(" "),e._m(20),e._v(" "),c("p",[e._v("3 【交易记录】中展示的是该合约内部的交易,点击TxID,可查看该条交易的详情")]),e._v(" "),e._m(21),e._v(" "),c("p",[e._v("4 【合约详情】中展示的是该合约的所有方法,对应的参数和返回值类型")]),e._v(" "),e._m(22),e._v(" "),c("p",[e._v("5 若合约由当前账户创建,可点击合约概览右上方的【删除】图标删除该合约,合约被删除后,可继续查看合约详细信息,但无法继续调用合约的方法")]),e._v(" "),e._m(23),e._v(" "),e._m(24),e._v(" "),c("p",[e._v("通过智能合约发行Token或由其他账户转入不同类型Token后,账户就会出现多资产")]),e._v(" "),c("p",[e._v("1 进入钱包,可查看当前账户地址下的所有类型资产")]),e._v(" "),e._m(25),e._v(" "),c("p",[e._v("2 点击【转账】可进入该类型资产的转账界面,输入收款地址和转账金额,可进行该类型资产的转账操作")]),e._v(" "),e._m(26),e._v(" "),c("p",[e._v("3 点击【交易记录】可进入该类型资产的交易记录页面")]),e._v(" "),e._m(27),e._v(" "),c("p",[e._v("4 在【交易记录】页面可通过点击下拉列表进行切换不同类型资产的交易记录")]),e._v(" "),e._m(28),e._v(" "),c("p",[e._v("5 点击TxID可查看该条交易记录详情")]),e._v(" "),c("hr"),e._v(" "),e._m(29),e._v(" "),e._m(30)])},f,!1,null,null,null);b.options.__file="GUIForSmartContract.md";a.default=b.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/60.c437b838.js b/docs/.vuepress/dist/assets/js/60.c437b838.js new file mode 100644 index 00000000..af086615 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/60.c437b838.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{238:function(e,t,i){e.exports=i.p+"assets/img/intro1.3e938c21.jpg"},239:function(e,t,i){e.exports=i.p+"assets/img/intro2.d161b583.jpg"},891:function(e,t,i){"use strict";i.r(t);var o=[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"why-nuls-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-nuls-2-0","aria-hidden":"true"}},[this._v("#")]),this._v(" Why NULS 2.0?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Loosened coupling and removal of dependencies between modules;")])]),this._v(" "),t("li",[t("p",[this._v("Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;")])]),this._v(" "),t("li",[t("p",[this._v("Complete elimination of programming language limitations.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform.\n"),t("img",{attrs:{src:i(238),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages.\n"),t("img",{attrs:{src:i(239),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"philosophy-of-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#philosophy-of-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Philosophy of Design")])}],n=i(0),a=Object(n.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.")]),e._v(" "),i("p",[e._v("Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:")]),e._v(" "),e._m(2),e._v(" "),i("p",[e._v("The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.")]),e._v(" "),i("p",[e._v("During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:")]),e._v(" "),i("p",[e._v("The first layer is the micro-service infrastructure layer.")]),e._v(" "),i("p",[e._v("The second layer is the basic service layer of the blockchain.")]),e._v(" "),i("p",[e._v("The third layer is the DApp application layer.")]),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentation"),i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/nuls2.0/NULS_2.0_Philosophy_of_Design_V0.1_(Eng)_Final.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("NULS2.0:Philosophy of Design"),i("OutboundLink")],1),e._v(".The documentation details the NULS2.0 evolutionary path。")])])},o,!1,null,null,null);a.options.__file="NULS2.0Introduction.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/61.f607b3ec.js b/docs/.vuepress/dist/assets/js/61.f607b3ec.js new file mode 100644 index 00000000..a62b69cb --- /dev/null +++ b/docs/.vuepress/dist/assets/js/61.f607b3ec.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{240:function(e,t,i){e.exports=i.p+"assets/img/introduction-1.3e938c21.jpg"},241:function(e,t,i){e.exports=i.p+"assets/img/introduction-2.d161b583.jpg"},895:function(e,t,i){"use strict";i.r(t);var n=[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-2-0-introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-2-0-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 2.0 Introduction")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"why-nuls-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-nuls-2-0","aria-hidden":"true"}},[this._v("#")]),this._v(" Why NULS 2.0?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Loosened coupling and removal of dependencies between modules;")])]),this._v(" "),t("li",[t("p",[this._v("Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;")])]),this._v(" "),t("li",[t("p",[this._v("Complete elimination of programming language limitations.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform.\n"),t("img",{attrs:{src:i(240),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages.\n"),t("img",{attrs:{src:i(241),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"philosophy-of-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#philosophy-of-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Philosophy of Design")])}],o=i(0),a=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.")]),e._v(" "),i("p",[e._v("Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:")]),e._v(" "),e._m(2),e._v(" "),i("p",[e._v("The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.")]),e._v(" "),i("p",[e._v("During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:")]),e._v(" "),i("p",[e._v("The first layer is the micro-service infrastructure layer.")]),e._v(" "),i("p",[e._v("The second layer is the basic service layer of the blockchain.")]),e._v(" "),i("p",[e._v("The third layer is the DApp application layer.")]),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentation"),i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/nuls2.0/NULS_2.0_Philosophy_of_Design_V0.1_(Eng)_Final.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("NULS2.0:Philosophy of Design"),i("OutboundLink")],1),e._v(".The documentation details the NULS2.0 evolutionary path。")])])},n,!1,null,null,null);a.options.__file="NULS2.0Introduction.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/62.a2eb63e8.js b/docs/.vuepress/dist/assets/js/62.a2eb63e8.js new file mode 100644 index 00000000..2f7c0d2a --- /dev/null +++ b/docs/.vuepress/dist/assets/js/62.a2eb63e8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{349:function(e,t,i){e.exports=i.p+"assets/img/introduction-1.3e938c21.jpg"},350:function(e,t,i){e.exports=i.p+"assets/img/introduction-2.d161b583.jpg"},943:function(e,t,i){"use strict";i.r(t);var n=[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls-2-0-introduction"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls-2-0-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 2.0 Introduction")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"why-nuls-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-nuls-2-0","aria-hidden":"true"}},[this._v("#")]),this._v(" Why NULS 2.0?")])},function(){var e=this.$createElement,t=this._self._c||e;return t("ol",[t("li",[t("p",[this._v("Loosened coupling and removal of dependencies between modules;")])]),this._v(" "),t("li",[t("p",[this._v("Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications;")])]),this._v(" "),t("li",[t("p",[this._v("Complete elimination of programming language limitations.")])])])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("This design refactors NULS from the perspective of the blockchain, to a higher level of cognition that will bring NULS into the new era of NULS IS EVERYTHING. The core team has decided to refactor the NULS 2.0 architecture based on this new architectural design. The result of this decision inevitably means that with certainty NULS will become a truly powerful, one-of-a-kind and supremely flexible platform.\n"),t("img",{attrs:{src:i(349),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("p",[this._v("The new design empowers NULS to be more than just the underlying infrastructure of the blockchain and instead transforms it into a distributed system infrastructure that seamlessly integrates with the blockchain system. It will be a platform for seamless communication between different systems (blockchain and other systems), which will enable businesses built around NULS to flourish more quickly while greatly reducing development costs. This overall optimization gives NULS innate, and undisputed competitive advantages.\n"),t("img",{attrs:{src:i(350),alt:""}})])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"philosophy-of-design"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#philosophy-of-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Philosophy of Design")])}],o=i(0),a=Object(o.a)({},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),i("p",[e._v("NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules.")]),e._v(" "),i("p",[e._v("Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome:")]),e._v(" "),e._m(2),e._v(" "),i("p",[e._v("The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture.")]),e._v(" "),i("p",[e._v("During the design of NULS 2.0, the NULS team and technical community also established the NULS CCC (Code Craft Council), to provide the first stage of autonomy for the technical community. Around this time, and as a matter of coincidence, Berzeck, a member of CCC, had been considering the idea of refactoring the NULS architecture with microservices, a problem which he worked on in former projects of considerable size. After reading the design proposed by Berzeck, the core team was very pleased to find that his version encapsulated an even more complete micro-service design, which coincided with the more flexible blockchain infrastructure the team was working to achieve. Berzeck’s design is divided into a three-layer system of architecture:")]),e._v(" "),i("p",[e._v("The first layer is the micro-service infrastructure layer.")]),e._v(" "),i("p",[e._v("The second layer is the basic service layer of the blockchain.")]),e._v(" "),i("p",[e._v("The third layer is the DApp application layer.")]),e._v(" "),e._m(3),e._v(" "),i("p",[e._v("This architecture allows for the development of more advanced applications built on the second layer (such as the distributed system of exchanges, the data service system, and systems similar to DiDi, all of which can be built on the second layer). Another significant benefit of the architecture is that the NULS system will not only build out multiple chains and multiple DApps, but also other large and medium-sized non-blockchain commercial systems, such as Internet, mobile Internet, Internet of Things, car networking — the possibilities are endless!")]),e._v(" "),e._m(4),e._v(" "),e._m(5),e._v(" "),i("p",[e._v("The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentation"),i("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/nuls2.0/NULS_2.0_Philosophy_of_Design_V0.1_(Eng)_Final.pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("NULS2.0:Philosophy of Design"),i("OutboundLink")],1),e._v(".The documentation details the NULS2.0 evolutionary path。")])])},n,!1,null,null,null);a.options.__file="NULS2.0Introduction.md";t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/63.7b74ed20.js b/docs/.vuepress/dist/assets/js/63.7b74ed20.js new file mode 100644 index 00000000..b2c3d996 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/63.7b74ed20.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{549:function(t,e,s){t.exports=s.p+"assets/img/intro1.3e938c21.jpg"},550:function(t,e,s){t.exports=s.p+"assets/img/intro2.d161b583.jpg"},874:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls-2-0-介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls-2-0-介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 2.0 介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"为什么要做nuls2-0"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#为什么要做nuls2-0","aria-hidden":"true"}},[this._v("#")]),this._v(" 为什么要做NULS2.0")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("这个设计站在一个脱离区块链的角度来重构NULS,是一个更高层次的认知,它将把NULS带入NULS IS EVERYTHING的新时代。核心团队决定在这个架构基础上来进行NULS2.0的架构重构。可以预见,NULS成为一个真正的强大灵活平台之后的景象。\n"),e("img",{attrs:{src:s(549),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("这样的设计让NULS将不仅仅是区块链底层基础设施,还是与区块链系统无缝结合的分布式系统基础架构,它将成为一个不同系统间(区块链以及其他系统)可以进行无缝通信的平台,这将使围绕NULS构建的企业能够更快地蓬勃发展,同时大大降低开发成本。这种整体上的优化,使得NULS生态具备先天的竞争优势。\n"),e("img",{attrs:{src:s(550),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nuls2-0的设计思维"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0的设计思维","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0的设计思维")])}],r=s(0),_=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("NULS创立的目的就是为了让区块链更简单,所以在2017年9月的时候,核心团队就定义了NULS 的基本架构为模块化,就是为了让更多开发者和用户能更容易的使用和编写模块。NULS目前完成了编码层的模块化,但存在模块之间耦合度较高的问题,开发者想使用某个模块或参与某个模块的开发,需要同时了解与其相关联的其他模块的设计,并且只能用特定的语言进行开发,这对NULS技术社区深度参与NULS架构的设计和开发,以及用户简单低成本的运用模块不够友好。")]),t._v(" "),s("p",[t._v("NULS在创立之初,就致力于成为一个由全球社区驱动的开源项目。我们认为,能不断催生创新思维的社区发展路线,才是区块链项目区别于其他商业项目的一大特点。不断的迭代与创新是开源项目发展过程中必然会产生的现象,也是区块链的魅力所在。为了让开源技术社区可以无任何障碍的融入NULS底层设计和开发中,以及为了革命性产品“链工厂”中的重要组成部分“模块仓库”的搭建和易用,有以下几个难点必须克服:")]),t._v(" "),s("p",[t._v("1、模块的耦合度降低,模块之间不在编写和使用上彼此依赖 ;")]),t._v(" "),s("p",[t._v("2、 模块可扩展、修改、替换,每一个模块都是简单的、纯粹的,不受到区块链程序整体复杂度的影响;")]),t._v(" "),s("p",[t._v("3、 彻底打破编程语言障碍。")]),t._v(" "),s("p",[t._v("核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。")]),t._v(" "),s("p",[t._v("在NULS2.0设计期间,NULS技术社区开发者还成立了NULS CCC(Code Craft Council),初步开始了技术社区的自治。无独有偶的是,CCC成员BERZECK也一直在思考用微服务的设计方式来重构NULS架构。核心团队阅览了BERZECK的设计方案后,大感欣慰,他提出了更完善的微服务设计思路,他的想法和我们想要达到的更加灵活的区块链底层设施不谋而合。Berzeck的设计方案分为三层系统架构设计:")]),t._v(" "),s("p",[t._v("第一层为微服务基础架构层;")]),t._v(" "),s("p",[t._v("第二层为区块链基础服务层;")]),t._v(" "),s("p",[t._v("第三层为DAPP应用层。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("此构架使得我们可以在第二层上开发更高级的应用系统(比如交易所的分布式系统,数据服务系统,甚至类似于滴滴打车的整个系统都可以构建在第二层之上)。构建在NULS体系上的,不仅仅是多个链和多个DAPP,还可以是有意向往区块链发展的其他大中小型互联网、移动互联网、物联网、车联网等等商业系统。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("NULS2.0的微服务架构是逐渐演化而成,想深入了解其是如何形成的,可阅读文档"),s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/nuls2.0/NULS_2.0_Philosophy_of_Design_V0.1_(Chi)_Final.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS2.0设计思维"),s("OutboundLink")],1),t._v(",文档中详细阐述了NULS2.0的演化之路。")])])},n,!1,null,null,null);_.options.__file="NULS2.0Introduction.md";e.default=_.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/64.ab1a2432.js b/docs/.vuepress/dist/assets/js/64.ab1a2432.js new file mode 100644 index 00000000..19f72670 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/64.ab1a2432.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{596:function(t,e,s){t.exports=s.p+"assets/img/introduction-1.3e938c21.jpg"},597:function(t,e,s){t.exports=s.p+"assets/img/introduction-2.d161b583.jpg"},852:function(t,e,s){"use strict";s.r(e);var n=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"nuls-2-0-介绍"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls-2-0-介绍","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS 2.0 介绍")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"为什么要做nuls2-0"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#为什么要做nuls2-0","aria-hidden":"true"}},[this._v("#")]),this._v(" 为什么要做NULS2.0")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("这个设计站在一个脱离区块链的角度来重构NULS,是一个更高层次的认知,它将把NULS带入NULS IS EVERYTHING的新时代。核心团队决定在这个架构基础上来进行NULS2.0的架构重构。可以预见,NULS成为一个真正的强大灵活平台之后的景象。\n"),e("img",{attrs:{src:s(596),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("这样的设计让NULS将不仅仅是区块链底层基础设施,还是与区块链系统无缝结合的分布式系统基础架构,它将成为一个不同系统间(区块链以及其他系统)可以进行无缝通信的平台,这将使围绕NULS构建的企业能够更快地蓬勃发展,同时大大降低开发成本。这种整体上的优化,使得NULS生态具备先天的竞争优势。\n"),e("img",{attrs:{src:s(597),alt:""}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"nuls2-0的设计思维"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0的设计思维","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0的设计思维")])}],r=s(0),i=Object(r.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("NULS创立的目的就是为了让区块链更简单,所以在2017年9月的时候,核心团队就定义了NULS 的基本架构为模块化,就是为了让更多开发者和用户能更容易的使用和编写模块。NULS目前完成了编码层的模块化,但存在模块之间耦合度较高的问题,开发者想使用某个模块或参与某个模块的开发,需要同时了解与其相关联的其他模块的设计,并且只能用特定的语言进行开发,这对NULS技术社区深度参与NULS架构的设计和开发,以及用户简单低成本的运用模块不够友好。")]),t._v(" "),s("p",[t._v("NULS在创立之初,就致力于成为一个由全球社区驱动的开源项目。我们认为,能不断催生创新思维的社区发展路线,才是区块链项目区别于其他商业项目的一大特点。不断的迭代与创新是开源项目发展过程中必然会产生的现象,也是区块链的魅力所在。为了让开源技术社区可以无任何障碍的融入NULS底层设计和开发中,以及为了革命性产品“链工厂”中的重要组成部分“模块仓库”的搭建和易用,有以下几个难点必须克服:")]),t._v(" "),s("p",[t._v("1、模块的耦合度降低,模块之间不在编写和使用上彼此依赖 ;")]),t._v(" "),s("p",[t._v("2、 模块可扩展、修改、替换,每一个模块都是简单的、纯粹的,不受到区块链程序整体复杂度的影响;")]),t._v(" "),s("p",[t._v("3、 彻底打破编程语言障碍。")]),t._v(" "),s("p",[t._v("核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。")]),t._v(" "),s("p",[t._v("在NULS2.0设计期间,NULS技术社区开发者还成立了NULS CCC(Code Craft Council),初步开始了技术社区的自治。无独有偶的是,CCC成员BERZECK也一直在思考用微服务的设计方式来重构NULS架构。核心团队阅览了BERZECK的设计方案后,大感欣慰,他提出了更完善的微服务设计思路,他的想法和我们想要达到的更加灵活的区块链底层设施不谋而合。Berzeck的设计方案分为三层系统架构设计:")]),t._v(" "),s("p",[t._v("第一层为微服务基础架构层;")]),t._v(" "),s("p",[t._v("第二层为区块链基础服务层;")]),t._v(" "),s("p",[t._v("第三层为DAPP应用层。")]),t._v(" "),t._m(2),t._v(" "),s("p",[t._v("此构架使得我们可以在第二层上开发更高级的应用系统(比如交易所的分布式系统,数据服务系统,甚至类似于滴滴打车的整个系统都可以构建在第二层之上)。构建在NULS体系上的,不仅仅是多个链和多个DAPP,还可以是有意向往区块链发展的其他大中小型互联网、移动互联网、物联网、车联网等等商业系统。")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),s("p",[t._v("NULS2.0的微服务架构是逐渐演化而成,想深入了解其是如何形成的,可阅读文档"),s("a",{attrs:{href:"https://nuls.io/api/v1/download/files/papers/nuls2.0/NULS_2.0_Philosophy_of_Design_V0.1_(Chi)_Final.pdf",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS2.0设计思维"),s("OutboundLink")],1),t._v(",文档中详细阐述了NULS2.0的演化之路。")])])},n,!1,null,null,null);i.options.__file="NULS2.0Introduction.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/65.23af0670.js b/docs/.vuepress/dist/assets/js/65.23af0670.js new file mode 100644 index 00000000..8b561793 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/65.23af0670.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{234:function(e,t,a){e.exports=a.p+"assets/img/image-20190103193901967.35788ccc.png"},861:function(e,t,a){"use strict";a.r(t);var n=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"build-chain"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#build-chain","aria-hidden":"true"}},[e._v("#")]),e._v(" Build Chain")]),e._v(" "),n("h2",{attrs:{id:"introduction"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),n("p",[e._v("This tutorial guides you to build a private chain based on NULS source code, to make is easier for users to learn about the operation, development or experiment of the NULS Blockchain. By building a chain to fully understand the operation of each node and data interaction, we can better grasp the overall operating mechanism of the NULS Blockchain, which is conducive to further research. We assume that readers have the skills to set up and debug a Java development environment.")]),e._v(" "),n("h2",{attrs:{id:"setting-up-environment"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-environment","aria-hidden":"true"}},[e._v("#")]),e._v(" Setting up environment")]),e._v(" "),n("ul",[n("li",[e._v("Operating systems: macOS, Windows")]),e._v(" "),n("li",[e._v("Build Tools: Maven")]),e._v(" "),n("li",[e._v("Development Tools: IntelliJ IDEA")]),e._v(" "),n("li",[e._v("NULS source code on github: https://github.com/nuls-io/nuls")])]),e._v(" "),n("h2",{attrs:{id:"beginning"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#beginning","aria-hidden":"true"}},[e._v("#")]),e._v(" Beginning")]),e._v(" "),n("p",[e._v("Since blockchain is a decentralized network composed of multiple nodes, we will take a private chain with three nodes as an example. Although we recommend using a Linux server to run the NULS main-net consensus node, in this tutorial, we choose macOS system that can set up a Java development environment to run and debug nodes.")]),e._v(" "),n("h2",{attrs:{id:"development-environment"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#development-environment","aria-hidden":"true"}},[e._v("#")]),e._v(" Development environment")]),e._v(" "),n("p",[e._v("First, clone the NULS source code using IntelliJ IDEA and open the project. Make sure JDK is the jdk1.8 version and Maven is configured correctly.")]),e._v(" "),n("h2",{attrs:{id:"steps-to-build"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#steps-to-build","aria-hidden":"true"}},[e._v("#")]),e._v(" Steps to build")]),e._v(" "),n("ol",[n("li",[e._v("Open the module.ini file, which is the configuration file for joining or building the network. In this tutorial, it is the configuration information of the NULS test-net.")])]),e._v(" "),n("p",[n("img",{attrs:{src:a(234),alt:"image-20190103193901967"}})]),e._v(" "),n("ol",{attrs:{start:"2"}},[n("li",[e._v("We will use three nodes to build a private chain. First we need to prepare devices (virtual machine works) for three nodes to run.")])]),e._v(" "),n("ul",[n("li",[e._v("Node A: 192.168.1.1")]),e._v(" "),n("li",[e._v("Node B: 192.168.1.2")]),e._v(" "),n("li",[e._v("Node C: 192.168.1.3")])]),e._v(" "),n("p",[e._v("We also need to set up a seed node to maintain the operation of the blockchain, i.e., to package and forge blocks. In addition, we need to prepare a block-forging address (including private key, to import into the seed node), which can be prepared in advance.")]),e._v(" "),n("p",[e._v("In this tutorial, the initial block-forging address we prepare is:\n"),n("code",[e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")])]),e._v(" "),n("p",[e._v('PS: You may find that the first few letters of the address we prepare differs from those of the test-net address in the figure, which is for the sake of distinguishing the test-net address from the main-net address, so as to avoid confusion that may result in adverse consequences. Specifically, we set the test-net address to start with "TT" and the main-net address to start with "Ns". This tutorial uses the NULS main-branch code, so the address starts with "Ns". If you prefer to custom the starting letters of the private-chain account address, you can try to modify the '),n("code",[e._v("chain.id")]),e._v(" parameter in the nuls.ini file. The parameters of the same chain must be in consistence.")]),e._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[e._v("Assuming node A is the seed node, then modify the network and consensus sections of the module.ini configuration file of three nodes A, B and C according to the following configuration:")])]),e._v(" "),n("div",{staticClass:"language-ini extra-class"},[n("pre",{pre:!0,attrs:{class:"language-ini"}},[n("code",[n("span",{pre:!0,attrs:{class:"token selector"}},[e._v("[network]")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Bootstrap")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.server.port")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("8003")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.magic")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("20190101")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.max.in")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("100")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.max.out")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("10")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.seed.ip")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("192.168.1.1:8003")]),e._v("\n\n"),n("span",{pre:!0,attrs:{class:"token selector"}},[e._v("[consensus]")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Bootstrap")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Partake.packing")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("true")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Min.upgrade.delay")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("1000")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Seed.nodes")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),e._v("\n")])])]),n("ul",[n("li",[e._v("Modify "),n("code",[e._v("work.seed.ip")]),e._v(" to the ip and port of the seed node.")]),e._v(" "),n("li",[e._v("Modify "),n("code",[e._v("seed.nodes")]),e._v(" to the block-forging address.")]),e._v(" "),n("li",[e._v("The consistency of the magic parameters "),n("code",[e._v("network.magic")]),e._v(" of all nodes in the private chain is a must.")])]),e._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[e._v("Run the three nodes separately through IntelliJ IDEA. If you only need to debug one node, the other two nodes can be packaged with maven and sent to a Linux server to run. Remarkably, a jre must be placed in the NULS root directory to run properly.")]),e._v(" "),n("li",[e._v("After launching the three nodes, once the IntelliJ IDEA console has the following log output, it means that the three nodes have successfully formed a private chain network, but it still cannot produce new blocks and the block height is 0. If there is no log output, you need to uncomment the "),n("code",[e._v('')]),e._v(" in logback.xml.")])]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash :xxxxxxx,192.168.1.2:8003,192.168.1.2:8003\n\n")])])]),n("ol",{attrs:{start:"6"}},[n("li",[e._v("Then import the prepared block-forging account "),n("code",[e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),e._v(" via wallet interface of the seed node A. After a while, you can see the latest height displayed in the console increasing, which indicates that the network is producing new blocks. At the same time, the height of the node B, C will also increase and the height of the three nodes will remain the same. At this point, the setup of the private chain network is completed.")])]),e._v(" "),n("h2",{attrs:{id:"conclusion"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#conclusion","aria-hidden":"true"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),n("p",[e._v("This tutorial mainly introduces the easiest way to build a private chain for the development and debugging of NULS, without modification on the source code of NULS. If you want to dig deeper into NULS, you can refer to the relevant documentation of NULS to modify and debug the source code. Maybe you will find more secrets!")])])}],s=a(0),o=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);o.options.__file="buildPrivateChain.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/66.2cf2b73c.js b/docs/.vuepress/dist/assets/js/66.2cf2b73c.js new file mode 100644 index 00000000..8909dd20 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/66.2cf2b73c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{277:function(_,t,v){_.exports=v.p+"assets/img/clip_image002.425eb96f.jpg"},909:function(_,t,v){"use strict";v.r(t);var a=[function(){var _=this,t=_.$createElement,a=_._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"alpha-如何使用nuls搭建区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#alpha-如何使用nuls搭建区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" [Alpha]如何使用NULS搭建区块链")]),_._v(" "),a("h2",{attrs:{id:"nuls2-0-开发环境搭建"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-开发环境搭建","aria-hidden":"true"}},[_._v("#")]),_._v(" NULS2.0 开发环境搭建")]),_._v(" "),a("p",[_._v("NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。")]),_._v(" "),a("p",[_._v("1 环境准备")]),_._v(" "),a("ul",[a("li",[_._v("安装JDK")]),_._v(" "),a("li",[_._v("安装Maven")]),_._v(" "),a("li",[_._v("安装IntelliJ IDEA开发工具")]),_._v(" "),a("li",[_._v("安装git")])]),_._v(" "),a("p",[_._v("2 clone源代码")]),_._v(" "),a("p",[_._v("git clone "),a("a",{attrs:{href:"mailto:git@github.com"}},[_._v("git@github.com")]),_._v(":nuls-io/nuls_2.0.git")]),_._v(" "),a("p",[_._v("3 IDEA导入nuls_2.0中所有maven项目")]),_._v(" "),a("p",[_._v("4 建立自己的maven项目")]),_._v(" "),a("p",[_._v("5 运行所有需要启动的模块")]),_._v(" "),a("h2",{attrs:{id:"使用nuls2-0核心模块搭建基础链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#使用nuls2-0核心模块搭建基础链","aria-hidden":"true"}},[_._v("#")]),_._v(" 使用NULS2.0核心模块搭建基础链")]),_._v(" "),a("p",[_._v("NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。")]),_._v(" "),a("p",[_._v("NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。")]),_._v(" "),a("h3",{attrs:{id:"_1-理解nuls-2-0的微服务架构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-理解nuls-2-0的微服务架构","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 理解NULS 2.0的微服务架构")]),_._v(" "),a("p",[a("img",{attrs:{src:v(277),alt:"img"}})]),_._v(" "),a("p",[_._v("NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。")]),_._v(" "),a("p",[_._v("因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。")]),_._v(" "),a("p",[_._v("理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。")]),_._v(" "),a("h3",{attrs:{id:"_2-修改基础配置信息"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-修改基础配置信息","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 修改基础配置信息")]),_._v(" "),a("p",[_._v("一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。")]),_._v(" "),a("p",[_._v("NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf")]),_._v(" "),a("p",[_._v("modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:")]),_._v(" "),a("table",[a("thead",[a("tr",[a("th",[_._v("section")]),_._v(" "),a("th",[_._v("param")]),_._v(" "),a("th",[_._v("name")]),_._v(" "),a("th",[_._v("remark")])])]),_._v(" "),a("tbody",[a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("chain.id")]),_._v(" "),a("td",[_._v("本链id")]),_._v(" "),a("td",[_._v("Uint16,NULS主网为1,测试网为2")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("address.prefix")]),_._v(" "),a("td",[_._v("地址前缀")]),_._v(" "),a("td",[_._v("大小字母+数字,2-5个字符")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("data.root.dir")]),_._v(" "),a("td",[_._v("数据存储路径")]),_._v(" "),a("td",[_._v("为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("encoding")]),_._v(" "),a("td",[_._v("编码方式")]),_._v(" "),a("td",[_._v("默认UTF-8,不建议修改")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("asset.id")]),_._v(" "),a("td",[_._v("本来主资产编码")]),_._v(" "),a("td",[_._v("NULS为1")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.root.dir")]),_._v(" "),a("td",[_._v("日志根目录")]),_._v(" "),a("td",[_._v("用于存放各个模块的日志文件")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.level")]),_._v(" "),a("td",[_._v("日志级别")]),_._v(" "),a("td",[_._v("日志打印级别debug/info/warn/error.")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储block模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td",[_._v("区块大小限制,避免太大区块太高参与门槛")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("max.rollback")]),_._v(" "),a("td",[_._v("最大回滚数量")]),_._v(" "),a("td",[_._v("当超过这个数量后,系统将停止回滚,避免出现重大问题")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("header.extend.max.size")]),_._v(" "),a("td",[_._v("扩展最大size")]),_._v(" "),a("td",[_._v("区块头中的扩展字段的大小限制")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("genesis.block.json.path")]),_._v(" "),a("td",[_._v("创世块描述文件")]),_._v(" "),a("td",[_._v("创世块的描述文件")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储共识模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("inflation.token.count")]),_._v(" "),a("td",[_._v("每年增发数量")]),_._v(" "),a("td",[_._v("增发数量用于通过coinbase交易奖励给节点")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("seed.addresses")]),_._v(" "),a("td",[_._v("共识种子地址")]),_._v(" "),a("td",[_._v('多个地址用","分隔')])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.address.pwd")]),_._v(" "),a("td",[_._v("地址密码")]),_._v(" "),a("td",[_._v("用于打包的地址的密码")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最小保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最大保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最大值,不能大于100")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最小值")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("单笔委托最小金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.total.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("节点接受委托的最大金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.token.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("当节点的委托达到该值则开始出块")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("red.punish.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("红牌锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.stop.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("停止节点锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("seeds")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v('种子节点,多个之间用","隔开')])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("magic.number")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("魔法数字,用于隔离其他网络")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("port")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("端口")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.seed")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("需要进行跨链时,配置NULS2.0种子节点")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("cross.listener.port")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.magic.number")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("contract")]),_._v(" "),a("td",[_._v("nrc20.file.path")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("NRC20协议描述json文件路径")])]),_._v(" "),a("tr",[a("td",[_._v("tx")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("Ledger")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.ip")]),_._v(" "),a("td",[_._v("mongodb地址")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.port")]),_._v(" "),a("td",[_._v("mongodb端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.listener.ips")]),_._v(" "),a("td",[_._v("rpc监听ip")]),_._v(" "),a("td",[_._v("可以配置多个")])]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.port")]),_._v(" "),a("td",[_._v("rpc监听端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("req.allow.per.s")]),_._v(" "),a("td",[_._v("并发限制")]),_._v(" "),a("td")])])]),_._v(" "),a("p",[_._v("表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。")]),_._v(" "),a("blockquote"),_._v(" "),a("h3",{attrs:{id:"_3-打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 打包和启动")]),_._v(" "),a("p",[_._v("链的配置项修改完成后,则可直接参考本文档的第4部分:"),a("a",{attrs:{href:"#%E6%89%93%E5%8C%85%E5%92%8C%E5%90%AF%E5%8A%A8"}},[_._v("打包和启动")])]),_._v(" "),a("h2",{attrs:{id:"搭建包含业务模块的区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#搭建包含业务模块的区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" 搭建包含业务模块的区块链")]),_._v(" "),a("p",[_._v("在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。")]),_._v(" "),a("h3",{attrs:{id:"_1-业务模块说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-业务模块说明","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 业务模块说明")]),_._v(" "),a("h4",{attrs:{id:"_1-1-何为业务模块"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-何为业务模块","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.1 何为业务模块")]),_._v(" "),a("p",[_._v("基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。")]),_._v(" "),a("p",[_._v("业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。")]),_._v(" "),a("h4",{attrs:{id:"_1-2-如何扩展协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-如何扩展协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.2 如何扩展协议")]),_._v(" "),a("p",[_._v("NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:")]),_._v(" "),a("ul",[a("li",[_._v("通过转账交易的remark字段进行扩展")])]),_._v(" "),a("p",[_._v("将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。")]),_._v(" "),a("ul",[a("li",[_._v("通过制定的业务扩展交易进行扩展")])]),_._v(" "),a("p",[_._v("NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。")]),_._v(" "),a("p",[a("strong",[_._v("示例:")])]),_._v(" "),a("p",[_._v("假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。")]),_._v(" "),a("p",[_._v("1 功能设计")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;\n\n2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;\n\n3. 解密查看:从数据库中获取记录,解密,展示解密结果\n\n4. 删除记事:app本地删除,不删除区块链中数据\n")])])]),a("p",[_._v("2 区块链交互")]),_._v(" "),a("p",[_._v("以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。")]),_._v(" "),a("ul",[a("li",[_._v("第一个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v('首先设计数据格式,如下\n\n{\n\n address:"",//记事所属人\n\n time:"",//记事时间点\n\n content:""//加密后的记事内容\n\n}\n\n根据数据格式,组装上链数据:address+time+content;\n\n确定应用的魔法数字,假设为12345678.\n\n则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。\n')])])]),a("ul",[a("li",[_._v("第二个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,\n如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)\n如果成功解析了数据,则将数据存储到本地数据库中\n")])])]),a("p",[_._v("3 其他业务实现")]),_._v(" "),a("p",[_._v("所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。")]),_._v(" "),a("blockquote",[a("p",[_._v("使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。")])]),_._v(" "),a("h3",{attrs:{id:"_2-需求分析"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-需求分析","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 需求分析")]),_._v(" "),a("p",[_._v("在动手开发模块之前,首先要确定几个问题:")]),_._v(" "),a("ul",[a("li",[_._v("自己需要的是什么样的功能?")]),_._v(" "),a("li",[_._v("是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?")]),_._v(" "),a("li",[_._v("用哪种方式实现这个模块?\n"),a("ul",[a("li",[_._v("扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。")]),_._v(" "),a("li",[_._v("增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要")]),_._v(" "),a("li",[_._v("修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。")])])])]),_._v(" "),a("h3",{attrs:{id:"_3-模块设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-模块设计","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 模块设计")]),_._v(" "),a("p",[_._v("在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。")]),_._v(" "),a("p",[_._v("那么如何设计自己的业务?举例说明:")]),_._v(" "),a("h4",{attrs:{id:"_3-1-扩展基础协议的方式:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-扩展基础协议的方式:","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.1 扩展基础协议的方式:")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。\n比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。\n\n第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。\n一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。\n")])])]),a("h4",{attrs:{id:"_3-2-新增协议的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-新增协议的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.2 新增协议的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。\n这里我们就用nuls的poc共识机制来举例\n功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。\nnuls的poc共识机制的业务功能有:\n1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。\n2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。\n3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。\n4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。\n\n协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。\npoc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易\n交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。\n例如创建共识节点:\n\t1)创建节点的账户不能重复多次创建共识节点;\n\t2)保证金在2-20万nuls之间;\n\t3)账户是否有过红牌记录;\n存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。\n例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等\n\n接口设计:需要对外提供的RPC接口\n例如:查询共识节点信息,查询共识委托信息等\n\n其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里\n")])])]),a("h4",{attrs:{id:"_3-3-修改基础链的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-修改基础链的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.3 修改基础链的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。\n修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。\n")])])]),a("h3",{attrs:{id:"_4-模块实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-模块实现","aria-hidden":"true"}},[_._v("#")]),_._v(" 4 模块实现")]),_._v(" "),a("p",[_._v("首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。")]),_._v(" "),a("p",[_._v("1、nuls-service-base-lib(baselib):")]),_._v(" "),a("p",[_._v("通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。")]),_._v(" "),a("p",[_._v("2、module-self:")]),_._v(" "),a("p",[_._v("模块本身,在一下几方面需要做出自己的实现:")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("模块管理")]),_._v(" "),a("p",[_._v("1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。")]),_._v(" "),a("p",[_._v("2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。")]),_._v(" "),a("p",[_._v("3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理")])]),_._v(" "),a("li",[a("p",[_._v("协议相关")]),_._v(" "),a("p",[_._v("当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息")]),_._v(" "),a("p",[_._v("当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。")])]),_._v(" "),a("li",[a("p",[_._v("数据存储")]),_._v(" "),a("p",[_._v("NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。")])]),_._v(" "),a("li",[a("p",[_._v("功能实现")]),_._v(" "),a("p",[_._v("如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。")])]),_._v(" "),a("li",[a("p",[_._v("功能接口")]),_._v(" "),a("p",[_._v("根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。")])]),_._v(" "),a("li",[a("p",[_._v("日志记录")]),_._v(" "),a("p",[_._v("NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。")])])]),_._v(" "),a("p",[_._v("总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。")]),_._v(" "),a("h3",{attrs:{id:"_5-定义自己的协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-定义自己的协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 5 定义自己的协议")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。")])]),_._v(" "),a("li",[a("p",[_._v("交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。")])])]),_._v(" "),a("h3",{attrs:{id:"_6-调试"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-调试","aria-hidden":"true"}},[_._v("#")]),_._v(" 6 调试")]),_._v(" "),a("p",[_._v("完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;\n\n2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;\n\n3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;\n\n4、检查交易验证逻辑是否严谨,不要出现安全漏洞;\n\n5、测试自身模块的业务是否正确、完整。\n")])])]),a("p",[_._v("全部测试都完成后,便可进入打包和启动阶段了")]),_._v(" "),a("h2",{attrs:{id:"打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 打包和启动")]),_._v(" "),a("h3",{attrs:{id:"_1-打包"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-打包","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 打包")]),_._v(" "),a("p",[_._v("NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0\n./package.sh -m\n")])])]),a("p",[_._v("确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。")]),_._v(" "),a("h3",{attrs:{id:"_2-启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 启动")]),_._v(" "),a("ul",[a("li",[_._v("编译成功 会生成如下路径文件")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("/home/nuls2/nuls_2.0/RELEASE/bin\n")])])]),a("ul",[a("li",[_._v("执行如下命令,即可一键批量启动所有模块")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0/RELEASE/bin\n./start.sh -c ./moudle.json(指定moudle.json配置文件启动)\n")])])]),a("ul",[a("li",[_._v("linux指令 jps 查看所有模块进程:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v(" ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws\n")])])]),a("ul",[a("li",[_._v("查看模块启动状态")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("./checkstatus.sh \n")])])]),a("ul",[a("li",[_._v("停止 工程模块:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("kill 进程号(进程号对应jps显示出来的 mykernel 模块的进程)\n")])])])])}],s=v(0),e=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);e.options.__file="howToUseNulsBuildChain.md";t.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/67.dd039849.js b/docs/.vuepress/dist/assets/js/67.dd039849.js new file mode 100644 index 00000000..3efb2e24 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/67.dd039849.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{316:function(e,t,n){e.exports=n.p+"assets/img/clip_image002.425eb96f.jpg"},929:function(e,t,n){"use strict";n.r(t);var a=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"build-chain"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#build-chain","aria-hidden":"true"}},[e._v("#")]),e._v(" Build Chain")]),e._v(" "),a("h2",{attrs:{id:"development-environment-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-environment-setup","aria-hidden":"true"}},[e._v("#")]),e._v(" Development environment setup")]),e._v(" "),a("p",[e._v("NULS2.0 is an open and non-restricted language underlying platform for blockchain. This paper only refers to the core business modules of blockchain to write the Java environment building process.")]),e._v(" "),a("p",[e._v("1 Environment to prepare")]),e._v(" "),a("ul",[a("li",[e._v("install the JDK")]),e._v(" "),a("li",[e._v("install Maven")]),e._v(" "),a("li",[e._v("install the IntelliJ IDEA development tools")]),e._v(" "),a("li",[e._v("install git")])]),e._v(" "),a("p",[e._v("2 Clone source code")]),e._v(" "),a("p",[e._v("git clone "),a("a",{attrs:{href:"mailto:git@github.com"}},[e._v("git@github.com")]),e._v(":nuls-io/nuls_2.0.git")]),e._v(" "),a("p",[e._v("3 IDEA imports all maven projects in nuls_2.0")]),e._v(" "),a("p",[e._v("4 Build your own maven project")]),e._v(" "),a("p",[e._v("5 Run all the modules that need to be started")]),e._v(" "),a("h2",{attrs:{id:"using-nuls2-0-core-module-to-build-the-basic-chain"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-nuls2-0-core-module-to-build-the-basic-chain","aria-hidden":"true"}},[e._v("#")]),e._v(" Using NULS2.0 core module to build the basic chain")]),e._v(" "),a("p",[e._v("NULS is a global open source blockchain underlying infrastructure. Making the blockchain simpler is the mission of NULS. This article will describe how to use the NULS core module to quickly build a basic blockchain.")]),e._v(" "),a("p",[e._v("NULS does not limit the attributes of the blockchain. Using the NULS underlying layer, you can build a private chain, a coalition chain, and a public chain. You can build a coin blockchain or build a currency-free blockchain.")]),e._v(" "),a("h3",{attrs:{id:"_1-understanding-the-microservice-architecture-of-nuls-2-0"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-understanding-the-microservice-architecture-of-nuls-2-0","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 Understanding the Microservice Architecture of NULS 2.0")]),e._v(" "),a("p",[a("img",{attrs:{src:n(316),alt:"img"}})]),e._v(" "),a("p",[e._v("NULS 2.0 is built on a micro-service architecture with built-in blockchain core business modules, including accounts, transactions, blocks, consensus, etc. When we build a basic blockchain based on NULS 2.0, we will be based on the NULS 2.0 blockchain. The basic functional layer is extended.")]),e._v(" "),a("p",[e._v('Because NULS2.0 already contains the basic functions of the blockchain, when developing its own blockchain, it only needs to organize its own unique business functions, abstract the corresponding protocol, and develop the function into a module inserted into NULS2. 0 can be. For example: Suppose we want to implement a "Notepad Chain". On the basis of NULS, we need to design a "Notepad" business transaction, such as a note transaction, delete a note transaction, our business module needs to do, in this The business logic code is added to the module, and the verification, processing, and rollback functions of the two transactions are implemented, and then the transaction information is reported to the transaction management module to process the transaction related logic.')]),e._v(" "),a("p",[e._v("Understand how to expand the blockchain function, you can design your own functional modules according to the following steps.")]),e._v(" "),a("h3",{attrs:{id:"_2-modify-basic-configuration-information"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-modify-basic-configuration-information","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 Modify basic configuration information")]),e._v(" "),a("p",[e._v("To run a blockchain, you need a lot of basic configuration. Each blockchain must have its own configuration parameters. When building a new blockchain, the first thing is to configure its own operating parameters.")]),e._v(" "),a("p",[e._v("The startup script of NULS2.0 supports the way to send configuration files to start the blockchain. The usage is as follows: sh start.sh -c modules.ncf")]),e._v(" "),a("p",[e._v("The modules.ncf can be configured with parameters of each module. The developer can modify the running parameters according to the situation of the own chain. The specific operating parameters are preset as follows:")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("section")]),e._v(" "),a("th",[e._v("param")]),e._v(" "),a("th",[e._v("name")]),e._v(" "),a("th",[e._v("remark")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("chain.id")]),e._v(" "),a("td",[e._v("This chain id")]),e._v(" "),a("td",[e._v("Uint16, NULS main network is 1, test network is 2")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("address.prefix")]),e._v(" "),a("td",[e._v("address prefix")]),e._v(" "),a("td",[e._v("size letters + numbers, 2-5 characters")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("data.root.dir")]),e._v(" "),a("td",[e._v("Data Storage Path")]),e._v(" "),a("td",[e._v("For all modules to be stored in the same directory, special paths can be configured in any module if needed")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("encoding")]),e._v(" "),a("td",[e._v("Encoding method")]),e._v(" "),a("td",[e._v("Default UTF-8, not recommended to modify")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("asset.id")]),e._v(" "),a("td",[e._v("Original Master Asset Code")]),e._v(" "),a("td",[e._v("NULS 1")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("log.root.dir")]),e._v(" "),a("td",[e._v("Log Root")]),e._v(" "),a("td",[e._v("Log files for each module")])]),e._v(" "),a("tr",[a("td",[e._v("common")]),e._v(" "),a("td",[e._v("log.level")]),e._v(" "),a("td",[e._v("log level")]),e._v(" "),a("td",[e._v("log print level debug/info/warn/error.")])]),e._v(" "),a("tr",[a("td",[e._v("block")]),e._v(" "),a("td",[e._v("data.folder")]),e._v(" "),a("td",[e._v("data subfolder")]),e._v(" "),a("td",[e._v("used to store block module data, placed under #{data.root.dir}")])]),e._v(" "),a("tr",[a("td",[e._v("Block")]),e._v(" "),a("td",[e._v("block.max.size")]),e._v(" "),a("td",[e._v("Block size max")]),e._v(" "),a("td",[e._v("Block size limit, avoid too large blocks too high to participate in the threshold")])]),e._v(" "),a("tr",[a("td",[e._v("block")]),e._v(" "),a("td",[e._v("block.interval")]),e._v(" "),a("td",[e._v("Block Interval")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("block")]),e._v(" "),a("td",[e._v("max.rollback")]),e._v(" "),a("td",[e._v("Maximum rollback quantity")]),e._v(" "),a("td",[e._v("When this number is exceeded, the system will stop rolling back to avoid major problems")])]),e._v(" "),a("tr",[a("td",[e._v("block")]),e._v(" "),a("td",[e._v("header.extend.max.size")]),e._v(" "),a("td",[e._v("Extended Maximum size")]),e._v(" "),a("td",[e._v("Size Limits for Extended Fields in Block Headers")])]),e._v(" "),a("tr",[a("td",[e._v("block")]),e._v(" "),a("td",[e._v("genesis.block.json.path")]),e._v(" "),a("td",[e._v("Genesis Block Description File")]),e._v(" "),a("td",[e._v("Genesis Block Description File")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("data.folder")]),e._v(" "),a("td",[e._v("data subfolder")]),e._v(" "),a("td",[e._v("used to store consensus module data, placed under #{data.root.dir}")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("packing.interval")]),e._v(" "),a("td",[e._v("Blocking interval")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("inflation.token.count")]),e._v(" "),a("td",[e._v("Annual Issues")]),e._v(" "),a("td",[e._v("The number of additional issuances used to reward nodes via coinbase transactions")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("block.max.size")]),e._v(" "),a("td",[e._v("Block size")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("seed.addresses")]),e._v(" "),a("td",[e._v("Consensus Seed Address")]),e._v(" "),a("td",[e._v('Multiple Addresses Separated by ","')])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("packing.address.pwd")]),e._v(" "),a("td",[e._v("Address Password")]),e._v(" "),a("td",[e._v("Password for the packaged address")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("agent.deposit.min")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Minimum Margin Quantity When Creating Nodes")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("agent.deposit.max")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Maximum Margin Quantity When Creating Nodes")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("commission.rate.max")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("The maximum commission rate, no more than 100")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("commission.rate.min")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Commission Ratio Minimum")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("deposit.min")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Single commission minimum amount")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("agent.total.deposit.max")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Maximum amount of nodes to accept delegates")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("packing.token.min")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("When the node's delegate reaches this value, it starts to block")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("red.punish.lock.time")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Red Card Lock Time")])]),e._v(" "),a("tr",[a("td",[e._v("consensus")]),e._v(" "),a("td",[e._v("agent.stop.lock.time")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Stop Node Lock Time")])]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("data.folder")]),e._v(" "),a("td",[e._v("data subfolder")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("seeds")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v('Seed nodes, separated by ","')])]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("magic.number")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("Magic numbers for isolating other networks")])]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("port")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("port")])]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("nuls.seed")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("NULS2.0 seed node configuration when cross-chaining is required")])]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("cross.listener.port")]),e._v(" "),a("td"),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("network")]),e._v(" "),a("td",[e._v("nuls.magic.number")]),e._v(" "),a("td"),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("contract")]),e._v(" "),a("td",[e._v("nrc20.file.path")]),e._v(" "),a("td"),e._v(" "),a("td",[e._v("NRC20 protocol description json file path")])]),e._v(" "),a("tr",[a("td",[e._v("tx")]),e._v(" "),a("td",[e._v("data.folder")]),e._v(" "),a("td",[e._v("data subfolder")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("Ledger")]),e._v(" "),a("td",[e._v("data.folder")]),e._v(" "),a("td",[e._v("data subfolder")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("api")]),e._v(" "),a("td",[e._v("mongodb.ip")]),e._v(" "),a("td",[e._v("mongodb address")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("api")]),e._v(" "),a("td",[e._v("mongodb.port")]),e._v(" "),a("td",[e._v("mongodbport")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("api")]),e._v(" "),a("td",[e._v("rpc.listener.ips")]),e._v(" "),a("td",[e._v("rpc listener ip")]),e._v(" "),a("td",[e._v("can configure multiple")])]),e._v(" "),a("tr",[a("td",[e._v("api")]),e._v(" "),a("td",[e._v("rpc.port")]),e._v(" "),a("td",[e._v("rpc listening port")]),e._v(" "),a("td")]),e._v(" "),a("tr",[a("td",[e._v("api")]),e._v(" "),a("td",[e._v("req.allow.per.s")]),e._v(" "),a("td",[e._v("Concurrency Limits")]),e._v(" "),a("td")])])]),e._v(" "),a("p",[e._v("The table lists the most common configuration items, not all. After the alpha version and the beta version, the team will sort out the list of available configurations for all NULS 2.0 for the majority of blockchain developers to configure their own areas. Blockchain.")]),e._v(" "),a("blockquote",[a("p",[e._v("[^Note]: Since the NULS2.0-alpha version does not complete the docking of Nulstar, the individual parameters may be modified later, which is subject to the final online version.")])]),e._v(" "),a("p",[e._v("### 3 Packaging and booting")]),e._v(" "),a("p",[e._v("After the configuration items of the chain have been modified, you can directly refer to Part 4 of this document: [Packing and Booting] (#Packing and Booting)")]),e._v(" "),a("h2",{attrs:{id:"building-a-blockchain-containing-business-modules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#building-a-blockchain-containing-business-modules","aria-hidden":"true"}},[e._v("#")]),e._v(" Building a blockchain containing business modules")]),e._v(" "),a("p",[e._v("After building your own blockchain using the modular infrastructure of NULS 2.0, you need to develop a business module and integrate it into the base chain to achieve your own unique business. The following sections can provide some guidance on how to develop a business module of your own.")]),e._v(" "),a("h3",{attrs:{id:"_1-business-module-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-business-module-description","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 Business Module Description")]),e._v(" "),a("h4",{attrs:{id:"_1-1-what-is-a-business-module"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-what-is-a-business-module","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.1 What is a business module?")]),e._v(" "),a("p",[e._v("A functional module with a custom service based on the bottom of the blockchain. The module can be a microservice module that can communicate with other modules according to the NULS2.0 module protocol, or can be an independent, only through the RPC interface. External application for basic module communication.")]),e._v(" "),a("p",[e._v("The service module does not add or modify the protocol, only extends the basic protocol, and implements its own business through the extension of the protocol.")]),e._v(" "),a("h4",{attrs:{id:"_1-2-how-to-extend-the-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-how-to-extend-the-agreement","aria-hidden":"true"}},[e._v("#")]),e._v(" 1.2 How to extend the agreement")]),e._v(" "),a("p",[e._v("NULS provides two ways to extend the protocol. The two methods are similar, as follows:")]),e._v(" "),a("ul",[a("li",[e._v("Expand by remark field of transfer transaction")])]),e._v(" "),a("p",[e._v("Serialize the data you want to wind up into a byte array and place it in the remark field of the transfer transaction. Place your own magic number at the very beginning of the byte array to distinguish other transfer transactions. Monitor the transfer transactions in all blocks in your own application, and parse and process the business when you find remarks that start with your own magic number.")]),e._v(" "),a("ul",[a("li",[e._v("Expanded through established business expansion transactions")])]),e._v(" "),a("p",[e._v("NULS provides a specific transaction type for business expansion. The transaction can freely fill in txData, serialize the data to be chained, into a byte array, and put it into the txData of the transfer transaction. Place your own magic numbers in front of the byte array to distinguish between transactions that are not of interest. Monitor the business extension transactions in all blocks in your own application, and find txData with its own module number for parsing and business processing.")]),e._v(" "),a("p",[a("strong",[e._v("Example:")])]),e._v(" "),a("p",[e._v("Suppose now that an application is to be implemented, the application's business is: private notepad, the core business is that each address can store the encrypted note text on the blockchain, and can be decrypted and viewed at any time.")]),e._v(" "),a("p",[e._v("1 functional design")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("1. Add a note: Encrypt the note content and send the encrypted data to the chain;\n\n2. Parse the block data extraction note data: obtain the data of the application from the blockchain, and store the data to the local database;\n\n3. Decrypt view: Get records from the database, decrypt, display decryption results\n\n4. Delete the note: the app is deleted locally, and the data in the blockchain is not deleted.\n")])])]),a("p",[e._v("2 blockchain interaction")]),e._v(" "),a("p",[e._v("The above function design needs to interact with the blockchain is 1 new note and 2 parsing block data extraction note data.")]),e._v(" "),a("ul",[a("li",[e._v("The implementation of the first function is as follows:")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('First design the data format as follows\n\n{\n\n  Address:"", / / ​​note owner\n\n  Time:"", / / ​​note time point\n\n  Content:""//Encrypted note content\n\n}\n\nAccording to the data format, assemble the uplink data: address+time+content;\n\nDetermine the magic number of the app, assuming 12345678.\n\nThen assemble the DataTransaction (business extension transaction), set the value of txData to the spliced ​​byte array of 12345678, address, time, content. After paying a sufficient fee, sign the transaction and broadcast the transaction to the network.\n')])])]),a("ul",[a("li",[e._v("The implementation of the second function is as follows:")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Listen to all the blocks, find the 'business expansion transaction' to analyze, first parse to txData, first determine whether it has started 12345678,\nIf not, discard the transaction. If yes, continue to parse and determine if address+time+content was successfully obtained (to avoid data confusion caused by repeated magic numbers)\nIf the data is successfully parsed, store the data in a local database\n")])])]),a("p",[e._v("3 other business implementation")]),e._v(" "),a("p",[e._v("All services that do not need to interact with the blockchain can be designed through conventional application methods, so that a simple blockchain application is completed.")]),e._v(" "),a("blockquote",[a("p",[e._v("Developing applications using business extensions is a simple, fast and efficient way. NULS's support for business expansion is full and friendly, and it is hoped that more and more people will join the NULS ecosystem.")])]),e._v(" "),a("h3",{attrs:{id:"_2-demand-analysis"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-demand-analysis","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 Demand Analysis")]),e._v(" "),a("p",[e._v("Before you start developing modules, you must first identify a few issues:")]),e._v(" "),a("ul",[a("li",[e._v("What kind of functions do you need?")]),e._v(" "),a("li",[e._v("Is it necessary to add modules to achieve business needs? Can it be implemented in an easier way with existing features?")]),e._v(" "),a("li",[e._v("In which way is this module implemented?")]),e._v(" "),a("li",[e._v("Ways to extend the basic protocol: no longer add new protocols, expand your own business based on the basic agreement to meet your own needs.")]),e._v(" "),a("li",[e._v("Add a new protocol method: you need to add a new protocol, the business logic corresponding to the new protocol, in order to meet your own needs.")]),e._v(" "),a("li",[e._v("Modify the basic chain: The above two can not achieve their own business, you need to modify the basic module to meet your own needs.")])]),e._v(" "),a("h3",{attrs:{id:"_3-module-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-module-design","aria-hidden":"true"}},[e._v("#")]),e._v(" 3 Module Design")]),e._v(" "),a("p",[e._v("After you have identified your needs, you need to design your own modules. The module design depends on the overall design of NULS2.0. When designing its own module, it can focus on designing its own business, and other parts are implemented according to the basic module.")]),e._v(" "),a("p",[e._v("So how do you design your own business? for example:")]),e._v(" "),a("h4",{attrs:{id:"_3-1-ways-to-extend-the-basic-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-ways-to-extend-the-basic-protocol","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.1 Ways to extend the basic protocol:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Case I: Our need is just to store some key information in the chain without complicated logic processing.\nFor example, we just want to store a contract related information in the chain, and can be queried at any time in the chain. At this time, we actually don't have to develop any modules. Nuls2.0 provides a transaction (DataTransaction) for storing data. The user only needs to convert the data into a byte array and store it in the txData field or remark field of the transaction. After the broadcast transaction to the whole network, the data can be successful. Winding up. Through the query trading interface provided by nuls2.0, you can query the relevant data of transactions and transactions at any time. Such other business functions can be designed and developed in the form of general software.\n\nCase II: Our needs need to store some key information on the chain and require simple logic processing.\nIn general, we recommend users to consider using smart contracts to develop DAPP, such as simple quiz games.\n")])])]),a("h4",{attrs:{id:"_3-2-how-to-add-a-new-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-how-to-add-a-new-agreement","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.2 How to add a new agreement")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("If our requirements are complex and have related logic processes, we must do so by adding new protocols.\nHere we use the nuls poc consensus mechanism to give examples\nFunctional design: first organize the functions to be provided according to the requirements, and design new protocols according to the functions.\nThe business functions of the nuls poc consensus mechanism are:\n1. The user can create a consensus node by sending a request for the consensus node transaction, and lock the 2-20 million nuls. After the node meets the block condition, it can participate in the package and get the block reward.\n2. Users can participate in the consensus by sending at least 2000 nuls by sending a transaction that joins the consignment consensus, and get a block reward.\n3. The user can unlock the nuls locked by the consignment consensus by sending a transaction that cancels the entrusted consensus. After canceling the entrustment, the reward will not be continued.\n4. The user can send the transaction to let the node exit the consensus. After exiting, all the nuls on the node will be unlocked, and the node will no longer participate in the block.\n\nProtocol design: including protocol serialization and deserialization, transaction validator, transaction confirmation processor, transaction rollback processor, need to pay attention to avoid conflicts with the underlying protocol.\n4 protocols of the poc consensus mechanism: create consensus node transactions, commission transactions, cancel commission transactions, node exit consensus transactions\nTransaction Verifier: Each protocol will have an associated business verifier. When the node receives a new transaction or receives a new block, it will execute the verifier, and the failed transaction will be rejected.\nFor example, create a consensus node:\n1) The account that creates the node cannot create the consensus node multiple times;\n2) The margin is between 20,000 and 200,000 nuls;\n3) Whether the account has a red card record;\nStorage design: Stores business data in the protocol as formatted data for providing user functions.\nFor example, after creating a consensus node, the bottom layer stores the transaction data of the created node, and also stores related information of the node, such as the name of the consensus node, the current total amount of the consensus node, the credit value of the consensus node, etc.\n\nInterface design: RPC interface that needs to be provided externally\nFor example: query consensus node information, query consensus delegation information, etc.\n\nOther: Other internal processing mechanisms are implemented within the module itself according to different business needs. For example, the core processing of the poc consensus is in the ConsensusProcess.\n")])])]),a("h4",{attrs:{id:"_3-3-how-to-modify-the-base-chain"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-how-to-modify-the-base-chain","aria-hidden":"true"}},[e._v("#")]),e._v(" 3.3 How to modify the base chain")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("This method differs from the second method only in that it involves the modification of the basic chain. When modifying, you need to fully understand the services of the basic chain. After adapting your own services, you need to perform sufficient tests.\nThe modified method can be the way to replace the module: get the source code of the base chain module, modify it, and then release its own module to replace the original base module.\n")])])]),a("h3",{attrs:{id:"_4-module-implementation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-module-implementation","aria-hidden":"true"}},[e._v("#")]),e._v(" 4 Module implementation")]),e._v(" "),a("p",[e._v("First of all, the module consists of the following two parts. For the first part, the official version only provides the Java version of lib, and will continue to provide C++, Go and other language versions.")]),e._v(" "),a("p",[e._v("1 nuls-service-base-lib (baselib):")]),e._v(" "),a("p",[e._v("Common, all modules have the same functionality, providing basic communication, interface format, general code, etc. If the developer uses a language that does not provide baselib, you need to develop baselib yourself.")]),e._v(" "),a("p",[e._v("2 module-self:")]),e._v(" "),a("p",[e._v("The module itself needs to make its own implementation in the following ways:")]),e._v(" "),a("ul",[a("li",[e._v("Module management")])]),e._v(" "),a("p",[e._v("1. Start and stop the script: Provide the module's start and stop scripts in your own module, and ensure that any timing to execute the start and stop scripts will not have a significant impact on the business and data.")]),e._v(" "),a("p",[e._v("2. After the startup, the state management is firstly connected to the Nulstar (microservice manager) through the startup parameters, reporting the information of the module itself, obtaining the information of the dependent module, attempting to communicate with the dependent module, and completing the initialization of the module during this period. And change the state of your own module. After all the modules that are dependent are ready, start running the business of your own module.")]),e._v(" "),a("p",[e._v("3. After the dependent module status changes, the module should be processed according to the changed status.")]),e._v(" "),a("ul",[a("li",[e._v("Agreement related")])]),e._v(" "),a("p",[e._v("After a new transaction is created in the module, it is necessary to register its own protocol information with the transaction management module each time the module is started, and report the transaction verifier, confirmation processor, and rollback processor information.")]),e._v(" "),a("ul",[a("li",[e._v("Network message")])]),e._v(" "),a("p",[e._v("After the new module adds the network protocol, the network module needs to subscribe to the message of the network that it needs, so that the network module can send the message to the message processor of the module after receiving the message.")]),e._v(" "),a("ul",[a("li",[e._v("data storage")])]),e._v(" "),a("p",[e._v("NULS2.0 does not impose any restrictions on data storage, and can freely design and implement its own data storage function according to its own business needs.")]),e._v(" "),a("ul",[a("li",[e._v("Function realization")])]),e._v(" "),a("p",[e._v("If there are other functions that need to be implemented, you can develop according to your own habits or industry standard specifications. NULS2.0 does not impose any restrictions.")]),e._v(" "),a("ul",[a("li",[e._v("Function interface")])]),e._v(" "),a("p",[e._v("According to the product design, the implementation of the function interface, NULS2.0 will provide a unified interface call mode, and will support access methods such as JSONRPC2.0/restFul/CMD/WebSocket.")]),e._v(" "),a("ul",[a("li",[e._v("Logging")])]),e._v(" "),a("p",[e._v("In principle, NULS2.0 does not limit the logging mode of the expansion module. However, it is recommended to collect all the logs into one root directory by referring to the basic chain, which is convenient for backup and viewing.")]),e._v(" "),a("p",[e._v("Summary: The extension of the business module can refer to the underlying infrastructure chain. All modules are equal in the architecture of NULS2.0. If you are unclear, you can learn or copy the solution of the basic module by looking at the basic module code. The follow-up will continue to open up some of the project's extension modules, so that developers can learn from it, making the development module more and more simple.")]),e._v(" "),a("h3",{attrs:{id:"_5-defining-your-own-agreement"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-defining-your-own-agreement","aria-hidden":"true"}},[e._v("#")]),e._v(" 5 Defining your own agreement")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("The principle of the design agreement: data is streamlined, do not add redundant data in the protocol, and reduce the data size as much as possible.")])]),e._v(" "),a("li",[a("p",[e._v("Network messages: message formats, serialization methods, deserialization methods, computational data size methods, subscription interfaces, and logical processors.")])]),e._v(" "),a("li",[a("p",[e._v("Trading: transaction format, serialization method, deserialization method, calculation data size method, validator, processor, rollback processor, etc.")])])]),e._v(" "),a("h3",{attrs:{id:"_6-debugging"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-debugging","aria-hidden":"true"}},[e._v("#")]),e._v(" 6 Debugging")]),e._v(" "),a("p",[e._v("After the design and development work is completed, it is inevitable to test. This part does not include the unit test part of the development process. Only the methods and precautions of the integration test are explained here.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("1 Start all modules through NULSTAR to see if their new modules can be started and stopped normally.\n\n2 Test whether the transaction of the newly added module can be sent, and whether various interfaces can be called normally;\n\n3 The main network test, whether the block can be packaged normally, whether the new transaction can be confirmed or rolled back;\n\n4 check the transaction verification logic is rigorous, do not appear security loopholes;\n\n5 Test whether the business of its own module is correct and complete.\n")])])]),a("p",[e._v("After all the tests are completed, you can enter the packaging and startup phase.")]),e._v(" "),a("h2",{attrs:{id:"packing-and-launching"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#packing-and-launching","aria-hidden":"true"}},[e._v("#")]),e._v(" Packing and launching")]),e._v(" "),a("h3",{attrs:{id:"_1-packaging"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-packaging","aria-hidden":"true"}},[e._v("#")]),e._v(" 1 Packaging")]),e._v(" "),a("p",[e._v("NULS2.0 has its own code packaging mechanism. Because it involves different languages ​​and different development environments, we have developed a unique packaging specification. Please ensure that the new development module follows the packaging specification and has provided the dependencies, scripts, etc. required by the specification. Components and testing the packaging process")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Cd /home/nuls2/nuls_2.0\n./package.sh -m\n")])])]),a("p",[e._v("After confirming that there is no problem, complete the development of the blockchain, you can hand over the packaged package to the relevant parties for public testing. After testing for a period of time, no problem can be found, you can formally assemble the blockchain network and start your own business. .")]),e._v(" "),a("h3",{attrs:{id:"_2-startup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-startup","aria-hidden":"true"}},[e._v("#")]),e._v(" 2 Startup")]),e._v(" "),a("ul",[a("li",[e._v("Compiled successfully will generate the following path file")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("/home/nuls2/nuls_2.0/RELEASE/bin\n")])])]),a("ul",[a("li",[e._v("Execute the following command to start all modules in batches with one click")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Cd /home/nuls2/nuls_2.0/RELEASE/bin\n./start.sh -c ./moudle.json (specify the moudle.json configuration file to start)\n")])])]),a("ul",[a("li",[e._v("linux command jps view all module processes:")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws\n ```\n\n- View module startup status\n\n")])])]),a("p",[e._v("./checkstatus.sh")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("\n- Stop Engineering Module:\n")])])]),a("p",[e._v("Kill process number (the process number corresponds to the process of the mykernel module displayed by jps)")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code")])])])}],o=n(0),s=Object(o.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);s.options.__file="howToUseNulsBuildChain.md";t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/68.c1f2396d.js b/docs/.vuepress/dist/assets/js/68.c1f2396d.js new file mode 100644 index 00000000..43dfb5ea --- /dev/null +++ b/docs/.vuepress/dist/assets/js/68.c1f2396d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{386:function(_,t,v){_.exports=v.p+"assets/img/clip_image002.425eb96f.jpg"},957:function(_,t,v){"use strict";v.r(t);var a=[function(){var _=this,t=_.$createElement,a=_._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"alpha-如何使用nuls搭建区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#alpha-如何使用nuls搭建区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" [Alpha]如何使用NULS搭建区块链")]),_._v(" "),a("h2",{attrs:{id:"nuls2-0-开发环境搭建"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-开发环境搭建","aria-hidden":"true"}},[_._v("#")]),_._v(" NULS2.0 开发环境搭建")]),_._v(" "),a("p",[_._v("NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。")]),_._v(" "),a("p",[_._v("1 环境准备")]),_._v(" "),a("ul",[a("li",[_._v("安装JDK")]),_._v(" "),a("li",[_._v("安装Maven")]),_._v(" "),a("li",[_._v("安装IntelliJ IDEA开发工具")]),_._v(" "),a("li",[_._v("安装git")])]),_._v(" "),a("p",[_._v("2 clone源代码")]),_._v(" "),a("p",[_._v("git clone "),a("a",{attrs:{href:"mailto:git@github.com"}},[_._v("git@github.com")]),_._v(":nuls-io/nuls_2.0.git")]),_._v(" "),a("p",[_._v("3 IDEA导入nuls_2.0中所有maven项目")]),_._v(" "),a("p",[_._v("4 建立自己的maven项目")]),_._v(" "),a("p",[_._v("5 运行所有需要启动的模块")]),_._v(" "),a("h2",{attrs:{id:"使用nuls2-0核心模块搭建基础链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#使用nuls2-0核心模块搭建基础链","aria-hidden":"true"}},[_._v("#")]),_._v(" 使用NULS2.0核心模块搭建基础链")]),_._v(" "),a("p",[_._v("NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。")]),_._v(" "),a("p",[_._v("NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。")]),_._v(" "),a("h3",{attrs:{id:"_1-理解nuls-2-0的微服务架构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-理解nuls-2-0的微服务架构","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 理解NULS 2.0的微服务架构")]),_._v(" "),a("p",[a("img",{attrs:{src:v(386),alt:"img"}})]),_._v(" "),a("p",[_._v("NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。")]),_._v(" "),a("p",[_._v("因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。")]),_._v(" "),a("p",[_._v("理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。")]),_._v(" "),a("h3",{attrs:{id:"_2-修改基础配置信息"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-修改基础配置信息","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 修改基础配置信息")]),_._v(" "),a("p",[_._v("一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。")]),_._v(" "),a("p",[_._v("NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf")]),_._v(" "),a("p",[_._v("modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:")]),_._v(" "),a("table",[a("thead",[a("tr",[a("th",[_._v("section")]),_._v(" "),a("th",[_._v("param")]),_._v(" "),a("th",[_._v("name")]),_._v(" "),a("th",[_._v("remark")])])]),_._v(" "),a("tbody",[a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("chain.id")]),_._v(" "),a("td",[_._v("本链id")]),_._v(" "),a("td",[_._v("Uint16,NULS主网为1,测试网为2")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("address.prefix")]),_._v(" "),a("td",[_._v("地址前缀")]),_._v(" "),a("td",[_._v("大小字母+数字,2-5个字符")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("data.root.dir")]),_._v(" "),a("td",[_._v("数据存储路径")]),_._v(" "),a("td",[_._v("为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("encoding")]),_._v(" "),a("td",[_._v("编码方式")]),_._v(" "),a("td",[_._v("默认UTF-8,不建议修改")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("asset.id")]),_._v(" "),a("td",[_._v("本来主资产编码")]),_._v(" "),a("td",[_._v("NULS为1")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.root.dir")]),_._v(" "),a("td",[_._v("日志根目录")]),_._v(" "),a("td",[_._v("用于存放各个模块的日志文件")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.level")]),_._v(" "),a("td",[_._v("日志级别")]),_._v(" "),a("td",[_._v("日志打印级别debug/info/warn/error.")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储block模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td",[_._v("区块大小限制,避免太大区块太高参与门槛")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("max.rollback")]),_._v(" "),a("td",[_._v("最大回滚数量")]),_._v(" "),a("td",[_._v("当超过这个数量后,系统将停止回滚,避免出现重大问题")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("header.extend.max.size")]),_._v(" "),a("td",[_._v("扩展最大size")]),_._v(" "),a("td",[_._v("区块头中的扩展字段的大小限制")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("genesis.block.json.path")]),_._v(" "),a("td",[_._v("创世块描述文件")]),_._v(" "),a("td",[_._v("创世块的描述文件")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储共识模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("inflation.token.count")]),_._v(" "),a("td",[_._v("每年增发数量")]),_._v(" "),a("td",[_._v("增发数量用于通过coinbase交易奖励给节点")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("seed.addresses")]),_._v(" "),a("td",[_._v("共识种子地址")]),_._v(" "),a("td",[_._v('多个地址用","分隔')])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.address.pwd")]),_._v(" "),a("td",[_._v("地址密码")]),_._v(" "),a("td",[_._v("用于打包的地址的密码")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最小保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最大保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最大值,不能大于100")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最小值")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("单笔委托最小金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.total.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("节点接受委托的最大金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.token.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("当节点的委托达到该值则开始出块")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("red.punish.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("红牌锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.stop.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("停止节点锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("seeds")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v('种子节点,多个之间用","隔开')])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("magic.number")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("魔法数字,用于隔离其他网络")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("port")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("端口")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.seed")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("需要进行跨链时,配置NULS2.0种子节点")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("cross.listener.port")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.magic.number")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("contract")]),_._v(" "),a("td",[_._v("nrc20.file.path")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("NRC20协议描述json文件路径")])]),_._v(" "),a("tr",[a("td",[_._v("tx")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("Ledger")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.ip")]),_._v(" "),a("td",[_._v("mongodb地址")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.port")]),_._v(" "),a("td",[_._v("mongodb端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.listener.ips")]),_._v(" "),a("td",[_._v("rpc监听ip")]),_._v(" "),a("td",[_._v("可以配置多个")])]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.port")]),_._v(" "),a("td",[_._v("rpc监听端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("req.allow.per.s")]),_._v(" "),a("td",[_._v("并发限制")]),_._v(" "),a("td")])])]),_._v(" "),a("p",[_._v("表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。")]),_._v(" "),a("blockquote"),_._v(" "),a("h3",{attrs:{id:"_3-打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 打包和启动")]),_._v(" "),a("p",[_._v("链的配置项修改完成后,则可直接参考本文档的第4部分:"),a("a",{attrs:{href:"#%E6%89%93%E5%8C%85%E5%92%8C%E5%90%AF%E5%8A%A8"}},[_._v("打包和启动")])]),_._v(" "),a("h2",{attrs:{id:"搭建包含业务模块的区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#搭建包含业务模块的区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" 搭建包含业务模块的区块链")]),_._v(" "),a("p",[_._v("在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。")]),_._v(" "),a("h3",{attrs:{id:"_1-业务模块说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-业务模块说明","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 业务模块说明")]),_._v(" "),a("h4",{attrs:{id:"_1-1-何为业务模块"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-何为业务模块","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.1 何为业务模块")]),_._v(" "),a("p",[_._v("基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。")]),_._v(" "),a("p",[_._v("业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。")]),_._v(" "),a("h4",{attrs:{id:"_1-2-如何扩展协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-如何扩展协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.2 如何扩展协议")]),_._v(" "),a("p",[_._v("NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:")]),_._v(" "),a("ul",[a("li",[_._v("通过转账交易的remark字段进行扩展")])]),_._v(" "),a("p",[_._v("将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。")]),_._v(" "),a("ul",[a("li",[_._v("通过制定的业务扩展交易进行扩展")])]),_._v(" "),a("p",[_._v("NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。")]),_._v(" "),a("p",[a("strong",[_._v("示例:")])]),_._v(" "),a("p",[_._v("假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。")]),_._v(" "),a("p",[_._v("1 功能设计")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;\n\n2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;\n\n3. 解密查看:从数据库中获取记录,解密,展示解密结果\n\n4. 删除记事:app本地删除,不删除区块链中数据\n")])])]),a("p",[_._v("2 区块链交互")]),_._v(" "),a("p",[_._v("以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。")]),_._v(" "),a("ul",[a("li",[_._v("第一个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v('首先设计数据格式,如下\n\n{\n\n address:"",//记事所属人\n\n time:"",//记事时间点\n\n content:""//加密后的记事内容\n\n}\n\n根据数据格式,组装上链数据:address+time+content;\n\n确定应用的魔法数字,假设为12345678.\n\n则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。\n')])])]),a("ul",[a("li",[_._v("第二个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,\n如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)\n如果成功解析了数据,则将数据存储到本地数据库中\n")])])]),a("p",[_._v("3 其他业务实现")]),_._v(" "),a("p",[_._v("所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。")]),_._v(" "),a("blockquote",[a("p",[_._v("使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。")])]),_._v(" "),a("h3",{attrs:{id:"_2-需求分析"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-需求分析","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 需求分析")]),_._v(" "),a("p",[_._v("在动手开发模块之前,首先要确定几个问题:")]),_._v(" "),a("ul",[a("li",[_._v("自己需要的是什么样的功能?")]),_._v(" "),a("li",[_._v("是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?")]),_._v(" "),a("li",[_._v("用哪种方式实现这个模块?\n"),a("ul",[a("li",[_._v("扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。")]),_._v(" "),a("li",[_._v("增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要")]),_._v(" "),a("li",[_._v("修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。")])])])]),_._v(" "),a("h3",{attrs:{id:"_3-模块设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-模块设计","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 模块设计")]),_._v(" "),a("p",[_._v("在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。")]),_._v(" "),a("p",[_._v("那么如何设计自己的业务?举例说明:")]),_._v(" "),a("h4",{attrs:{id:"_3-1-扩展基础协议的方式:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-扩展基础协议的方式:","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.1 扩展基础协议的方式:")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。\n比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。\n\n第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。\n一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。\n")])])]),a("h4",{attrs:{id:"_3-2-新增协议的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-新增协议的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.2 新增协议的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。\n这里我们就用nuls的poc共识机制来举例\n功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。\nnuls的poc共识机制的业务功能有:\n1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。\n2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。\n3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。\n4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。\n\n协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。\npoc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易\n交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。\n例如创建共识节点:\n\t1)创建节点的账户不能重复多次创建共识节点;\n\t2)保证金在2-20万nuls之间;\n\t3)账户是否有过红牌记录;\n存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。\n例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等\n\n接口设计:需要对外提供的RPC接口\n例如:查询共识节点信息,查询共识委托信息等\n\n其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里\n")])])]),a("h4",{attrs:{id:"_3-3-修改基础链的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-修改基础链的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.3 修改基础链的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。\n修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。\n")])])]),a("h3",{attrs:{id:"_4-模块实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-模块实现","aria-hidden":"true"}},[_._v("#")]),_._v(" 4 模块实现")]),_._v(" "),a("p",[_._v("首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。")]),_._v(" "),a("p",[_._v("1、nuls-service-base-lib(baselib):")]),_._v(" "),a("p",[_._v("通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。")]),_._v(" "),a("p",[_._v("2、module-self:")]),_._v(" "),a("p",[_._v("模块本身,在一下几方面需要做出自己的实现:")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("模块管理")]),_._v(" "),a("p",[_._v("1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。")]),_._v(" "),a("p",[_._v("2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。")]),_._v(" "),a("p",[_._v("3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理")])]),_._v(" "),a("li",[a("p",[_._v("协议相关")]),_._v(" "),a("p",[_._v("当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息")]),_._v(" "),a("p",[_._v("当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。")])]),_._v(" "),a("li",[a("p",[_._v("数据存储")]),_._v(" "),a("p",[_._v("NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。")])]),_._v(" "),a("li",[a("p",[_._v("功能实现")]),_._v(" "),a("p",[_._v("如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。")])]),_._v(" "),a("li",[a("p",[_._v("功能接口")]),_._v(" "),a("p",[_._v("根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。")])]),_._v(" "),a("li",[a("p",[_._v("日志记录")]),_._v(" "),a("p",[_._v("NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。")])])]),_._v(" "),a("p",[_._v("总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。")]),_._v(" "),a("h3",{attrs:{id:"_5-定义自己的协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-定义自己的协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 5 定义自己的协议")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。")])]),_._v(" "),a("li",[a("p",[_._v("交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。")])])]),_._v(" "),a("h3",{attrs:{id:"_6-调试"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-调试","aria-hidden":"true"}},[_._v("#")]),_._v(" 6 调试")]),_._v(" "),a("p",[_._v("完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;\n\n2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;\n\n3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;\n\n4、检查交易验证逻辑是否严谨,不要出现安全漏洞;\n\n5、测试自身模块的业务是否正确、完整。\n")])])]),a("p",[_._v("全部测试都完成后,便可进入打包和启动阶段了")]),_._v(" "),a("h2",{attrs:{id:"打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 打包和启动")]),_._v(" "),a("h3",{attrs:{id:"_1-打包"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-打包","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 打包")]),_._v(" "),a("p",[_._v("NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0\n./package.sh -m\n")])])]),a("p",[_._v("确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。")]),_._v(" "),a("h3",{attrs:{id:"_2-启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 启动")]),_._v(" "),a("ul",[a("li",[_._v("编译成功 会生成如下路径文件")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("/home/nuls2/nuls_2.0/RELEASE/bin\n")])])]),a("ul",[a("li",[_._v("执行如下命令,即可一键批量启动所有模块")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0/RELEASE/bin\n./start.sh -c ./moudle.json(指定moudle.json配置文件启动)\n")])])]),a("ul",[a("li",[_._v("linux指令 jps 查看所有模块进程:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v(" ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws\n")])])]),a("ul",[a("li",[_._v("查看模块启动状态")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("./checkstatus.sh \n")])])]),a("ul",[a("li",[_._v("停止 工程模块:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("kill 进程号(进程号对应jps显示出来的 mykernel 模块的进程)\n")])])])])}],s=v(0),e=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);e.options.__file="howToUseNulsBuildChain.md";t.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/69.f64d6dc5.js b/docs/.vuepress/dist/assets/js/69.f64d6dc5.js new file mode 100644 index 00000000..4b6c281e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/69.f64d6dc5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{413:function(e,t,a){e.exports=a.p+"assets/img/image-20190103193901967.35788ccc.png"},975:function(e,t,a){"use strict";a.r(t);var n=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"how-to-build-a-private-chain-based-on-nuls"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#how-to-build-a-private-chain-based-on-nuls","aria-hidden":"true"}},[e._v("#")]),e._v(" How to build a private chain based on NULS")]),e._v(" "),n("h2",{attrs:{id:"introduction"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[e._v("#")]),e._v(" Introduction")]),e._v(" "),n("p",[e._v("This tutorial guides you to build a private chain based on NULS source code, to make is easier for users to learn about the operation, development or experiment of the NULS Blockchain. By building a chain to fully understand the operation of each node and data interaction, we can better grasp the overall operating mechanism of the NULS Blockchain, which is conducive to further research. We assume that readers have the skills to set up and debug a Java development environment.")]),e._v(" "),n("h2",{attrs:{id:"setting-up-environment"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#setting-up-environment","aria-hidden":"true"}},[e._v("#")]),e._v(" Setting up environment")]),e._v(" "),n("ul",[n("li",[e._v("Operating systems: macOS, Windows")]),e._v(" "),n("li",[e._v("Build Tools: Maven")]),e._v(" "),n("li",[e._v("Development Tools: IntelliJ IDEA")]),e._v(" "),n("li",[e._v("NULS source code on github: https://github.com/nuls-io/nuls")])]),e._v(" "),n("h2",{attrs:{id:"beginning"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#beginning","aria-hidden":"true"}},[e._v("#")]),e._v(" Beginning")]),e._v(" "),n("p",[e._v("Since blockchain is a decentralized network composed of multiple nodes, we will take a private chain with three nodes as an example. Although we recommend using a Linux server to run the NULS main-net consensus node, in this tutorial, we choose macOS system that can set up a Java development environment to run and debug nodes.")]),e._v(" "),n("h2",{attrs:{id:"development-environment"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#development-environment","aria-hidden":"true"}},[e._v("#")]),e._v(" Development environment")]),e._v(" "),n("p",[e._v("First, clone the NULS source code using IntelliJ IDEA and open the project. Make sure JDK is the jdk1.8 version and Maven is configured correctly.")]),e._v(" "),n("h2",{attrs:{id:"steps-to-build"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#steps-to-build","aria-hidden":"true"}},[e._v("#")]),e._v(" Steps to build")]),e._v(" "),n("ol",[n("li",[e._v("Open the module.ini file, which is the configuration file for joining or building the network. In this tutorial, it is the configuration information of the NULS test-net.")])]),e._v(" "),n("p",[n("img",{attrs:{src:a(413),alt:"image-20190103193901967"}})]),e._v(" "),n("ol",{attrs:{start:"2"}},[n("li",[e._v("We will use three nodes to build a private chain. First we need to prepare devices (virtual machine works) for three nodes to run.")])]),e._v(" "),n("ul",[n("li",[e._v("Node A: 192.168.1.1")]),e._v(" "),n("li",[e._v("Node B: 192.168.1.2")]),e._v(" "),n("li",[e._v("Node C: 192.168.1.3")])]),e._v(" "),n("p",[e._v("We also need to set up a seed node to maintain the operation of the blockchain, i.e., to package and forge blocks. In addition, we need to prepare a block-forging address (including private key, to import into the seed node), which can be prepared in advance.")]),e._v(" "),n("p",[e._v("In this tutorial, the initial block-forging address we prepare is:\n"),n("code",[e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")])]),e._v(" "),n("p",[e._v('PS: You may find that the first few letters of the address we prepare differs from those of the test-net address in the figure, which is for the sake of distinguishing the test-net address from the main-net address, so as to avoid confusion that may result in adverse consequences. Specifically, we set the test-net address to start with "TT" and the main-net address to start with "Ns". This tutorial uses the NULS main-branch code, so the address starts with "Ns". If you prefer to custom the starting letters of the private-chain account address, you can try to modify the '),n("code",[e._v("chain.id")]),e._v(" parameter in the nuls.ini file. The parameters of the same chain must be in consistence.")]),e._v(" "),n("ol",{attrs:{start:"3"}},[n("li",[e._v("Assuming node A is the seed node, then modify the network and consensus sections of the module.ini configuration file of three nodes A, B and C according to the following configuration:")])]),e._v(" "),n("div",{staticClass:"language-ini extra-class"},[n("pre",{pre:!0,attrs:{class:"language-ini"}},[n("code",[n("span",{pre:!0,attrs:{class:"token selector"}},[e._v("[network]")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Bootstrap")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.server.port")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("8003")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.magic")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("20190101")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.max.in")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("100")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.max.out")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("10")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Network.seed.ip")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("192.168.1.1:8003")]),e._v("\n\n"),n("span",{pre:!0,attrs:{class:"token selector"}},[e._v("[consensus]")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Bootstrap")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Partake.packing")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("true")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Min.upgrade.delay")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("1000")]),e._v("\n"),n("span",{pre:!0,attrs:{class:"token constant"}},[e._v("Seed.nodes")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("=")]),e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),e._v("\n")])])]),n("ul",[n("li",[e._v("Modify "),n("code",[e._v("work.seed.ip")]),e._v(" to the ip and port of the seed node.")]),e._v(" "),n("li",[e._v("Modify "),n("code",[e._v("seed.nodes")]),e._v(" to the block-forging address.")]),e._v(" "),n("li",[e._v("The consistency of the magic parameters "),n("code",[e._v("network.magic")]),e._v(" of all nodes in the private chain is a must.")])]),e._v(" "),n("ol",{attrs:{start:"4"}},[n("li",[e._v("Run the three nodes separately through IntelliJ IDEA. If you only need to debug one node, the other two nodes can be packaged with maven and sent to a Linux server to run. Remarkably, a jre must be placed in the NULS root directory to run properly.")]),e._v(" "),n("li",[e._v("After launching the three nodes, once the IntelliJ IDEA console has the following log output, it means that the three nodes have successfully formed a private chain network, but it still cannot produce new blocks and the block height is 0. If there is no log output, you need to uncomment the "),n("code",[e._v('')]),e._v(" in logback.xml.")])]),e._v(" "),n("div",{staticClass:"language- extra-class"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[e._v("io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash :xxxxxxx,192.168.1.2:8003,192.168.1.2:8003\n\n")])])]),n("ol",{attrs:{start:"6"}},[n("li",[e._v("Then import the prepared block-forging account "),n("code",[e._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),e._v(" via wallet interface of the seed node A. After a while, you can see the latest height displayed in the console increasing, which indicates that the network is producing new blocks. At the same time, the height of the node B, C will also increase and the height of the three nodes will remain the same. At this point, the setup of the private chain network is completed.")])]),e._v(" "),n("h2",{attrs:{id:"conclusion"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#conclusion","aria-hidden":"true"}},[e._v("#")]),e._v(" Conclusion")]),e._v(" "),n("p",[e._v("This tutorial mainly introduces the easiest way to build a private chain for the development and debugging of NULS, without modification on the source code of NULS. If you want to dig deeper into NULS, you can refer to the relevant documentation of NULS to modify and debug the source code. Maybe you will find more secrets!")])])}],s=a(0),o=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},n,!1,null,null,null);o.options.__file="buildPrivateChain.md";t.default=o.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/7.66c6371d.js b/docs/.vuepress/dist/assets/js/7.66c6371d.js new file mode 100644 index 00000000..4a0d7e40 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/7.66c6371d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{175:function(t,e,a){t.exports=a.p+"assets/img/Install.33ff9464.jpg"},176:function(t,e,a){t.exports=a.p+"assets/img/Install2.23136d69.jpg"},177:function(t,e,a){t.exports=a.p+"assets/img/Install3.145b9c4e.jpg"},178:function(t,e,a){t.exports=a.p+"assets/img/createProject.e78abf06.jpg"},179:function(t,e,a){t.exports=a.p+"assets/img/createProject2.b7246453.jpg"},180:function(t,e,a){t.exports=a.p+"assets/img/code.785ccdb5.jpg"},181:function(t,e,a){t.exports=a.p+"assets/img/Deploy.0f2d2d88.jpg"},182:function(t,e,a){t.exports=a.p+"assets/img/Add.e1d751e6.jpg"},183:function(t,e,a){t.exports=a.p+"assets/img/Add3.fbd88d0f.jpg"},184:function(t,e,a){t.exports=a.p+"assets/img/Add5.dfc1a6d7.jpg"},185:function(t,e,a){t.exports=a.p+"assets/img/package.6fff1f40.jpg"},186:function(t,e,a){t.exports=a.p+"assets/img/package1.e07eba9a.jpg"},187:function(t,e,a){t.exports=a.p+"assets/img/package3.e7db1454.jpg"},188:function(t,e,a){t.exports=a.p+"assets/img/package2.698a4145.jpg"},189:function(t,e,a){t.exports=a.p+"assets/img/package4.a9a579bf.jpg"},190:function(t,e,a){t.exports=a.p+"assets/img/Deploy2.ccca3cbd.jpg"},191:function(t,e,a){t.exports=a.p+"assets/img/Deploy3.131a59dc.jpg"},192:function(t,e,a){t.exports=a.p+"assets/img/Deploy4.ebcdade6.jpg"},193:function(t,e,a){t.exports=a.p+"assets/img/Deploy5.37a2c168.jpg"},194:function(t,e,a){t.exports=a.p+"assets/img/Deploy6.f4b26eb1.jpg"},195:function(t,e,a){t.exports=a.p+"assets/img/Deploy7.e33e7d01.jpg"},871:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"idea-plugin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#idea-plugin","aria-hidden":"true"}},[this._v("#")]),this._v(" IDEA Plugin")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-install-nuls-plugin-on-idea"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-install-nuls-plugin-on-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 Install NULS Plugin on IDEA")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(175),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Select the said ZIP, and click OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(176),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Tick NULS plugin, and click Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(177),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-create-a-nuls-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-a-nuls-project","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 Create a NULS project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(178),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(179),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-compile-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-compile-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 Compile smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(180),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-set-and-deploy-the-node-and-account-for-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-set-and-deploy-the-node-and-account-for-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 Set and deploy the node and account for contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click NULS plugin on the right, and call NULS plugin interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(181),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract.\nRecommendation: Start the local wallet, and add the wallet address as the node address.")]),t._v(" "),s("p",[t._v("Click + on the top left corner of panel, and select Add Node.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(182),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Input Node address and clock OK")]),t._v(" "),s("p",[s("img",{attrs:{src:a(183),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(184),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-package-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-package-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 Package contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code")]),t._v(" "),s("p",[s("img",{attrs:{src:a(185),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).")]),t._v(" "),s("p",[s("img",{attrs:{src:a(186),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(187),alt:"code"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(188),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-deploy-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 Deploy contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(189),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Parameters following JarFilePath are the parameters of the contract construction function.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(190),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(191),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(192),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(193),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Review the deployed contract on the top of panel")]),t._v(" "),s("p",[s("img",{attrs:{src:a(194),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the deployed contract to review all method of this contract")]),t._v(" "),s("p",[s("img",{attrs:{src:a(195),alt:"code"}})])])])}],c=a(0),n=Object(c.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Get NULS plugin"),a("OutboundLink")],1),t._v(" ZIP, and save in disk\nClick File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Input Project name, click finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),a("p",[t._v("Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},s,!1,null,null,null);n.options.__file="ideaPlugin.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/70.1b8f30ff.js b/docs/.vuepress/dist/assets/js/70.1b8f30ff.js new file mode 100644 index 00000000..e8183631 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/70.1b8f30ff.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{515:function(t,a,s){t.exports=s.p+"assets/img/image-20190103193901967.35788ccc.png"},906:function(t,a,s){"use strict";s.r(a);var e=[function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"搭建区块链"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#搭建区块链","aria-hidden":"true"}},[t._v("#")]),t._v(" 搭建区块链")]),t._v(" "),e("h2",{attrs:{id:"简介"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#简介","aria-hidden":"true"}},[t._v("#")]),t._v(" 简介")]),t._v(" "),e("p",[t._v("​\t本教程是基于NULS源代码介绍如何搭建私链,目的是为了方便学习了解NULS区块链网络运行,开发或者实验。自己搭建一条链来全方位的了解各节点是如何运行以及数据交互等,可以更好的把握NULS区块链网络的整体运行机制,有助于更深一步的研究。我们默认本文阅读者是具备Java开发环境的构建和调试技能的。")]),t._v(" "),e("h2",{attrs:{id:"环境搭建"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#环境搭建","aria-hidden":"true"}},[t._v("#")]),t._v(" 环境搭建")]),t._v(" "),e("ul",[e("li",[t._v("操作系统:macOS、Windows")]),t._v(" "),e("li",[t._v("构建工具:Maven")]),t._v(" "),e("li",[t._v("开发工具:IntelliJ IDEA")]),t._v(" "),e("li",[t._v("NULS源码github地址:https://github.com/nuls-io/nuls")])]),t._v(" "),e("h2",{attrs:{id:"开始"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开始","aria-hidden":"true"}},[t._v("#")]),t._v(" 开始")]),t._v(" "),e("p",[t._v("​\t由于区块链是去中心化网络,是由多个节点组成,我们将以3个节点搭建一条私链为例进行介绍。虽然我们建议使用Linux服务器来作为运行NULS主网共识节点的服务器,但由于涉及到开发调试的需求,本文我们将在可以搭建Java开发环境的macOS系统上运行调试节点。")]),t._v(" "),e("h2",{attrs:{id:"开发环境"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开发环境","aria-hidden":"true"}},[t._v("#")]),t._v(" 开发环境")]),t._v(" "),e("p",[t._v("​\t首先使用IntelliJ IDEA克隆NULS源代码,并打开项目。确保Java使用的是jdk1.8,以及Maven工具配置正确。")]),t._v(" "),e("h2",{attrs:{id:"如何搭建"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#如何搭建","aria-hidden":"true"}},[t._v("#")]),t._v(" 如何搭建")]),t._v(" "),e("p",[t._v("​\t1.打开module.ini 文件,该文件为加入或组建网络的配置文件,此示例是NULS测试网的配置信息。")]),t._v(" "),e("p",[e("img",{attrs:{src:s(515),alt:"image-20190103193901967"}})]),t._v(" "),e("p",[t._v("2.我们将用3个节点来搭建一条私链,首先需要准备可供3个节点运行的设备(可以是虚拟机)。")]),t._v(" "),e("ul",[e("li",[t._v("节点A:192.168.1.1")]),t._v(" "),e("li",[t._v("节点B:192.168.1.2")]),t._v(" "),e("li",[t._v("节点C:192.168.1.3")])]),t._v(" "),e("p",[t._v("我们还需要设置一个种子节点,用来进行维持区块链的运行,即打包出块。同时我们还需要准备一个出块地址(包括私钥,用于在种子节点导入该地址),可以事先准备。")]),t._v(" "),e("p",[t._v("本例我们准备的初始出块地址为:"),e("code",[t._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")])]),t._v(" "),e("p",[t._v('PS:如果你比较细心你可能为发现我们准备的地址和图中测试网的地址的开头字母是不一样的,那是为了让用户更容易识别测试网地址和主网地址,以免混淆导致不良后果,我们特意将测试网地址设置为以"TT"开头,将主网地址设置为"Ns"开头,而本教程使用的是NULS主分支代码,所以使用"Ns"开头的地址。如果您想自定义私链的账户地址开头字母,可以尝试修改nuls.ini文件中的'),e("code",[t._v("chain.id")]),t._v("参数,同一条链的节点该参数必须一致。")]),t._v(" "),e("ol",{attrs:{start:"3"}},[e("li",[t._v("假设节点A为种子节点,那么将A、B、C三个节点的module.ini配置文件的network、consensus节都按照以下配置进行修改:")])]),t._v(" "),e("div",{staticClass:"language-ini extra-class"},[e("pre",{pre:!0,attrs:{class:"language-ini"}},[e("code",[e("span",{pre:!0,attrs:{class:"token selector"}},[t._v("[network]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("bootstrap")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("network.server.port")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("8003")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("network.magic")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("20190101")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("network.max.in")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("100")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("network.max.out")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("10")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("network.seed.ip")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("192.168.1.1:8003")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token selector"}},[t._v("[consensus]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("bootstrap")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("partake.packing")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("true")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("min.upgrade.delay")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("1000")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token constant"}},[t._v("seed.nodes")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("=")]),t._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),t._v("\n")])])]),e("ul",[e("li",[t._v("将"),e("code",[t._v("work.seed.ip")]),t._v("修改为种子节点的ip和端口。")]),t._v(" "),e("li",[t._v("将"),e("code",[t._v("seed.nodes")]),t._v("修改为出块地址。")]),t._v(" "),e("li",[t._v("必须保证私链所有节点的魔法参数"),e("code",[t._v("network.magic")]),t._v("一致")])]),t._v(" "),e("ol",{attrs:{start:"4"}},[e("li",[t._v("通过IntelliJ IDEA分别将3个节点运行起来,如果只需要调试其中一个节点,那么其他两个节点可以用maven打包发送到Linux服务器中运行,但是要注意的是需要准备一个jre放到NULS根目录中才能正常运行。")]),t._v(" "),e("li",[t._v("这3个节点启动后直到IntelliJ IDEA控制台有类似以下日志输出,则表示3个节点已近组成一个私有链的网络,但是没有打包出块,高度为0。如果没有日志输出,需要打开logback.xml中"),e("code",[t._v('')]),t._v("的注释。")])]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v("io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash:xxxxxxx,192.168.1.2:8003,192.168.1.2:8003\n\n")])])]),e("ol",{attrs:{start:"6"}},[e("li",[t._v("这时在种子节点A的钱包界面中,导入事先准备的出块账户"),e("code",[t._v("Nse4zpZHsUuU7h5ymv28pcGbwHju3joV")]),t._v(",稍等一会儿,则可以看见控制台的最新高度在增加了,表示网络已经在打包出块了,而与此同时B节点、C节点高度也会增加并且3个节点高度保持一致,此时表示私有链网络已经搭建完成。")])]),t._v(" "),e("h2",{attrs:{id:"总结"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#总结","aria-hidden":"true"}},[t._v("#")]),t._v(" 总结")]),t._v(" "),e("p",[t._v("​\t本文主要介绍使用最简便的方式搭建一个用于开发调试NULS的私链,并没有修改NULS的源代码。如果您需要更进一步探索NULS,可以查阅NULS的相关文档并在此基础上对源码进行修改调试,或许您会发现更多的奥秘!")])])}],n=s(0),r=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},e,!1,null,null,null);r.options.__file="buildPrivateChain.md";a.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/71.6abde1ee.js b/docs/.vuepress/dist/assets/js/71.6abde1ee.js new file mode 100644 index 00000000..3f22ab2b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/71.6abde1ee.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{563:function(_,t,v){_.exports=v.p+"assets/img/clip_image002.425eb96f.jpg"},866:function(_,t,v){"use strict";v.r(t);var a=[function(){var _=this,t=_.$createElement,a=_._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"搭建区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#搭建区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" 搭建区块链")]),_._v(" "),a("h2",{attrs:{id:"nuls2-0-开发环境搭建"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-开发环境搭建","aria-hidden":"true"}},[_._v("#")]),_._v(" NULS2.0 开发环境搭建")]),_._v(" "),a("p",[_._v("NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。")]),_._v(" "),a("p",[_._v("1 环境准备")]),_._v(" "),a("ul",[a("li",[_._v("安装JDK")]),_._v(" "),a("li",[_._v("安装Maven")]),_._v(" "),a("li",[_._v("安装IntelliJ IDEA开发工具")]),_._v(" "),a("li",[_._v("安装git")])]),_._v(" "),a("p",[_._v("2 clone源代码")]),_._v(" "),a("p",[_._v("git clone "),a("a",{attrs:{href:"mailto:git@github.com"}},[_._v("git@github.com")]),_._v(":nuls-io/nuls_2.0.git")]),_._v(" "),a("p",[_._v("3 IDEA导入nuls_2.0中所有maven项目")]),_._v(" "),a("p",[_._v("4 建立自己的maven项目")]),_._v(" "),a("p",[_._v("5 运行所有需要启动的模块")]),_._v(" "),a("h2",{attrs:{id:"使用nuls2-0核心模块搭建基础链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#使用nuls2-0核心模块搭建基础链","aria-hidden":"true"}},[_._v("#")]),_._v(" 使用NULS2.0核心模块搭建基础链")]),_._v(" "),a("p",[_._v("NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。")]),_._v(" "),a("p",[_._v("NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。")]),_._v(" "),a("h3",{attrs:{id:"_1-理解nuls-2-0的微服务架构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-理解nuls-2-0的微服务架构","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 理解NULS 2.0的微服务架构")]),_._v(" "),a("p",[a("img",{attrs:{src:v(563),alt:"img"}})]),_._v(" "),a("p",[_._v("NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。")]),_._v(" "),a("p",[_._v("因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。")]),_._v(" "),a("p",[_._v("理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。")]),_._v(" "),a("h3",{attrs:{id:"_2-修改基础配置信息"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-修改基础配置信息","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 修改基础配置信息")]),_._v(" "),a("p",[_._v("一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。")]),_._v(" "),a("p",[_._v("NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf")]),_._v(" "),a("p",[_._v("modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:")]),_._v(" "),a("table",[a("thead",[a("tr",[a("th",[_._v("section")]),_._v(" "),a("th",[_._v("param")]),_._v(" "),a("th",[_._v("name")]),_._v(" "),a("th",[_._v("remark")])])]),_._v(" "),a("tbody",[a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("chain.id")]),_._v(" "),a("td",[_._v("本链id")]),_._v(" "),a("td",[_._v("Uint16,NULS主网为1,测试网为2")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("address.prefix")]),_._v(" "),a("td",[_._v("地址前缀")]),_._v(" "),a("td",[_._v("大小字母+数字,2-5个字符")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("data.root.dir")]),_._v(" "),a("td",[_._v("数据存储路径")]),_._v(" "),a("td",[_._v("为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("encoding")]),_._v(" "),a("td",[_._v("编码方式")]),_._v(" "),a("td",[_._v("默认UTF-8,不建议修改")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("asset.id")]),_._v(" "),a("td",[_._v("本来主资产编码")]),_._v(" "),a("td",[_._v("NULS为1")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.root.dir")]),_._v(" "),a("td",[_._v("日志根目录")]),_._v(" "),a("td",[_._v("用于存放各个模块的日志文件")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.level")]),_._v(" "),a("td",[_._v("日志级别")]),_._v(" "),a("td",[_._v("日志打印级别debug/info/warn/error.")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储block模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td",[_._v("区块大小限制,避免太大区块太高参与门槛")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("max.rollback")]),_._v(" "),a("td",[_._v("最大回滚数量")]),_._v(" "),a("td",[_._v("当超过这个数量后,系统将停止回滚,避免出现重大问题")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("header.extend.max.size")]),_._v(" "),a("td",[_._v("扩展最大size")]),_._v(" "),a("td",[_._v("区块头中的扩展字段的大小限制")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("genesis.block.json.path")]),_._v(" "),a("td",[_._v("创世块描述文件")]),_._v(" "),a("td",[_._v("创世块的描述文件")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储共识模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("inflation.token.count")]),_._v(" "),a("td",[_._v("每年增发数量")]),_._v(" "),a("td",[_._v("增发数量用于通过coinbase交易奖励给节点")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("seed.addresses")]),_._v(" "),a("td",[_._v("共识种子地址")]),_._v(" "),a("td",[_._v('多个地址用","分隔')])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.address.pwd")]),_._v(" "),a("td",[_._v("地址密码")]),_._v(" "),a("td",[_._v("用于打包的地址的密码")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最小保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最大保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最大值,不能大于100")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最小值")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("单笔委托最小金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.total.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("节点接受委托的最大金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.token.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("当节点的委托达到该值则开始出块")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("red.punish.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("红牌锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.stop.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("停止节点锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("seeds")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v('种子节点,多个之间用","隔开')])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("magic.number")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("魔法数字,用于隔离其他网络")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("port")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("端口")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.seed")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("需要进行跨链时,配置NULS2.0种子节点")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("cross.listener.port")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.magic.number")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("contract")]),_._v(" "),a("td",[_._v("nrc20.file.path")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("NRC20协议描述json文件路径")])]),_._v(" "),a("tr",[a("td",[_._v("tx")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("Ledger")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.ip")]),_._v(" "),a("td",[_._v("mongodb地址")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.port")]),_._v(" "),a("td",[_._v("mongodb端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.listener.ips")]),_._v(" "),a("td",[_._v("rpc监听ip")]),_._v(" "),a("td",[_._v("可以配置多个")])]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.port")]),_._v(" "),a("td",[_._v("rpc监听端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("req.allow.per.s")]),_._v(" "),a("td",[_._v("并发限制")]),_._v(" "),a("td")])])]),_._v(" "),a("p",[_._v("表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。")]),_._v(" "),a("blockquote"),_._v(" "),a("h3",{attrs:{id:"_3-打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 打包和启动")]),_._v(" "),a("p",[_._v("链的配置项修改完成后,则可直接参考本文档的第4部分:"),a("a",{attrs:{href:"#%E6%89%93%E5%8C%85%E5%92%8C%E5%90%AF%E5%8A%A8"}},[_._v("打包和启动")])]),_._v(" "),a("h2",{attrs:{id:"搭建包含业务模块的区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#搭建包含业务模块的区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" 搭建包含业务模块的区块链")]),_._v(" "),a("p",[_._v("在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。")]),_._v(" "),a("h3",{attrs:{id:"_1-业务模块说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-业务模块说明","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 业务模块说明")]),_._v(" "),a("h4",{attrs:{id:"_1-1-何为业务模块"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-何为业务模块","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.1 何为业务模块")]),_._v(" "),a("p",[_._v("基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。")]),_._v(" "),a("p",[_._v("业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。")]),_._v(" "),a("h4",{attrs:{id:"_1-2-如何扩展协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-如何扩展协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.2 如何扩展协议")]),_._v(" "),a("p",[_._v("NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:")]),_._v(" "),a("ul",[a("li",[_._v("通过转账交易的remark字段进行扩展")])]),_._v(" "),a("p",[_._v("将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。")]),_._v(" "),a("ul",[a("li",[_._v("通过制定的业务扩展交易进行扩展")])]),_._v(" "),a("p",[_._v("NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。")]),_._v(" "),a("p",[a("strong",[_._v("示例:")])]),_._v(" "),a("p",[_._v("假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。")]),_._v(" "),a("p",[_._v("1 功能设计")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;\n\n2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;\n\n3. 解密查看:从数据库中获取记录,解密,展示解密结果\n\n4. 删除记事:app本地删除,不删除区块链中数据\n")])])]),a("p",[_._v("2 区块链交互")]),_._v(" "),a("p",[_._v("以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。")]),_._v(" "),a("ul",[a("li",[_._v("第一个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v('首先设计数据格式,如下\n\n{\n\n address:"",//记事所属人\n\n time:"",//记事时间点\n\n content:""//加密后的记事内容\n\n}\n\n根据数据格式,组装上链数据:address+time+content;\n\n确定应用的魔法数字,假设为12345678.\n\n则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。\n')])])]),a("ul",[a("li",[_._v("第二个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,\n如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)\n如果成功解析了数据,则将数据存储到本地数据库中\n")])])]),a("p",[_._v("3 其他业务实现")]),_._v(" "),a("p",[_._v("所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。")]),_._v(" "),a("blockquote",[a("p",[_._v("使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。")])]),_._v(" "),a("h3",{attrs:{id:"_2-需求分析"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-需求分析","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 需求分析")]),_._v(" "),a("p",[_._v("在动手开发模块之前,首先要确定几个问题:")]),_._v(" "),a("ul",[a("li",[_._v("自己需要的是什么样的功能?")]),_._v(" "),a("li",[_._v("是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?")]),_._v(" "),a("li",[_._v("用哪种方式实现这个模块?\n"),a("ul",[a("li",[_._v("扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。")]),_._v(" "),a("li",[_._v("增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要")]),_._v(" "),a("li",[_._v("修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。")])])])]),_._v(" "),a("h3",{attrs:{id:"_3-模块设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-模块设计","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 模块设计")]),_._v(" "),a("p",[_._v("在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。")]),_._v(" "),a("p",[_._v("那么如何设计自己的业务?举例说明:")]),_._v(" "),a("h4",{attrs:{id:"_3-1-扩展基础协议的方式:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-扩展基础协议的方式:","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.1 扩展基础协议的方式:")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。\n比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。\n\n第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。\n一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。\n")])])]),a("h4",{attrs:{id:"_3-2-新增协议的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-新增协议的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.2 新增协议的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。\n这里我们就用nuls的poc共识机制来举例\n功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。\nnuls的poc共识机制的业务功能有:\n1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。\n2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。\n3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。\n4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。\n\n协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。\npoc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易\n交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。\n例如创建共识节点:\n\t1)创建节点的账户不能重复多次创建共识节点;\n\t2)保证金在2-20万nuls之间;\n\t3)账户是否有过红牌记录;\n存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。\n例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等\n\n接口设计:需要对外提供的RPC接口\n例如:查询共识节点信息,查询共识委托信息等\n\n其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里\n")])])]),a("h4",{attrs:{id:"_3-3-修改基础链的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-修改基础链的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.3 修改基础链的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。\n修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。\n")])])]),a("h3",{attrs:{id:"_4-模块实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-模块实现","aria-hidden":"true"}},[_._v("#")]),_._v(" 4 模块实现")]),_._v(" "),a("p",[_._v("首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。")]),_._v(" "),a("p",[_._v("1、nuls-service-base-lib(baselib):")]),_._v(" "),a("p",[_._v("通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。")]),_._v(" "),a("p",[_._v("2、module-self:")]),_._v(" "),a("p",[_._v("模块本身,在一下几方面需要做出自己的实现:")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("模块管理")]),_._v(" "),a("p",[_._v("1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。")]),_._v(" "),a("p",[_._v("2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。")]),_._v(" "),a("p",[_._v("3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理")])]),_._v(" "),a("li",[a("p",[_._v("协议相关")]),_._v(" "),a("p",[_._v("当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息")]),_._v(" "),a("p",[_._v("当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。")])]),_._v(" "),a("li",[a("p",[_._v("数据存储")]),_._v(" "),a("p",[_._v("NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。")])]),_._v(" "),a("li",[a("p",[_._v("功能实现")]),_._v(" "),a("p",[_._v("如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。")])]),_._v(" "),a("li",[a("p",[_._v("功能接口")]),_._v(" "),a("p",[_._v("根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。")])]),_._v(" "),a("li",[a("p",[_._v("日志记录")]),_._v(" "),a("p",[_._v("NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。")])])]),_._v(" "),a("p",[_._v("总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。")]),_._v(" "),a("h3",{attrs:{id:"_5-定义自己的协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-定义自己的协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 5 定义自己的协议")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。")])]),_._v(" "),a("li",[a("p",[_._v("交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。")])])]),_._v(" "),a("h3",{attrs:{id:"_6-调试"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-调试","aria-hidden":"true"}},[_._v("#")]),_._v(" 6 调试")]),_._v(" "),a("p",[_._v("完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;\n\n2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;\n\n3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;\n\n4、检查交易验证逻辑是否严谨,不要出现安全漏洞;\n\n5、测试自身模块的业务是否正确、完整。\n")])])]),a("p",[_._v("全部测试都完成后,便可进入打包和启动阶段了")]),_._v(" "),a("h2",{attrs:{id:"打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 打包和启动")]),_._v(" "),a("h3",{attrs:{id:"_1-打包"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-打包","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 打包")]),_._v(" "),a("p",[_._v("NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0\n./package.sh -m\n")])])]),a("p",[_._v("确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。")]),_._v(" "),a("h3",{attrs:{id:"_2-启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 启动")]),_._v(" "),a("ul",[a("li",[_._v("编译成功 会生成如下路径文件")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("/home/nuls2/nuls_2.0/RELEASE/bin\n")])])]),a("ul",[a("li",[_._v("执行如下命令,即可一键批量启动所有模块")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0/RELEASE/bin\n./start.sh -c ./moudle.json(指定moudle.json配置文件启动)\n")])])]),a("ul",[a("li",[_._v("linux指令 jps 查看所有模块进程:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v(" ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws\n")])])]),a("ul",[a("li",[_._v("查看模块启动状态")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("./checkstatus.sh \n")])])]),a("ul",[a("li",[_._v("停止 工程模块:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("kill 进程号(进程号对应jps显示出来的 mykernel 模块的进程)\n")])])])])}],s=v(0),e=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);e.options.__file="howToUseNulsBuildChain.md";t.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/72.a80f16f5.js b/docs/.vuepress/dist/assets/js/72.a80f16f5.js new file mode 100644 index 00000000..2fee230d --- /dev/null +++ b/docs/.vuepress/dist/assets/js/72.a80f16f5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{634:function(_,t,v){_.exports=v.p+"assets/img/clip_image002.425eb96f.jpg"},833:function(_,t,v){"use strict";v.r(t);var a=[function(){var _=this,t=_.$createElement,a=_._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"alpha-如何使用nuls搭建区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#alpha-如何使用nuls搭建区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" [Alpha]如何使用NULS搭建区块链")]),_._v(" "),a("h2",{attrs:{id:"nuls2-0-开发环境搭建"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-开发环境搭建","aria-hidden":"true"}},[_._v("#")]),_._v(" NULS2.0 开发环境搭建")]),_._v(" "),a("p",[_._v("NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。")]),_._v(" "),a("p",[_._v("1 环境准备")]),_._v(" "),a("ul",[a("li",[_._v("安装JDK")]),_._v(" "),a("li",[_._v("安装Maven")]),_._v(" "),a("li",[_._v("安装IntelliJ IDEA开发工具")]),_._v(" "),a("li",[_._v("安装git")])]),_._v(" "),a("p",[_._v("2 clone源代码")]),_._v(" "),a("p",[_._v("git clone "),a("a",{attrs:{href:"mailto:git@github.com"}},[_._v("git@github.com")]),_._v(":nuls-io/nuls_2.0.git")]),_._v(" "),a("p",[_._v("3 IDEA导入nuls_2.0中所有maven项目")]),_._v(" "),a("p",[_._v("4 建立自己的maven项目")]),_._v(" "),a("p",[_._v("5 运行所有需要启动的模块")]),_._v(" "),a("h2",{attrs:{id:"使用nuls2-0核心模块搭建基础链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#使用nuls2-0核心模块搭建基础链","aria-hidden":"true"}},[_._v("#")]),_._v(" 使用NULS2.0核心模块搭建基础链")]),_._v(" "),a("p",[_._v("NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。")]),_._v(" "),a("p",[_._v("NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。")]),_._v(" "),a("h3",{attrs:{id:"_1-理解nuls-2-0的微服务架构"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-理解nuls-2-0的微服务架构","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 理解NULS 2.0的微服务架构")]),_._v(" "),a("p",[a("img",{attrs:{src:v(634),alt:"img"}})]),_._v(" "),a("p",[_._v("NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。")]),_._v(" "),a("p",[_._v("因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。")]),_._v(" "),a("p",[_._v("理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。")]),_._v(" "),a("h3",{attrs:{id:"_2-修改基础配置信息"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-修改基础配置信息","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 修改基础配置信息")]),_._v(" "),a("p",[_._v("一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。")]),_._v(" "),a("p",[_._v("NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf")]),_._v(" "),a("p",[_._v("modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:")]),_._v(" "),a("table",[a("thead",[a("tr",[a("th",[_._v("section")]),_._v(" "),a("th",[_._v("param")]),_._v(" "),a("th",[_._v("name")]),_._v(" "),a("th",[_._v("remark")])])]),_._v(" "),a("tbody",[a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("chain.id")]),_._v(" "),a("td",[_._v("本链id")]),_._v(" "),a("td",[_._v("Uint16,NULS主网为1,测试网为2")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("address.prefix")]),_._v(" "),a("td",[_._v("地址前缀")]),_._v(" "),a("td",[_._v("大小字母+数字,2-5个字符")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("data.root.dir")]),_._v(" "),a("td",[_._v("数据存储路径")]),_._v(" "),a("td",[_._v("为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("encoding")]),_._v(" "),a("td",[_._v("编码方式")]),_._v(" "),a("td",[_._v("默认UTF-8,不建议修改")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("asset.id")]),_._v(" "),a("td",[_._v("本来主资产编码")]),_._v(" "),a("td",[_._v("NULS为1")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.root.dir")]),_._v(" "),a("td",[_._v("日志根目录")]),_._v(" "),a("td",[_._v("用于存放各个模块的日志文件")])]),_._v(" "),a("tr",[a("td",[_._v("common")]),_._v(" "),a("td",[_._v("log.level")]),_._v(" "),a("td",[_._v("日志级别")]),_._v(" "),a("td",[_._v("日志打印级别debug/info/warn/error.")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储block模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td",[_._v("区块大小限制,避免太大区块太高参与门槛")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("block.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("max.rollback")]),_._v(" "),a("td",[_._v("最大回滚数量")]),_._v(" "),a("td",[_._v("当超过这个数量后,系统将停止回滚,避免出现重大问题")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("header.extend.max.size")]),_._v(" "),a("td",[_._v("扩展最大size")]),_._v(" "),a("td",[_._v("区块头中的扩展字段的大小限制")])]),_._v(" "),a("tr",[a("td",[_._v("block")]),_._v(" "),a("td",[_._v("genesis.block.json.path")]),_._v(" "),a("td",[_._v("创世块描述文件")]),_._v(" "),a("td",[_._v("创世块的描述文件")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td",[_._v("用于存储共识模块数据,该文件夹放在#{data.root.dir}下")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.interval")]),_._v(" "),a("td",[_._v("出块间隔")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("inflation.token.count")]),_._v(" "),a("td",[_._v("每年增发数量")]),_._v(" "),a("td",[_._v("增发数量用于通过coinbase交易奖励给节点")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("block.max.size")]),_._v(" "),a("td",[_._v("区块最大size")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("seed.addresses")]),_._v(" "),a("td",[_._v("共识种子地址")]),_._v(" "),a("td",[_._v('多个地址用","分隔')])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.address.pwd")]),_._v(" "),a("td",[_._v("地址密码")]),_._v(" "),a("td",[_._v("用于打包的地址的密码")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最小保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("创建节点时最大保证金数量")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最大值,不能大于100")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("commission.rate.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("佣金比例最小值")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("deposit.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("单笔委托最小金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.total.deposit.max")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("节点接受委托的最大金额")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("packing.token.min")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("当节点的委托达到该值则开始出块")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("red.punish.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("红牌锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("consensus")]),_._v(" "),a("td",[_._v("agent.stop.lock.time")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("停止节点锁定时间")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("seeds")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v('种子节点,多个之间用","隔开')])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("magic.number")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("魔法数字,用于隔离其他网络")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("port")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("端口")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.seed")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("需要进行跨链时,配置NULS2.0种子节点")])]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("cross.listener.port")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("network")]),_._v(" "),a("td",[_._v("nuls.magic.number")]),_._v(" "),a("td"),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("contract")]),_._v(" "),a("td",[_._v("nrc20.file.path")]),_._v(" "),a("td"),_._v(" "),a("td",[_._v("NRC20协议描述json文件路径")])]),_._v(" "),a("tr",[a("td",[_._v("tx")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("Ledger")]),_._v(" "),a("td",[_._v("data.folder")]),_._v(" "),a("td",[_._v("data子文件夹")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.ip")]),_._v(" "),a("td",[_._v("mongodb地址")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("mongodb.port")]),_._v(" "),a("td",[_._v("mongodb端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.listener.ips")]),_._v(" "),a("td",[_._v("rpc监听ip")]),_._v(" "),a("td",[_._v("可以配置多个")])]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("rpc.port")]),_._v(" "),a("td",[_._v("rpc监听端口")]),_._v(" "),a("td")]),_._v(" "),a("tr",[a("td",[_._v("api")]),_._v(" "),a("td",[_._v("req.allow.per.s")]),_._v(" "),a("td",[_._v("并发限制")]),_._v(" "),a("td")])])]),_._v(" "),a("p",[_._v("表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。")]),_._v(" "),a("blockquote"),_._v(" "),a("h3",{attrs:{id:"_3-打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 打包和启动")]),_._v(" "),a("p",[_._v("链的配置项修改完成后,则可直接参考本文档的第4部分:"),a("a",{attrs:{href:"#%E6%89%93%E5%8C%85%E5%92%8C%E5%90%AF%E5%8A%A8"}},[_._v("打包和启动")])]),_._v(" "),a("h2",{attrs:{id:"搭建包含业务模块的区块链"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#搭建包含业务模块的区块链","aria-hidden":"true"}},[_._v("#")]),_._v(" 搭建包含业务模块的区块链")]),_._v(" "),a("p",[_._v("在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。")]),_._v(" "),a("h3",{attrs:{id:"_1-业务模块说明"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-业务模块说明","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 业务模块说明")]),_._v(" "),a("h4",{attrs:{id:"_1-1-何为业务模块"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-何为业务模块","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.1 何为业务模块")]),_._v(" "),a("p",[_._v("基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。")]),_._v(" "),a("p",[_._v("业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。")]),_._v(" "),a("h4",{attrs:{id:"_1-2-如何扩展协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-如何扩展协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 1.2 如何扩展协议")]),_._v(" "),a("p",[_._v("NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:")]),_._v(" "),a("ul",[a("li",[_._v("通过转账交易的remark字段进行扩展")])]),_._v(" "),a("p",[_._v("将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。")]),_._v(" "),a("ul",[a("li",[_._v("通过制定的业务扩展交易进行扩展")])]),_._v(" "),a("p",[_._v("NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。")]),_._v(" "),a("p",[a("strong",[_._v("示例:")])]),_._v(" "),a("p",[_._v("假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。")]),_._v(" "),a("p",[_._v("1 功能设计")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;\n\n2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;\n\n3. 解密查看:从数据库中获取记录,解密,展示解密结果\n\n4. 删除记事:app本地删除,不删除区块链中数据\n")])])]),a("p",[_._v("2 区块链交互")]),_._v(" "),a("p",[_._v("以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。")]),_._v(" "),a("ul",[a("li",[_._v("第一个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v('首先设计数据格式,如下\n\n{\n\n address:"",//记事所属人\n\n time:"",//记事时间点\n\n content:""//加密后的记事内容\n\n}\n\n根据数据格式,组装上链数据:address+time+content;\n\n确定应用的魔法数字,假设为12345678.\n\n则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。\n')])])]),a("ul",[a("li",[_._v("第二个功能的实现思路如下:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,\n如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)\n如果成功解析了数据,则将数据存储到本地数据库中\n")])])]),a("p",[_._v("3 其他业务实现")]),_._v(" "),a("p",[_._v("所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。")]),_._v(" "),a("blockquote",[a("p",[_._v("使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。")])]),_._v(" "),a("h3",{attrs:{id:"_2-需求分析"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-需求分析","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 需求分析")]),_._v(" "),a("p",[_._v("在动手开发模块之前,首先要确定几个问题:")]),_._v(" "),a("ul",[a("li",[_._v("自己需要的是什么样的功能?")]),_._v(" "),a("li",[_._v("是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?")]),_._v(" "),a("li",[_._v("用哪种方式实现这个模块?\n"),a("ul",[a("li",[_._v("扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。")]),_._v(" "),a("li",[_._v("增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要")]),_._v(" "),a("li",[_._v("修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。")])])])]),_._v(" "),a("h3",{attrs:{id:"_3-模块设计"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-模块设计","aria-hidden":"true"}},[_._v("#")]),_._v(" 3 模块设计")]),_._v(" "),a("p",[_._v("在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。")]),_._v(" "),a("p",[_._v("那么如何设计自己的业务?举例说明:")]),_._v(" "),a("h4",{attrs:{id:"_3-1-扩展基础协议的方式:"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-扩展基础协议的方式:","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.1 扩展基础协议的方式:")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。\n比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。\n\n第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。\n一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。\n")])])]),a("h4",{attrs:{id:"_3-2-新增协议的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-新增协议的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.2 新增协议的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。\n这里我们就用nuls的poc共识机制来举例\n功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。\nnuls的poc共识机制的业务功能有:\n1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。\n2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。\n3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。\n4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。\n\n协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。\npoc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易\n交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。\n例如创建共识节点:\n\t1)创建节点的账户不能重复多次创建共识节点;\n\t2)保证金在2-20万nuls之间;\n\t3)账户是否有过红牌记录;\n存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。\n例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等\n\n接口设计:需要对外提供的RPC接口\n例如:查询共识节点信息,查询共识委托信息等\n\n其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里\n")])])]),a("h4",{attrs:{id:"_3-3-修改基础链的方式"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-修改基础链的方式","aria-hidden":"true"}},[_._v("#")]),_._v(" 3.3 修改基础链的方式")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。\n修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。\n")])])]),a("h3",{attrs:{id:"_4-模块实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-模块实现","aria-hidden":"true"}},[_._v("#")]),_._v(" 4 模块实现")]),_._v(" "),a("p",[_._v("首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。")]),_._v(" "),a("p",[_._v("1、nuls-service-base-lib(baselib):")]),_._v(" "),a("p",[_._v("通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。")]),_._v(" "),a("p",[_._v("2、module-self:")]),_._v(" "),a("p",[_._v("模块本身,在一下几方面需要做出自己的实现:")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("模块管理")]),_._v(" "),a("p",[_._v("1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。")]),_._v(" "),a("p",[_._v("2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。")]),_._v(" "),a("p",[_._v("3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理")])]),_._v(" "),a("li",[a("p",[_._v("协议相关")]),_._v(" "),a("p",[_._v("当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息")]),_._v(" "),a("p",[_._v("当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。")])]),_._v(" "),a("li",[a("p",[_._v("数据存储")]),_._v(" "),a("p",[_._v("NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。")])]),_._v(" "),a("li",[a("p",[_._v("功能实现")]),_._v(" "),a("p",[_._v("如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。")])]),_._v(" "),a("li",[a("p",[_._v("功能接口")]),_._v(" "),a("p",[_._v("根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。")])]),_._v(" "),a("li",[a("p",[_._v("日志记录")]),_._v(" "),a("p",[_._v("NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。")])])]),_._v(" "),a("p",[_._v("总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。")]),_._v(" "),a("h3",{attrs:{id:"_5-定义自己的协议"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-定义自己的协议","aria-hidden":"true"}},[_._v("#")]),_._v(" 5 定义自己的协议")]),_._v(" "),a("ul",[a("li",[a("p",[_._v("设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。")])]),_._v(" "),a("li",[a("p",[_._v("网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。")])]),_._v(" "),a("li",[a("p",[_._v("交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。")])])]),_._v(" "),a("h3",{attrs:{id:"_6-调试"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-调试","aria-hidden":"true"}},[_._v("#")]),_._v(" 6 调试")]),_._v(" "),a("p",[_._v("完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;\n\n2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;\n\n3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;\n\n4、检查交易验证逻辑是否严谨,不要出现安全漏洞;\n\n5、测试自身模块的业务是否正确、完整。\n")])])]),a("p",[_._v("全部测试都完成后,便可进入打包和启动阶段了")]),_._v(" "),a("h2",{attrs:{id:"打包和启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#打包和启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 打包和启动")]),_._v(" "),a("h3",{attrs:{id:"_1-打包"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-打包","aria-hidden":"true"}},[_._v("#")]),_._v(" 1 打包")]),_._v(" "),a("p",[_._v("NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试")]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0\n./package.sh -m\n")])])]),a("p",[_._v("确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。")]),_._v(" "),a("h3",{attrs:{id:"_2-启动"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-启动","aria-hidden":"true"}},[_._v("#")]),_._v(" 2 启动")]),_._v(" "),a("ul",[a("li",[_._v("编译成功 会生成如下路径文件")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("/home/nuls2/nuls_2.0/RELEASE/bin\n")])])]),a("ul",[a("li",[_._v("执行如下命令,即可一键批量启动所有模块")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("cd /home/nuls2/nuls_2.0/RELEASE/bin\n./start.sh -c ./moudle.json(指定moudle.json配置文件启动)\n")])])]),a("ul",[a("li",[_._v("linux指令 jps 查看所有模块进程:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v(" ./start.sh --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws\n")])])]),a("ul",[a("li",[_._v("查看模块启动状态")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("./checkstatus.sh \n")])])]),a("ul",[a("li",[_._v("停止 工程模块:")])]),_._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[_._v("kill 进程号(进程号对应jps显示出来的 mykernel 模块的进程)\n")])])])])}],s=v(0),e=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},a,!1,null,null,null);e.options.__file="howToUseNulsBuildChain.md";t.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/73.6690fcbd.js b/docs/.vuepress/dist/assets/js/73.6690fcbd.js new file mode 100644 index 00000000..ee89abb6 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/73.6690fcbd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{853:function(t,e,s){"use strict";s.r(e);var a=s(0),i=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"api手册"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#api手册","aria-hidden":"true"}},[this._v("#")]),this._v(" API手册")])])}],!1,null,null,null);i.options.__file="APIManual.md";e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/74.d7f82bfd.js b/docs/.vuepress/dist/assets/js/74.d7f82bfd.js new file mode 100644 index 00000000..3c46fef2 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/74.d7f82bfd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{857:function(a,t,e){"use strict";e.r(t);var s=e(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"nrc-20-token-standard"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nrc-20-token-standard","aria-hidden":"true"}},[a._v("#")]),a._v(" NRC-20 Token Standard")]),a._v(" "),e("h2",{attrs:{id:"simple-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#simple-summary","aria-hidden":"true"}},[a._v("#")]),a._v(" Simple Summary")]),a._v(" "),e("p",[a._v("A standard interface for tokens.")]),a._v(" "),e("h2",{attrs:{id:"abstract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[a._v("#")]),a._v(" Abstract")]),a._v(" "),e("p",[a._v("The following standard allows for the implementation of a standard API for tokens within smart contracts.\nThis standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.")]),a._v(" "),e("h2",{attrs:{id:"motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[a._v("#")]),a._v(" Motivation")]),a._v(" "),e("p",[a._v("A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.")]),a._v(" "),e("h2",{attrs:{id:"specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[a._v("#")]),a._v(" Specification")]),a._v(" "),e("h2",{attrs:{id:"token"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token","aria-hidden":"true"}},[a._v("#")]),a._v(" Token")]),a._v(" "),e("h3",{attrs:{id:"methods"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#methods","aria-hidden":"true"}},[a._v("#")]),a._v(" Methods")]),a._v(" "),e("p",[e("strong",[a._v("NOTE")]),a._v(": Callers MUST handle "),e("code",[a._v("false")]),a._v(" from "),e("code",[a._v("return boolean")]),a._v(". Callers MUST NOT assume that "),e("code",[a._v("false")]),a._v(" is never returned!")]),a._v(" "),e("h4",{attrs:{id:"name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#name","aria-hidden":"true"}},[a._v("#")]),a._v(" name")]),a._v(" "),e("p",[a._v("Returns the name of the token - e.g. "),e("code",[a._v('"MyToken"')]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"symbol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#symbol","aria-hidden":"true"}},[a._v("#")]),a._v(" symbol")]),a._v(" "),e("p",[a._v('Returns the symbol of the token. E.g. "MT".')]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("symbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"decimals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#decimals","aria-hidden":"true"}},[a._v("#")]),a._v(" decimals")]),a._v(" "),e("p",[a._v("Returns the number of decimals the token uses - e.g. "),e("code",[a._v("8")]),a._v(", means to divide the token amount by "),e("code",[a._v("100000000")]),a._v(" to get its user representation.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("int")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("decimals")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"totalsupply"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#totalsupply","aria-hidden":"true"}},[a._v("#")]),a._v(" totalSupply")]),a._v(" "),e("p",[a._v("Returns the total token supply.")]),a._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[a._v("@View\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("totalSupply")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"balanceof"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#balanceof","aria-hidden":"true"}},[a._v("#")]),a._v(" balanceOf")]),a._v(" "),e("p",[a._v("Returns the account balance of another account with address "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("balanceOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[a._v("#")]),a._v(" transfer")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" if the "),e("code",[a._v("from")]),a._v(" account balance does not have enough tokens to spend.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transfer")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transferfrom"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferfrom","aria-hidden":"true"}},[a._v("#")]),a._v(" transferFrom")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens from address "),e("code",[a._v("from")]),a._v(" to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("p",[a._v("The "),e("code",[a._v("transferFrom")]),a._v(" method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf.\nThis can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" unless the "),e("code",[a._v("from")]),a._v(" account has deliberately authorized the sender of the message via some mechanism, such as calling "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transferFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"approve"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approve","aria-hidden":"true"}},[a._v("#")]),a._v(" approve")]),a._v(" "),e("p",[a._v("Allows "),e("code",[a._v("spender")]),a._v(" to withdraw from your account multiple times, up to the "),e("code",[a._v("value")]),a._v(" amount. If this function is called again it overwrites the current allowance with "),e("code",[a._v("value")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("approve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"allowance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#allowance","aria-hidden":"true"}},[a._v("#")]),a._v(" allowance")]),a._v(" "),e("p",[a._v("Returns the amount which "),e("code",[a._v("spender")]),a._v(" is still allowed to withdraw from "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("allowance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h3",{attrs:{id:"events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#events","aria-hidden":"true"}},[a._v("#")]),a._v(" Events")]),a._v(" "),e("h4",{attrs:{id:"transferevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferevent","aria-hidden":"true"}},[a._v("#")]),a._v(" TransferEvent")]),a._v(" "),e("p",[a._v("MUST trigger when tokens are transferred, including zero value transfers.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("TransferEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h4",{attrs:{id:"approvalevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approvalevent","aria-hidden":"true"}},[a._v("#")]),a._v(" ApprovalEvent")]),a._v(" "),e("p",[a._v("MUST trigger on any successful call to "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("ApprovalEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h2",{attrs:{id:"implementation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation","aria-hidden":"true"}},[a._v("#")]),a._v(" Implementation")]),a._v(" "),e("h4",{attrs:{id:"example-implementations-are-available-at"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-implementations-are-available-at","aria-hidden":"true"}},[a._v("#")]),a._v(" Example implementations are available at")]),a._v(" "),e("ul",[e("li",[a._v("https://github.com/nuls-io/nuls-nrc20")])])])}],!1,null,null,null);n.options.__file="NRC-20TokenStandard.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/75.fc906157.js b/docs/.vuepress/dist/assets/js/75.fc906157.js new file mode 100644 index 00000000..399b1247 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/75.fc906157.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{859:function(e,t,a){"use strict";a.r(t);var s=a(0),r=Object(s.a)({},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[e._m(0),e._v(" "),e._m(1),e._v(" "),a("p",[e._v("The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.")]),e._v(" "),e._m(2),e._v(" "),a("h4",{attrs:{id:"have-a-try"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#have-a-try","aria-hidden":"true"}},[e._v("#")]),e._v(" "),a("router-link",{attrs:{to:"/NULS2.0/"}},[e._v("Have a try")])],1)])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"welcome-to-nuls"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#welcome-to-nuls","aria-hidden":"true"}},[this._v("#")]),this._v(" Welcome to NULS")])},function(){var e=this.$createElement,t=this._self._c||e;return t("blockquote",[t("p",[this._v("NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.")])])},function(){var e=this.$createElement,t=this._self._c||e;return t("h2",{attrs:{id:"nuls2-0-alpha-version-is-released"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha-version-is-released","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha Version is released")])}],!1,null,null,null);r.options.__file="README.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/76.106a4524.js b/docs/.vuepress/dist/assets/js/76.106a4524.js new file mode 100644 index 00000000..a38bd177 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/76.106a4524.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{863:function(t,e,s){"use strict";s.r(e);var a=s(0),n=Object(a.a)({},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),s("p",[t._v("​\tThe User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),s("p",[t._v("It is recommended to use core of version 2.6.32 or higher.")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),s("ul",[t._m(15),t._v(" "),t._m(16),t._v(" "),s("li",[s("p",[t._v("Enter "),s("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("wallet download on NULS website"),s("OutboundLink")],1),t._v(",and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users.")]),t._v(" "),s("p",[t._v("The following is for downloading wallet (v1.0.0) in Linux system:")]),t._v(" "),t._m(17),s("p",[t._v("Note: the downloading link for the subsequent versions is subject to change.")])])]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),s("p",[t._v("All commands for output and printing")]),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),s("p",[t._v("Return message help")]),t._v(" "),t._m(31),s("p",[t._v("Return message help -a")]),t._v(" "),t._m(32),s("p",[t._v("Example")]),t._v(" "),t._m(33),t._m(34),t._v(" "),s("p",[t._v("Create account and return to account addresses collection")]),t._v(" "),t._m(35),t._v(" "),t._m(36),t._v(" "),s("p",[t._v("Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter;")]),t._v(" "),s("p",[t._v("Return accounts collection")]),t._v(" "),t._m(37),s("p",[t._v("Example, to create 2 accounts without password")]),t._v(" "),t._m(38),t._m(39),t._v(" "),s("p",[t._v("For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account")]),t._v(" "),t._m(40),t._v(" "),t._m(41),t._v(" "),s("p",[t._v("Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe.")]),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(42),s("p",[t._v("Example: backup of an account with password")]),t._v(" "),t._m(43),t._m(44),t._v(" "),s("p",[t._v("Remove local account according to account address; if the account is encrypted, insert password.")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(47),s("p",[t._v("Example")]),t._v(" "),t._m(48),t._m(49),t._v(" "),s("p",[t._v("Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts.")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(52),s("p",[t._v("Example")]),t._v(" "),t._m(53),t._m(54),t._v(" "),s("p",[t._v("Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one.")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(57),s("p",[t._v("Example")]),t._v(" "),t._m(58),t._m(59),t._v(" "),s("p",[t._v("Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source.")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),s("p",[t._v("Return message, transaction hash")]),t._v(" "),t._m(62),s("p",[t._v("Example")]),t._v(" "),t._m(63),t._m(64),t._v(" "),s("p",[t._v("Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account.")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),s("p",[t._v("Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required.")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(67),s("p",[t._v("Example")]),t._v(" "),t._m(68),t._m(69),t._v(" "),s("p",[t._v("Import account’s private key and create a local account. Receive failure to import if there is an existing local account.")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),s("p",[t._v("注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(72),s("p",[t._v("Example")]),t._v(" "),t._m(73),t._m(74),t._v(" "),s("p",[t._v("Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account.")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),s("p",[t._v("Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.")]),t._v(" "),s("p",[t._v("Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import).")]),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(77),s("p",[t._v("Example")]),t._v(" "),t._m(78),t._m(79),t._v(" "),s("p",[t._v("Inquire account information based on account address")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(82),s("p",[t._v("Example")]),t._v(" "),t._m(83),t._m(84),t._v(" "),s("p",[t._v("Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),s("p",[t._v("Return message, output accounts collection")]),t._v(" "),t._m(87),s("p",[t._v("Example: to get list of accounts, showing page 1, 2 items per page")]),t._v(" "),t._m(88),t._m(89),t._v(" "),s("p",[t._v("Inquire account’s private key based on account address; if the account is encrypted, insert password.")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(92),s("p",[t._v("Example")]),t._v(" "),t._m(93),t._m(94),t._v(" "),s("p",[t._v("Inquire account balance based on account address")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),s("p",[t._v("Return message, imported account address")]),t._v(" "),t._m(97),s("p",[t._v("Example")]),t._v(" "),t._m(98),t._m(99),t._v(" "),s("p",[t._v("Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly.")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),s("p",[t._v("Return message, transfer transaction hash")]),t._v(" "),t._m(102),s("p",[t._v("Example")]),t._v(" "),t._m(103),t._m(104),t._v(" "),s("p",[t._v("Inquire transaction details as per transaction hash")]),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),s("p",[t._v("Return message, transaction details")]),t._v(" "),t._m(107),s("p",[t._v("Example, to inquire transfer transaction")]),t._v(" "),t._m(108),t._m(109),t._v(" "),s("p",[t._v("Inquire list of transactions in this account based on account address")]),t._v(" "),t._m(110),t._v(" "),t._m(111),t._v(" "),s("p",[t._v("Return message, transaction details")]),t._v(" "),t._m(112),s("p",[t._v("Example")]),t._v(" "),t._m(113),t._m(114),t._v(" "),s("p",[t._v("Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least.")]),t._v(" "),t._m(115),t._v(" "),t._m(116),t._v(" "),s("p",[t._v("Return message, agent hash of return node")]),t._v(" "),t._m(117),s("p",[t._v("Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS")]),t._v(" "),t._m(118),t._m(119),t._v(" "),s("p",[t._v("Include consensus of 2000NULS at least based on account address and node agent hash")]),t._v(" "),t._m(120),t._v(" "),t._m(121),t._v(" "),s("p",[t._v("Return message, transaction hash for including consensus; to exit the consensus, require such hash.")]),t._v(" "),t._m(122),s("p",[t._v("Example")]),t._v(" "),t._m(123),t._m(124),t._v(" "),s("p",[t._v("Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent.")]),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),s("p",[t._v("Return message, transaction hash upon exiting the consensus")]),t._v(" "),t._m(127),s("p",[t._v("Example")]),t._v(" "),t._m(128),t._m(129),t._v(" "),s("p",[t._v("Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours.")]),t._v(" "),t._m(130),t._v(" "),t._m(131),t._v(" "),s("p",[t._v("Return message, transaction hash of stop node")]),t._v(" "),t._m(132),s("p",[t._v("Example")]),t._v(" "),t._m(133),t._m(134),t._v(" "),s("p",[t._v("Get node details as per agent hash of node")]),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(137),s("p",[t._v("Example")]),t._v(" "),t._m(138),t._m(139),t._v(" "),s("p",[t._v("As per list of consensus nodes")]),t._v(" "),t._m(140),t._v(" "),t._m(141),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(142),s("p",[t._v("Example")]),t._v(" "),t._m(143),t._m(144),t._v(" "),s("p",[t._v("Inquire total information of network consensuses")]),t._v(" "),t._m(145),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(146),s("p",[t._v("Example")]),t._v(" "),t._m(147),t._m(148),t._v(" "),s("p",[t._v("Get the general of all agents (consensuses) information of the account based on account address")]),t._v(" "),t._m(149),t._v(" "),t._m(150),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(151),s("p",[t._v("Example")]),t._v(" "),t._m(152),t._m(153),t._v(" "),s("p",[t._v("Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash.")]),t._v(" "),t._m(154),t._v(" "),t._m(155),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(156),s("p",[t._v("Example")]),t._v(" "),t._m(157),t._m(158),t._v(" "),s("p",[t._v("Inquire list of agency nodes asper address (return list of node information)")]),t._v(" "),t._m(159),t._v(" "),t._m(160),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(161),s("p",[t._v("Example, to get page 1, display 2 items per page")]),t._v(" "),t._m(162),t._m(163),t._v(" "),s("p",[t._v("Get the latest block head information")]),t._v(" "),t._m(164),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(165),s("p",[t._v("Example")]),t._v(" "),t._m(166),t._m(167),t._v(" "),s("p",[t._v("Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.")]),t._v(" "),t._m(168),t._v(" "),t._m(169),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(170),s("p",[t._v("Example: to get block as per height")]),t._v(" "),t._m(171),t._m(172),t._v(" "),s("p",[t._v("Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.")]),t._v(" "),t._m(173),t._v(" "),t._m(174),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(175),s("p",[t._v("Example: to get block as per height")]),t._v(" "),t._m(176),t._m(177),t._v(" "),s("p",[t._v("Inquire network basic information")]),t._v(" "),t._m(178),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(179),s("p",[t._v("Example")]),t._v(" "),t._m(180),t._m(181),t._v(" "),s("p",[t._v("Inquire network node IP")]),t._v(" "),t._m(182),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(183),s("p",[t._v("Example: get block as per height")]),t._v(" "),t._m(184),t._m(185),t._v(" "),s("p",[t._v("Inquire current version number")]),t._v(" "),t._m(186),t._v(" "),s("p",[t._v("Return message")]),t._v(" "),t._m(187),s("p",[t._v("Example")]),t._v(" "),t._m(188),t._m(189),t._v(" "),s("p",[t._v("Inquire current version number")]),t._v(" "),t._m(190),t._v(" "),s("p",[t._v("Example")]),t._v(" "),t._m(191),t._m(192),t._v(" "),s("p",[t._v("Exiting from wallet command line program does not mean exiting from wallet node started.")]),t._v(" "),t._m(193),t._v(" "),s("p",[t._v("Example")]),t._v(" "),t._m(194)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"linux-cli-manual"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#linux-cli-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" Linux CLI Manual")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"version-update-records"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update-records","aria-hidden":"true"}},[this._v("#")]),this._v(" Version Update Records")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("Version")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Date updated")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Contents")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-12")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("All functions of official version")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"preparation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preparation","aria-hidden":"true"}},[this._v("#")]),this._v(" Preparation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"server-hardware"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardware","aria-hidden":"true"}},[this._v("#")]),this._v(" Server hardware")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Server for creating NULS nodes shall be with configurations not lower than the following")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Hard Disk")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Broadband")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("Quad-core 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("16G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("128G Hard Disk")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("20M Uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Recommendation")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Hard Disk")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("Broadband")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("8-core 3.0GHz")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("32G")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("256G Hard Disk")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("100M Uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"version-of-system-and-core"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-of-system-and-core","aria-hidden":"true"}},[this._v("#")]),this._v(" Version of system and core")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux system")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS (recommended)")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#start","aria-hidden":"true"}},[this._v("#")]),this._v(" Start")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"download"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#download","aria-hidden":"true"}},[this._v("#")]),this._v(" Download")])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("li",[e("p",[this._v("GitHub:https://github.com/nuls-io/nuls-wallet-release")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"install"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#install","aria-hidden":"true"}},[this._v("#")]),this._v(" Install")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Extract downloaded files in Linux system")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"operate"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#operate","aria-hidden":"true"}},[this._v("#")]),this._v(" Operate")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("p",[this._v("Enter bin catalogue and run startup script to start full-node wallet")]),this._v(" "),e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("$ cd bin\n$ ./start.sh\n")])])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"use-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" Use wallet")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"quick-start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick-start")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Upon confirming the wallet is started, start the command line of wallet to run it.")]),t._v(" "),s("p",[t._v("Enter bin catalogue to execute the following commands:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("$ ./cmd.sh\n")])])]),s("p",[t._v("Display NULS naming prompt "),s("code",[t._v("nuls>>>")]),t._v(", and then directly input NULS wallet operation command to run it.")]),t._v(" "),s("p",[t._v("The following gives an example of account creating:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('nuls>>> create\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:*********\nPlease confirm new password:*********\n[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\nnuls>>>\n')])])]),s("p",[t._v("Command "),s("code",[t._v("create")]),t._v(" is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully.")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"conventions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#conventions","aria-hidden":"true"}},[this._v("#")]),this._v(" Conventions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("For password: it must be 8 to 20 digits, including letters and figures.")]),this._v(" "),e("li",[this._v('Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required.')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"wallet-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wallet-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Wallet command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"help-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#help-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Help command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: help [-a] **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("-a")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Formatting printing command, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n\tOPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n\t
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"create-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Create account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: create [number] **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number]")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Quantity of accounts created, optional")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 2\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:\n[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"backup-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#backup-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Backup account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command: backup
[path]")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("[path]")]),t._v(" "),s("td",[t._v("The target folder of backup files, defaults to be the current folder, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nThe path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"remove-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#remove-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Remove account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: remove
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"set-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Set account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: setpwd
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"change-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#change-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Change account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: resetpwd
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nEnter your old password:**********\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"set-nickname"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-nickname","aria-hidden":"true"}},[this._v("#")]),this._v(" Set nickname")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:setalias
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Nickname, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias\n"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account-keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account-keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: import keystore **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Address of keystore files to be imported, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account’s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account’s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account’s private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:import **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Account’s private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"imported-account’s-private-key-overwritten"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#imported-account’s-private-key-overwritten","aria-hidden":"true"}},[this._v("#")]),this._v(" Imported account’s private key (overwritten)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:import **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Account’s private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getaccount
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Nickname\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Public key\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key after encryption (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Creation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//Encrypted or not (set password or not"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\n{\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-list-of-accounts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-list-of-accounts","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire list of accounts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getaccounts ")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Nickname\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Public key\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Private key (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Private key after encryption (unavailable if the account is encrypted"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:39:14"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Creation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("//Encrypted or not (set password or not"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-13 11:02:23"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts 1 2\n[ {\n "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",\n "alias" : null,\n "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",\n "priKey" : "",\n "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",\n "extend" : null,\n "createTime" : "2018-07-13 11:39:14",\n "encrypted" : true\n}, {\n "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",\n "alias" : null,\n "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",\n "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",\n "encryptedPriKey" : "",\n "extend" : null,\n "createTime" : "2018-07-13 11:02:23",\n "encrypted" : false\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account’s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account’s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account’s private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getprikey
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy\nPlease enter the password.\nEnter your password:**********\n"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getbalance
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Locked balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("//Available balance\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "balance" : "9999998.99",\n "locked" : "0",\n "usable" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: transfer
[remark] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("transferring address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("receiving address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("transferred amount, round to 8 decimals in total (in NULS), required")])]),t._v(" "),s("tr",[s("td",[t._v("[remark]")]),t._v(" "),s("td",[t._v("Remarks, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer\nPlease enter the password.\nEnter your password:**********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-transaction-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-transaction-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire transaction details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:gettx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Transaction hash, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type (transfer transaction as an example"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of package transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction service charge\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//(Transfer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" transaction amount\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//remarks\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Signature\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status of transaction confirmation (confirmed or unconfirmed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("46")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("254")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Input of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979998.98"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Output of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"')]),t._v("// Target address of transaction output (means to transfer "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v(" to the target address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"100"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Target address of transaction output (means to give users changes"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9979898.979"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"usable"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596\n{\n "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "type" : "transfer",\n "time" : "2018-07-16 11:21:46",\n "blockHeight" : 26269,\n "fee" : "0.001",\n "value" : "100",\n "remark" : "Transfer",\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",\n "status" : "confirm",\n "confirmCount" : 46,\n "size" : 254,\n "inputs" : [ {\n "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979998.98",\n "lockTime" : 0\n } ],\n "outputs" : [ {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 0,\n "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",\n "value" : "100",\n "lockTime" : 0,\n "status" : "usable"\n }, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "index" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : "9979898.979",\n "lockTime" : 0,\n "status" : "usable"\n } ]\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-list-of-transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-list-of-transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire list of transactions")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:gettxlist
")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26473")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:55:43"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("//Message\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26269")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 11:21:46"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txType"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"info"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"+100"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10\n[ {\n "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",\n "blockHeight" : 26473,\n "time" : "2018-07-16 11:55:43",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n}, {\n "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",\n "blockHeight" : 26269,\n "time" : "2018-07-16 11:21:46",\n "txType" : "transfer",\n "status" : 1,\n "info" : "+100"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"create-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Create node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:createagent **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Account address of nodes created, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node account package address, required (note: the account shall have no password, otherwise the node cannot package)")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Agent commission proportion, with a range of 10~100, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node creating deposit of 2 at least, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password:**********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"include-consensus-agency-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#include-consensus-agency-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Include consensus (agency node)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:deposit
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Node agent hash, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Include consensus deposit, not less than 2000NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"exit-the-consensus-agency"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-the-consensus-agency","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit the consensus (agency)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: withdraw
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Transaction hash upon agency, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"stop-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stop-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Stop node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:stopagent
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-node-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-node-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Get node details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: getagent **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Node agent hash, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agency amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6\n{\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.05,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-nodes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-nodes","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of nodes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getagents **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("60.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:33:38"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28141")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.05")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"208000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agent amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v("//Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getagents 1 2\n[ {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.18,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n}, {\n "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",\n "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",\n "deposit" : "20000",\n "commissionRate" : 10.0,\n "agentName" : null,\n "agentId" : "5CE291D8",\n "time" : "2018-07-16 16:31:12",\n "blockHeight" : 28126,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.16,\n "totalDeposit" : "208000",\n "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-total-information-of-network-consensuses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-total-information-of-network-consensuses","aria-hidden":"true"}},[this._v("#")]),this._v(" Get total information of network consensuses")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getconsensus **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1758000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Total quantity of agents\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusAccountNumber"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of consensus accounts\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAgentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v("//Quantity of package addresses\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getconsensus\n{\n "agentCount" : 6,\n "totalDeposit" : "1758000",\n "rewardOfDay" : "0",\n "consensusAccountNumber" : 6,\n "packingAgentCount" : 6\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-general-of-agents-in-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-general-of-agents-in-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get general of agents in single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositedinfo
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("Account address, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes created\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1600000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Quantity of total agents\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"joinAgentCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of nodes in agency\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usableBalance"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8048998.869"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Available balance\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Total bonuses gained\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardOfDay"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"219.65910271"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonuses gained a day\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"')]),t._v("//Node hash\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "agentCount" : 1,\n "totalDeposit" : "1600000",\n "joinAgentCount" : 6,\n "usableBalance" : "8048998.869",\n "reward" : "219.65910271",\n "rewardOfDay" : "219.65910271",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-agent-information-of-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-agent-information-of-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of agent information of single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositeds
[agentHash] **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])]),t._v(" "),s("tr",[s("td",[t._v("[agentHash]")]),t._v(" "),s("td",[t._v("Node hash, optional")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agency amount\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Address of agent\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:38:25"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agency transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28148")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"35024DE6"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"')]),t._v("//Node address\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "deposit" : "2000",\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:25",\n "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",\n "blockHeight" : 28148,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "35024DE6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"\n}, {\n "deposit" : "2000",\n "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",\n "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "time" : "2018-07-16 16:38:43",\n "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",\n "blockHeight" : 28149,\n "delHeight" : -1,\n "status" : "consensus",\n "agentName" : "E09EB7FD",\n "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-list-of-agency-nodes-of-single-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-list-of-agency-nodes-of-single-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Get list of agency nodes of single account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getdepositedagents
**")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("
")]),t._v(" "),s("td",[t._v("Account address, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Page, to get the data on which page, required")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Number of data displayed on each page, required")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Account address for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node package (block"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rewardAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Bonus address (default to be address for creating node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"20000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Deposit for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"commissionRate"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("40.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Agent commission proportion\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentName"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Node name (source"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentId"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0198ACAF"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// Node ID\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:32:52"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Time for creating node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28136")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of node creating transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"delHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"consensus"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Status\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"creditVal"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" -"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.91")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Credit value\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"totalDeposit"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"204000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Current total agent amount of node\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"memberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("// Quantity of participants\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2\n[ {\n "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",\n "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",\n "deposit" : "20000",\n "commissionRate" : 40.0,\n "agentName" : null,\n "agentId" : "0198ACAF",\n "time" : "2018-07-16 16:32:52",\n "blockHeight" : 28136,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : -0.91,\n "totalDeposit" : "204000",\n "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",\n "memberCount" : 3\n}, {\n "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",\n "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",\n "deposit" : "20000",\n "commissionRate" : 60.0,\n "agentName" : null,\n "agentId" : "35024DE6",\n "time" : "2018-07-16 16:33:38",\n "blockHeight" : 28141,\n "delHeight" : -1,\n "status" : "consensus",\n "creditVal" : 0.91,\n "totalDeposit" : "208000",\n "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",\n "memberCount" : 5\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"get-the-latest-block-head-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-latest-block-head-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the latest block head information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:getbestblockheader")])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:40"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("33950")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("668413")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-17 10:25:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("204")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"')]),t._v("// Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",\n "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",\n "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",\n "time" : "2018-07-17 10:25:40",\n "height" : 33950,\n "txCount" : 1,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 668413,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-17 10:25:30",\n "packingIndexOfRound" : 1,\n "reward" : "0",\n "fee" : "0",\n "confirmCount" : 0,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-block-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-block-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire block information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getblock | **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block hash")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Height of block")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("//Transaction collection\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coinbase"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction type\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height of transaction\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction service charge\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confirm"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Transaction input\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" //Transaction output\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("29115")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6174,\n "size" : 507,\n "txList" : [ {\n "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",\n "type" : "coinbase",\n "time" : "2018-07-16 16:29:30",\n "blockHeight" : 28115,\n "fee" : "0",\n "value" : null,\n "remark" : null,\n "scriptSig" : null,\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 54,\n "inputs" : [ ],\n "outputs" : [ {\n "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "value" : 100000,\n "lockTime" : 29115\n } ]\n }, {\n "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",\n "type" : "transfer",\n "time" : "2018-07-16 16:29:27",\n "blockHeight" : 28115,\n "fee" : "0.001",\n "value" : null,\n "remark" : null,\n "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",\n "status" : "confirm",\n "confirmCount" : 6174,\n "size" : 249,\n "inputs" : [ {\n "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",\n "fromIndex" : 1,\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 972899896100000\n } ],\n "outputs" : [ {\n "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",\n "value" : 3000000000000,\n "lockTime" : 0\n }, {\n "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",\n "value" : 969899896000000,\n "lockTime" : 0\n } ]\n } ],\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-block-head-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-block-head-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire block head information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getblockheader | **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("table",[s("thead",[s("tr",[s("th",[t._v("Parameter")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block hash")])]),t._v(" "),s("tr",[s("td",[t._v("")]),t._v(" "),s("td",[t._v("Block height")])])])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Former block hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Merkle hash\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:30"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block generation time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("28115")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Block height\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of block package transactions\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package address\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("662578")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rounds of consensuses\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of participants in consensus\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2018-07-16 16:29:20"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Start time of current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Rank of package and block in current round\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Consensus bonus \n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Package service charge of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6174")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Times of confirmation\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("507")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Size of block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"')]),t._v("//Signature\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblockheader 28115\n{\n "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",\n "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",\n "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",\n "time" : "2018-07-16 16:29:30",\n "height" : 28115,\n "txCount" : 2,\n "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",\n "roundIndex" : 662578,\n "consensusMemberCount" : 1,\n "roundStartTime" : "2018-07-16 16:29:20",\n "packingIndexOfRound" : 1,\n "reward" : "0.001",\n "fee" : "0.001",\n "confirmCount" : 6280,\n "size" : 204,\n "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-network-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-network-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire network information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:getnetinfo **")])])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Height of local latest block\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Height of latest block online\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Offset of network time\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//Quantity of passive connecting nodes\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//Quantity of active connecting nodes\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getnetinfo\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-network-node-ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-network-node-ip","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire network node IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command: getnetnodes **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getnetnodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"inquire-current-version-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#inquire-current-version-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Inquire current version information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:version **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),this._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"192.168.1.223"')]),this._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> version\n{\n "myVersion" : "1.0.0",\n "newestVersion" : "0.9.11",\n "upgradable" : false,\n "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"version-update"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update","aria-hidden":"true"}},[this._v("#")]),this._v(" Version update")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("**Command:upgrade **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> version 1.0.0\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"exit-wallet-command-program"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-wallet-command-program","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit wallet command program")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("Command:exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="clientCLI.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/77.ad77edec.js b/docs/.vuepress/dist/assets/js/77.ad77edec.js new file mode 100644 index 00000000..4037ed7a --- /dev/null +++ b/docs/.vuepress/dist/assets/js/77.ad77edec.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{869:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("NULS smart contract adopts IntelliJ IDEA as development tool")]),t._v(" "),t._m(6),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Click to download the plugin"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("NULS smart contract plug-ins provide the following main functions:")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("NULS smart contract syntax is a subset of Java syntax, with some restrictions")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),a("p",[t._v("Java key words are listed as follows and those not applicable for NULS smart contract will be marked")]),t._v(" "),a("p",[t._v("Access control")]),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class")]),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("Key words of package")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("Key words of data type")]),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("Conditional loops (process control)")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("Error processing")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("Modification method, class, property and variables")]),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("other")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("NULS smart contract can be developed with the following class")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("a simple contract")]),t._v(" "),t._m(27),t._v(" "),t._m(28),a("p",[t._v("In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details\nThe project has several classes and interfaces")]),t._v(" "),a("p",[t._v("When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class")]),t._v(" "),a("p",[t._v("After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status")]),t._v(" "),a("p",[t._v("Explanatory comments")]),t._v(" "),a("p",[t._v("@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means")]),t._v(" "),a("p",[t._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")]),t._v(" "),a("p",[t._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value")]),t._v(" "),a("p",[t._v("Go to download NULS source code on github, and get some contract examples")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("Contract SDK provides several classes to be convenient for contract development:")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._m(36),t._v(" "),t._m(37),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"development-manual"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#development-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" Development Manual")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_1-introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_2-development-environment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-development-environment","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Development environment")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-setup-of-nuls-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-setup-of-nuls-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Setup of NULS wallet")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-setup-of-jdk-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-setup-of-jdk-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Setup of JDK 8")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-setup-of-intellij-idea"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-setup-of-intellij-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Setup of IntelliJ IDEA")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-4-setup-of-nuls-smart-contract-plug-ins"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-setup-of-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Setup of NULS smart contract plug-ins")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Newly create NULS contract project")]),this._v(" "),s("li",[this._v("Provide the unavailable Java properties, classes ad methods")]),this._v(" "),s("li",[this._v("Compile, package and deploy contracts")]),this._v(" "),s("li",[this._v("Display and call contract methods")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_3-nuls-smart-contract-specifications-and-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-nuls-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. NULS smart contract specifications and syntax")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-1-nuls-smart-contract-specifications"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-nuls-smart-contract-specifications","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 NULS smart contract specifications")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-2-keywords"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-keywords","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Keywords")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("public")]),this._v(" "),s("li",[this._v("protected")]),this._v(" "),s("li",[this._v("private")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("class")]),t._v(" "),a("li",[t._v("interface")]),t._v(" "),a("li",[t._v("abstract")]),t._v(" "),a("li",[t._v("implements")]),t._v(" "),a("li",[t._v("extends")]),t._v(" "),a("li",[t._v("new")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("import")]),this._v(" "),s("li",[this._v("package")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("byte")]),t._v(" "),a("li",[t._v("char")]),t._v(" "),a("li",[t._v("boolean")]),t._v(" "),a("li",[t._v("short")]),t._v(" "),a("li",[t._v("int")]),t._v(" "),a("li",[t._v("float")]),t._v(" "),a("li",[t._v("long")]),t._v(" "),a("li",[t._v("double")]),t._v(" "),a("li",[t._v("void")]),t._v(" "),a("li",[t._v("null")]),t._v(" "),a("li",[t._v("true")]),t._v(" "),a("li",[t._v("false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("if")]),t._v(" "),a("li",[t._v("else")]),t._v(" "),a("li",[t._v("while")]),t._v(" "),a("li",[t._v("for")]),t._v(" "),a("li",[t._v("switch")]),t._v(" "),a("li",[t._v("case")]),t._v(" "),a("li",[t._v("default")]),t._v(" "),a("li",[t._v("do")]),t._v(" "),a("li",[t._v("break")]),t._v(" "),a("li",[t._v("continue")]),t._v(" "),a("li",[t._v("return")]),t._v(" "),a("li",[t._v("instanceof")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("catch")]),t._v(" "),a("li",[t._v("try")]),t._v(" "),a("li",[t._v("finally")]),t._v(" "),a("li",[t._v("throw")]),t._v(" "),a("li",[t._v("throws")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("static")]),t._v(" "),a("li",[t._v("final")]),t._v(" "),a("li",[t._v("super")]),t._v(" "),a("li",[t._v("this")]),t._v(" "),a("li",[t._v("native(not supported)")]),t._v(" "),a("li",[t._v("strictfp(not supported)")]),t._v(" "),a("li",[t._v("synchronized(not supported)")]),t._v(" "),a("li",[t._v("transient(not supported)")]),t._v(" "),a("li",[t._v("volatile(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("enum(not supported)")]),this._v(" "),s("li",[this._v("assert(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-3-basic-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-basic-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 Basic syntax")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign")]),t._v(" "),a("li",[t._v("Basic data type: byte short int long float double char boolean")]),t._v(" "),a("li",[t._v("Reference data type: class, interface, array")]),t._v(" "),a("li",[t._v("Arithmetic operators: + - * /%++ -")]),t._v(" "),a("li",[t._v("Relational operator: > <> = <= ==! =")]),t._v(" "),a("li",[t._v("Logical Operators: ! &| ^ && ||")]),t._v(" "),a("li",[t._v("Bit operator: &| ^~>> << >>>")]),t._v(" "),a("li",[t._v("Assignment operator: =")]),t._v(" "),a("li",[t._v("Extension assignment operators: + = - = * = / =")]),t._v(" "),a("li",[t._v("String link operator: +")]),t._v(" "),a("li",[t._v("Conditional operators: ? :")]),t._v(" "),a("li",[t._v("Process control sentence (if, switch, for, while, do...while)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-4-available-class"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-available-class","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 Available class")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("io.nuls.contract.sdk.Address")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Block")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.BlockHeader")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Contract")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Event")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Msg")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Utils")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.View")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Required")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Payable")]),t._v(" "),a("li",[t._v("java.lang.Boolean")]),t._v(" "),a("li",[t._v("java.lang.Byte")]),t._v(" "),a("li",[t._v("java.lang.Short")]),t._v(" "),a("li",[t._v("java.lang.Character")]),t._v(" "),a("li",[t._v("java.lang.Integer")]),t._v(" "),a("li",[t._v("java.lang.Long")]),t._v(" "),a("li",[t._v("java.lang.Float")]),t._v(" "),a("li",[t._v("java.lang.Double")]),t._v(" "),a("li",[t._v("java.lang.String")]),t._v(" "),a("li",[t._v("java.lang.StringBuilder")]),t._v(" "),a("li",[t._v("java.math.BigInteger")]),t._v(" "),a("li",[t._v("java.math.BigDecimal")]),t._v(" "),a("li",[t._v("java.util.Collection")]),t._v(" "),a("li",[t._v("java.util.List")]),t._v(" "),a("li",[t._v("java.util.ArrayList")]),t._v(" "),a("li",[t._v("java.util.LinkedList")]),t._v(" "),a("li",[t._v("java.util.Map")]),t._v(" "),a("li",[t._v("java.util.HashMap")]),t._v(" "),a("li",[t._v("java.util.LinkedHashMap")]),t._v(" "),a("li",[t._v("java.util.Set")]),t._v(" "),a("li",[t._v("java.util.HashSet")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-5-other-restrictions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-other-restrictions","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 Other restrictions")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Contract class can have one construction method. No restriction for other classes")]),this._v(" "),s("li",[this._v("The maximum gas consumption for executing a contract method once is 10 million, including the method of the "),s("code",[this._v("@View")]),this._v(" type, Make sure to optimize the contract code as much as possible.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_4-nuls-smart-contract-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-nuls-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Nuls smart contract example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" contracts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("examples"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleStorage")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("storedData "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_5-nuls-contract-sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-nuls-contract-sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. NULS Contract SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-address","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Address")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Get the balance of the address (only the balance of contract address)\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Transfer amount to the address from contract \n *\n * @param value transfer amount (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract method to call the address\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Call the contract method of this address with a return value(String)\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n * @return return value after calling the contract\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("callWithReturnValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Verify the address \n *\n * @param address\n * @see io.nuls.kernel.utils.AddressTool#validAddress(String)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Address address1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-block","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Block")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Block")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s head\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Current block’s head\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Newest block’s head\n *\n * @return \n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newestBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s hash\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockhash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * CCurrent block’s miner address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("coinbase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s No.\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("number")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s time stamp\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.BlockHeader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockHeader")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Address packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTxCount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStateRoot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n BlockHeader that "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BlockHeader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BlockHeader{"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", time="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", height="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", txCount="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", packingAddress="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", stateRoot=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'}'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Contract")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract interface, implemented by contract class\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-event","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n* Event interface, implemented by event class\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Event")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-msg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-msg","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Msg")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Msg")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Remaining gas\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasleft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * sender of the contract\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Gas price\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasprice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-utils","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Utils")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Utils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Utils")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back.\n *\n * @param expression\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back\n *\n * @param expression\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n *\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Send events\n *\n * @param event\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Event event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @param seed a private seed\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash4 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash4"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("xBL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param src source string (hex encoding string)\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param bytes source byte array\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bytes"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]verify signature data(ECDSA)\n *\n * @param data(hex encoding string)\n * @param signature(hex encoding string)\n * @param pubkey(hex encoding string)\n * @return verify result\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("verifySignatureData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String signature"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String pubkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-payable"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-payable","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Payable")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Payable")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-required"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-required","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Required")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PARAMETER"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-view"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-view","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.View")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_6-main-rpc-interface-of-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-main-rpc-interface-of-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Main RPC interface of smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-1-create-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-create-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 Create smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4687")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-2-estimate-the-gas-consumption-for-creating-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-estimate-the-gas-consumption-for-creating-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 Estimate the gas consumption for creating smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-3-call-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-3-call-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.3 Call smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/call")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractAddress*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address of smart contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodName*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method signature which may be not transferred if the method name is not repeated")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qwe"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.4 Estimate the gas consumption for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/call")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.5 Estimate the price for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedprice")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-6-terminate-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-6-terminate-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.6 Terminate smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/delete")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.7 Call the smart contract function which is not linked to blockchain (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/view")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.8 Get the implementation results of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/result/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.9 Get the basic information of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/info/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-10-verify-if-it-is-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-10-verify-if-it-is-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.10 Verify if it is contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.11 Get the NULS balance of smart contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/balance/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.12 Get the transaction details of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.13 Get the transaction list of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/list/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.14 Inquire contract UTXO as per address and limit (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/limit/{address}/{limit}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.15 Inquire contract UTXO as per address and amount (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/amount/{address}/{amount}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-16-transfer-amount-to-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-16-transfer-amount-to-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.16 Transfer amount to smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/transfer")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_7-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-1-voting-smart-contract-code-segments-are-as-follows"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-voting-smart-contract-code-segments-are-as-follows","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.1 Voting smart contract code "),s("code",[this._v("segments")]),this._v(" are as follows")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-vote")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BaseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteInterface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("List"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" VoteInterface baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("VoteContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n baseVote "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n VoteEntity voteEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n VoteConfig config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" success "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("success"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("If the methods of smart contract include the parameter of "),s("code",[this._v("array type")]),this._v(", please use the following method to transfer parameters")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Refer to the "),s("code",[this._v("create")]),this._v(" method in the aforesaid voting contract code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtydTVWskMc7GkZzbsq2FoChqKFwMf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseLt14NacjTDhXaTXUdrk6VF7aEwtW4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Test voting 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Voting contract 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536044066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536184066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-2-standard-token-smart-contract-code-segments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-standard-token-smart-contract-code-segments","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.2 Standard Token Smart contract code "),s("code",[this._v("segments")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-nrc20")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("HashMap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("emit"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("require"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleToken")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Token "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" BigInteger totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" balances "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decimals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("totalSupply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleToken")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("decimals "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TEN"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ownerAllowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferFrom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("approve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("increaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decreaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger oldValue "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("oldValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient approved token"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The value must be greater than or equal to 0."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient balance of token."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])}],!1,null,null,null);e.options.__file="developerManual.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/78.10c7b197.js b/docs/.vuepress/dist/assets/js/78.10c7b197.js new file mode 100644 index 00000000..7ab223a9 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/78.10c7b197.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{873:function(e,t,a){"use strict";a.r(t);var n=a(0),r=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"ways-of-creating-random-numbers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ways-of-creating-random-numbers","aria-hidden":"true"}},[e._v("#")]),e._v(" Ways of creating random numbers")]),e._v(" "),a("blockquote",[a("p",[e._v("References:")]),e._v(" "),a("p",[e._v("[Solidity Pitfalls: Random Number Generation for Ethereum]\n(https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/)")]),e._v(" "),a("p",[e._v("[Predicting Random Numbers in Ethereum Smart Contracts]\n(https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620)")])]),e._v(" "),a("h3",{attrs:{id:"_1-linear-congruential-generator-lcg-algorithm-to-generate-pseudorandom-numbers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-linear-congruential-generator-lcg-algorithm-to-generate-pseudorandom-numbers","aria-hidden":"true"}},[e._v("#")]),e._v(" 1. "),a("code",[e._v("Linear Congruential Generator (LCG)")]),e._v(": algorithm to generate pseudorandom numbers")]),e._v(" "),a("p",[e._v("The NULS smart contract SDK provides a way to create random numbers. It takes the current block's miner address, contract address, contract invoker address, and current block’s timestamp as random factors, and uses the algorithm "),a("code",[e._v("linear congruential generator (LCG)")]),e._v(" to generate pseudorandom numbers")]),e._v(" "),a("p",[e._v("Invoking like this:")]),e._v(" "),a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[e._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[e._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[e._v("/**\n * add a random factor\n */")]),e._v("\nio"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),e._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[e._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[e._v("long")]),e._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(";")]),e._v("\n")])])]),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_2-using-the-blockhash-of-the-future-block"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-using-the-blockhash-of-the-future-block","aria-hidden":"true"}},[e._v("#")]),e._v(" 2. Using the "),a("code",[e._v("BlockHash")]),e._v(" of the future block")]),e._v(" "),a("p",[e._v("Taking lottery as an example, it needs to invoke contract transactions twice - close the lottery and pick the winner.")]),e._v(" "),a("p",[e._v("Once the lottery is closed, record the current block height H1 and generate a number N. Pick the winner when the height of the future block reaches "),a("code",[e._v("H1+N")]),e._v("。")]),e._v(" "),a("p",[e._v("When picking the winner, add up the recorded block height H1 and block number in interval (0~80] (to be determined) to the block height H2, and take the "),a("code",[e._v("BlockHash")]),e._v(" of the block H2 as a random seed.")]),e._v(" "),a("p",[e._v("ETH cannot use this way for the following reasons:\n"),a("img",{attrs:{src:"https://cdn-images-1.medium.com/max/1600/1*eyNTfWTkmM-3YuMca-1H0A.png",alt:""}})]),e._v(" "),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_3-random-seeds-limited-to-participants"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-random-seeds-limited-to-participants","aria-hidden":"true"}},[e._v("#")]),e._v(" 3. Random seeds limited to participants")]),e._v(" "),a("p",[e._v("In the case of lottery, we need more arbitrary data for picking our winner. When we determine the winner, we can use the addresses of the players that have entered our lottery smart contract as random factors to generate random numbers.")]),e._v(" "),a("p",[e._v("--")]),e._v(" "),a("h3",{attrs:{id:"_4-commit-reveal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-commit-reveal","aria-hidden":"true"}},[e._v("#")]),e._v(" 4. commit-reveal")]),e._v(" "),a("p",[e._v("Also take the lottery as an example.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("The contract sets aside awards for the random number.")])]),e._v(" "),a("li",[a("p",[e._v("Each user generates own secret random number N.")])]),e._v(" "),a("li",[a("p",[e._v("Users can hash their N and address to generate the hash value of their secret random numbers: String hash = sha3(N + Msg.sender()).")])])]),e._v(" "),a("p",[e._v("Note: step 2 and 3 should be performed locally, for instance, the user submits N to the lottery application, which performs the hash operation.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("Users submit their hash to the smart contract.")])]),e._v(" "),a("li",[a("p",[e._v("Submission is open until the number of blocks reaches a certain value, or until enough participants join.")])]),e._v(" "),a("li",[a("p",[e._v("Once the submission is closed, it’s time to pick the winner.")])]),e._v(" "),a("li",[a("p",[e._v("Each user submits their random number N to the smart contract.")])]),e._v(" "),a("li",[a("p",[e._v("The contract verifies sha3 (N + Msg.sender()) to match the original submission.")])]),e._v(" "),a("li",[a("p",[e._v("If the user fails to submit a valid N in time, his deposit will be forfeited.")])]),e._v(" "),a("li",[a("p",[e._v("Perform XOR operation on all-verified N to get random numbers.")])]),e._v(" "),a("li",[a("p",[e._v("These numbers are used to determine the winners --\x3e (N % numUsers).")])])])])}],!1,null,null,null);r.options.__file="randomImplementations.md";t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/79.08097c6d.js b/docs/.vuepress/dist/assets/js/79.08097c6d.js new file mode 100644 index 00000000..9e4153ed --- /dev/null +++ b/docs/.vuepress/dist/assets/js/79.08097c6d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[79],{875:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"wallet-adds-a-random-seed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-adds-a-random-seed","aria-hidden":"true"}},[t._v("#")]),t._v(" Wallet adds a random seed")]),t._v(" "),s("h2",{attrs:{id:"wallet-adds-a-random-seed-rpc-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-adds-a-random-seed-rpc-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" Wallet adds a random seed RPC interface")]),t._v(" "),s("p",[t._v("The random seed you get is a big number, and notice, it could be a negative number")]),t._v(" "),s("h3",{attrs:{id:"get-a-random-seed-list-based-on-the-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-a-random-seed-list-based-on-the-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get a random seed list based on the height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cutoff height, cannot exceed startHeight+1000")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"get-random-seed-list-according-to-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-random-seed-list-according-to-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get random seed list according to height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cut-off height,endHeight-startHeight<=1000")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),s("h2",{attrs:{id:"smart-contracts-support-random-numbers-in-the-underlying-chain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#smart-contracts-support-random-numbers-in-the-underlying-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" Smart contracts support random Numbers in the underlying chain")]),t._v(" "),s("p",[t._v("Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code.\nTake one of these methods as an example"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v(" Shows how to generate random Numbers using random number seeds.")]),t._v(" "),s("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height range, a specific algorithm is used to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get the set of original seeds according to the height range\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"_2)-a-dice-example-shaking-at-the-same-time-n"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2)-a-dice-example-shaking-at-the-same-time-n","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) A dice "),s("code",[t._v("example")]),t._v(" shaking at the same time N")]),t._v(" "),s("h4",{attrs:{id:"_2-1-calculation-method-1"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-calculation-method-1","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) Calculation method 1")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("The original seed is multiplied by the number of tosses, resulting in an array of bytes")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"_2-2-calculation-method-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-calculation-method-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) Calculation method 2")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/8.b37e7034.js b/docs/.vuepress/dist/assets/js/8.b37e7034.js new file mode 100644 index 00000000..5149d018 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/8.b37e7034.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{175:function(t,e,a){t.exports=a.p+"assets/img/Install.33ff9464.jpg"},176:function(t,e,a){t.exports=a.p+"assets/img/Install2.23136d69.jpg"},177:function(t,e,a){t.exports=a.p+"assets/img/Install3.145b9c4e.jpg"},178:function(t,e,a){t.exports=a.p+"assets/img/createProject.e78abf06.jpg"},179:function(t,e,a){t.exports=a.p+"assets/img/createProject2.b7246453.jpg"},180:function(t,e,a){t.exports=a.p+"assets/img/code.785ccdb5.jpg"},181:function(t,e,a){t.exports=a.p+"assets/img/Deploy.0f2d2d88.jpg"},182:function(t,e,a){t.exports=a.p+"assets/img/Add.e1d751e6.jpg"},183:function(t,e,a){t.exports=a.p+"assets/img/Add3.fbd88d0f.jpg"},184:function(t,e,a){t.exports=a.p+"assets/img/Add5.dfc1a6d7.jpg"},185:function(t,e,a){t.exports=a.p+"assets/img/package.6fff1f40.jpg"},186:function(t,e,a){t.exports=a.p+"assets/img/package1.e07eba9a.jpg"},187:function(t,e,a){t.exports=a.p+"assets/img/package3.e7db1454.jpg"},188:function(t,e,a){t.exports=a.p+"assets/img/package2.698a4145.jpg"},189:function(t,e,a){t.exports=a.p+"assets/img/package4.a9a579bf.jpg"},190:function(t,e,a){t.exports=a.p+"assets/img/Deploy2.ccca3cbd.jpg"},191:function(t,e,a){t.exports=a.p+"assets/img/Deploy3.131a59dc.jpg"},192:function(t,e,a){t.exports=a.p+"assets/img/Deploy4.ebcdade6.jpg"},193:function(t,e,a){t.exports=a.p+"assets/img/Deploy5.37a2c168.jpg"},194:function(t,e,a){t.exports=a.p+"assets/img/Deploy6.f4b26eb1.jpg"},195:function(t,e,a){t.exports=a.p+"assets/img/Deploy7.e33e7d01.jpg"},883:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"idea-plugin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#idea-plugin","aria-hidden":"true"}},[this._v("#")]),this._v(" IDEA Plugin")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-install-nuls-plugin-on-idea"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-install-nuls-plugin-on-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 Install NULS Plugin on IDEA")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(175),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Select the said ZIP, and click OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(176),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Tick NULS plugin, and click Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(177),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-create-a-nuls-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-a-nuls-project","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 Create a NULS project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(178),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(179),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-compile-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-compile-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 Compile smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(180),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-set-and-deploy-the-node-and-account-for-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-set-and-deploy-the-node-and-account-for-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 Set and deploy the node and account for contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click NULS plugin on the right, and call NULS plugin interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(181),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract.\nRecommendation: Start the local wallet, and add the wallet address as the node address.")]),t._v(" "),s("p",[t._v("Click + on the top left corner of panel, and select Add Node.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(182),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Input Node address and clock OK")]),t._v(" "),s("p",[s("img",{attrs:{src:a(183),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(184),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-package-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-package-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 Package contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code")]),t._v(" "),s("p",[s("img",{attrs:{src:a(185),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).")]),t._v(" "),s("p",[s("img",{attrs:{src:a(186),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(187),alt:"code"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(188),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-deploy-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 Deploy contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(189),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Parameters following JarFilePath are the parameters of the contract construction function.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(190),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(191),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(192),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(193),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Review the deployed contract on the top of panel")]),t._v(" "),s("p",[s("img",{attrs:{src:a(194),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the deployed contract to review all method of this contract")]),t._v(" "),s("p",[s("img",{attrs:{src:a(195),alt:"code"}})])])])}],c=a(0),n=Object(c.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Get NULS plugin"),a("OutboundLink")],1),t._v(" ZIP, and save in disk\nClick File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Input Project name, click finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),a("p",[t._v("Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},s,!1,null,null,null);n.options.__file="smartContractIDEAPlugin.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/80.c33bd3c0.js b/docs/.vuepress/dist/assets/js/80.c33bd3c0.js new file mode 100644 index 00000000..1b2dc1f0 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/80.c33bd3c0.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{877:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"rpc-tool-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rpc-tool-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" RPC-TOOL design document")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"_1-overall-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Overall description")]),t._v(" "),a("h3",{attrs:{id:"_1-1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-summary","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 summary")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-position-of-rpc-tool"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-position-of-rpc-tool","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 position of RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("NULS 2 according to function partition module, all modules are isolated and can run independently.")]),t._v(" "),a("li",[t._v("Interaction between modules through RPC call interface")]),t._v(" "),a("li",[t._v("As long as the module implements the required interface, it can be implemented in any language")]),t._v(" "),a("li",[t._v("Each module will use RPC, so it will be encapsulated into the same jar file")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-what-will-rpc-tool-did"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-will-rpc-tool-did","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 what will RPC-TOOL did")]),t._v(" "),a("p",[t._v("Data interaction between modules is done through RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("RPC Server start")]),t._v(" "),a("li",[t._v("Register all CMD commands of the current module")]),t._v(" "),a("li",[t._v("Parsing the received CMD command")]),t._v(" "),a("li",[t._v("Returns the result by calling the corresponding method based on CMD")]),t._v(" "),a("li",[t._v("RPC Client start")]),t._v(" "),a("li",[t._v("Interacting with kernel")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-position"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-position","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 position")]),t._v(" "),a("p",[t._v("RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.")]),t._v(" "),a("h2",{attrs:{id:"_2-functional-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2. functional design")]),t._v(" "),a("h2",{attrs:{id:"_3-interface-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 3. interface design")]),t._v(" "),a("h3",{attrs:{id:"_3-1-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 interface")]),t._v(" "),a("h4",{attrs:{id:"status"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#status","aria-hidden":"true"}},[t._v("#")]),t._v(" status")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel will periodically push the status of the current system to each module, which is used for receiving")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"service"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"modules"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"READY"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"addr"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19722")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rpcList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cmd1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conf_reset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependsModule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("modules_information")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("modules_information")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("service")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("modules")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("module")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("name")])]),t._v(" "),a("tr",[a("td",[t._v("status")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("status")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("addr")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("ip address/host name")])]),t._v(" "),a("tr",[a("td",[t._v("port")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("port")])]),t._v(" "),a("tr",[a("td",[t._v("rpcList")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("list")]),t._v(" "),a("td",[t._v("cmd list")])]),t._v(" "),a("tr",[a("td",[t._v("dependsModule")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"shutdown"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#shutdown","aria-hidden":"true"}},[t._v("#")]),t._v(" shutdown")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (waiting for all the processing of the current business to complete)")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"terminate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#terminate","aria-hidden":"true"}},[t._v("#")]),t._v(" terminate")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (immediately terminates).")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confget"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confget","aria-hidden":"true"}},[t._v("#")]),t._v(" confGet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel gets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confGet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confset","aria-hidden":"true"}},[t._v("#")]),t._v(" confSet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel sets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confSet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confreset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confreset","aria-hidden":"true"}},[t._v("#")]),t._v(" confReset")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel restore template is configured as initial value.")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confReset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h2",{attrs:{id:"_4-event-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 4. Event description")]),t._v(" "),a("h2",{attrs:{id:"_5-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 5. Protocol")]),t._v(" "),a("h2",{attrs:{id:"_6-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 6. Configuration")]),t._v(" "),a("h2",{attrs:{id:"_7-java-unique-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-unique-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 7. Java unique design")]),t._v(" "),a("h3",{attrs:{id:"server"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#server","aria-hidden":"true"}},[t._v("#")]),t._v(" Server")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Start server")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// Port is not necessary. If no port is specified, the system is allocated randomly\nBaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);\n\n// Scan the package in which the CMD command is located\nserver.scanPackage("io.nuls.rpc.mycmd");\n\n// Initialization\nserver.init("moduleName", "dependsModule, type is List");\n\n// start\nserver.start();\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Custom CMD")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// extends BaseCmd\npublic class SomeCmd extends BaseCmd\n\n// Custom method to add annotation CmdInfo \n@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)\npublic Object methodName(List params) {\n System.out.println("I\'m version 1");\n return success();\n}\n\nNote: rpc-tool automatically transfers the Object[] transferred from client to List. \n')])])])]),t._v(" "),a("li",[a("p",[t._v("There must be and only one CMD class to implement the KernelCmd interface.")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("// Implement interface \npublic class SomeCmd extends BaseCmd implements KernelCmd \n\n/**\n * Receive all module information from kernel \n */\npublic Object status(List params);\n\n/**\n * Shut down service: after the existing business is completed\n */\npublic Object shutdown(List params);\n\n/**\n * Shut down service: close immediately, whether or not the business is completed.\n */\npublic Object terminate(List params);\n\n/**\n * Provide local configuration information \n */\npublic Object confGet(List params);\n\n/**\n * Update local configuration information \n */\npublic Object confSet(List params);\n\n/**\n * Reset local configuration information \n */\npublic Object confReset(List params);\n")])])])])]),t._v(" "),a("h3",{attrs:{id:"client"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#client","aria-hidden":"true"}},[t._v("#")]),t._v(" Client")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Provide module information to kernel")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("RpcClient.versionToKernel();\n")])])])]),t._v(" "),a("li",[a("p",[t._v("call rpc")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// CMD corresponds to one interface. \nString jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);\n\n// CMD corresponds to multiple interfaces. \nString jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);\n\nnote:\nparams is instance of Object[] \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"data-exchange"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-exchange","aria-hidden":"true"}},[t._v("#")]),t._v(" Data exchange")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "shutdown",\n "minVersion": 1.0, //根据自己需要传最低版本号\n "params": [],\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Response(success and failure are the same)")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "msg": " This property is only available when failed",\n "version": "Actually called version",\n "result": {}\n} \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"other"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#other","aria-hidden":"true"}},[t._v("#")]),t._v(" Other")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("@Override\n@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)\npublic Object status(List params){\n return super.status(params);\n}\n")])])])]),t._v(" "),a("li",[a("p",[t._v("There are ways to return to success and failure in BaseCmd."),a("br"),t._v("\nsuccess:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object success(double version) {\n return success(version, null);\n}\n\nprotected Object success(double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", 0);\n map.put("msg", SUCCESS);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])]),a("p",[t._v("fail:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object fail(String code, String msg, double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", code);\n map.put("msg", msg);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])])])]),t._v(" "),a("h2",{attrs:{id:"_8-supplementary-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 8. supplementary content")])])}],!1,null,null,null);n.options.__file="rpcToolWebsocketDesign.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/81.c1c8227b.js b/docs/.vuepress/dist/assets/js/81.c1c8227b.js new file mode 100644 index 00000000..5bfd7918 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/81.c1c8227b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{879:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),a("p",[t._v("Import jar files by using build tool")]),t._v(" "),t._m(8),t._v(" "),t._m(9),t._m(10),t._v(" "),a("p",[t._v("First introduce SDK namespace")]),t._v(" "),t._m(11),a("p",[t._v("After importing, create a client instance using the following code")]),t._v(" "),t._m(12),t._v(" "),t._m(13),t._m(14),t._v(" "),t._m(15),t._m(16),t._v(" "),t._m(17),a("p",[t._v("--")]),t._v(" "),t._m(18),t._v(" "),t._m(19),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(21),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(22),t._v(" "),t._m(23),t._m(24),t._v(" "),t._m(25),a("hr"),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(27),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(28),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),a("hr"),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(35),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(36),t._v(" "),t._m(37),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),a("hr"),t._v(" "),t._m(42),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(43),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(47),t._v(" "),t._m(48),t._m(49),t._v(" "),t._m(50),a("hr"),t._v(" "),t._m(51),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(52),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(53),t._v(" "),t._m(54),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._m(57),t._v(" "),t._m(58),a("hr"),t._v(" "),t._m(59),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(60),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),a("hr"),t._v(" "),t._m(67),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(68),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(69),t._v(" "),t._m(70),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(71),t._v(" "),t._m(72),t._m(73),t._v(" "),t._m(74),a("hr"),t._v(" "),t._m(75),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(79),t._v(" "),t._m(80),t._m(81),t._v(" "),t._m(82),t._m(83),t._v(" "),t._m(84),t._m(85),t._v(" "),t._m(86),a("hr"),t._v(" "),t._m(87),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(88),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(91),t._v(" "),t._m(92),t._m(93),t._v(" "),t._m(94),a("hr"),t._v(" "),t._m(95),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("Instrucions")]),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(99),t._v(" "),t._m(100),t._m(101),t._v(" "),t._m(102),a("hr"),t._v(" "),t._m(103),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(104),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(105),t._v(" "),t._m(106),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._m(109),t._v(" "),t._m(110),a("hr"),t._v(" "),t._m(111),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(112),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(113),t._v(" "),t._m(114),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(115),t._v(" "),t._m(116),t._m(117),t._v(" "),t._m(118),t._m(119),t._v(" "),t._m(120),t._m(121),t._v(" "),t._m(122),a("hr"),t._v(" "),t._m(123),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(124),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(125),t._v(" "),t._m(126),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(127),t._v(" "),t._m(128),t._m(129),t._v(" "),t._m(130),t._m(131),t._v(" "),t._m(132),a("hr"),t._v(" "),t._m(133),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(134),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(135),t._v(" "),t._m(136),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(137),t._v(" "),t._m(138),t._m(139),t._v(" "),t._m(140),t._m(141),t._v(" "),t._m(142),a("hr"),t._v(" "),t._m(143),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(144),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(145),t._v(" "),t._m(146),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(147),t._v(" "),t._m(148),t._m(149),t._v(" "),t._m(150),t._m(151),t._v(" "),t._m(152),a("hr"),t._v(" "),t._m(153),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(154),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(155),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(156),t._v(" "),t._m(157),t._m(158),t._v(" "),t._m(159),t._m(160),t._v(" "),t._m(161),a("hr"),t._v(" "),t._m(162),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(164),t._v(" "),t._m(165),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(166),t._v(" "),t._m(167),t._m(168),t._v(" "),t._m(169),a("hr"),t._v(" "),t._m(170),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(171),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(174),t._v(" "),t._m(175),t._m(176),t._v(" "),t._m(177),a("hr"),t._v(" "),t._m(178),t._v(" "),t._m(179),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(180),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(181),t._v(" "),t._m(182),t._v(" "),t._m(183),a("hr"),t._v(" "),t._m(184),t._v(" "),t._m(185),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(186),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),t._m(189),t._v(" "),t._m(190),a("blockquote"),t._v(" "),a("hr"),t._v(" "),t._m(191),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(192),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(193),t._v(" "),t._m(194),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(195),t._v(" "),t._m(196),t._m(197),t._v(" "),t._m(198),a("hr"),t._v(" "),t._m(199),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(200),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(201),t._v(" "),t._m(202),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(203),t._v(" "),t._m(204),t._m(205),t._v(" "),t._m(206),a("hr"),t._v(" "),t._m(207),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(208),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(209),t._v(" "),t._m(210),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(211),t._v(" "),t._m(212),t._m(213),t._v(" "),t._m(214),a("hr"),t._v(" "),t._m(215),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(216),t._v(" "),a("p",[t._v("Instruction")]),t._v(" "),t._m(217),t._v(" "),t._m(218),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(219),t._v(" "),t._m(220),t._m(221),t._v(" "),t._m(222),a("hr"),t._v(" "),t._m(223),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(224),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(225),t._v(" "),t._m(226),t._v(" "),t._m(227),t._v(" "),t._m(228),a("hr"),t._v(" "),t._m(229),t._v(" "),t._m(230),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(231),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(232),t._v(" "),a("table",[t._m(233),t._v(" "),t._m(234),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privKeys")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" private key of the transaction")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("passwords")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List"),a("String")],1),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password corresponding to the private key (passwords for multiple accounts must be the same)\n")])])]),t._v(" "),t._m(235),t._v(" "),t._m(236),a("blockquote"),t._v(" "),t._m(237),t._v(" "),t._m(238),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(239),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(240),t._v(" "),t._m(241),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(242),t._v(" "),t._m(243),t._m(244),t._v(" "),t._m(245),a("hr"),t._v(" "),t._m(246),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(247),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(248),t._v(" "),t._m(249),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(250),t._v(" "),t._m(251),t._m(252),t._v(" "),t._m(253),a("hr"),t._v(" "),t._m(254),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(255),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(256),t._v(" "),t._m(257),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(258),t._v(" "),t._m(259),t._m(260),t._v(" "),t._m(261),a("hr"),t._v(" "),t._m(262),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(263),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(264),t._v(" "),t._m(265),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(266),t._v(" "),t._m(267),t._m(268),t._v(" "),t._m(269),a("hr"),t._v(" "),t._m(270),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(271),t._v(" "),a("p",[t._v("Instrucntions")]),t._v(" "),t._m(272),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(273),t._v(" "),t._m(274),t._m(275),t._v(" "),t._m(276),a("hr"),t._v(" "),t._m(277),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(278),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(279),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(280),t._v(" "),t._m(281),t._m(282),t._v(" "),t._m(283),a("hr"),t._v(" "),t._m(284),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(285),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(286),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(287),t._v(" "),t._m(288),t._m(289),t._v(" "),t._m(290),a("hr"),t._v(" "),t._m(291),t._v(" "),t._m(292),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(293),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(294),t._v(" "),t._m(295),t._v(" "),t._m(296),t._v(" "),t._m(297),a("hr"),t._v(" "),t._m(298),t._v(" "),t._m(299),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(300),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(301),t._v(" "),t._m(302),t._v(" "),t._m(303),t._v(" "),t._m(304),a("hr"),t._v(" "),t._m(305),t._v(" "),t._m(306),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(307),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(308),t._v(" "),t._m(309),t._v(" "),t._m(310),t._v(" "),t._m(311),t._m(312),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(313),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(314),t._v(" "),t._m(315),t._v(" "),t._m(316),t._v(" "),t._m(317),t._m(318),t._v(" "),a("p",[t._v("Interface")]),t._v(" "),t._m(319),t._v(" "),a("p",[t._v("Instructions")]),t._v(" "),t._m(320),t._v(" "),t._m(321),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(322),t._v(" "),t._m(323),t._m(324),t._v(" "),t._m(325),t._m(326),t._v(" "),t._m(327),t._v(" "),t._m(328),t._v(" "),t._m(329),t._v(" "),t._m(330),t._m(331),t._v(" "),t._m(332),t._m(333),t._v(" "),t._m(334),t._m(335),t._v(" "),t._m(336),t._m(337),t._v(" "),t._m(338),a("hr"),t._v(" "),t._m(339),t._v(" "),t._m(340),a("hr"),t._v(" "),t._m(341),t._v(" "),t._m(342),a("hr"),t._v(" "),t._m(343),t._v(" "),t._m(344),a("hr"),t._v(" "),t._m(345),t._v(" "),t._m(346),a("hr"),t._v(" "),t._m(347),t._v(" "),t._m(348),a("hr"),t._v(" "),t._m(349),t._v(" "),t._m(350),a("hr"),t._v(" "),t._m(351),t._v(" "),t._m(352)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"convention"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#convention","aria-hidden":"true"}},[this._v("#")]),this._v(" Convention")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article)")]),t._v(" "),a("li",[t._v("The return object described in each interface refers to the content of the data attribute in the Result")]),t._v(" "),a("li",[t._v("Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na")]),t._v(" "),a("li",[t._v("Before running the SDK, you need to confirm that the NULS service is started and running normally")]),t._v(" "),a("li",[t._v("JDK1.8+ is recommended")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"releases-history"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#releases-history","aria-hidden":"true"}},[this._v("#")]),this._v(" Releases History")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Version")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Release Date")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Release Notes")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-19")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Provide interfaces for docking basic functions of the NULS service")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.11.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-06-22")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.14")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-04")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.15")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-07")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add four consensus interfaces (4.1-4.4)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v0.9.16")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-11")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add interface 4.5")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.0.1")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-07-13")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add error code")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("v1.1.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-09-28")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Add multi-account transfer interface")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick Start")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_1-importing-files"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-importing-files","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Importing files")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Use maven")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-xml extra-class"},[a("pre",{pre:!0,attrs:{class:"language-xml"}},[a("code",[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("dependency")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("groupId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("io.nuls.sdk"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("artifactId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("sdk-all"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("version")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1.0.1"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-creating-sdk-instance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-creating-sdk-instance","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Creating SDK instance")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace of the SDK boot class ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace of the SDK calls tool ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Initiate SDK")]),this._v(" "),s("li",[this._v("If no parameters are passed in initialization method, the default PRC IP and Port respectively are "),s("code",[this._v("127.0.0.1")]),this._v(", 8001 "),s("code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//By default ")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Pass in the NULS service’s IP and Port")]),t._v("\nSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"192.168.1.88"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"8001"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Call interface methods using the tool class")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g a complete example of creating an account with password")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("SDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// introduce the namespace for corresponding modules as required ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\tSDKBootstrap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"accounts-accountservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#accounts-accountservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Accounts AccountService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-1-creating-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-creating-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.1 Creating account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAccount(int count, String password);")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Creates one or more accounts with or without a password depending on the parameters passed in.\nThe information about the successfully created account will be persisted to the NULS service local database.")]),t._v(" "),a("p",[t._v("Returns a set of successfully created account addresses\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" required or not ")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account count to be created (default 1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" optional ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" // Return a set of the created account addresses\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"')]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//create an account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//create an account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three password-less accounts ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three accounts with passwords ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-2-creating-offline-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-creating-offline-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.2 Creating offline account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createOfflineAccount(int count, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Directly create an offline account and return it completely, without underlying interaction with NULS and persistence\nCreates an encrypted off-line account (Not saved to the database)")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v(" note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("count")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account count to be created (default 1)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" optional ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiBQg72BCLmLqttRpPfp8ECRCBwbdD"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529314943624")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"')]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create an offline account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create an offline account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three password-less offline accounts")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create three offline accounts with passwords")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createOfflineAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-3-getting-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-getting-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.3 Getting account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccount(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets information about the account by account address")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("AccountInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if when a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAccount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-4-getting-the-fee-for-setting-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-getting-the-fee-for-setting-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.4 Getting the fee for setting alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAliasFee(String address, String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)>\nResult.data "),s("code",[this._v("double")]),this._v(", unit is "),s("code",[this._v("NULS")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[this._v("Note!")]),this._v(" The unit of the fee returned by this interface is "),s("code",[this._v("NULS")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" alias name to be set")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.01")]),t._v(" //( unit"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" NULS"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAliasFee")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-5-getting-account-list"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-getting-account-list","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.5 Getting account list")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAccountList(int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a list of accounts based on the paging parameters")]),this._v(" "),s("p",[this._v("Result.data Page "),s("a",{attrs:{href:"#AccountInfo"}},[s("code",[this._v("List")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("page number, must be greater than 0 ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" record size displayed per page, ranging from 1 to 100")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2Cid96JrTGA2XaNG6zXrRKh18kLUbLP"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529311250627")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t...\n\t\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAccountList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-6-getting-account-address-by-account-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-getting-account-address-by-account-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.6 Getting account address by account alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getAddressByAlias(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the account address by the account alias")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account alias")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[this._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getAddressByAlias")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-7-getting-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-getting-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.7 Getting account private key")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getPrikey(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the private key of the account by account address and password, and returns the private key string")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the way of calling the account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the way of calling the password-less account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrikey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-8-verifying-the-availability-of-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-verifying-the-availability-of-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.8 Verifying the availability of alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isAliasUsable(String alias)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Verifies that the alias is available (if it is not used) by alias name")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("alias name")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the alias is available\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return the case where the alias is unavailable")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the alias is not available\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isAliasUsable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"factory666"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-9-account-backup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-account-backup","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.9 Account Backup")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result backupAccount(String address, String path, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing.")]),this._v(" "),s("p",[this._v("Result: the generated file address")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Backup an password-less account to the current directory")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Backup an account with password to the /backup directory")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("backupAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-10-importing-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-importing-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.10 Importing account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByKeystore")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("path/fileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String/FileReader")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//import an account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//import a password-less account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/backup/XXXXXX.keystore"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByKeystore")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fileReader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-11-importing-account-private-key"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-importing-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.11 Importing account (private key)")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result importAccountByPriKey(String privateKey, String password, boolean overwrite)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Imports an account by private key")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr"),a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("privateKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" private key of the account")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("overwrite")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("boolean")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// set a password when importing account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no password is set when importing account")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("importAccountByPriKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e120......"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-12-verifying-account-is-encrypted"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-verifying-account-is-encrypted","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.12 Verifying account is encrypted")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result isEncrypted(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Verifies the account is encrypted")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate encrypted\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return unencrypted")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("isEncrypted")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-removing-account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-removing-account","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 Removing account")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result removeAccount(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Removes an account")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("removeAccount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-13-setting-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-setting-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.13 Setting password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPassword(String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Sets a password for an unencrypted account. Encrypted account cannot call this interface.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-14-modifying-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-modifying-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.14 Modifying password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPassword(String address, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Modifys the password for an encrypted account. Unencrypted account cannot call this interface.")]),this._v(" "),s("p",[this._v("Result")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the current password of the account")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t//indicate a success\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return failure and error cases, such as a parameter error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPassword")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-15-setting-alias"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-setting-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.15 Setting alias")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setAlias(String address, String alias, String password)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Sets alias name for an account")]),t._v(" "),a("p",[t._v("Result: the hash of the transaction for setting the alias\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("alias")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("alias name to be set ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" account password, leave it blank if the account is not encrypted ")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\t\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"')]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example for error")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT007"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The account already set an alias"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAlias")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChqBTvFXttQsghj8zQpcdv76TQU8G5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"factory666"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-16-setting-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-setting-offline-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.16 Setting offline-account password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result setPasswordOffline(String address, String priKey, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service")]),this._v(" "),s("p",[this._v("Result: the encrypted private key(encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account’s private key")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_1-17-modifying-offline-account-password"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-modifying-offline-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" 1.17 Modifying offline-account password")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Modifies the password of the offline account independently in SDK, without interaction with NULS service")]),this._v(" "),s("p",[this._v("Result: the encrypted private key generated by the new password (encryptedPriKey)")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("encryptedPriKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("encrypted private key")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("original password ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("newPassword")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("resetPasswordOffline")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS111111"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"transactions-accountledgerservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transactions-accountledgerservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Transactions AccountLedgerService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-1-creating-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-creating-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Creating transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("blockquote",[a("p",[t._v("Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. "),a("strong",[t._v("The calculation of the fee will be explained in detail later")])]),t._v(" "),a("p",[t._v("Result.data "),a("code",[t._v("String")]),t._v(": serialized transaction string in hexadecimal\n"),a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output referred by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output newly generated by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction remarks")])])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the outputs for assembly transaction, the attribute of the output in the example is mandatory.")]),t._v("\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:100000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-2-transaction-signatures"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-transaction-signatures","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Transaction Signatures")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signTransaction(String txHex, String priKey, String address, String password)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Signs the transaction by private key")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": the signed transaction, serialized string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("serialized transaction data in hexadecimal ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("priKey")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("private key of the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the address corresponding to the private key, used to verify the validity of the private key. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the password of the private key, leave it blank if the private key is not encrypted ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString priKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString password "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NULS6352s!f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-3-querying-transaction-details-by-transaction-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-querying-transaction-details-by-transaction-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Querying transaction details by transaction hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getTxByHash(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Queries transaction details by transaction hash")]),this._v(" "),s("p",[this._v("Result.data: "),s("a",{attrs:{href:"#Transaction"}},[s("code",[this._v("Transaction")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction hash ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getTxByHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-4-transfers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-transfers","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Transfers")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result transfer(String address, String toAddress, String password, long amount, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Initiates a transfer transaction")]),this._v(" "),s("p",[this._v("Result: the transaction hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" address of the transferor account ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("toAddress")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" address of the transferee account ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("password")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" password of the transferor account, leave it blank if the account is not encrypted. ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("amount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("long")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transfer amount (unit: Na)")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("remarks")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//account with password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remarks 1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//account without password")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8888800000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('" remarks 1NULS=10000000Na"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-5-querying-account-balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-5-querying-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.5 Querying account balance")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBalance(String address)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the account balance")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BalanceInfo"}},[s("code",[this._v("BalanceInfo")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("account address")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1009899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-6-broadcasting-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-6-broadcasting-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.6 Broadcasting transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result broadcastTransaction(String txHex);")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Broadcasts a transaction")]),this._v(" "),s("p",[this._v("Result.data String: transaction hash")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("txHex")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("serialized transaction data in hexadecimal ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" service"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("broadcastTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isSuccess")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n String txHash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-7-creating-multi-address-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-7-creating-multi-address-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.7 Creating multi-address transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. "),s("strong",[this._v("The calculation of the fee will be explained in detail later")])]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output referred by the transaction")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("outputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" usable output newly generated by the transaction ")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("nInputAccount")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input account number")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("remark")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("optional")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction remarks")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String remark "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create transaction demo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" outputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" nInputAccount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//the outputs for assembly transaction, the attribute of the output in the example is mandatory.")]),t._v("\n Output output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\noutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000000")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createMultipleInputAddressTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("nInputAccount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remark"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:100000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024\n124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_2-8-signing-multi-address-transfer-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-8-signing-multi-address-transfer-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.8 Signing multi-address transfer transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Signs a transaction by private key")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": signed transaction, serialized string in hexadecimal")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("th",{attrs:{align:"center"}},[this._v("parameter")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("type")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("required or not")]),this._v(" "),s("th",{attrs:{align:"center"}},[this._v("note")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("tr",[s("td",{attrs:{align:"center"}},[this._v("txHex")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("String")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("required")]),this._v(" "),s("td",{attrs:{align:"center"}},[this._v("serialized transaction data in hexadecimal ")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("String txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" priKeys "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" passwords "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Arrays"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("asList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("signMultiTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txHex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" priKeys"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" passwords"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"blocks-blockservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blocks-blockservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Blocks BlockService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-1-getting-block-header-by-block-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-getting-block-header-by-block-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 Getting block header by block height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block header by block height")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block height")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-2-getting-block-header-by-block-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-getting-block-header-by-block-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Getting block header by block hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getblockHeader(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block header by block hash")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block hash ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getblockHeader")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-3-getting-block-by-block-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-getting-block-by-block-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 Getting block by block height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(int height)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block by block height")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("height")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block height")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following formats:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[this._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-4-getting-block-by-block-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-getting-block-by-block-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 Getting block by block hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getBlock(String hash)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a block by block hash")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#Block"}},[s("code",[this._v("Block")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("hash")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("block hash")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("-Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("420416")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323170000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("54")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2884")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323198461")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transfer"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9999899000000")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CiVA3n1VoNQobAax4d7qNEBZAfehLN"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("99900000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2ChDcC1nvki521xXhYAUzYXt4RLNULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("9899998900000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529323210000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1884")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("33")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("38")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getBlock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[this._v('"041f3d2ceed........"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-5-getting-the-latest-block-header"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-getting-the-latest-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 Getting the latest block header")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the latest block header")]),this._v(" "),s("p",[this._v("Result.data "),s("a",{attrs:{href:"#BlockHeader"}},[s("code",[this._v("BlockHeader")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299160000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CWsZb9w8XXTE58TUhBGczxf4U6NULS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("419517")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529299150000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1909")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-6-getting-the-latest-block’s-height"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-6-getting-the-latest-block’s-height","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.6 Getting the latest block’s height")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHight()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the height of the latest block")]),this._v(" "),s("p",[this._v("Result.data: height (Long)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("-Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5210")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHight")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_3-7-getting-the-latest-block’s-hash"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-7-getting-the-latest-block’s-hash","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.7 Getting the latest block’s Hash")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getNewestBlockHash()")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets the block Hash of the latest block")]),this._v(" "),s("p",[this._v("Result.data: Hash (String)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[this._v("getNewestBlockHash")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v(";")]),this._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"consensus-consensusservice"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#consensus-consensusservice","aria-hidden":"true"}},[this._v("#")]),this._v(" Consensus ConsensusService")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-1-offline-assembling-transaction-for-creating-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-offline-assembling-transaction-for-creating-node","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.1 Offline assembling transaction for creating node")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles transaction for creating node offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("agentInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the information about the node to be created")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input information")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction fee")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the information about the node to be created, the attribute of AgentInfo in the example is mandatory.")]),t._v("\nAgentInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AgentInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the agent address of the consensus node")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the address of the node actually packing block")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// deposit for creating a node, not less than 20000NULS and not more than 200000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setCommissionRate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// commission ratio ranging from 1 to 100")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//fee for creating a node")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of transaction fee **: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:1000000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(288 + 50 * inputs.length)/1024\n210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-2-offline-assembling-agent-consensus-transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-offline-assembling-agent-consensus-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.2 Offline assembling agent consensus transaction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles an agent consensus transaction offline.")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction data in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("depositInfo")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("the information about the node to be created")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("inputs")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("List")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("input information")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("fee")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("transaction fee")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the inputs for assembly transaction, the attribute of the input in the example is mandatory.")]),t._v("\nList"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" inputs "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nInput input "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Input")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setFromIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("999998760000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory.")]),t._v("\nDepositInfo info "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("DepositInfo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//address of the agent consensus node")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDeposit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300000")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the agent token number ranging from 2000NULS to 500000NULS")]),t._v("\ninfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAgentHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the id of the transaction for creating consensus node")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//fee for creating a node")]),t._v("\nNa fee "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Na"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("info"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" inputs"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fee"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("** Calculation of fee for creating an agent transaction**: unit price of the fee* transaction size")]),this._v(" "),s("p",[this._v("** unit price of the fee (min)**:1000000 NA/1KB")]),this._v(" "),s("p",[s("strong",[this._v("Calculation of transaction size")]),this._v(":(288 + 50 * inputs.length)/1024\n210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB.\nWhen the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-3-offline-assembling-transaction-for-canceling-agent-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-offline-assembling-transaction-for-canceling-agent-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.3 Offline assembling transaction for canceling agent consensus")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createCancelDepositTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles a transaction for canceling agent consensus offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the output locked when participating in the consensus ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus.")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" use the output as a parameter to generate an transaction "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" canceling agent consensus\nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCancelDepositTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-4-offline-assembling-transaction-for-stopping-consensus-node"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-offline-assembling-transaction-for-stopping-consensus-node","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.4 Offline assembling transaction for stopping consensus node")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result createStopAgentTransaction(Output output)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Assembles a transaction for stopping consensus node offline")]),this._v(" "),s("p",[this._v("Result.data "),s("code",[this._v("String")]),this._v(": serialized transaction string in hexadecimal")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("output")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("Object")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" the output locked when creating a node ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. ")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" use the output as a parameter to generate a transaction "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" canceling agent consensus \nOutput output "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Output")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTxHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setIndex")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000000000000")]),t._v("L"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\noutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setLockTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nResult result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createStopAgentTransaction")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nMap"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nString txHex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"_4-5-getting-list-of-agent-consensus"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-getting-list-of-agent-consensus","aria-hidden":"true"}},[this._v("#")]),this._v(" 4.5 Getting list of agent consensus")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("strong",[s("code",[this._v("Result getDeposits(String address, int pageNumber, int pageSize)")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Gets a list of agent consensus by agent address")]),this._v(" "),s("p",[this._v("Result.data List: a list of agent consensus")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("tr",[a("th",{attrs:{align:"center"}},[t._v("parameter")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("type")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("required or not")]),t._v(" "),a("th",{attrs:{align:"center"}},[t._v("note")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("address")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("String")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("agent address")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageNumber")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("required")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("page number")])]),t._v(" "),a("tr",[a("td",{attrs:{align:"center"}},[t._v("pageSize")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v("int")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" required ")]),t._v(" "),a("td",{attrs:{align:"center"}},[t._v(" record size displayed per page ranging from 1 to 100< ")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return "),s("code",[this._v("Result")]),this._v(" object in the following format:")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageNumber"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pageSize"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pages"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"deposit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000010000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("98")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"agentAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("em",[this._v("e.g Sample Code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("Result result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" NulsSDKTool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getDeposits")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"appendix"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#appendix","aria-hidden":"true"}},[this._v("#")]),this._v(" Appendix")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h4",{attrs:{id:"example-of-result-returned-by-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-of-result-returned-by-interface","aria-hidden":"true"}},[this._v("#")]),this._v(" Example of Result returned by interface")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"result"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#result","aria-hidden":"true"}},[this._v("#")]),this._v(" Result")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface and the specific data returned by the business service.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// interface executes correctly\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" data\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface, and the business service returns true.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate the normal access to the interface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" and the business service returns "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// interface executes correctly\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" // the result returned by interface business function\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Indicate the normal access to the interface, and the business service returns false.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // interface executes correctly\n \t"),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v(" // the result returned by interface business function\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Return error cases, such as a parameter error, exception, etc.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\t// indicate an error \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"data"')]),t._v(":"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ACT005"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxx...."')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("This is the full result of creating an offline account with password.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n //data为List\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"list"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1529041525794")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\t \t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"account"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#account","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Account"}},[this._v(" Account ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" account alias\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" public key\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"extend"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" extension\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"createTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" create time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encrypted"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" boolean"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted or not\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"priKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if a password-less offline account is created)\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPriKey"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" encrypted private key(not "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v(" only if an offline account with password is created)\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"input"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#input","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Input"}},[this._v(" Input ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in amount\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"output"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#output","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Output"}},[this._v(" Output ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" index\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(usable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(time lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(consensus lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(spent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"transaction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Transaction"}},[this._v(" Transaction ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction type\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction initiation time \n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction fee\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction amount\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remarks\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(to be confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address \n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in amount\n\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" index\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("usable(usable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("timeLock(time lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("consensusLock(consensus lock"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("spent(spent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"balanceinfo"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balanceinfo","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BalanceInfo"}},[this._v(" BalanceInfo ")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"usable"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(' available balance\n\t“locked"'),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" locked balance\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"BlockHeader"}},[this._v(" BlockHeader")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" hash value of the previous block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" merkle hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block generation time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of transactions packaged by the block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of members participating in the consensus\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the start time of the current consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the packing index of the current round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus reward\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing fee obtained\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h5",{attrs:{id:"block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#block","aria-hidden":"true"}},[this._v("#")]),this._v(" "),s("a",{attrs:{name:"Block"}},[this._v(" Block")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" hash value of the previous block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" merkle hash\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block generation time\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block height\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of transactions packaged by the block\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing address\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count of members participating in the consensus\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the start time of the current consensus round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" the packing index of the current round\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reward"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" consensus reward\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" packing fee obtained\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction hash\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction type\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction initiation time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" block time\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction fee\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction amount\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" remarks\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scriptSig"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" signature\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transaction status "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("unConfirm(to be confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("confirm(confirmed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"confirmCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" confirmation count\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" int"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" size\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("inputs\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromHash"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" txHash of the output \n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fromIndex"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Integer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outIndexof the output\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" transfer-in address\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long transfer-in amount\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outputs"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" outputs\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" amount\n\t\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" lock time\n\t\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n\t\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])}],!1,null,null,null);e.options.__file="sdk.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/82.042ca332.js b/docs/.vuepress/dist/assets/js/82.042ca332.js new file mode 100644 index 00000000..2bfbcef5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/82.042ca332.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{881:function(t,s,e){"use strict";e.r(s);var a=e(0),r=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"service-charge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#service-charge","aria-hidden":"true"}},[t._v("#")]),t._v(" Service charge")]),t._v(" "),e("h2",{attrs:{id:"_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?")]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Background:")]),t._v(" Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.")])]),t._v(" "),e("p",[t._v("In the main-net, there are now three more types of transactions: "),e("code",[t._v("creating a smart contract")]),t._v(", "),e("code",[t._v("invoking a smart contract")]),t._v(", "),e("code",[t._v("deleting a smart contract")])]),t._v(" "),e("p",[t._v("The difference between those three transactions and other transactions such as "),e("code",[t._v("transfer")]),t._v(" is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.")]),t._v(" "),e("ul",[e("li",[t._v("Calculation of smart contract service charge")])]),t._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" COMPARISON "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Compare bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONSTANT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Simple numeric type bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LDC "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Numeric constant, string constant (length * LDC) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONTROL "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v(".5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Control bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TABLESWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * TABLESWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOOKUPSWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * LOOKUPSWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONVERSION "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Value conversion ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" EXTENDED "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Null determine ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MULTIANEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Multidimensional Array (size * MULTIANEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send the local variable to the top of the stack \n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYLOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send an item of the array to the top of the stack\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MATH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Mathematical operations and shift operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" REFERENCE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Object related operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" NEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//One-dimensional array (size * NEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STACK "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Stack operation ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Save the value in the top of the stack to a local variable ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYSTORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Save the value of the stack to an array ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TRANSFER "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Transfer transaction")]),t._v("\n\n")])])]),e("ul",[e("li",[t._v("Total service charge for invoking a smart contract\nThe total service charge for a contract transaction consists of three parts")])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.")])]),t._v(" "),e("li",[e("p",[t._v("The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.")])])]),t._v(" "),e("blockquote",[e("p",[t._v("For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.")])]),t._v(" "),e("ul",[e("li",[t._v("The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")])]),t._v(" "),e("ul",[e("li",[t._v("How much does a contract invoker pay?")])]),t._v(" "),e("p",[t._v("To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")]),t._v(" "),e("ul",[e("li",[t._v("Who receives the service charge?")])]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Precondition:")]),t._v("This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.")])]),t._v(" "),e("p",[t._v("The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.")])])}],!1,null,null,null);r.options.__file="smartContractFee.md";s.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/83.371427a4.js b/docs/.vuepress/dist/assets/js/83.371427a4.js new file mode 100644 index 00000000..5e233602 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/83.371427a4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{885:function(e,t,n){"use strict";n.r(t);var o=n(0),i=Object(o.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[n("h1",{attrs:{id:"launching-nuls-with-source-code"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#launching-nuls-with-source-code","aria-hidden":"true"}},[e._v("#")]),e._v(" Launching NULS with source code")]),e._v(" "),n("h2",{attrs:{id:"downloading-source-code"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#downloading-source-code","aria-hidden":"true"}},[e._v("#")]),e._v(" Downloading source code")]),e._v(" "),n("p",[e._v("Visit the NULS project on github: https://github.com/nuls-io/nuls")]),e._v(" "),n("p",[e._v("Option 1: downloading the source code directly")]),e._v(" "),n("pre",[n("code",[e._v('After accessing the github, click the "Clone or download" button and select Download ZIP to download the source-code package.\n')])]),e._v(" "),n("p",[e._v("Option 2: running the git command to clone the NULS repository")]),e._v(" "),n("pre",[n("code",[e._v("` git clone https://github.com/nuls-io/nuls.git`\n")])]),e._v(" "),n("p",[e._v("Option 3: (recommended): cloning the NULS repository with development tools such as IntelliJ IDEA.")]),e._v(" "),n("h2",{attrs:{id:"environment-description"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#environment-description","aria-hidden":"true"}},[e._v("#")]),e._v(" Environment description")]),e._v(" "),n("pre",[n("code",[e._v("Operating Systems: macOS, Windows\n\nBuilding Tools: maven\n\nDevelopment Tools: IntelliJ IDEA\n\nDevelopment Language: Java (JDK1.8)\n")])]),e._v(" "),n("h2",{attrs:{id:"basic-introduction-of-launching-nuls"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#basic-introduction-of-launching-nuls","aria-hidden":"true"}},[e._v("#")]),e._v(" Basic introduction of launching NULS")]),e._v(" "),n("pre",[n("code",[e._v("Since blockchain is a decentralized network composed of multiple nodes, it makes no sense to launch a node with NULS source code alone, and it is also not feasible. This tutorial assumes an existing custom test-net running with NULS source code, and the source code other than the network parameters is not modified when building the network. How can we run the NULS source code and join the network \n")])]),e._v(" "),n("ol",[n("li",[e._v("First install jdk1.8 and the build tool - maven.")])]),e._v(" "),n("p",[e._v("2. Run IntelliJ IDEA\n     - If you download the source code package, extract it and import the NULS project via IntelliJ IDEA\n     - If you download the source code by running git command to clone the NULS repository, import the NULS project via IntelliJ IDEA.\n     - Clone the NULS repository via IntelliJ IDEA’s Git plugin.\n 3. Configure network environment parameters consistent with the existing network.\n     - Open the module.ini configuration file in the client-module project\n     - It is recommended to replace the module.ini file with that of other nodes in the known custom test-net to ensure the consistency of the network environment parameters.\n 4. Run the NULS boot class Bootstrap.java in the client-module project, located in "),n("code",[e._v("io.nuls.client")]),e._v(" package.\n 5. The NULS wallet interface will be opened during start-up process and the block height of the custom test-net will be synchronized, indicating that the startup is successful.")])])}],!1,null,null,null);i.options.__file="sourceCodeStartNULS.md";t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/84.95658ce6.js b/docs/.vuepress/dist/assets/js/84.95658ce6.js new file mode 100644 index 00000000..8689e147 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/84.95658ce6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{887:function(t,n,a){"use strict";a.r(n);var s=a(0),e=Object(s.a)({},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[a("router-link",{attrs:{to:"/startNULS/connectTestnet.html"}},[t._v("Preparations for deployment and invocation of smart contracts")])],1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("Preparations for the development of smart contract code")]),t._v(" "),a("p",[t._v("[Downloading JDK8]\n(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading NULS smart contract plug-ins]\n(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)")]),t._v(" "),a("p",[t._v("[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._m(7),t._v(" "),a("p",[t._v("[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)")]),t._v(" "),a("p",[t._v("[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)")]),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("[How to deploy and invoke the wallet smart contract]\n(https://dev.nuls.io/zh-cn/contract/smartContract.html)")]),t._v(" "),t._m(9),t._v(" "),a("p",[t._v("[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)")])])},[function(){var t=this.$createElement,n=this._self._c||t;return n("h1",{attrs:{id:"quick-start"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick Start")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Running the test-net environment, creating an account, and claiming test tokens.")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_3-smart-contract-example"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. Smart contract example")])},function(){var t=this.$createElement,n=this._self._c||t;return n("p",[n("strong",[this._v("_Quickly compile and deploy a smart contract with the example _")])])},function(){var t=this.$createElement,n=this._self._c||t;return n("ul",[n("li",[this._v("Simple example")])])},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigDecimal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nPublic "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n Private String sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferToContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// mark the @Payable annotation. Smart contract can receive NULS when invoking this method")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigDecimal nuls "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigDecimal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("movePointLeft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I received your transfer amount: "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toPlainString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayWhat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("If")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say nothing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_4-smart-contract-repository"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-smart-contract-repository","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Smart contract repository")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_5-deploying-and-invoking-smart-contracts"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_5-deploying-and-invoking-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. Deploying and invoking smart contracts")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_6-smart-contract-specifications-and-syntax"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_6-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Smart contract specifications and syntax")])}],!1,null,null,null);e.options.__file="startSmartContract.md";n.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/85.e4365ba5.js b/docs/.vuepress/dist/assets/js/85.e4365ba5.js new file mode 100644 index 00000000..133822ac --- /dev/null +++ b/docs/.vuepress/dist/assets/js/85.e4365ba5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{889:function(a,t,e){"use strict";e.r(t);var s=e(0),n=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"nrc-20-token-standard"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#nrc-20-token-standard","aria-hidden":"true"}},[a._v("#")]),a._v(" NRC-20 Token Standard")]),a._v(" "),e("h2",{attrs:{id:"simple-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#simple-summary","aria-hidden":"true"}},[a._v("#")]),a._v(" Simple Summary")]),a._v(" "),e("p",[a._v("A standard interface for tokens.")]),a._v(" "),e("h2",{attrs:{id:"abstract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#abstract","aria-hidden":"true"}},[a._v("#")]),a._v(" Abstract")]),a._v(" "),e("p",[a._v("The following standard allows for the implementation of a standard API for tokens within smart contracts.\nThis standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.")]),a._v(" "),e("h2",{attrs:{id:"motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#motivation","aria-hidden":"true"}},[a._v("#")]),a._v(" Motivation")]),a._v(" "),e("p",[a._v("A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.")]),a._v(" "),e("h2",{attrs:{id:"specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#specification","aria-hidden":"true"}},[a._v("#")]),a._v(" Specification")]),a._v(" "),e("h2",{attrs:{id:"token"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token","aria-hidden":"true"}},[a._v("#")]),a._v(" Token")]),a._v(" "),e("h3",{attrs:{id:"methods"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#methods","aria-hidden":"true"}},[a._v("#")]),a._v(" Methods")]),a._v(" "),e("p",[e("strong",[a._v("NOTE")]),a._v(": Callers MUST handle "),e("code",[a._v("false")]),a._v(" from "),e("code",[a._v("return boolean")]),a._v(". Callers MUST NOT assume that "),e("code",[a._v("false")]),a._v(" is never returned!")]),a._v(" "),e("h4",{attrs:{id:"name"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#name","aria-hidden":"true"}},[a._v("#")]),a._v(" name")]),a._v(" "),e("p",[a._v("Returns the name of the token - e.g. "),e("code",[a._v('"MyToken"')]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("name")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"symbol"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#symbol","aria-hidden":"true"}},[a._v("#")]),a._v(" symbol")]),a._v(" "),e("p",[a._v('Returns the symbol of the token. E.g. "MT".')]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" String "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("symbol")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"decimals"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#decimals","aria-hidden":"true"}},[a._v("#")]),a._v(" decimals")]),a._v(" "),e("p",[a._v("Returns the number of decimals the token uses - e.g. "),e("code",[a._v("8")]),a._v(", means to divide the token amount by "),e("code",[a._v("100000000")]),a._v(" to get its user representation.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("int")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("decimals")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"totalsupply"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#totalsupply","aria-hidden":"true"}},[a._v("#")]),a._v(" totalSupply")]),a._v(" "),e("p",[a._v("Returns the total token supply.")]),a._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[a._v("@View\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("totalSupply")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"balanceof"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#balanceof","aria-hidden":"true"}},[a._v("#")]),a._v(" balanceOf")]),a._v(" "),e("p",[a._v("Returns the account balance of another account with address "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("balanceOf")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[a._v("#")]),a._v(" transfer")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" if the "),e("code",[a._v("from")]),a._v(" account balance does not have enough tokens to spend.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transfer")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"transferfrom"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferfrom","aria-hidden":"true"}},[a._v("#")]),a._v(" transferFrom")]),a._v(" "),e("p",[a._v("Transfers "),e("code",[a._v("value")]),a._v(" amount of tokens from address "),e("code",[a._v("from")]),a._v(" to address "),e("code",[a._v("to")]),a._v(", and MUST fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("p",[a._v("The "),e("code",[a._v("transferFrom")]),a._v(" method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf.\nThis can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies.\nThe function SHOULD "),e("code",[a._v("revert")]),a._v(" unless the "),e("code",[a._v("from")]),a._v(" account has deliberately authorized the sender of the message via some mechanism, such as calling "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("p",[e("em",[a._v("Note")]),a._v(" Transfers of 0 values MUST be treated as normal transfers and fire the "),e("code",[a._v("TransferEvent")]),a._v(" event.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("transferFrom")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"approve"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approve","aria-hidden":"true"}},[a._v("#")]),a._v(" approve")]),a._v(" "),e("p",[a._v("Allows "),e("code",[a._v("spender")]),a._v(" to withdraw from your account multiple times, up to the "),e("code",[a._v("value")]),a._v(" amount. If this function is called again it overwrites the current allowance with "),e("code",[a._v("value")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("boolean")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("approve")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h4",{attrs:{id:"allowance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#allowance","aria-hidden":"true"}},[a._v("#")]),a._v(" allowance")]),a._v(" "),e("p",[a._v("Returns the amount which "),e("code",[a._v("spender")]),a._v(" is still allowed to withdraw from "),e("code",[a._v("owner")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@View")]),a._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" BigInteger "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("allowance")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(";")]),a._v("\n")])])]),e("h3",{attrs:{id:"events"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#events","aria-hidden":"true"}},[a._v("#")]),a._v(" Events")]),a._v(" "),e("h4",{attrs:{id:"transferevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transferevent","aria-hidden":"true"}},[a._v("#")]),a._v(" TransferEvent")]),a._v(" "),e("p",[a._v("MUST trigger when tokens are transferred, including zero value transfers.")]),a._v(" "),e("p",[a._v("A token contract which creates new tokens SHOULD trigger a Transfer event with the "),e("code",[a._v("from")]),a._v(" address set to "),e("code",[a._v("null")]),a._v(" when tokens are created.")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("TransferEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),a._v("Address from"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address to"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h4",{attrs:{id:"approvalevent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#approvalevent","aria-hidden":"true"}},[a._v("#")]),a._v(" ApprovalEvent")]),a._v(" "),e("p",[a._v("MUST trigger on any successful call to "),e("code",[a._v("approve(@Required Address spender, @Required BigInteger value)")]),a._v(".")]),a._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[a._v("public")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[a._v("ApprovalEvent")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("(")]),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address owner"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" Address spender"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(",")]),a._v(" "),e("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[a._v("@Required")]),a._v(" BigInteger value"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v(")")]),a._v("\n")])])]),e("h2",{attrs:{id:"implementation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#implementation","aria-hidden":"true"}},[a._v("#")]),a._v(" Implementation")]),a._v(" "),e("h4",{attrs:{id:"example-implementations-are-available-at"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#example-implementations-are-available-at","aria-hidden":"true"}},[a._v("#")]),a._v(" Example implementations are available at")]),a._v(" "),e("ul",[e("li",[a._v("https://github.com/nuls-io/nuls-nrc20")])])])}],!1,null,null,null);n.options.__file="NRC-20TokenStandard.md";t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/86.c5ed5194.js b/docs/.vuepress/dist/assets/js/86.c5ed5194.js new file mode 100644 index 00000000..8635bf29 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/86.c5ed5194.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{893:function(e,t,n){"use strict";n.r(t);var r=n(0),i=Object(r.a)({},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"content"},[e._m(0),e._v(" "),n("p",[e._v("Dear users:")]),e._v(" "),n("p",[e._v("It is a great honor to announce that the NULS2.0 Alpha version has been released at 10:30 am, Beijing time: 2019-03-28. We sincerely invite you to participate in the internal test.")]),e._v(" "),n("p",[e._v("The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture.")]),e._v(" "),n("p",[e._v("The Alpha version test mainly includes:")]),e._v(" "),n("ul",[n("li",[e._v("Full functionality of the Linux wallet, such as account creation, import, transfer, node creation, etc")]),e._v(" "),n("li",[e._v("Build blockchain based on NULS2.0 core modules")]),e._v(" "),n("li",[e._v("Build blockchain including "),n("router-link",{attrs:{to:"/NULS2.0/developModule.html"}},[e._v("business module")])],1)]),e._v(" "),e._m(1),e._v(" "),n("p",[e._v("1 "),n("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/pangu/NULS-Wallet-linux64-alpha1.tgz",target:"_blank",rel:"noopener noreferrer"}},[e._v("Download linux client"),n("OutboundLink")],1)]),e._v(" "),n("p",[e._v("2 "),n("router-link",{attrs:{to:"/NULS2.0/linuxTutorial.html"}},[e._v("linux CLI Manual")])],1),e._v(" "),n("p",[e._v("3 "),n("a",{attrs:{href:"https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141",target:"_blank",rel:"noopener noreferrer"}},[e._v("Apply for test NULS"),n("OutboundLink")],1),e._v(" and reply: Alpha+address")]),e._v(" "),n("p",[e._v("4 Access blockchain explorer: "),n("a",{attrs:{href:"http://alpha.nulscan.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://alpha.nulscan.io/"),n("OutboundLink")],1)]),e._v(" "),n("p",[e._v("5 "),n("router-link",{attrs:{to:"/NULS2.0/howToUseNulsBuildChain.html"}},[e._v("Build Blockchain based on NULS2.0")])],1),e._v(" "),n("p",[e._v("6 Submit bug:"),n("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0/issues",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls_2.0/issues"),n("OutboundLink")],1)]),e._v(" "),e._m(2),e._v(" "),n("ul",[n("li",[e._v("Github:"),n("a",{attrs:{href:"https://github.com/nuls-io/nuls_2.0",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://github.com/nuls-io/nuls_2.0"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Community:"),n("a",{attrs:{href:"https://nuls.community",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://nuls.community"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Tech community Telegram:"),n("a",{attrs:{href:"https://t.me/nulstest",target:"_blank",rel:"noopener noreferrer"}},[e._v("https://t.me/nulstest"),n("OutboundLink")],1)]),e._v(" "),n("li",[e._v("Wechat:NULS中文社区")])]),e._v(" "),n("p",[e._v("To learn more about us, visit "),n("a",{attrs:{href:"https://nuls.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("nuls.io"),n("OutboundLink")],1),e._v(".")])])},[function(){var e=this.$createElement,t=this._self._c||e;return t("h1",{attrs:{id:"nuls2-0-alpha-version-is-released"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nuls2-0-alpha-version-is-released","aria-hidden":"true"}},[this._v("#")]),this._v(" NULS2.0 Alpha Version is released")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"join-test:"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#join-test:","aria-hidden":"true"}},[this._v("#")]),this._v(" Join Test:")])},function(){var e=this.$createElement,t=this._self._c||e;return t("h3",{attrs:{id:"related-link"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#related-link","aria-hidden":"true"}},[this._v("#")]),this._v(" Related Link")])}],!1,null,null,null);i.options.__file="README.md";t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/87.1a56019a.js b/docs/.vuepress/dist/assets/js/87.1a56019a.js new file mode 100644 index 00000000..164f6856 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/87.1a56019a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{907:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/SHA-2",target:"_blank",rel:"noopener noreferrer"}},[t._v("SHA-256"),a("OutboundLink")],1),t._v(" hashes are used, however "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/RIPEMD",target:"_blank",rel:"noopener noreferrer"}},[t._v("RIPEMD-160"),a("OutboundLink")],1),t._v(" is also used when a shorter hash is desirable (for example when creating a NULS address).")]),t._v(" "),a("p",[t._v('Example of double-SHA-256 encoding of string "nuls":')]),t._v(" "),t._m(3),a("p",[t._v("For NULS addresses (RIPEMD-160) this would give:")]),t._v(" "),t._m(4),t._m(5),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.")]),t._v(" "),a("p",[t._v("First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.")]),t._v(" "),a("p",[t._v("Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),a("p",[t._v("where")]),t._v(" "),t._m(10),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("A NULS address is in fact the hash of a ECDSA public key, computed this way:")]),t._v(" "),t._m(13),a("p",[t._v("非nuls体系的地址格式如下:")]),t._v(" "),a("p",[t._v("例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定")]),t._v(" "),t._m(14),t._m(15),t._v(" "),a("p",[t._v("Satellite-chain uses custom messaging for communication over the TCP protocol.")]),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("The message consists of a 24-byte header and payload.")]),t._v(" "),t._m(18),t._m(19),t._v(" "),a("p",[t._v("The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("Variable-length integers that can be encoded based on the values expressed to save space.")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),a("p",[t._v("A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("Variable-length buffer, consistent with the VarString implementation.")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),a("p",[t._v("6-byte number.")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("When a network address is needed somewhere, this structure is used.")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("交易特性")]),t._v(" "),t._m(35),a("p",[t._v("coinData结构")]),t._v(" "),t._m(36),a("p",[t._v("CoinForm结构[40]")]),t._v(" "),t._m(37),a("p",[t._v("CoinTo结构[44]")]),t._v(" "),t._m(38),a("p",[t._v("手续费")]),t._v(" "),t._m(39),t._m(40),t._v(" "),a("p",[t._v("参考各个模块")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"protocol-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#protocol-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Protocol design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-standards"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-standards","aria-hidden":"true"}},[this._v("#")]),this._v(" Common standards")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"hashes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hashes","aria-hidden":"true"}},[this._v("#")]),this._v(" Hashes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)\n7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)\nf8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"merkle-trees"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merkle-trees","aria-hidden":"true"}},[this._v("#")]),this._v(" Merkle Trees")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Merkle trees are binary trees of hashes. Merkle trees in NULS use a "),e("strong",[this._v("double")]),this._v(" SHA-256, the SHA-256 hash of the SHA-256 hash of something.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the "),e("strong",[this._v("Merkle root")]),this._v(" of the tree.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("For example, imagine a block with three transactions "),e("em",[this._v("a")]),this._v(", "),e("em",[this._v("b")]),this._v(" and "),e("em",[this._v("c")]),this._v(". The Merkle tree is:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("d1 = dhash(a)\nd2 = dhash(b)\nd3 = dhash(c)\nd4 = dhash(c) # a, b, c are 3. that's an odd number, so we take the c twice\n\nd5 = dhash(d1 concat d2)\nd6 = dhash(d3 concat d4)\n\nd7 = dhash(d5 concat d6)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("dhash(a) = sha256(sha256(a))\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("d7")]),this._v(" is the Merkle root of the 3 transactions in this block.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"addresses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#addresses","aria-hidden":"true"}},[this._v("#")]),this._v(" Addresses")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("ChainId = 2 byte,The ID of the chain in which the account belongs.\naddressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……\npkh = 20 byte , RIPEMD-160(SHA-256(public key))\nxor = 1 byte, XOR(chainId+addressType+pkh)\naddress = Base58Encode(chainId+addressType+pkh+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address = Base58Encode(chainId+原始地址长度+原始地址+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Digital binary stream using little endian。")]),this._v(" "),e("li",[this._v("Floating point numbers convert to integers and transfer by little endian")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"message"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message","aria-hidden":"true"}},[this._v("#")]),this._v(" Message")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("*---------------------------------------------------------------*\n| Header(24 Byte) | Payload |\n*---------------------------------------------------------------*\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"message-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-header","aria-hidden":"true"}},[this._v("#")]),this._v(" message header")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("MagicNumber")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Packet valid flag")])]),t._v(" "),a("tr",[a("td",[t._v("12")]),t._v(" "),a("td",[t._v("command")]),t._v(" "),a("td",[t._v("char[12]")]),t._v(" "),a("td",[t._v("ASCII string identifying the packet content, NULL padded")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("PayloadLength")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("checksum")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("First 4 bytes of sha256(sha256(payload))")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Common Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varint"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varint","aria-hidden":"true"}},[this._v("#")]),this._v(" VarInt")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Value")]),t._v(" "),a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Structure")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("< 0xfd")]),t._v(" "),a("td",[t._v("1")]),t._v(" "),a("td",[t._v("uint8")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffff")]),t._v(" "),a("td",[t._v("3")]),t._v(" "),a("td",[t._v("0xfd + uint16")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffffffff")]),t._v(" "),a("td",[t._v("5")]),t._v(" "),a("td",[t._v("0xfe + uint32")])]),t._v(" "),a("tr",[a("td",[t._v("> 0xffffffff")]),t._v(" "),a("td",[t._v("9")]),t._v(" "),a("td",[t._v("0xff + uint64")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varstring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varstring","aria-hidden":"true"}},[this._v("#")]),this._v(" VarString")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of the string")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("value")]),t._v(" "),a("td",[t._v("uint8[length]")]),t._v(" "),a("td",[t._v("The string itself")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varbyte"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varbyte","aria-hidden":"true"}},[this._v("#")]),this._v(" VarByte")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("data")]),t._v(" "),a("td",[t._v("byte[length]")]),t._v(" "),a("td",[t._v("payload")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"int48"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#int48","aria-hidden":"true"}},[this._v("#")]),this._v(" Int48")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"network-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#network-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Network address")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("16")]),t._v(" "),a("td",[t._v("IPv6/4")]),t._v(" "),a("td",[t._v("char[16]")]),t._v(" "),a("td",[t._v("IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port1")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number, network byte order")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port2")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number,for cross-chain module")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"block-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#block-headers","aria-hidden":"true"}},[this._v("#")]),this._v(" Block_headers")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("version")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("version bumber")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("preHash")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("merkleRoot")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("stateRoot")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("second")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("txCount")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("extends")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("本字段内容不同的链可设置不同的约束")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("signature")]),t._v(" "),a("td",[t._v("Varbyte")]),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" Transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("时间,精确到秒")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("业务数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("资产数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("sig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("只包含签名,不包含pubkey")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("多账户转出\n多账户转入\n多资产转账\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("froms://List格式,\ntos://List格式\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24] 账户地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount: //uint128,转出数量\nnonce : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节\nlocked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24],目标地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount : //uint128,转账金额\nlockTime://uint32,解锁高度或解锁时间,-1为永久锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-types","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Types")])}],!1,null,null,null);r.options.__file="generalProtocol.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/88.a0664933.js b/docs/.vuepress/dist/assets/js/88.a0664933.js new file mode 100644 index 00000000..28c4e2ab --- /dev/null +++ b/docs/.vuepress/dist/assets/js/88.a0664933.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{911:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"json-rpc-interface-interaction-format-and-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-rpc-interface-interaction-format-and-specification","aria-hidden":"true"}},[t._v("#")]),t._v(" JSON-RPC Interface interaction format and specification")]),t._v(" "),a("h3",{attrs:{id:"request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Request Body")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls_accounts"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("parameters")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("cmd")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("The command to call")])]),t._v(" "),a("tr",[a("td",[t._v("params")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("parameters")])]),t._v(" "),a("tr",[a("td",[t._v("min_version")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("float")]),t._v(" "),a("td",[t._v("The minimum version of the interface to call")])])])]),t._v(" "),a("h3",{attrs:{id:"response-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Response Body")]),t._v(" "),a("ul",[a("li",[t._v("success")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("returns")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("ture")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),a("td",[t._v("The result status of the request, 0 means success. Otherwise return an error code")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",[t._v("User-friendly request execution result description")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("object")]),t._v(" "),a("td",[t._v("Method return value")])])])]),t._v(" "),a("h3",{attrs:{id:"error-code"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-code","aria-hidden":"true"}},[t._v("#")]),t._v(" Error Code")]),t._v(" "),a("h4",{attrs:{id:"json-rpc-standard-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-rpc-standard-errors","aria-hidden":"true"}},[t._v("#")]),t._v(" JSON RPC Standard errors")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Code")]),t._v(" "),a("th",[t._v("Possible Return message")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Success")]),t._v(" "),a("td",[t._v("Operation success")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("Parse error")]),t._v(" "),a("td",[t._v("Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Invalid Request")]),t._v(" "),a("td",[t._v("The JSON sent is not a valid Request object.")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("Method not found")]),t._v(" "),a("td",[t._v("The method does not exist / is not available.")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("Invalid params")]),t._v(" "),a("td",[t._v("Invalid method parameter(s).")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("Internal error")]),t._v(" "),a("td",[t._v("Internal JSON-RPC error.")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("Unauthorized")]),t._v(" "),a("td",[t._v("Should be used when some action is not authorized, e.g. sending from a locked account.")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("Action not allowed")]),t._v(" "),a("td",[t._v("Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("Timeout")]),t._v(" "),a("td",[t._v("Should be used when an action timedout.")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("Conflict")]),t._v(" "),a("td",[t._v("Should be used when an action conflicts with another (ongoing?) action.")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("Execution error")]),t._v(" "),a("td",[t._v("Will contain a subset of custom errors in the data field. See below.")])]),t._v(" "),a("tr",[a("td",[t._v("11 to 100")]),t._v(" "),a("td",[a("code",[t._v("Server error")])]),t._v(" "),a("td",[t._v("Reserved for implementation-defined server-errors.")])])])]),t._v(" "),a("h4",{attrs:{id:"custom-error-fields"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-error-fields","aria-hidden":"true"}},[t._v("#")]),t._v(" Custom error fields")]),t._v(" "),a("p",[t._v("Custom error "),a("code",[t._v("10")]),t._v(" can contain custom error(s) to further explain what went wrong.")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n code"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Execution error'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);r.options.__file="interfaceStandard.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/89.365bb774.js b/docs/.vuepress/dist/assets/js/89.365bb774.js new file mode 100644 index 00000000..15e6b451 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/89.365bb774.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{915:function(t,e,a){"use strict";a.r(e);var s=a(0),n=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("The Linux kernel version is recommended to use 2.6.32 and above")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),a("ul",[a("li",[t._v("Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release")]),t._v(" "),a("li",[t._v("After entering the interface of "),a("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS official wallet download"),a("OutboundLink")],1),t._v(", select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.")])]),t._v(" "),a("p",[t._v("To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:")]),t._v(" "),t._m(15),a("p",[t._v("Note: the download address may be different if there are subsequent versions.")]),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),a("p",[t._v("Enter the cmdclient/1.0.0 directory and execute the following command:")]),t._v(" "),t._m(25),t._m(26),t._v(" "),t._m(27),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),a("p",[t._v("Print all valid commands,")]),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("Return: help")]),t._v(" "),t._m(35),a("p",[t._v("Return: help-a")]),t._v(" "),t._m(36),a("p",[t._v("Example")]),t._v(" "),t._m(37),t._m(38),t._v(" "),a("p",[t._v("Create an account and return the set of account addresses")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),a("p",[t._v("When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.")]),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(41),a("p",[t._v("Example")]),t._v(" "),a("p",[t._v("Create a single account")]),t._v(" "),t._m(42),a("p",[t._v("Create multiple accounts at once")]),t._v(" "),t._m(43),t._m(44),t._v(" "),a("p",[t._v("To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(47),a("p",[t._v("Example: backup an account with password")]),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),a("p",[t._v("Enter the password to remove a local account based on the account address")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(52),a("p",[t._v("Example")]),t._v(" "),t._m(53),t._m(54),t._v(" "),a("p",[t._v("Set a new password according to the account address and password.")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(57),a("p",[t._v("Example")]),t._v(" "),t._m(58),t._m(59),t._v(" "),a("p",[t._v("Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(62),a("p",[t._v("Example")]),t._v(" "),t._m(63),t._m(64),t._v(" "),a("p",[t._v("Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),a("p",[t._v("Note: the original password is required to import the keystore file to generate the account")]),t._v(" "),a("p",[t._v("Return: address of the imported account")]),t._v(" "),t._m(67),a("p",[t._v("Example")]),t._v(" "),t._m(68),t._m(69),t._v(" "),a("p",[t._v("Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),a("p",[t._v("Example")]),t._v(" "),t._m(73),t._m(74),t._v(" "),a("p",[t._v("Query account information with the account address")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(77),a("p",[t._v("Example")]),t._v(" "),t._m(78),t._m(79),t._v(" "),a("p",[t._v("Query the account list with the paging parameters and return all accounts in descending order by creation time.")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(82),a("p",[t._v("Example: get accounts list")]),t._v(" "),t._m(83),t._m(84),t._v(" "),a("p",[t._v("Query the account’s private key with the account address and password")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),a("p",[t._v("Return: the private key of the imported account (unencrypted)")]),t._v(" "),t._m(87),a("p",[t._v("Example")]),t._v(" "),t._m(88),t._m(89),t._v(" "),a("p",[t._v("Query account balance with the account address")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("p",[t._v("Return: the address of the imported account")]),t._v(" "),t._m(92),a("p",[t._v("Example")]),t._v(" "),t._m(93),t._m(94),t._v(" "),a("p",[t._v("Transfer NULS to the specific account with the account address")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("Return: transfer transaction hash")]),t._v(" "),t._m(97),a("p",[t._v("Example")]),t._v(" "),t._m(98),t._m(99),t._v(" "),a("p",[t._v("Query the transaction details with the transaction hash")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),a("p",[t._v("Return: transaction details")]),t._v(" "),t._m(102),a("p",[t._v("Example: query transfer transaction")]),t._v(" "),t._m(103),t._m(104),t._v(" "),t._m(105),t._m(106),t._v(" "),a("p",[t._v("Transfer to an external address with an account alias")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(109),a("p",[t._v('Example: transfer 10,000 NULS to external address through alias "zlj"')]),t._v(" "),t._m(110),t._m(111),t._v(" "),a("p",[t._v("To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.")]),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("Return: agent hash of the node")]),t._v(" "),t._m(114),a("p",[t._v("Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.")]),t._v(" "),t._m(115),t._m(116),t._v(" "),a("p",[t._v("Join consensus by account address and node agentHash, which requires at least 2,000NULS")]),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),a("p",[t._v("Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.")]),t._v(" "),t._m(119),a("p",[t._v("Example")]),t._v(" "),t._m(120),t._m(121),t._v(" "),a("p",[t._v("Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.")]),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),a("p",[t._v("Return: transaction hash to cancel consensus")]),t._v(" "),t._m(124),a("p",[t._v("Example")]),t._v(" "),t._m(125),t._m(126),t._v(" "),a("p",[t._v("Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.")]),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),a("p",[t._v("Return: transaction hash to stop a node")]),t._v(" "),t._m(129),a("p",[t._v("Example")]),t._v(" "),t._m(130),t._m(131),t._v(" "),a("p",[t._v("Get the latest block header’s information")]),t._v(" "),t._m(132),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(133),a("p",[t._v("Example")]),t._v(" "),t._m(134),t._m(135),t._v(" "),a("p",[t._v("Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(138),a("p",[t._v("Example: get block with block height")]),t._v(" "),t._m(139),t._m(140),t._v(" "),a("p",[t._v("This interface is called to create a smart contract on the chain")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),a("p",[t._v("Returns the transaction hash for which the contract was created and the address of the contract")]),t._v(" "),t._m(143),a("p",[t._v("The example creates a contract (contractCode omits the middle)")]),t._v(" "),t._m(144),t._m(145),t._v(" "),a("p",[t._v("Gets the description of the intelligent contract and the argument list of the constructor and the calling method")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(148),a("p",[t._v("example")]),t._v(" "),t._m(149),t._m(150),t._v(" "),a("p",[t._v("Call the functions provided by the smart contract")]),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),a("p",[t._v("Returns: transaction hash")]),t._v(" "),t._m(153),t._m(154),t._v(" "),t._m(155),t._m(156),t._v(" "),a("p",[t._v("Stop an available smart contract")]),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(159),a("p",[t._v("example")]),t._v(" "),t._m(160),t._m(161),t._v(" "),a("p",[t._v("Calling the contract view method immediately returns the result and no transaction is generated")]),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("The return value")]),t._v(" "),t._m(164),a("p",[t._v("The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address")]),t._v(" "),t._m(165),t._m(166),t._v(" "),a("p",[t._v("To the specified contract address into the main network currency")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(169),a("p",[t._v("Example passes two NULS to the specified contract")]),t._v(" "),t._m(170),t._m(171),t._v(" "),a("p",[t._v("NRC20 token transfer")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(174),a("p",[t._v("example token transfer:")]),t._v(" "),t._m(175),t._m(176),t._v(" "),a("p",[t._v("Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results")]),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(179),a("p",[t._v("example")]),t._v(" "),t._m(180),t._m(181),t._v(" "),a("p",[t._v("Gets the execution result of a contract")]),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(184),a("p",[t._v("example")]),t._v(" "),t._m(185),t._m(186),t._v(" "),a("p",[t._v("Gets the list of parameters that need to be passed in to create the specified contract")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(189),a("p",[t._v("example")]),t._v(" "),t._m(190),t._m(191),t._v(" "),a("p",[t._v("Gets the list of contracts created by the specified account address")]),t._v(" "),t._m(192),t._v(" "),t._m(193),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(194),a("p",[t._v("example")]),t._v(" "),t._m(195),t._m(196),t._v(" "),a("p",[t._v("Query network basic information")]),t._v(" "),t._m(197),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(198),a("p",[t._v("Example")]),t._v(" "),t._m(199),t._m(200),t._v(" "),a("p",[t._v("Query the network node IP")]),t._v(" "),t._m(201),t._v(" "),a("p",[t._v("Return information")]),t._v(" "),t._m(202),a("p",[t._v("Example: get a block with the block height")]),t._v(" "),t._m(203),t._m(204),t._v(" "),a("p",[t._v("Exit the command line that operates the wallet, while it won’t stop the launched wallet node.")]),t._v(" "),t._m(205),t._v(" "),a("p",[t._v("Example")]),t._v(" "),t._m(206)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"alpha-linux-cli-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#alpha-linux-cli-tutorial","aria-hidden":"true"}},[this._v("#")]),this._v(" [Alpha]Linux CLI tutorial")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"version-update-history"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update-history","aria-hidden":"true"}},[this._v("#")]),this._v(" Version update history")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Versions")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Date")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Contents")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-03-18")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("alpha")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"preparation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preparation","aria-hidden":"true"}},[this._v("#")]),this._v(" Preparation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"server-hardware-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardware-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Server hardware configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("The server for NULS node should be not lower than the following configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4-Core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("16GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("128GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Recommended configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("8-core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("32GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("256GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("100Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"system-and-kernel-version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#system-and-kernel-version","aria-hidden":"true"}},[this._v("#")]),this._v(" System and kernel version")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux system")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS 6, 7")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"get-started"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-started","aria-hidden":"true"}},[this._v("#")]),this._v(" Get started")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"download"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#download","aria-hidden":"true"}},[this._v("#")]),this._v(" Download")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation","aria-hidden":"true"}},[this._v("#")]),this._v(" Installation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Extract the downloaded file in Linux")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"run"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#run","aria-hidden":"true"}},[this._v("#")]),this._v(" Run")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Enter the extracted directory and run the boot script to start the full node wallet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd NULS-Wallet-linux64-2.0.0-alpha-1\n $ ./start.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"use-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" Use wallet")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"quick-start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick start")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd cmdclient/1.0.0\n $ ./cmd.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("At this point, you can see the input prompt "),e("code",[this._v("nuls>>>")]),this._v(", now you can directly type NULS wallet command to operate.\nFor example, to create an account you can do like this:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' nuls>>> create\n Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\n Enter your password:*********\n Please confirm new password:*********\n [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\n nuls>>>\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Command "),e("code",[this._v("create")]),this._v(" means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"convention"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#convention","aria-hidden":"true"}},[this._v("#")]),this._v(" Convention")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Password rules: password length varies from 8 to 20 and must contain both letters and digits.")]),this._v(" "),e("li",[this._v('Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"wallet-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wallet-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Wallet command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"help-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#help-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Help command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: help [-a]|[group]|[command]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("-a")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("format the printed command, optional")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("command")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view instructions for the specific command")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("group")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view all instructions for the commands in the specific command group")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n OPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\nnuls>>> help account\nnuls>>> help create\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-an-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-an-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Create an account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: create [number]")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number] the number of accounts you want to create, optional")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}})])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create \nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 3\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"back-up-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#back-up-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Back up account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: backup
[path]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("[path]")]),t._v(" "),a("td",[t._v("the directory where the generated backup file is included, current directory by default, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("shell\nnuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj\nEnter account password\n***************\nThe path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"remove-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#remove-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Remove account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: remove
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\nEnter your password for account**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"modify-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modify-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Modify account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:resetpwd
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N\nEnter your old password:**********\nEnter new password**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"set-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Set alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: setalias
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("alias name, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("txHash"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[this._v("0020")]),this._v('f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj\nEnter your account password**********\ntxHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: importkeystore ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("path of the keystore file to be imported, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: import ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account's private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccount
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // the encrypted private key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baglance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // frozen assets \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // total assets\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),t._v(" // usable assets \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // account address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),t._v(" //public key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n{\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //encrypted private key \n "alias" : "zlj", //alias\n "baglance" : { \n "freeze" : 0, // frozen assets\n "total" : 997999999800000, // total assets\n "available" : 997999999800000 // usable assets\n },\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", // account address\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key \n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-list","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account list")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccounts **")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("page number indicating the page to query, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("number of rows displayed per page, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //public key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),t._v(" //private key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts\n[ {\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //address\n "alias" : null, //alias\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //encrypted public key\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //encrypted private key\n}, {\n "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",\n "alias" : null,\n "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",\n "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"\n}, {\n "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",\n "alias" : "zlj",\n "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",\n "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account's private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getprikey
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token number"}},[this._v("00")]),this._v("a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9\nEnter your account password**********\n7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbalance
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // locked balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("// usable balance\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "total" : "9999998.99",\n "freeze" : "0",\n "available" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfer | | [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address(Select any item with the fromAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address alias(Select any item with the fromAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer\nPlease enter the password.\nEnter your password: *********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-transaction-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-transaction-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Query transaction details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: gettx **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash, optional")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //transaction type (refer to the table below for Enumeration type description "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("Enumeration type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1552979783918")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"transactionSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg=="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"6L2s6LSm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestAlgType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestBytes"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f"')]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("341")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONFIRMED"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //confirmation state\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("225")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inBlockIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinDataInstance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABmAU91zVafgSLoRrxnHo7k3r/Azg="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"79acNPim+aw="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABL/80LO1f8vxvfNXc5l9eeIDTGKM="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //fee\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"multiSignTx"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f\n{\n "type" : 2, //transaction type (refer to the table below for Enumeration type description [Enumeration type])\n "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",\n "txData" : null,\n "time" : 1552979783918,\n "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",\n "remark" : "6L2s6LSm",\n "hash" : {\n "digestAlgType" : 0,\n "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", \n "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" \n },\n "blockHeight" : 341, //block height\n "status" : "CONFIRMED", //confirmation state\n "size" : 225,\n "inBlockIndex" : 0,\n "coinDataInstance" : { \n "from" : [ {\n "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100100000,\n "nonce" : "79acNPim+aw=",\n "locked" : 0\n } ],\n "to" : [ {\n "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100000000,\n "lockTime" : 0\n } ]\n },\n "fee" : 100000, //fee\n "multiSignTx" : false\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"enumeration-type-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#enumeration-type-description","aria-hidden":"true"}},[this._v("#")]),this._v(" Enumeration type description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("/** coinbase transaction*/\n int TX_TYPE_COINBASE = 1;\n /** transfer */\n int TX_TYPE_TRANSFER = 2;\n /** set alias */\n int TX_TYPE_ALIAS = 3;\n /** create consensus node */\n int TX_TYPE_REGISTER_AGENT = 4;\n /** agent (join consensus) */\n int TX_TYPE_JOIN_CONSENSUS = 5;\n /** cancel agent (cancel consensus)*/\n int TX_TYPE_CANCEL_DEPOSIT = 6;\n /** yellow punish */\n int TX_TYPE_YELLOW_PUNISH = 7;\n /** red punish */\n int TX_TYPE_RED_PUNISH = 8;\n /** stop node (stop consensus node)*/\n int TX_TYPE_STOP_AGENT = 9;\n /** cross-chain transfer */\n int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;\n /** register chain */\n int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;\n /** destroy chain*/\n int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;\n /** add asset to chain*/\n int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;\n /** remove asset from chain*/\n int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;\n /** create contract */\n int TX_TYPE_CREATE_CONTRACT = 100;\n /** call contract */\n int TX_TYPE_CALL_CONTRACT = 101;\n /** delete contract*/\n int TX_TYPE_DELETE_CONTRACT = 102;\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-by-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-by-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer by alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("order: transfer
[remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("sender address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000\nEnter your account password**********\n00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Create node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: createagent ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address to create a node, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agent commission ratio with a range from 10 to 100, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit to create a node, no less than 2000 NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password: **********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"join-consensus-agent-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#join-consensus-agent-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Join consensus (agent node)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: deposit
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agentHash of the node, optional")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit required to join consensus, no less than 2000NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"cancel-consensus-cancel-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cancel-consensus-cancel-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Cancel consensus (cancel agent)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: withdraw
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("hash of the agent transaction, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"stop-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stop-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Stop agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: stopagent
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-latest-information-of-block-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-latest-information-of-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the latest information of block header")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbestblockheader")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block singnature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // packing address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",\n "time" : "2019-03-19 18:26:20.020",\n "height" : 1479,\n "txCount" : 0,\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",\n "size" : 0,\n "packingAddress" : null,\n "roundIndex" : 155299118,\n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1,\n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-block-header-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-block-header-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query block header information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getblock | ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block hash")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block height")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block signature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing address \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash\n "time" : "2019-03-19 18:26:20.020", //packing time \n "height" : 1479, //block height \n "txCount" : 1, // number of transactions included in the block\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature \n "size" : 0, //block size \n "packingAddress" : null, //packing address \n "roundIndex" : 155299118, \n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1, \n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Create smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:createcontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Create the account address for the smart contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Consumes of the gas for creating the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Hex code of the contract code")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //transaction hash\n "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo\nThe arguments structure: \n[ {\n "type" : "String",\n "name" : "name",\n "required" : true\n}, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n}, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n}, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n} ]\nPlease enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'").\nEnter the arguments:"KQB","KQB",10000,2\n{\n "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-basic-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-basic-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract basic information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractinfo ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("contract address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\nnuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ngetcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\n{\n "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "createTime" : 1553563706022,\n "blockHeight" : 46,\n "isNrc20" : true,\n "nrc20TokenName" : "QKB",\n "nrc20TokenSymbol" : "QKB",\n "decimals" : 2,\n "totalSupply" : "200000000",\n "status" : "normal",\n "method" : [ {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },{\n "name" : "transfer",\n "desc" : "(Address to, BigInteger value) return boolean",\n "args" : [ {\n "type" : "Address",\n "name" : "to",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "value",\n "required" : true\n } ],\n "returnArg" : "boolean",\n "view" : false,\n "event" : false,\n "payable" : false\n }]\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"invoke-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#invoke-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Invoke smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:callcontract [-d methodDesc] [-r remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("This contract is the largest consumption of Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The method name of the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("If transfer is to be made to the contract, the amount of transfer")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])]),t._v(" "),a("tr",[a("td",[t._v("[-r remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("The example calls the nrc20-token transfer function for a specified contract, Example "),e("code",[this._v("tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L")]),this._v(" NRC20 contract address, number of input parameters for receiving address and account transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\ncallcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\nPlease Enter your account passwordzhoujun172\n**********\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2\n"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"delete-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Delete smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontract ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ndeletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\nPlease enter your account passwordzhoujun172\n**********\n"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"call-the-contract-view-method"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#call-the-contract-view-method","aria-hidden":"true"}},[this._v("#")]),this._v(" Call the contract view method")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontractviewcontract [-d methodDesc] --view contract")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Method called")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The return value varies depending on the function being called\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nviewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n{\n "result" : "20000000"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-money-to-the-contract-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-money-to-the-contract-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer money to the contract address")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfertocontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Transfer out account address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark\nPlease enter your account password\n**********\n"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"token-transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token-transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" token transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:tokentransfer [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("contract address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000\nPlease enter your account password\n**********\n"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontracttx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\ngetcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "type" : "100",\n "time" : "2019-03-26 09:28:26",\n "blockHeight" : 46,\n "fee" : 0.0,\n "value" : 0.0,\n "remark" : null,\n "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",\n "status" : "confirm",\n "confirmCount" : 0,\n "size" : 6686,\n "inputs" : [ {\n "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "assetsChainId" : 2,\n "assetsId" : 1,\n "amount" : "5700000",\n "nonce" : "ffffffff",\n "locked" : 0,\n "value" : 0.0\n } ],\n "outputs" : [ ],\n "txData" : {\n "data" : {\n "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "value" : 0.0,\n "hexCode" : "504b03040a0000080...........31600000000",\n "gasLimit" : 200000,\n "price" : "0.00000025",\n "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]\n }\n },\n "contractResult" : {\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n }\n}\n\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-execution-result"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-execution-result","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract execution result")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractresult ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-constructor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-constructor","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract constructor")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractcontructor ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Hex code of the contract code")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000\n{\n "constructor" : {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },\n "isNrc20" : true\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"gets-the-list-of-contracts-created-for-the-specified-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#gets-the-list-of-contracts-created-for-the-specified-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Gets the list of contracts created for the specified account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getaccountcontracts ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\n[ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",\n "createTime" : "2019-03-25 16:08:25.025",\n "height" : 253,\n "confirmCount" : 195,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",\n "createTime" : "2019-03-25 15:33:54.054",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network info")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height locally \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height of the network \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//network time offset \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//number of in-nodes \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//number of out-nodes \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network info\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-node-ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-node-ip","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network node IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network nodes")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('" 192.168.1.223 "')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network nodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"exit-the-wallet-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-the-wallet-cli","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit the wallet CLI")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="linuxTutorial.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/9.c34e88ed.js b/docs/.vuepress/dist/assets/js/9.c34e88ed.js new file mode 100644 index 00000000..75bc1302 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/9.c34e88ed.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{317:function(t,e,a){t.exports=a.p+"assets/img/Install.33ff9464.jpg"},318:function(t,e,a){t.exports=a.p+"assets/img/Install2.23136d69.jpg"},319:function(t,e,a){t.exports=a.p+"assets/img/Install3.145b9c4e.jpg"},320:function(t,e,a){t.exports=a.p+"assets/img/createProject.e78abf06.jpg"},321:function(t,e,a){t.exports=a.p+"assets/img/createProject2.b7246453.jpg"},322:function(t,e,a){t.exports=a.p+"assets/img/code.785ccdb5.jpg"},323:function(t,e,a){t.exports=a.p+"assets/img/Deploy.0f2d2d88.jpg"},324:function(t,e,a){t.exports=a.p+"assets/img/Add.e1d751e6.jpg"},325:function(t,e,a){t.exports=a.p+"assets/img/Add3.fbd88d0f.jpg"},326:function(t,e,a){t.exports=a.p+"assets/img/Add5.dfc1a6d7.jpg"},327:function(t,e,a){t.exports=a.p+"assets/img/package.6fff1f40.jpg"},328:function(t,e,a){t.exports=a.p+"assets/img/package1.e07eba9a.jpg"},329:function(t,e,a){t.exports=a.p+"assets/img/package3.e7db1454.jpg"},330:function(t,e,a){t.exports=a.p+"assets/img/package2.698a4145.jpg"},331:function(t,e,a){t.exports=a.p+"assets/img/package4.a9a579bf.jpg"},332:function(t,e,a){t.exports=a.p+"assets/img/Deploy2.ccca3cbd.jpg"},333:function(t,e,a){t.exports=a.p+"assets/img/Deploy3.131a59dc.jpg"},334:function(t,e,a){t.exports=a.p+"assets/img/Deploy4.ebcdade6.jpg"},335:function(t,e,a){t.exports=a.p+"assets/img/Deploy5.37a2c168.jpg"},336:function(t,e,a){t.exports=a.p+"assets/img/Deploy6.f4b26eb1.jpg"},337:function(t,e,a){t.exports=a.p+"assets/img/Deploy7.e33e7d01.jpg"},931:function(t,e,a){"use strict";a.r(e);var s=[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"idea-plugin"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#idea-plugin","aria-hidden":"true"}},[this._v("#")]),this._v(" IDEA Plugin")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_1-install-nuls-plugin-on-idea"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-install-nuls-plugin-on-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 1 Install NULS Plugin on IDEA")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(317),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Select the said ZIP, and click OK")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(318),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Tick NULS plugin, and click Apply")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(319),alt:"Install"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_2-create-a-nuls-project"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-a-nuls-project","aria-hidden":"true"}},[this._v("#")]),this._v(" 2 Create a NULS project")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(320),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(321),alt:"create"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_3-compile-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-compile-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 3 Compile smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("img",{attrs:{src:a(322),alt:"code"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_4-set-and-deploy-the-node-and-account-for-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-set-and-deploy-the-node-and-account-for-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 4 Set and deploy the node and account for contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click NULS plugin on the right, and call NULS plugin interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(323),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract.\nRecommendation: Start the local wallet, and add the wallet address as the node address.")]),t._v(" "),s("p",[t._v("Click + on the top left corner of panel, and select Add Node.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(324),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Input Node address and clock OK")]),t._v(" "),s("p",[s("img",{attrs:{src:a(325),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(326),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_5-package-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-package-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 5 Package contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code")]),t._v(" "),s("p",[s("img",{attrs:{src:a(327),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).")]),t._v(" "),s("p",[s("img",{attrs:{src:a(328),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface")]),t._v(" "),s("p",[s("img",{attrs:{src:a(329),alt:"code"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(330),alt:"code"}})])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"_6-deploy-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-deploy-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6 Deploy contract")])},function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",[s("li",[s("p",[t._v("On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(331),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Parameters following JarFilePath are the parameters of the contract construction function.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(332),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(333),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(334),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(335),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Review the deployed contract on the top of panel")]),t._v(" "),s("p",[s("img",{attrs:{src:a(336),alt:"code"}})])]),t._v(" "),s("li",[s("p",[t._v("Click the deployed contract to review all method of this contract")]),t._v(" "),s("p",[s("img",{attrs:{src:a(337),alt:"code"}})])])])}],c=a(0),n=Object(c.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Get NULS plugin"),a("OutboundLink")],1),t._v(" ZIP, and save in disk\nClick File->Settings->Plugin->Install plugin from disk")])]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("Input Project name, click finish")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),a("p",[t._v("Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)")]),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),t._m(15),t._v(" "),t._m(16),t._v(" "),t._m(17)])},s,!1,null,null,null);n.options.__file="ideaPlugin.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/90.2330af89.js b/docs/.vuepress/dist/assets/js/90.2330af89.js new file mode 100644 index 00000000..4a2a72d3 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/90.2330af89.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{919:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"wallet-adds-a-random-seed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-adds-a-random-seed","aria-hidden":"true"}},[t._v("#")]),t._v(" Wallet adds a random seed")]),t._v(" "),s("h2",{attrs:{id:"一、wallet-adds-a-random-seed-rpc-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、wallet-adds-a-random-seed-rpc-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、Wallet adds a random seed RPC interface")]),t._v(" "),s("p",[t._v("The random seed you get is a big number, and notice, it could be a negative number")]),t._v(" "),s("h3",{attrs:{id:"get-a-random-seed-list-based-on-the-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-a-random-seed-list-based-on-the-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get a random seed list based on the height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cutoff height, cannot exceed startHeight+1000")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"get-random-seed-list-according-to-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-random-seed-list-according-to-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get random seed list according to height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cut-off height,endHeight-startHeight<=1000")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),s("h2",{attrs:{id:"二、smart-contracts-support-random-numbers-in-the-underlying-chain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、smart-contracts-support-random-numbers-in-the-underlying-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、Smart contracts support random Numbers in the underlying chain")]),t._v(" "),s("p",[t._v("Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code.\nTake one of these methods as an example"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v(" Shows how to generate random Numbers using random number seeds.")]),t._v(" "),s("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height range, a specific algorithm is used to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get the set of original seeds according to the height range\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"_2)-a-dice-example-shaking-at-the-same-time-n"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2)-a-dice-example-shaking-at-the-same-time-n","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) A dice "),s("code",[t._v("example")]),t._v(" shaking at the same time N")]),t._v(" "),s("h4",{attrs:{id:"_2-1-calculation-method-1"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-calculation-method-1","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) Calculation method 1")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("The original seed is multiplied by the number of tosses, resulting in an array of bytes")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"_2-2-calculation-method-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-calculation-method-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) Calculation method 2")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/91.25be9d8a.js b/docs/.vuepress/dist/assets/js/91.25be9d8a.js new file mode 100644 index 00000000..2048f609 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/91.25be9d8a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{921:function(t,s,a){"use strict";a.r(s);var e=a(0),n=Object(e.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"rpc-tool-design-document"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#rpc-tool-design-document","aria-hidden":"true"}},[t._v("#")]),t._v(" RPC-TOOL design document")]),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),a("h2",{attrs:{id:"_1-overall-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-overall-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Overall description")]),t._v(" "),a("h3",{attrs:{id:"_1-1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-summary","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1 summary")]),t._v(" "),a("h4",{attrs:{id:"_1-1-1-position-of-rpc-tool"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1-position-of-rpc-tool","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.1 position of RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("NULS 2 according to function partition module, all modules are isolated and can run independently.")]),t._v(" "),a("li",[t._v("Interaction between modules through RPC call interface")]),t._v(" "),a("li",[t._v("As long as the module implements the required interface, it can be implemented in any language")]),t._v(" "),a("li",[t._v("Each module will use RPC, so it will be encapsulated into the same jar file")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-2-what-will-rpc-tool-did"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-2-what-will-rpc-tool-did","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.2 what will RPC-TOOL did")]),t._v(" "),a("p",[t._v("Data interaction between modules is done through RPC-TOOL")]),t._v(" "),a("ul",[a("li",[t._v("RPC Server start")]),t._v(" "),a("li",[t._v("Register all CMD commands of the current module")]),t._v(" "),a("li",[t._v("Parsing the received CMD command")]),t._v(" "),a("li",[t._v("Returns the result by calling the corresponding method based on CMD")]),t._v(" "),a("li",[t._v("RPC Client start")]),t._v(" "),a("li",[t._v("Interacting with kernel")])]),t._v(" "),a("h4",{attrs:{id:"_1-1-3-position"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-3-position","aria-hidden":"true"}},[t._v("#")]),t._v(" 1.1.3 position")]),t._v(" "),a("p",[t._v("RPC-TOOL is the underlying application, and any module will depend on RPC-TOOL.")]),t._v(" "),a("h2",{attrs:{id:"_2-functional-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-functional-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 2. functional design")]),t._v(" "),a("h2",{attrs:{id:"_3-interface-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-interface-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 3. interface design")]),t._v(" "),a("h3",{attrs:{id:"_3-1-interface"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 3.1 interface")]),t._v(" "),a("h4",{attrs:{id:"status"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#status","aria-hidden":"true"}},[t._v("#")]),t._v(" status")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel will periodically push the status of the current system to each module, which is used for receiving")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"service"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"modules"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"moduleABC"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"READY"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"addr"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"127.0.0.1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"port"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("19722")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rpcList"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cmd1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"conf_reset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependsModule"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("index")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("modules_information")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("modules_information")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("service")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("modules")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("map")]),t._v(" "),a("td",[t._v("All module information")])])])]),t._v(" "),a("p",[t._v("module")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("name")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("name")])]),t._v(" "),a("tr",[a("td",[t._v("status")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("status")])]),t._v(" "),a("tr",[a("td",[t._v("available")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("boolean")]),t._v(" "),a("td",[t._v("can start service?")])]),t._v(" "),a("tr",[a("td",[t._v("addr")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("ip address/host name")])]),t._v(" "),a("tr",[a("td",[t._v("port")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("int")]),t._v(" "),a("td",[t._v("port")])]),t._v(" "),a("tr",[a("td",[t._v("rpcList")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("list")]),t._v(" "),a("td",[t._v("cmd list")])]),t._v(" "),a("tr",[a("td",[t._v("dependsModule")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string[]")]),t._v(" "),a("td",[t._v("The dependent modules")])])])])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"shutdown"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#shutdown","aria-hidden":"true"}},[t._v("#")]),t._v(" shutdown")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (waiting for all the processing of the current business to complete)")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shutdown"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"terminate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#terminate","aria-hidden":"true"}},[t._v("#")]),t._v(" terminate")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel calls the interface to close the module (immediately terminates).")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"terminate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confget"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confget","aria-hidden":"true"}},[t._v("#")]),t._v(" confGet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel gets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confGet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confset","aria-hidden":"true"}},[t._v("#")]),t._v(" confSet")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel sets module configuration items")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confSet"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key1"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"key2"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value2"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h4",{attrs:{id:"confreset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#confreset","aria-hidden":"true"}},[t._v("#")]),t._v(" confReset")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Interface description\nKernel restore template is configured as initial value.")])]),t._v(" "),a("li",[a("p",[t._v("Request example")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"confReset"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"minVersion"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),a("li",[a("p",[t._v("Request parameter specification")]),t._v(" "),a("p",[t._v("N/A")])]),t._v(" "),a("li",[a("p",[t._v("Response example\nFailed")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxxxxxxxxxxxxxxxxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Success")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n \t"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n")])])])]),t._v(" "),a("li",[a("p",[t._v("Response field specification\nN/A")])])]),t._v(" "),a("h2",{attrs:{id:"_4-event-description"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-event-description","aria-hidden":"true"}},[t._v("#")]),t._v(" 4. Event description")]),t._v(" "),a("h2",{attrs:{id:"_5-protocol"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-protocol","aria-hidden":"true"}},[t._v("#")]),t._v(" 5. Protocol")]),t._v(" "),a("h2",{attrs:{id:"_6-configuration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6-configuration","aria-hidden":"true"}},[t._v("#")]),t._v(" 6. Configuration")]),t._v(" "),a("h2",{attrs:{id:"_7-java-unique-design"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_7-java-unique-design","aria-hidden":"true"}},[t._v("#")]),t._v(" 7. Java unique design")]),t._v(" "),a("h3",{attrs:{id:"server"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#server","aria-hidden":"true"}},[t._v("#")]),t._v(" Server")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Start server")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// Port is not necessary. If no port is specified, the system is allocated randomly\nBaseRpcServer server = new GrizzlyServer(RpcConstant.KERNEL_PORT);\n\n// Scan the package in which the CMD command is located\nserver.scanPackage("io.nuls.rpc.mycmd");\n\n// Initialization\nserver.init("moduleName", "dependsModule, type is List");\n\n// start\nserver.start();\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Custom CMD")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// extends BaseCmd\npublic class SomeCmd extends BaseCmd\n\n// Custom method to add annotation CmdInfo \n@CmdInfo(cmd = "cmd1", version = 1.0, preCompatible = true)\npublic Object methodName(List params) {\n System.out.println("I\'m version 1");\n return success();\n}\n\nNote: rpc-tool automatically transfers the Object[] transferred from client to List. \n')])])])]),t._v(" "),a("li",[a("p",[t._v("There must be and only one CMD class to implement the KernelCmd interface.")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("// Implement interface \npublic class SomeCmd extends BaseCmd implements KernelCmd \n\n/**\n * Receive all module information from kernel \n */\npublic Object status(List params);\n\n/**\n * Shut down service: after the existing business is completed\n */\npublic Object shutdown(List params);\n\n/**\n * Shut down service: close immediately, whether or not the business is completed.\n */\npublic Object terminate(List params);\n\n/**\n * Provide local configuration information \n */\npublic Object confGet(List params);\n\n/**\n * Update local configuration information \n */\npublic Object confSet(List params);\n\n/**\n * Reset local configuration information \n */\npublic Object confReset(List params);\n")])])])])]),t._v(" "),a("h3",{attrs:{id:"client"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#client","aria-hidden":"true"}},[t._v("#")]),t._v(" Client")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Provide module information to kernel")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("RpcClient.versionToKernel();\n")])])])]),t._v(" "),a("li",[a("p",[t._v("call rpc")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('// CMD corresponds to one interface. \nString jsonStr = RpcClient.callSingleRpc("shutdown", params, minVersion);\n\n// CMD corresponds to multiple interfaces. \nString jsonStr = RpcClient.callMultiplyRpc("shutdown", params, minVersion);\n\nnote:\nparams is instance of Object[] \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"data-exchange"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-exchange","aria-hidden":"true"}},[t._v("#")]),t._v(" Data exchange")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Request")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "cmd": "shutdown",\n "minVersion": 1.0, //根据自己需要传最低版本号\n "params": [],\n}\n')])])])]),t._v(" "),a("li",[a("p",[t._v("Response(success and failure are the same)")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('{\n "code":0,\n "msg": " This property is only available when failed",\n "version": "Actually called version",\n "result": {}\n} \n')])])])])]),t._v(" "),a("h3",{attrs:{id:"other"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#other","aria-hidden":"true"}},[t._v("#")]),t._v(" Other")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("BaseCmd has a default implementation of the status method, so if you don't have a specific requirement, you just need to do the following:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("@Override\n@CmdInfo(cmd = RpcConstant.STATUS, version = 1.0, preCompatible = true)\npublic Object status(List params){\n return super.status(params);\n}\n")])])])]),t._v(" "),a("li",[a("p",[t._v("There are ways to return to success and failure in BaseCmd."),a("br"),t._v("\nsuccess:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object success(double version) {\n return success(version, null);\n}\n\nprotected Object success(double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", 0);\n map.put("msg", SUCCESS);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])]),a("p",[t._v("fail:")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('protected Object fail(String code, String msg, double version, Object result) {\n Map map = new HashMap<>(16);\n map.put("code", code);\n map.put("msg", msg);\n map.put("version", version);\n map.put("result", result);\n return map;\n}\n')])])])])]),t._v(" "),a("h2",{attrs:{id:"_8-supplementary-content"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_8-supplementary-content","aria-hidden":"true"}},[t._v("#")]),t._v(" 8. supplementary content")])])}],!1,null,null,null);n.options.__file="rpcToolWebsocketDesign.md";s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/92.7fca59f6.js b/docs/.vuepress/dist/assets/js/92.7fca59f6.js new file mode 100644 index 00000000..d4dc60fd --- /dev/null +++ b/docs/.vuepress/dist/assets/js/92.7fca59f6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{927:function(t,s,a){"use strict";a.r(s);var n=a(0),e=Object(n.a)({},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),a("p",[t._v("NULS smart contract adopts IntelliJ IDEA as development tool")]),t._v(" "),t._m(6),t._v(" "),a("p",[a("a",{attrs:{href:"https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip",target:"_blank",rel:"noopener noreferrer"}},[t._v("Click to download the plugin"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("NULS smart contract plug-ins provide the following main functions:")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("NULS smart contract syntax is a subset of Java syntax, with some restrictions")]),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),a("p",[t._v("Java key words are listed as follows and those not applicable for NULS smart contract will be marked")]),t._v(" "),a("p",[t._v("Access control")]),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class")]),t._v(" "),t._m(13),t._v(" "),a("p",[t._v("Key words of package")]),t._v(" "),t._m(14),t._v(" "),a("p",[t._v("Key words of data type")]),t._v(" "),t._m(15),t._v(" "),a("p",[t._v("Conditional loops (process control)")]),t._v(" "),t._m(16),t._v(" "),a("p",[t._v("Error processing")]),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("Modification method, class, property and variables")]),t._v(" "),t._m(18),t._v(" "),a("p",[t._v("other")]),t._v(" "),t._m(19),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("NULS smart contract can be developed with the following class")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("a simple contract")]),t._v(" "),t._m(27),t._v(" "),t._m(28),a("p",[t._v("In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details\nThe project has several classes and interfaces")]),t._v(" "),a("p",[t._v("When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class")]),t._v(" "),a("p",[t._v("After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status")]),t._v(" "),a("p",[t._v("Explanatory comments")]),t._v(" "),a("p",[t._v("@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means")]),t._v(" "),a("p",[t._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")]),t._v(" "),a("p",[t._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value")]),t._v(" "),a("p",[t._v("Go to download NULS source code on github, and get some contract examples")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("Contract SDK provides several classes to be convenient for contract development:")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._m(32),t._v(" "),t._m(33),t._m(34),t._v(" "),t._m(35),t._m(36),t._v(" "),t._m(37),t._m(38),t._v(" "),t._m(39),t._m(40),t._v(" "),t._m(41),t._m(42),t._v(" "),t._m(43),t._m(44),t._v(" "),t._m(45),t._v(" "),t._m(46),t._m(47),t._v(" "),t._m(48),t._v(" "),t._m(49),t._m(50),t._v(" "),t._m(51),t._v(" "),t._m(52),t._m(53),t._v(" "),a("p",[t._v("See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)")]),t._v(" "),t._m(54),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),t._m(57),t._v(" "),t._m(58),t._v(" "),t._m(59),t._m(60),t._v(" "),t._m(61),t._v(" "),t._m(62),t._v(" "),t._m(63),t._v(" "),t._m(64),t._m(65),t._v(" "),t._m(66),t._v(" "),t._m(67),t._v(" "),t._m(68),t._v(" "),t._m(69),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),t._v(" "),t._m(73),t._v(" "),t._m(74),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),t._m(77),t._v(" "),t._m(78),t._v(" "),t._m(79),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),t._m(82),t._v(" "),t._m(83),t._v(" "),t._m(84),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),t._m(87),t._v(" "),t._m(88),t._v(" "),t._m(89),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),t._m(92),t._v(" "),t._m(93),t._v(" "),t._m(94),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),t._m(97),t._v(" "),t._m(98),t._v(" "),t._m(99),t._m(100),t._v(" "),t._m(101),t._v(" "),t._m(102),t._m(103),t._v(" "),t._m(104),t._v(" "),t._m(105)])},[function(){var t=this.$createElement,s=this._self._c||t;return s("h1",{attrs:{id:"development-manual"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#development-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" Development Manual")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_1-introduction"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Introduction")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_2-development-environment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-development-environment","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Development environment")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-1-setup-of-nuls-wallet"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-setup-of-nuls-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.1 Setup of NULS wallet")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-2-setup-of-jdk-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-setup-of-jdk-8","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.2 Setup of JDK 8")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-3-setup-of-intellij-idea"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-3-setup-of-intellij-idea","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.3 Setup of IntelliJ IDEA")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_2-4-setup-of-nuls-smart-contract-plug-ins"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-4-setup-of-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2.4 Setup of NULS smart contract plug-ins")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Newly create NULS contract project")]),this._v(" "),s("li",[this._v("Provide the unavailable Java properties, classes ad methods")]),this._v(" "),s("li",[this._v("Compile, package and deploy contracts")]),this._v(" "),s("li",[this._v("Display and call contract methods")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_3-nuls-smart-contract-specifications-and-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-nuls-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. NULS smart contract specifications and syntax")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-1-nuls-smart-contract-specifications"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-nuls-smart-contract-specifications","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.1 NULS smart contract specifications")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-2-keywords"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-keywords","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.2 Keywords")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("public")]),this._v(" "),s("li",[this._v("protected")]),this._v(" "),s("li",[this._v("private")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("class")]),t._v(" "),a("li",[t._v("interface")]),t._v(" "),a("li",[t._v("abstract")]),t._v(" "),a("li",[t._v("implements")]),t._v(" "),a("li",[t._v("extends")]),t._v(" "),a("li",[t._v("new")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("import")]),this._v(" "),s("li",[this._v("package")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("byte")]),t._v(" "),a("li",[t._v("char")]),t._v(" "),a("li",[t._v("boolean")]),t._v(" "),a("li",[t._v("short")]),t._v(" "),a("li",[t._v("int")]),t._v(" "),a("li",[t._v("float")]),t._v(" "),a("li",[t._v("long")]),t._v(" "),a("li",[t._v("double")]),t._v(" "),a("li",[t._v("void")]),t._v(" "),a("li",[t._v("null")]),t._v(" "),a("li",[t._v("true")]),t._v(" "),a("li",[t._v("false")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("if")]),t._v(" "),a("li",[t._v("else")]),t._v(" "),a("li",[t._v("while")]),t._v(" "),a("li",[t._v("for")]),t._v(" "),a("li",[t._v("switch")]),t._v(" "),a("li",[t._v("case")]),t._v(" "),a("li",[t._v("default")]),t._v(" "),a("li",[t._v("do")]),t._v(" "),a("li",[t._v("break")]),t._v(" "),a("li",[t._v("continue")]),t._v(" "),a("li",[t._v("return")]),t._v(" "),a("li",[t._v("instanceof")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("catch")]),t._v(" "),a("li",[t._v("try")]),t._v(" "),a("li",[t._v("finally")]),t._v(" "),a("li",[t._v("throw")]),t._v(" "),a("li",[t._v("throws")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("static")]),t._v(" "),a("li",[t._v("final")]),t._v(" "),a("li",[t._v("super")]),t._v(" "),a("li",[t._v("this")]),t._v(" "),a("li",[t._v("native(not supported)")]),t._v(" "),a("li",[t._v("strictfp(not supported)")]),t._v(" "),a("li",[t._v("synchronized(not supported)")]),t._v(" "),a("li",[t._v("transient(not supported)")]),t._v(" "),a("li",[t._v("volatile(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("enum(not supported)")]),this._v(" "),s("li",[this._v("assert(not supported)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-3-basic-syntax"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-basic-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.3 Basic syntax")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign")]),t._v(" "),a("li",[t._v("Basic data type: byte short int long float double char boolean")]),t._v(" "),a("li",[t._v("Reference data type: class, interface, array")]),t._v(" "),a("li",[t._v("Arithmetic operators: + - * /%++ -")]),t._v(" "),a("li",[t._v("Relational operator: > <> = <= ==! =")]),t._v(" "),a("li",[t._v("Logical Operators: ! &| ^ && ||")]),t._v(" "),a("li",[t._v("Bit operator: &| ^~>> << >>>")]),t._v(" "),a("li",[t._v("Assignment operator: =")]),t._v(" "),a("li",[t._v("Extension assignment operators: + = - = * = / =")]),t._v(" "),a("li",[t._v("String link operator: +")]),t._v(" "),a("li",[t._v("Conditional operators: ? :")]),t._v(" "),a("li",[t._v("Process control sentence (if, switch, for, while, do...while)")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-4-available-class"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-available-class","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.4 Available class")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ul",[a("li",[t._v("io.nuls.contract.sdk.Address")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Block")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.BlockHeader")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Contract")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Event")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Msg")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.Utils")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.View")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Required")]),t._v(" "),a("li",[t._v("io.nuls.contract.sdk.annotation.Payable")]),t._v(" "),a("li",[t._v("java.lang.Boolean")]),t._v(" "),a("li",[t._v("java.lang.Byte")]),t._v(" "),a("li",[t._v("java.lang.Short")]),t._v(" "),a("li",[t._v("java.lang.Character")]),t._v(" "),a("li",[t._v("java.lang.Integer")]),t._v(" "),a("li",[t._v("java.lang.Long")]),t._v(" "),a("li",[t._v("java.lang.Float")]),t._v(" "),a("li",[t._v("java.lang.Double")]),t._v(" "),a("li",[t._v("java.lang.String")]),t._v(" "),a("li",[t._v("java.lang.StringBuilder")]),t._v(" "),a("li",[t._v("java.math.BigInteger")]),t._v(" "),a("li",[t._v("java.math.BigDecimal")]),t._v(" "),a("li",[t._v("java.util.Collection")]),t._v(" "),a("li",[t._v("java.util.List")]),t._v(" "),a("li",[t._v("java.util.ArrayList")]),t._v(" "),a("li",[t._v("java.util.LinkedList")]),t._v(" "),a("li",[t._v("java.util.Map")]),t._v(" "),a("li",[t._v("java.util.HashMap")]),t._v(" "),a("li",[t._v("java.util.LinkedHashMap")]),t._v(" "),a("li",[t._v("java.util.Set")]),t._v(" "),a("li",[t._v("java.util.HashSet")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_3-5-other-restrictions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-5-other-restrictions","aria-hidden":"true"}},[this._v("#")]),this._v(" 3.5 Other restrictions")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Contract class can have one construction method. No restriction for other classes")]),this._v(" "),s("li",[this._v("The maximum gas consumption for executing a contract method once is 10 million, including the method of the "),s("code",[this._v("@View")]),this._v(" type, Make sure to optimize the contract code as much as possible.")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_4-nuls-smart-contract-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-nuls-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Nuls smart contract example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[s("strong",[s("em",[this._v("Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract")])])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" contracts"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("examples"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleStorage")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setStoredData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("storedData "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" storedData"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_5-nuls-contract-sdk"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-nuls-contract-sdk","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. NULS Contract SDK")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-address"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-address","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Address")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Address")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Get the balance of the address (only the balance of contract address)\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Transfer amount to the address from contract \n *\n * @param value transfer amount (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract method to call the address\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Call the contract method of this address with a return value(String)\n *\n * @param Method name\n * @param Method signature\n * @param Parameters \n * @param value Incidental currency (in Na)\n * @return return value after calling the contract\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("callWithReturnValue")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String methodName"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String methodDesc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Verify the address \n *\n * @param address\n * @see io.nuls.kernel.utils.AddressTool#validAddress(String)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valid")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Address address1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-block"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-block","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Block")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Block")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s head\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Current block’s head\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Newest block’s head\n *\n * @return \n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BlockHeader "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("newestBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Given block’s hash\n *\n * @param blockNumber\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("blockhash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("blockNumber"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * CCurrent block’s miner address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("coinbase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s No.\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("number")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * \n * Current block’s time stamp\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-blockheader"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-blockheader","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.BlockHeader")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BlockHeader")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Address packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" String stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHash")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTime")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getHeight")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getTxCount")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getStateRoot")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Object o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("o "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getClass")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n BlockHeader that "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BlockHeader"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("time"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("height"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("txCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" that"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hash"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" packingAddress"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" stateRoot"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"BlockHeader{"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", time="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" time "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", height="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" height "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", txCount="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" txCount "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", packingAddress="')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" packingAddress "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('", stateRoot=\'"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" stateRoot "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'\\''")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'}'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Contract")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract interface, implemented by contract class\n */")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-event"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-event","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Event")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n* Event interface, implemented by event class\n*/")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Event")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-msg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-msg","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Msg")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Msg")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Remaining gas\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasleft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * sender of the contract\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Gas price\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("gasprice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Contract address\n *\n * @return\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" Address "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-utils","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.Utils")])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Utils")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Utils")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back.\n *\n * @param expression\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Check conditions; if conditions are not met, it will roll back\n *\n * @param expression\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("expression"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Terminate implementation and restore status\n *\n * @param errorMessage\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("revert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String errorMessage"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Send events\n *\n * @param event\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Event event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @param seed a private seed\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" seed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("currentBlockHeader")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPackingAddress")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("address")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" hash4 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Block"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("timestamp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("hashCode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash3 "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" hash4"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hash "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("xBL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("L "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("seed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * @return pseudo random number (0 ~ 1)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pseudoRandom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("x5DEECE66DL"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param src source string (hex encoding string)\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n *\n * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.\n *\n * @param bytes source byte array\n * @return sha3-256 hash (hex encoding string)\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bytes"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]verify signature data(ECDSA)\n *\n * @param data(hex encoding string)\n * @param signature(hex encoding string)\n * @param pubkey(hex encoding string)\n * @return verify result\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("verifySignatureData")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String signature"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String pubkey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with a specific algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @param algorithm Hash algorithm identifier\n * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds\n *\n * @param endHeight the cutoff block height\n * @param seedCount the number of original seeds\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get a collection of raw seeds based on the block height range\n *\n * @param startHeight the starting block height\n * @param endHeight the cutoff block height\n * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))\n */")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-payable"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-payable","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Payable")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Payable")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-required"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-required","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.Required")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Required labels the parameter of @Required. When it is called, there must be transfer-in value.")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("PARAMETER"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"io-nuls-contract-sdk-annotation-view"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#io-nuls-contract-sdk-annotation-view","aria-hidden":"true"}},[this._v("#")]),this._v(" io.nuls.contract.sdk.annotation.View")])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[s("code",[this._v("@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Target")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ElementType"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("METHOD"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Retention")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RetentionPolicy"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("RUNTIME"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Documented")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" @"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("interface")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("View")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_6-main-rpc-interface-of-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-main-rpc-interface-of-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Main RPC interface of smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-1-create-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-1-create-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.1 Create smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4687")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asd"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-2-estimate-the-gas-consumption-for-creating-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-2-estimate-the-gas-consumption-for-creating-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.2 Estimate the gas consumption for creating smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/create")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractCode*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("smart contract code (byte code’s Hex coded string)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractCode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-3-call-smart-contract"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-3-call-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.3 Call smart contract")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/call")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Type")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("sender*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("password*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("password of transaction creator")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("contractAddress*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("address of smart contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("gasLimit*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("max. gas consumption")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("price*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("unit price of implementation contract")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("value")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("long")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodName*")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method name")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("methodDesc")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("method signature which may be not transferred if the method name is not repeated")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("remark")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("args")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("string[][]")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("Parameter list")])])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("Example Value")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"balance"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"qwe"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-4-estimate-the-gas-consumption-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.4 Estimate the gas consumption for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedgas/call")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-5-estimate-the-price-for-calling-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.5 Estimate the price for calling smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/imputedprice")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-6-terminate-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-6-terminate-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.6 Terminate smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/delete")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-7-call-the-smart-contract-function-which-is-not-linked-to-blockchain-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.7 Call the smart contract function which is not linked to blockchain (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/view")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-8-get-the-implementation-results-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.8 Get the implementation results of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/result/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-9-get-the-basic-information-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.9 Get the basic information of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/info/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-10-verify-if-it-is-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-10-verify-if-it-is-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.10 Verify if it is contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-11-get-the-nuls-balance-of-smart-contract-address-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.11 Get the NULS balance of smart contract address (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/balance/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-12-get-the-transaction-details-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.12 Get the transaction details of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/{hash}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-13-get-the-transaction-list-of-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.13 Get the transaction list of smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/tx/list/{address}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-14-inquire-contract-utxo-as-per-address-and-limit-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.14 Inquire contract UTXO as per address and limit (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/limit/{address}/{limit}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-15-inquire-contract-utxo-as-per-address-and-amount-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.15 Inquire contract UTXO as per address and amount (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("GET "),s("code",[this._v("/api/contract/amount/{address}/{amount}")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_6-16-transfer-amount-to-smart-contract-see-swagger-ui"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-16-transfer-amount-to-smart-contract-see-swagger-ui","aria-hidden":"true"}},[this._v("#")]),this._v(" 6.16 Transfer amount to smart contract (see "),s("code",[this._v("Swagger UI")]),this._v(")")])},function(){var t=this.$createElement,s=this._self._c||t;return s("ul",[s("li",[this._v("POST "),s("code",[this._v("/api/contract/transfer")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h2",{attrs:{id:"_7-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 7. Example")])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-1-voting-smart-contract-code-segments-are-as-follows"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-1-voting-smart-contract-code-segments-are-as-follows","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.1 Voting smart contract code "),s("code",[this._v("segments")]),this._v(" are as follows")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-vote")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BaseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("func"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteInterface"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteConfig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("vote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("model"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("VoteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("List"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" VoteInterface baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("VoteContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n baseVote "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BaseVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("minRecognizance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n VoteEntity voteEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("title"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" desc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" items"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n VoteConfig config "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("VoteConfig")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endTime"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" isMultipleSelect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" maxSelectCount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" voteCanModify"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" success "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("init")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getId")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" config"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("success"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" voteEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" itemIds"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("redemption")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("canVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" VoteEntity "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" List"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Long"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryVoteResult")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" baseVote"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("queryAddressHasVote")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("voteId"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("p",[this._v("If the methods of smart contract include the parameter of "),s("code",[this._v("array type")]),this._v(", please use the following method to transfer parameters")])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Refer to the "),s("code",[this._v("create")]),this._v(" method in the aforesaid voting contract code")])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-javascript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-javascript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sender"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NsdtydTVWskMc7GkZzbsq2FoChqKFwMf"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"contractAddress"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NseLt14NacjTDhXaTXUdrk6VF7aEwtW4"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"gasLimit"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("200000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodName"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"create"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"methodDesc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"remark"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"args"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Test voting 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Voting contract 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Option 3"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536044066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1536184066056")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,s=this._self._c||t;return s("h3",{attrs:{id:"_7-2-standard-token-smart-contract-code-segments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-2-standard-token-smart-contract-code-segments","aria-hidden":"true"}},[this._v("#")]),this._v(" 7.2 Standard Token Smart contract code "),s("code",[this._v("segments")])])},function(){var t=this.$createElement,s=this._self._c||t;return s("blockquote",[s("p",[this._v("Full code: "),s("code",[this._v("https://github.com/nuls-io/nuls-nrc20")])])])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("package")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("HashMap"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("emit"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Utils"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("require"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleToken")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Token "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" BigInteger totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" balances "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decimals")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("totalSupply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleToken")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("symbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" symbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("decimals "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n totalSupply "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" initialAmount"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("TEN"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decimals"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" totalSupply"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ownerAllowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ownerAllowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferFrom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("from"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" BigInteger "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("owner"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transfer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TransferEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" to"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("approve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("increaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" addedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("boolean")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("decreaseApproval")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" Address spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" BigInteger subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger oldValue "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("oldValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" subtractedValue"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("emit")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ApprovalEvent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sender")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" spender"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger allowance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("allowance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient approved token"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" allowance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setAllowed")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Address address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Map"),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n address1Allowed "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashMap")]),a("span",{pre:!0,attrs:{class:"token generics function"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n address1Allowed"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The value must be greater than or equal to 0."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtractBalance")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Address address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger balance "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("balanceOf")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Insufficient balance of token."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n balances"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("put")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("address"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("subtract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" BigInteger value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("check")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("compareTo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\n\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])}],!1,null,null,null);e.options.__file="developerManual.md";s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/93.5d25de24.js b/docs/.vuepress/dist/assets/js/93.5d25de24.js new file mode 100644 index 00000000..49077aec --- /dev/null +++ b/docs/.vuepress/dist/assets/js/93.5d25de24.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{933:function(t,e,a){"use strict";a.r(e);var s=a(0),n=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("The Linux kernel version is recommended to use 2.6.32 and above")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),a("ul",[a("li",[t._v("Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release")]),t._v(" "),a("li",[t._v("After entering the interface of "),a("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS official wallet download"),a("OutboundLink")],1),t._v(", select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.")])]),t._v(" "),a("p",[t._v("To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:")]),t._v(" "),t._m(15),a("p",[t._v("Note: the download address may be different if there are subsequent versions.")]),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),a("p",[t._v("Enter the cmdclient/1.0.0 directory and execute the following command:")]),t._v(" "),t._m(25),t._m(26),t._v(" "),t._m(27),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),a("p",[t._v("Print all valid commands,")]),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("Return: help")]),t._v(" "),t._m(35),a("p",[t._v("Return: help-a")]),t._v(" "),t._m(36),a("p",[t._v("Example")]),t._v(" "),t._m(37),t._m(38),t._v(" "),a("p",[t._v("Create an account and return the set of account addresses")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),a("p",[t._v("When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.")]),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(41),a("p",[t._v("Example")]),t._v(" "),a("p",[t._v("Create a single account")]),t._v(" "),t._m(42),a("p",[t._v("Create multiple accounts at once")]),t._v(" "),t._m(43),t._m(44),t._v(" "),a("p",[t._v("To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(47),a("p",[t._v("Example: backup an account with password")]),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),a("p",[t._v("Enter the password to remove a local account based on the account address")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(52),a("p",[t._v("Example")]),t._v(" "),t._m(53),t._m(54),t._v(" "),a("p",[t._v("Set a new password according to the account address and password.")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(57),a("p",[t._v("Example")]),t._v(" "),t._m(58),t._m(59),t._v(" "),a("p",[t._v("Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(62),a("p",[t._v("Example")]),t._v(" "),t._m(63),t._m(64),t._v(" "),a("p",[t._v("Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),a("p",[t._v("Note: the original password is required to import the keystore file to generate the account")]),t._v(" "),a("p",[t._v("Return: address of the imported account")]),t._v(" "),t._m(67),a("p",[t._v("Example")]),t._v(" "),t._m(68),t._m(69),t._v(" "),a("p",[t._v("Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),a("p",[t._v("Example")]),t._v(" "),t._m(73),t._m(74),t._v(" "),a("p",[t._v("Query account information with the account address")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(77),a("p",[t._v("Example")]),t._v(" "),t._m(78),t._m(79),t._v(" "),a("p",[t._v("Query the account list with the paging parameters and return all accounts in descending order by creation time.")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(82),a("p",[t._v("Example: get accounts list")]),t._v(" "),t._m(83),t._m(84),t._v(" "),a("p",[t._v("Query the account’s private key with the account address and password")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),a("p",[t._v("Return: the private key of the imported account (unencrypted)")]),t._v(" "),t._m(87),a("p",[t._v("Example")]),t._v(" "),t._m(88),t._m(89),t._v(" "),a("p",[t._v("Query account balance with the account address")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("p",[t._v("Return: the address of the imported account")]),t._v(" "),t._m(92),a("p",[t._v("Example")]),t._v(" "),t._m(93),t._m(94),t._v(" "),a("p",[t._v("Transfer NULS to the specific account with the account address")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("Return: transfer transaction hash")]),t._v(" "),t._m(97),a("p",[t._v("Example")]),t._v(" "),t._m(98),t._m(99),t._v(" "),a("p",[t._v("Query the transaction details with the transaction hash")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),a("p",[t._v("Return: transaction details")]),t._v(" "),t._m(102),a("p",[t._v("Example: query transfer transaction")]),t._v(" "),t._m(103),t._m(104),t._v(" "),t._m(105),t._m(106),t._v(" "),a("p",[t._v("Transfer to an external address with an account alias")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(109),a("p",[t._v('Example: transfer 10,000 NULS to external address through alias "zlj"')]),t._v(" "),t._m(110),t._m(111),t._v(" "),a("p",[t._v("To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.")]),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("Return: agent hash of the node")]),t._v(" "),t._m(114),a("p",[t._v("Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.")]),t._v(" "),t._m(115),t._m(116),t._v(" "),a("p",[t._v("Join consensus by account address and node agentHash, which requires at least 2,000NULS")]),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),a("p",[t._v("Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.")]),t._v(" "),t._m(119),a("p",[t._v("Example")]),t._v(" "),t._m(120),t._m(121),t._v(" "),a("p",[t._v("Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.")]),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),a("p",[t._v("Return: transaction hash to cancel consensus")]),t._v(" "),t._m(124),a("p",[t._v("Example")]),t._v(" "),t._m(125),t._m(126),t._v(" "),a("p",[t._v("Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.")]),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),a("p",[t._v("Return: transaction hash to stop a node")]),t._v(" "),t._m(129),a("p",[t._v("Example")]),t._v(" "),t._m(130),t._m(131),t._v(" "),a("p",[t._v("Get the latest block header’s information")]),t._v(" "),t._m(132),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(133),a("p",[t._v("Example")]),t._v(" "),t._m(134),t._m(135),t._v(" "),a("p",[t._v("Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(138),a("p",[t._v("Example: get block with block height")]),t._v(" "),t._m(139),t._m(140),t._v(" "),a("p",[t._v("This interface is called to create a smart contract on the chain")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),a("p",[t._v("Returns the transaction hash for which the contract was created and the address of the contract")]),t._v(" "),t._m(143),a("p",[t._v("The example creates a contract (contractCode omits the middle)")]),t._v(" "),t._m(144),t._m(145),t._v(" "),a("p",[t._v("Gets the description of the intelligent contract and the argument list of the constructor and the calling method")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(148),a("p",[t._v("example")]),t._v(" "),t._m(149),t._m(150),t._v(" "),a("p",[t._v("Call the functions provided by the smart contract")]),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),a("p",[t._v("Returns: transaction hash")]),t._v(" "),t._m(153),t._m(154),t._v(" "),t._m(155),t._m(156),t._v(" "),a("p",[t._v("Stop an available smart contract")]),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(159),a("p",[t._v("example")]),t._v(" "),t._m(160),t._m(161),t._v(" "),a("p",[t._v("Calling the contract view method immediately returns the result and no transaction is generated")]),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("The return value")]),t._v(" "),t._m(164),a("p",[t._v("The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address")]),t._v(" "),t._m(165),t._m(166),t._v(" "),a("p",[t._v("To the specified contract address into the main network currency")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(169),a("p",[t._v("Example passes two NULS to the specified contract")]),t._v(" "),t._m(170),t._m(171),t._v(" "),a("p",[t._v("NRC20 token transfer")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(174),a("p",[t._v("example token transfer:")]),t._v(" "),t._m(175),t._m(176),t._v(" "),a("p",[t._v("Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results")]),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(179),a("p",[t._v("example")]),t._v(" "),t._m(180),t._m(181),t._v(" "),a("p",[t._v("Gets the execution result of a contract")]),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(184),a("p",[t._v("example")]),t._v(" "),t._m(185),t._m(186),t._v(" "),a("p",[t._v("Gets the list of parameters that need to be passed in to create the specified contract")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(189),a("p",[t._v("example")]),t._v(" "),t._m(190),t._m(191),t._v(" "),a("p",[t._v("Gets the list of contracts created by the specified account address")]),t._v(" "),t._m(192),t._v(" "),t._m(193),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(194),a("p",[t._v("example")]),t._v(" "),t._m(195),t._m(196),t._v(" "),a("p",[t._v("Query network basic information")]),t._v(" "),t._m(197),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(198),a("p",[t._v("Example")]),t._v(" "),t._m(199),t._m(200),t._v(" "),a("p",[t._v("Query the network node IP")]),t._v(" "),t._m(201),t._v(" "),a("p",[t._v("Return information")]),t._v(" "),t._m(202),a("p",[t._v("Example: get a block with the block height")]),t._v(" "),t._m(203),t._m(204),t._v(" "),a("p",[t._v("Exit the command line that operates the wallet, while it won’t stop the launched wallet node.")]),t._v(" "),t._m(205),t._v(" "),a("p",[t._v("Example")]),t._v(" "),t._m(206)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"linux-cli-manual"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#linux-cli-manual","aria-hidden":"true"}},[this._v("#")]),this._v(" Linux CLI Manual")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"version-update-history"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update-history","aria-hidden":"true"}},[this._v("#")]),this._v(" Version update history")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Versions")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Date")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Contents")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-03-18")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("alpha")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"preparation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preparation","aria-hidden":"true"}},[this._v("#")]),this._v(" Preparation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"server-hardware-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardware-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Server hardware configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("The server for NULS node should be not lower than the following configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4-Core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("16GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("128GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Recommended configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("8-core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("32GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("256GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("100Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"system-and-kernel-version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#system-and-kernel-version","aria-hidden":"true"}},[this._v("#")]),this._v(" System and kernel version")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux system")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS 6, 7")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"get-started"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-started","aria-hidden":"true"}},[this._v("#")]),this._v(" Get started")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"download"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#download","aria-hidden":"true"}},[this._v("#")]),this._v(" Download")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation","aria-hidden":"true"}},[this._v("#")]),this._v(" Installation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Extract the downloaded file in Linux")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"run"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#run","aria-hidden":"true"}},[this._v("#")]),this._v(" Run")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Enter the extracted directory and run the boot script to start the full node wallet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd NULS-Wallet-linux64-2.0.0-alpha-1\n $ ./start.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"use-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" Use wallet")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"quick-start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick start")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd cmdclient/1.0.0\n $ ./cmd.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("At this point, you can see the input prompt "),e("code",[this._v("nuls>>>")]),this._v(", now you can directly type NULS wallet command to operate.\nFor example, to create an account you can do like this:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' nuls>>> create\n Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\n Enter your password:*********\n Please confirm new password:*********\n [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\n nuls>>>\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Command "),e("code",[this._v("create")]),this._v(" means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"convention"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#convention","aria-hidden":"true"}},[this._v("#")]),this._v(" Convention")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Password rules: password length varies from 8 to 20 and must contain both letters and digits.")]),this._v(" "),e("li",[this._v('Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"wallet-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wallet-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Wallet command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"help-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#help-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Help command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: help [-a]|[group]|[command]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("-a")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("format the printed command, optional")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("command")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view instructions for the specific command")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("group")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view all instructions for the commands in the specific command group")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n OPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\nnuls>>> help account\nnuls>>> help create\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-an-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-an-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Create an account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: create [number]")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number] the number of accounts you want to create, optional")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}})])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create \nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 3\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"back-up-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#back-up-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Back up account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: backup
[path]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("[path]")]),t._v(" "),a("td",[t._v("the directory where the generated backup file is included, current directory by default, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("shell\nnuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj\nEnter account password\n***************\nThe path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"remove-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#remove-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Remove account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: remove
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\nEnter your password for account**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"modify-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modify-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Modify account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:resetpwd
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N\nEnter your old password:**********\nEnter new password**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"set-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Set alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: setalias
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("alias name, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("txHash"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[this._v("0020")]),this._v('f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj\nEnter your account password**********\ntxHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: importkeystore ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("path of the keystore file to be imported, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: import ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account's private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccount
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // the encrypted private key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baglance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // frozen assets \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // total assets\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),t._v(" // usable assets \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // account address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),t._v(" //public key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n{\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //encrypted private key \n "alias" : "zlj", //alias\n "baglance" : { \n "freeze" : 0, // frozen assets\n "total" : 997999999800000, // total assets\n "available" : 997999999800000 // usable assets\n },\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", // account address\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key \n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-list","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account list")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccounts **")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("page number indicating the page to query, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("number of rows displayed per page, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //public key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),t._v(" //private key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts\n[ {\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //address\n "alias" : null, //alias\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //encrypted public key\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //encrypted private key\n}, {\n "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",\n "alias" : null,\n "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",\n "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"\n}, {\n "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",\n "alias" : "zlj",\n "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",\n "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account's private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getprikey
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token number"}},[this._v("00")]),this._v("a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9\nEnter your account password**********\n7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbalance
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // locked balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("// usable balance\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "total" : "9999998.99",\n "freeze" : "0",\n "available" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfer | | [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address(Select any item with the fromAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address alias(Select any item with the fromAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer\nPlease enter the password.\nEnter your password: *********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-transaction-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-transaction-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Query transaction details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: gettx **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash, optional")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //transaction type (refer to the table below for Enumeration type description "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("Enumeration type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1552979783918")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"transactionSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg=="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"6L2s6LSm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestAlgType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestBytes"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f"')]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("341")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONFIRMED"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //confirmation state\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("225")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inBlockIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinDataInstance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABmAU91zVafgSLoRrxnHo7k3r/Azg="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"79acNPim+aw="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABL/80LO1f8vxvfNXc5l9eeIDTGKM="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //fee\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"multiSignTx"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f\n{\n "type" : 2, //transaction type (refer to the table below for Enumeration type description [Enumeration type])\n "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",\n "txData" : null,\n "time" : 1552979783918,\n "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",\n "remark" : "6L2s6LSm",\n "hash" : {\n "digestAlgType" : 0,\n "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", \n "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" \n },\n "blockHeight" : 341, //block height\n "status" : "CONFIRMED", //confirmation state\n "size" : 225,\n "inBlockIndex" : 0,\n "coinDataInstance" : { \n "from" : [ {\n "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100100000,\n "nonce" : "79acNPim+aw=",\n "locked" : 0\n } ],\n "to" : [ {\n "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100000000,\n "lockTime" : 0\n } ]\n },\n "fee" : 100000, //fee\n "multiSignTx" : false\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"enumeration-type-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#enumeration-type-description","aria-hidden":"true"}},[this._v("#")]),this._v(" Enumeration type description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("/** coinbase transaction*/\n int TX_TYPE_COINBASE = 1;\n /** transfer */\n int TX_TYPE_TRANSFER = 2;\n /** set alias */\n int TX_TYPE_ALIAS = 3;\n /** create consensus node */\n int TX_TYPE_REGISTER_AGENT = 4;\n /** agent (join consensus) */\n int TX_TYPE_JOIN_CONSENSUS = 5;\n /** cancel agent (cancel consensus)*/\n int TX_TYPE_CANCEL_DEPOSIT = 6;\n /** yellow punish */\n int TX_TYPE_YELLOW_PUNISH = 7;\n /** red punish */\n int TX_TYPE_RED_PUNISH = 8;\n /** stop node (stop consensus node)*/\n int TX_TYPE_STOP_AGENT = 9;\n /** cross-chain transfer */\n int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;\n /** register chain */\n int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;\n /** destroy chain*/\n int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;\n /** add asset to chain*/\n int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;\n /** remove asset from chain*/\n int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;\n /** create contract */\n int TX_TYPE_CREATE_CONTRACT = 100;\n /** call contract */\n int TX_TYPE_CALL_CONTRACT = 101;\n /** delete contract*/\n int TX_TYPE_DELETE_CONTRACT = 102;\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-by-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-by-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer by alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("order: transfer
[remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("sender address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000\nEnter your account password**********\n00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Create node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: createagent ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address to create a node, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agent commission ratio with a range from 10 to 100, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit to create a node, no less than 2000 NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password: **********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"join-consensus-agent-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#join-consensus-agent-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Join consensus (agent node)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: deposit
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agentHash of the node, optional")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit required to join consensus, no less than 2000NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"cancel-consensus-cancel-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cancel-consensus-cancel-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Cancel consensus (cancel agent)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: withdraw
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("hash of the agent transaction, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"stop-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stop-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Stop agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: stopagent
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-latest-information-of-block-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-latest-information-of-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the latest information of block header")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbestblockheader")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block singnature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // packing address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",\n "time" : "2019-03-19 18:26:20.020",\n "height" : 1479,\n "txCount" : 0,\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",\n "size" : 0,\n "packingAddress" : null,\n "roundIndex" : 155299118,\n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1,\n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-block-header-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-block-header-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query block header information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getblock | ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block hash")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block height")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block signature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing address \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash\n "time" : "2019-03-19 18:26:20.020", //packing time \n "height" : 1479, //block height \n "txCount" : 1, // number of transactions included in the block\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature \n "size" : 0, //block size \n "packingAddress" : null, //packing address \n "roundIndex" : 155299118, \n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1, \n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Create smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:createcontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Create the account address for the smart contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Consumes of the gas for creating the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Hex code of the contract code")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //transaction hash\n "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo\nThe arguments structure: \n[ {\n "type" : "String",\n "name" : "name",\n "required" : true\n}, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n}, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n}, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n} ]\nPlease enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'").\nEnter the arguments:"KQB","KQB",10000,2\n{\n "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-basic-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-basic-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract basic information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractinfo ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("contract address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\nnuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ngetcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\n{\n "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "createTime" : 1553563706022,\n "blockHeight" : 46,\n "isNrc20" : true,\n "nrc20TokenName" : "QKB",\n "nrc20TokenSymbol" : "QKB",\n "decimals" : 2,\n "totalSupply" : "200000000",\n "status" : "normal",\n "method" : [ {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },{\n "name" : "transfer",\n "desc" : "(Address to, BigInteger value) return boolean",\n "args" : [ {\n "type" : "Address",\n "name" : "to",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "value",\n "required" : true\n } ],\n "returnArg" : "boolean",\n "view" : false,\n "event" : false,\n "payable" : false\n }]\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"invoke-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#invoke-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Invoke smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:callcontract [-d methodDesc] [-r remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("This contract is the largest consumption of Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The method name of the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("If transfer is to be made to the contract, the amount of transfer")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])]),t._v(" "),a("tr",[a("td",[t._v("[-r remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("The example calls the nrc20-token transfer function for a specified contract, Example "),e("code",[this._v("tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L")]),this._v(" NRC20 contract address, number of input parameters for receiving address and account transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\ncallcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\nPlease Enter your account passwordzhoujun172\n**********\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2\n"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"delete-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Delete smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontract ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ndeletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\nPlease enter your account passwordzhoujun172\n**********\n"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"call-the-contract-view-method"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#call-the-contract-view-method","aria-hidden":"true"}},[this._v("#")]),this._v(" Call the contract view method")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontractviewcontract [-d methodDesc] --view contract")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Method called")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The return value varies depending on the function being called\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nviewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n{\n "result" : "20000000"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-money-to-the-contract-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-money-to-the-contract-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer money to the contract address")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfertocontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Transfer out account address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark\nPlease enter your account password\n**********\n"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"token-transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token-transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" token transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:tokentransfer [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("contract address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000\nPlease enter your account password\n**********\n"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontracttx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\ngetcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "type" : "100",\n "time" : "2019-03-26 09:28:26",\n "blockHeight" : 46,\n "fee" : 0.0,\n "value" : 0.0,\n "remark" : null,\n "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",\n "status" : "confirm",\n "confirmCount" : 0,\n "size" : 6686,\n "inputs" : [ {\n "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "assetsChainId" : 2,\n "assetsId" : 1,\n "amount" : "5700000",\n "nonce" : "ffffffff",\n "locked" : 0,\n "value" : 0.0\n } ],\n "outputs" : [ ],\n "txData" : {\n "data" : {\n "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "value" : 0.0,\n "hexCode" : "504b03040a0000080...........31600000000",\n "gasLimit" : 200000,\n "price" : "0.00000025",\n "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]\n }\n },\n "contractResult" : {\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n }\n}\n\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-execution-result"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-execution-result","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract execution result")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractresult ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-constructor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-constructor","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract constructor")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractcontructor ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Hex code of the contract code")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000\n{\n "constructor" : {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },\n "isNrc20" : true\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"gets-the-list-of-contracts-created-for-the-specified-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#gets-the-list-of-contracts-created-for-the-specified-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Gets the list of contracts created for the specified account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getaccountcontracts ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\n[ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",\n "createTime" : "2019-03-25 16:08:25.025",\n "height" : 253,\n "confirmCount" : 195,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",\n "createTime" : "2019-03-25 15:33:54.054",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network info")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height locally \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height of the network \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//network time offset \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//number of in-nodes \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//number of out-nodes \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network info\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-node-ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-node-ip","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network node IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network nodes")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('" 192.168.1.223 "')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network nodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"exit-the-wallet-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-the-wallet-cli","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit the wallet CLI")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="linuxTutorial.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/94.52f3f774.js b/docs/.vuepress/dist/assets/js/94.52f3f774.js new file mode 100644 index 00000000..a2379640 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/94.52f3f774.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{939:function(t,s,e){"use strict";e.r(s);var a=e(0),r=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"content"},[e("h1",{attrs:{id:"service-charge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#service-charge","aria-hidden":"true"}},[t._v("#")]),t._v(" Service Charge")]),t._v(" "),e("h3",{attrs:{id:"_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-standards-of-service-charge-for-smart-contracts-how-is-the-service-fee-charged-how-much-does-it-cost-an-interface-invoker-who-will-receive-the-service-charge","aria-hidden":"true"}},[t._v("#")]),t._v(" 1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?")]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Background:")]),t._v(" Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.")])]),t._v(" "),e("p",[t._v("In the main-net, there are now three more types of transactions: "),e("code",[t._v("creating a smart contract")]),t._v(", "),e("code",[t._v("invoking a smart contract")]),t._v(", "),e("code",[t._v("deleting a smart contract")])]),t._v(" "),e("p",[t._v("The difference between those three transactions and other transactions such as "),e("code",[t._v("transfer")]),t._v(" is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.")]),t._v(" "),e("ul",[e("li",[t._v("Calculation of smart contract service charge")])]),t._v(" "),e("div",{staticClass:"language-java extra-class"},[e("pre",{pre:!0,attrs:{class:"language-java"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" COMPARISON "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Compare bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONSTANT "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Simple numeric type bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LDC "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Numeric constant, string constant (length * LDC) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONTROL "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Control bytecode ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TABLESWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * TABLESWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOOKUPSWITCH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Switch bytecode (size * LOOKUPSWITCH) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" CONVERSION "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Value conversion ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" EXTENDED "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Null determine ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MULTIANEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Multidimensional Array (size * MULTIANEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" LOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send the local variable to the top of the stack \n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYLOAD "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Send an item of the array to the top of the stack\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MATH "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Mathematical operations and shift operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" REFERENCE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Object related operations ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" NEWARRAY "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//One-dimensional array (size * NEWARRAY) ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STACK "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Stack operation ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" STORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Save the value in the top of the stack to a local variable ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ARRAYSTORE "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Save the value of the stack to an array ")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("final")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" TRANSFER "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Transfer transaction")]),t._v("\n\n")])])]),e("ul",[e("li",[t._v("Total service charge for invoking a smart contract\nThe total service charge for a contract transaction consists of three parts")])]),t._v(" "),e("ul",[e("li",[e("p",[t._v("The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.")])]),t._v(" "),e("li",[e("p",[t._v("The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.")])])]),t._v(" "),e("blockquote",[e("p",[t._v("For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.")])]),t._v(" "),e("ul",[e("li",[t._v("The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.")])]),t._v(" "),e("blockquote",[e("p",[t._v("Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")])]),t._v(" "),e("ul",[e("li",[t._v("How much does a contract invoker pay?")])]),t._v(" "),e("p",[t._v("To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.")]),t._v(" "),e("ul",[e("li",[t._v("Who receives the service charge?")])]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v("Precondition:")]),t._v("This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.")])]),t._v(" "),e("p",[t._v("The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.")])])}],!1,null,null,null);r.options.__file="smartContractFee.md";s.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/95.3da9bca5.js b/docs/.vuepress/dist/assets/js/95.3da9bca5.js new file mode 100644 index 00000000..2bc3d72e --- /dev/null +++ b/docs/.vuepress/dist/assets/js/95.3da9bca5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{941:function(t,n,a){"use strict";a.r(n);var s=a(0),e=Object(s.a)({},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[a("router-link",{attrs:{to:"/startNULS/connectTestnet.html"}},[t._v("Preparations for deployment and invocation of smart contracts")])],1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("Preparations for the development of smart contract code")]),t._v(" "),a("p",[t._v("[Downloading JDK8]\n(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)")]),t._v(" "),a("p",[t._v("[Downloading NULS smart contract plug-ins]\n(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)")]),t._v(" "),a("p",[t._v("[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)")]),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._m(7),t._v(" "),a("p",[t._v("[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)")]),t._v(" "),a("p",[t._v("[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)")]),t._v(" "),a("p",[t._v("[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)")]),t._v(" "),t._m(8),t._v(" "),a("p",[t._v("[How to deploy and invoke the wallet smart contract]\n(https://dev.nuls.io/zh-cn/contract/smartContract.html)")]),t._v(" "),t._m(9),t._v(" "),a("p",[t._v("[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)")])])},[function(){var t=this.$createElement,n=this._self._c||t;return n("h1",{attrs:{id:"quick-start"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick Start")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-running-the-test-net-environment-creating-an-account-and-claiming-test-tokens","aria-hidden":"true"}},[this._v("#")]),this._v(" 1. Running the test-net environment, creating an account, and claiming test tokens.")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-installing-jdk8-intellij-idea-and-nuls-smart-contract-plug-ins","aria-hidden":"true"}},[this._v("#")]),this._v(" 2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_3-smart-contract-example"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-smart-contract-example","aria-hidden":"true"}},[this._v("#")]),this._v(" 3. Smart contract example")])},function(){var t=this.$createElement,n=this._self._c||t;return n("p",[n("strong",[this._v("_Quickly compile and deploy a smart contract with the example _")])])},function(){var t=this.$createElement,n=this._self._c||t;return n("ul",[n("li",[this._v("Simple example")])])},function(){var t=this,n=t.$createElement,a=t._self._c||n;return a("div",{staticClass:"language-java extra-class"},[a("pre",{pre:!0,attrs:{class:"language-java"}},[a("code",[t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Payable"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Required"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("contract"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sdk"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("annotation"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("View"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigDecimal"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nImport java"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("BigInteger"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nPublic "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleContract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implements")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Contract")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n Private String sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Override")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("_payable")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayContent")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Required")]),t._v(" String content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" content"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@Payable")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("transferToContract")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// mark the @Payable annotation. Smart contract can receive NULS when invoking this method")]),t._v("\n BigInteger value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigDecimal nuls "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigDecimal")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("movePointLeft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can do something else")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I received your transfer amount: "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" nuls"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toPlainString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token annotation punctuation"}},[t._v("@View")]),t._v("\n Public String "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sayWhat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("If")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sayContent "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" null"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say "')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" sayContent"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n Return "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"you want say nothing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_4-smart-contract-repository"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-smart-contract-repository","aria-hidden":"true"}},[this._v("#")]),this._v(" 4. Smart contract repository")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_5-deploying-and-invoking-smart-contracts"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_5-deploying-and-invoking-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" 5. Deploying and invoking smart contracts")])},function(){var t=this.$createElement,n=this._self._c||t;return n("h2",{attrs:{id:"_6-smart-contract-specifications-and-syntax"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_6-smart-contract-specifications-and-syntax","aria-hidden":"true"}},[this._v("#")]),this._v(" 6. Smart contract specifications and syntax")])}],!1,null,null,null);e.options.__file="startSmartContract.md";n.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/96.24b73c87.js b/docs/.vuepress/dist/assets/js/96.24b73c87.js new file mode 100644 index 00000000..4b00ba60 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/96.24b73c87.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{955:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),a("p",[t._v("[TOC]")]),t._v(" "),t._m(1),t._v(" "),t._m(2),t._v(" "),a("p",[t._v("Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/SHA-2",target:"_blank",rel:"noopener noreferrer"}},[t._v("SHA-256"),a("OutboundLink")],1),t._v(" hashes are used, however "),a("a",{attrs:{href:"http://en.wikipedia.org/wiki/RIPEMD",target:"_blank",rel:"noopener noreferrer"}},[t._v("RIPEMD-160"),a("OutboundLink")],1),t._v(" is also used when a shorter hash is desirable (for example when creating a NULS address).")]),t._v(" "),a("p",[t._v('Example of double-SHA-256 encoding of string "nuls":')]),t._v(" "),t._m(3),a("p",[t._v("For NULS addresses (RIPEMD-160) this would give:")]),t._v(" "),t._m(4),t._m(5),t._v(" "),t._m(6),t._v(" "),a("p",[t._v("If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.")]),t._v(" "),a("p",[t._v("First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.")]),t._v(" "),a("p",[t._v("Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.")]),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),a("p",[t._v("where")]),t._v(" "),t._m(10),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("A NULS address is in fact the hash of a ECDSA public key, computed this way:")]),t._v(" "),t._m(13),a("p",[t._v("非nuls体系的地址格式如下:")]),t._v(" "),a("p",[t._v("例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定")]),t._v(" "),t._m(14),t._m(15),t._v(" "),a("p",[t._v("Satellite-chain uses custom messaging for communication over the TCP protocol.")]),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),a("p",[t._v("The message consists of a 24-byte header and payload.")]),t._v(" "),t._m(18),t._m(19),t._v(" "),a("p",[t._v("The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.")]),t._v(" "),t._m(20),t._v(" "),a("p",[t._v("[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.")]),t._v(" "),t._m(21),t._v(" "),t._m(22),t._v(" "),a("p",[t._v("Variable-length integers that can be encoded based on the values expressed to save space.")]),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),a("p",[t._v("A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.")]),t._v(" "),t._m(25),t._v(" "),t._m(26),t._v(" "),a("p",[t._v("Variable-length buffer, consistent with the VarString implementation.")]),t._v(" "),t._m(27),t._v(" "),t._m(28),t._v(" "),a("p",[t._v("6-byte number.")]),t._v(" "),t._m(29),t._v(" "),a("p",[t._v("When a network address is needed somewhere, this structure is used.")]),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("交易特性")]),t._v(" "),t._m(35),a("p",[t._v("coinData结构")]),t._v(" "),t._m(36),a("p",[t._v("CoinForm结构[40]")]),t._v(" "),t._m(37),a("p",[t._v("CoinTo结构[44]")]),t._v(" "),t._m(38),a("p",[t._v("手续费")]),t._v(" "),t._m(39),t._m(40),t._v(" "),a("p",[t._v("参考各个模块")])])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"protocol-design"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#protocol-design","aria-hidden":"true"}},[this._v("#")]),this._v(" Protocol design")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-standards"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-standards","aria-hidden":"true"}},[this._v("#")]),this._v(" Common standards")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"hashes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#hashes","aria-hidden":"true"}},[this._v("#")]),this._v(" Hashes")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)\n7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls\n96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)\nf8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"merkle-trees"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#merkle-trees","aria-hidden":"true"}},[this._v("#")]),this._v(" Merkle Trees")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Merkle trees are binary trees of hashes. Merkle trees in NULS use a "),e("strong",[this._v("double")]),this._v(" SHA-256, the SHA-256 hash of the SHA-256 hash of something.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the "),e("strong",[this._v("Merkle root")]),this._v(" of the tree.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("For example, imagine a block with three transactions "),e("em",[this._v("a")]),this._v(", "),e("em",[this._v("b")]),this._v(" and "),e("em",[this._v("c")]),this._v(". The Merkle tree is:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("d1 = dhash(a)\nd2 = dhash(b)\nd3 = dhash(c)\nd4 = dhash(c) # a, b, c are 3. that's an odd number, so we take the c twice\n\nd5 = dhash(d1 concat d2)\nd6 = dhash(d3 concat d4)\n\nd7 = dhash(d5 concat d6)\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("dhash(a) = sha256(sha256(a))\n\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("em",[this._v("d7")]),this._v(" is the Merkle root of the 3 transactions in this block.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"addresses"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#addresses","aria-hidden":"true"}},[this._v("#")]),this._v(" Addresses")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("ChainId = 2 byte,The ID of the chain in which the account belongs.\naddressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……\npkh = 20 byte , RIPEMD-160(SHA-256(public key))\nxor = 1 byte, XOR(chainId+addressType+pkh)\naddress = Base58Encode(chainId+addressType+pkh+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address = Base58Encode(chainId+原始地址长度+原始地址+xor)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Digital binary stream using little endian。")]),this._v(" "),e("li",[this._v("Floating point numbers convert to integers and transfer by little endian")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"message"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message","aria-hidden":"true"}},[this._v("#")]),this._v(" Message")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("*---------------------------------------------------------------*\n| Header(24 Byte) | Payload |\n*---------------------------------------------------------------*\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"message-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-header","aria-hidden":"true"}},[this._v("#")]),this._v(" message header")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("MagicNumber")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Packet valid flag")])]),t._v(" "),a("tr",[a("td",[t._v("12")]),t._v(" "),a("td",[t._v("command")]),t._v(" "),a("td",[t._v("char[12]")]),t._v(" "),a("td",[t._v("ASCII string identifying the packet content, NULL padded")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("PayloadLength")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("checksum")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("First 4 bytes of sha256(sha256(payload))")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"common-structre"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#common-structre","aria-hidden":"true"}},[this._v("#")]),this._v(" Common Structre")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varint"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varint","aria-hidden":"true"}},[this._v("#")]),this._v(" VarInt")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Value")]),t._v(" "),a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Structure")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("< 0xfd")]),t._v(" "),a("td",[t._v("1")]),t._v(" "),a("td",[t._v("uint8")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffff")]),t._v(" "),a("td",[t._v("3")]),t._v(" "),a("td",[t._v("0xfd + uint16")])]),t._v(" "),a("tr",[a("td",[t._v("<= 0xffffffff")]),t._v(" "),a("td",[t._v("5")]),t._v(" "),a("td",[t._v("0xfe + uint32")])]),t._v(" "),a("tr",[a("td",[t._v("> 0xffffffff")]),t._v(" "),a("td",[t._v("9")]),t._v(" "),a("td",[t._v("0xff + uint64")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varstring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varstring","aria-hidden":"true"}},[this._v("#")]),this._v(" VarString")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of the string")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("value")]),t._v(" "),a("td",[t._v("uint8[length]")]),t._v(" "),a("td",[t._v("The string itself")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"varbyte"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#varbyte","aria-hidden":"true"}},[this._v("#")]),this._v(" VarByte")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("length")]),t._v(" "),a("td",[t._v("VarInt")]),t._v(" "),a("td",[t._v("Length of payload in number of bytes")])]),t._v(" "),a("tr",[a("td",[t._v("length")]),t._v(" "),a("td",[t._v("data")]),t._v(" "),a("td",[t._v("byte[length]")]),t._v(" "),a("td",[t._v("payload")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"int48"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#int48","aria-hidden":"true"}},[this._v("#")]),this._v(" Int48")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"network-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#network-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Network address")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("16")]),t._v(" "),a("td",[t._v("IPv6/4")]),t._v(" "),a("td",[t._v("char[16]")]),t._v(" "),a("td",[t._v("IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port1")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number, network byte order")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("port2")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("port number,for cross-chain module")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"block-headers"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#block-headers","aria-hidden":"true"}},[this._v("#")]),this._v(" Block_headers")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("version")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("version bumber")])]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("preHash")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("32")]),t._v(" "),a("td",[t._v("merkleRoot")]),t._v(" "),a("td",[t._v("byte[32]")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("stateRoot")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("second")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("txCount")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("extends")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("本字段内容不同的链可设置不同的约束")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("signature")]),t._v(" "),a("td",[t._v("Varbyte")]),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"transactions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transactions","aria-hidden":"true"}},[this._v("#")]),this._v(" Transactions")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Len")]),t._v(" "),a("th",[t._v("Fields")]),t._v(" "),a("th",[t._v("Data Type")]),t._v(" "),a("th",[t._v("Remark")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("type")]),t._v(" "),a("td",[t._v("uint16")]),t._v(" "),a("td",[t._v("交易类型")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("time")]),t._v(" "),a("td",[t._v("uint32")]),t._v(" "),a("td",[t._v("时间,精确到秒")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("txData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("业务数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("coinData")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("资产数据")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("remark")]),t._v(" "),a("td",[t._v("VarString")]),t._v(" "),a("td",[t._v("备注")])]),t._v(" "),a("tr",[a("td",[t._v("?")]),t._v(" "),a("td",[t._v("sig")]),t._v(" "),a("td",[t._v("VarByte")]),t._v(" "),a("td",[t._v("只包含签名,不包含pubkey")])]),t._v(" "),a("tr",[a("td"),t._v(" "),a("td"),t._v(" "),a("td"),t._v(" "),a("td")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("多账户转出\n多账户转入\n多资产转账\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("froms://List格式,\ntos://List格式\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24] 账户地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount: //uint128,转出数量\nnonce : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节\nlocked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("address: //byte[24],目标地址\nassetsChainId://uint16 资产发行链的id\nassetsId: //uint16 资产id\namount : //uint128,转账金额\nlockTime://uint32,解锁高度或解锁时间,-1为永久锁定\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"message-types"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#message-types","aria-hidden":"true"}},[this._v("#")]),this._v(" Message Types")])}],!1,null,null,null);r.options.__file="generalProtocol.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/97.cd2d42fb.js b/docs/.vuepress/dist/assets/js/97.cd2d42fb.js new file mode 100644 index 00000000..a77363d5 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/97.cd2d42fb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[97],{959:function(t,e,a){"use strict";a.r(e);var s=a(0),r=Object(s.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("h1",{attrs:{id:"json-rpc-interface-interaction-format-and-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-rpc-interface-interaction-format-and-specification","aria-hidden":"true"}},[t._v("#")]),t._v(" JSON-RPC Interface interaction format and specification")]),t._v(" "),a("h3",{attrs:{id:"request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Request Body")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"cmd"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"nuls_accounts"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"params"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"param2"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"min_version"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("parameters")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("parameter")]),t._v(" "),a("th",[t._v("required")]),t._v(" "),a("th",[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("cmd")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("string")]),t._v(" "),a("td",[t._v("The command to call")])]),t._v(" "),a("tr",[a("td",[t._v("params")]),t._v(" "),a("td",[t._v("true")]),t._v(" "),a("td",[t._v("array")]),t._v(" "),a("td",[t._v("parameters")])]),t._v(" "),a("tr",[a("td",[t._v("min_version")]),t._v(" "),a("td",[t._v("false")]),t._v(" "),a("td",[t._v("float")]),t._v(" "),a("td",[t._v("The minimum version of the interface to call")])])])]),t._v(" "),a("h3",{attrs:{id:"response-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#response-body","aria-hidden":"true"}},[t._v("#")]),t._v(" Response Body")]),t._v(" "),a("ul",[a("li",[t._v("success")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"msg"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Success"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"result"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("returns")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("required")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("type")]),t._v(" "),a("th",[t._v("description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("code")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("ture")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("int")]),t._v(" "),a("td",[t._v("The result status of the request, 0 means success. Otherwise return an error code")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("msg")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("string")]),t._v(" "),a("td",[t._v("User-friendly request execution result description")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("result")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("true")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("object")]),t._v(" "),a("td",[t._v("Method return value")])])])]),t._v(" "),a("h3",{attrs:{id:"error-code"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-code","aria-hidden":"true"}},[t._v("#")]),t._v(" Error Code")]),t._v(" "),a("h4",{attrs:{id:"json-rpc-standard-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-rpc-standard-errors","aria-hidden":"true"}},[t._v("#")]),t._v(" JSON RPC Standard errors")]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Code")]),t._v(" "),a("th",[t._v("Possible Return message")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("0")]),t._v(" "),a("td",[t._v("Success")]),t._v(" "),a("td",[t._v("Operation success")])]),t._v(" "),a("tr",[a("td",[t._v("1")]),t._v(" "),a("td",[t._v("Parse error")]),t._v(" "),a("td",[t._v("Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.")])]),t._v(" "),a("tr",[a("td",[t._v("2")]),t._v(" "),a("td",[t._v("Invalid Request")]),t._v(" "),a("td",[t._v("The JSON sent is not a valid Request object.")])]),t._v(" "),a("tr",[a("td",[t._v("3")]),t._v(" "),a("td",[t._v("Method not found")]),t._v(" "),a("td",[t._v("The method does not exist / is not available.")])]),t._v(" "),a("tr",[a("td",[t._v("4")]),t._v(" "),a("td",[t._v("Invalid params")]),t._v(" "),a("td",[t._v("Invalid method parameter(s).")])]),t._v(" "),a("tr",[a("td",[t._v("5")]),t._v(" "),a("td",[t._v("Internal error")]),t._v(" "),a("td",[t._v("Internal JSON-RPC error.")])]),t._v(" "),a("tr",[a("td",[t._v("6")]),t._v(" "),a("td",[t._v("Unauthorized")]),t._v(" "),a("td",[t._v("Should be used when some action is not authorized, e.g. sending from a locked account.")])]),t._v(" "),a("tr",[a("td",[t._v("7")]),t._v(" "),a("td",[t._v("Action not allowed")]),t._v(" "),a("td",[t._v("Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).")])]),t._v(" "),a("tr",[a("td",[t._v("8")]),t._v(" "),a("td",[t._v("Timeout")]),t._v(" "),a("td",[t._v("Should be used when an action timedout.")])]),t._v(" "),a("tr",[a("td",[t._v("9")]),t._v(" "),a("td",[t._v("Conflict")]),t._v(" "),a("td",[t._v("Should be used when an action conflicts with another (ongoing?) action.")])]),t._v(" "),a("tr",[a("td",[t._v("10")]),t._v(" "),a("td",[t._v("Execution error")]),t._v(" "),a("td",[t._v("Will contain a subset of custom errors in the data field. See below.")])]),t._v(" "),a("tr",[a("td",[t._v("11 to 100")]),t._v(" "),a("td",[a("code",[t._v("Server error")])]),t._v(" "),a("td",[t._v("Reserved for implementation-defined server-errors.")])])])]),t._v(" "),a("h4",{attrs:{id:"custom-error-fields"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#custom-error-fields","aria-hidden":"true"}},[t._v("#")]),t._v(" Custom error fields")]),t._v(" "),a("p",[t._v("Custom error "),a("code",[t._v("10")]),t._v(" can contain custom error(s) to further explain what went wrong.")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n code"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n msg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Execution error'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);r.options.__file="interfaceStandard.md";e.default=r.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/98.a520e926.js b/docs/.vuepress/dist/assets/js/98.a520e926.js new file mode 100644 index 00000000..adc6b62b --- /dev/null +++ b/docs/.vuepress/dist/assets/js/98.a520e926.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{963:function(t,e,a){"use strict";a.r(e);var s=a(0),n=Object(s.a)({},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[t._m(0),t._v(" "),t._m(1),t._v(" "),a("p",[t._v("This section is a guide for the use of the full node wallet for Linux version of the NULS2.0-alpha test network. We suppose you have basic operation capability of Linux system. This paper introduces how to use NULS wallet to create accounts, import accounts, transfer, and create nodes or stake, etc. in the Linux system. We recommend users to use the Linux system server to create stable NULS nodes.")]),t._v(" "),t._m(2),t._v(" "),t._m(3),t._v(" "),t._m(4),t._v(" "),t._m(5),t._v(" "),t._m(6),t._v(" "),t._m(7),t._v(" "),t._m(8),t._v(" "),t._m(9),t._v(" "),t._m(10),t._v(" "),t._m(11),t._v(" "),t._m(12),t._v(" "),a("p",[t._v("The Linux kernel version is recommended to use 2.6.32 and above")]),t._v(" "),t._m(13),t._v(" "),t._m(14),t._v(" "),a("ul",[a("li",[t._v("Access to NULS official website address for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub address: https://github.com/nuls-io/nuls-wallet-release")]),t._v(" "),a("li",[t._v("After entering the interface of "),a("a",{attrs:{href:"http://nuls.io/wallet",target:"_blank",rel:"noopener noreferrer"}},[t._v("NULS official wallet download"),a("OutboundLink")],1),t._v(", select Linux version to download. MEGA and Baidu Cloud Disk are available for your choice.")])]),t._v(" "),a("p",[t._v("To download v2.0.0-alpha-1 wallet via Linux system, you can type the following command:")]),t._v(" "),t._m(15),a("p",[t._v("Note: the download address may be different if there are subsequent versions.")]),t._v(" "),t._m(16),t._v(" "),t._m(17),t._v(" "),t._m(18),t._m(19),t._v(" "),t._m(20),t._v(" "),t._m(21),t._m(22),t._v(" "),t._m(23),t._v(" "),t._m(24),t._v(" "),a("p",[t._v("Enter the cmdclient/1.0.0 directory and execute the following command:")]),t._v(" "),t._m(25),t._m(26),t._v(" "),t._m(27),t._m(28),t._v(" "),t._m(29),t._v(" "),t._m(30),t._v(" "),t._m(31),t._v(" "),t._m(32),t._v(" "),a("p",[t._v("Print all valid commands,")]),t._v(" "),t._m(33),t._v(" "),t._m(34),t._v(" "),a("p",[t._v("Return: help")]),t._v(" "),t._m(35),a("p",[t._v("Return: help-a")]),t._v(" "),t._m(36),a("p",[t._v("Example")]),t._v(" "),t._m(37),t._m(38),t._v(" "),a("p",[t._v("Create an account and return the set of account addresses")]),t._v(" "),t._m(39),t._v(" "),t._m(40),t._v(" "),a("p",[t._v("When creating an account, you are required to enter the password for the account. The password must be set to ensure the security of the assets.")]),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(41),a("p",[t._v("Example")]),t._v(" "),a("p",[t._v("Create a single account")]),t._v(" "),t._m(42),a("p",[t._v("Create multiple accounts at once")]),t._v(" "),t._m(43),t._m(44),t._v(" "),a("p",[t._v("To back up an account, a file named as account address with the extension .keystore is generated, which is the backup file for the account")]),t._v(" "),t._m(45),t._v(" "),t._m(46),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(47),a("p",[t._v("Example: backup an account with password")]),t._v(" "),t._m(48),t._v(" "),t._m(49),t._v(" "),a("p",[t._v("Enter the password to remove a local account based on the account address")]),t._v(" "),t._m(50),t._v(" "),t._m(51),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(52),a("p",[t._v("Example")]),t._v(" "),t._m(53),t._m(54),t._v(" "),a("p",[t._v("Set a new password according to the account address and password.")]),t._v(" "),t._m(55),t._v(" "),t._m(56),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(57),a("p",[t._v("Example")]),t._v(" "),t._m(58),t._m(59),t._v(" "),a("p",[t._v("Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source")]),t._v(" "),t._m(60),t._v(" "),t._m(61),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(62),a("p",[t._v("Example")]),t._v(" "),t._m(63),t._m(64),t._v(" "),a("p",[t._v("Import the account keystore file to generate a local account. The operation is not accessible if the local account already exists locally.")]),t._v(" "),t._m(65),t._v(" "),t._m(66),t._v(" "),a("p",[t._v("Note: the original password is required to import the keystore file to generate the account")]),t._v(" "),a("p",[t._v("Return: address of the imported account")]),t._v(" "),t._m(67),a("p",[t._v("Example")]),t._v(" "),t._m(68),t._m(69),t._v(" "),a("p",[t._v("Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password.")]),t._v(" "),t._m(70),t._v(" "),t._m(71),t._v(" "),t._m(72),a("p",[t._v("Example")]),t._v(" "),t._m(73),t._m(74),t._v(" "),a("p",[t._v("Query account information with the account address")]),t._v(" "),t._m(75),t._v(" "),t._m(76),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(77),a("p",[t._v("Example")]),t._v(" "),t._m(78),t._m(79),t._v(" "),a("p",[t._v("Query the account list with the paging parameters and return all accounts in descending order by creation time.")]),t._v(" "),t._m(80),t._v(" "),t._m(81),t._v(" "),a("p",[t._v("Return: accounts set")]),t._v(" "),t._m(82),a("p",[t._v("Example: get accounts list")]),t._v(" "),t._m(83),t._m(84),t._v(" "),a("p",[t._v("Query the account’s private key with the account address and password")]),t._v(" "),t._m(85),t._v(" "),t._m(86),t._v(" "),a("p",[t._v("Return: the private key of the imported account (unencrypted)")]),t._v(" "),t._m(87),a("p",[t._v("Example")]),t._v(" "),t._m(88),t._m(89),t._v(" "),a("p",[t._v("Query account balance with the account address")]),t._v(" "),t._m(90),t._v(" "),t._m(91),t._v(" "),a("p",[t._v("Return: the address of the imported account")]),t._v(" "),t._m(92),a("p",[t._v("Example")]),t._v(" "),t._m(93),t._m(94),t._v(" "),a("p",[t._v("Transfer NULS to the specific account with the account address")]),t._v(" "),t._m(95),t._v(" "),t._m(96),t._v(" "),a("p",[t._v("Return: transfer transaction hash")]),t._v(" "),t._m(97),a("p",[t._v("Example")]),t._v(" "),t._m(98),t._m(99),t._v(" "),a("p",[t._v("Query the transaction details with the transaction hash")]),t._v(" "),t._m(100),t._v(" "),t._m(101),t._v(" "),a("p",[t._v("Return: transaction details")]),t._v(" "),t._m(102),a("p",[t._v("Example: query transfer transaction")]),t._v(" "),t._m(103),t._m(104),t._v(" "),t._m(105),t._m(106),t._v(" "),a("p",[t._v("Transfer to an external address with an account alias")]),t._v(" "),t._m(107),t._v(" "),t._m(108),t._v(" "),a("p",[t._v("Return: transaction hash")]),t._v(" "),t._m(109),a("p",[t._v('Example: transfer 10,000 NULS to external address through alias "zlj"')]),t._v(" "),t._m(110),t._m(111),t._v(" "),a("p",[t._v("To create a node through account address, it is required to provide two addresses. The first one is the node address, and you need to input the password for the node account. The other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as deposit.")]),t._v(" "),t._m(112),t._v(" "),t._m(113),t._v(" "),a("p",[t._v("Return: agent hash of the node")]),t._v(" "),t._m(114),a("p",[t._v("Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS.")]),t._v(" "),t._m(115),t._m(116),t._v(" "),a("p",[t._v("Join consensus by account address and node agentHash, which requires at least 2,000NULS")]),t._v(" "),t._m(117),t._v(" "),t._m(118),t._v(" "),a("p",[t._v("Return: the hash of the transaction to join consensus, which is needed to cancel the consensus.")]),t._v(" "),t._m(119),a("p",[t._v("Example")]),t._v(" "),t._m(120),t._m(121),t._v(" "),a("p",[t._v("Cancel consensus (agent) according to account address and the hash of the transaction for joining consensus. When a single account agents nodes for multiple times, each agent transaction is independent. So to cancel consensus, the agent can only be cancelled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time.")]),t._v(" "),t._m(122),t._v(" "),t._m(123),t._v(" "),a("p",[t._v("Return: transaction hash to cancel consensus")]),t._v(" "),t._m(124),a("p",[t._v("Example")]),t._v(" "),t._m(125),t._m(126),t._v(" "),a("p",[t._v("Stop the node and all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours.")]),t._v(" "),t._m(127),t._v(" "),t._m(128),t._v(" "),a("p",[t._v("Return: transaction hash to stop a node")]),t._v(" "),t._m(129),a("p",[t._v("Example")]),t._v(" "),t._m(130),t._m(131),t._v(" "),a("p",[t._v("Get the latest block header’s information")]),t._v(" "),t._m(132),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(133),a("p",[t._v("Example")]),t._v(" "),t._m(134),t._m(135),t._v(" "),a("p",[t._v("Query block information with the block height or block hash, and exactly only one of them can be used as the query condition.")]),t._v(" "),t._m(136),t._v(" "),t._m(137),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(138),a("p",[t._v("Example: get block with block height")]),t._v(" "),t._m(139),t._m(140),t._v(" "),a("p",[t._v("This interface is called to create a smart contract on the chain")]),t._v(" "),t._m(141),t._v(" "),t._m(142),t._v(" "),a("p",[t._v("Returns the transaction hash for which the contract was created and the address of the contract")]),t._v(" "),t._m(143),a("p",[t._v("The example creates a contract (contractCode omits the middle)")]),t._v(" "),t._m(144),t._m(145),t._v(" "),a("p",[t._v("Gets the description of the intelligent contract and the argument list of the constructor and the calling method")]),t._v(" "),t._m(146),t._v(" "),t._m(147),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(148),a("p",[t._v("example")]),t._v(" "),t._m(149),t._m(150),t._v(" "),a("p",[t._v("Call the functions provided by the smart contract")]),t._v(" "),t._m(151),t._v(" "),t._m(152),t._v(" "),a("p",[t._v("Returns: transaction hash")]),t._v(" "),t._m(153),t._m(154),t._v(" "),t._m(155),t._m(156),t._v(" "),a("p",[t._v("Stop an available smart contract")]),t._v(" "),t._m(157),t._v(" "),t._m(158),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(159),a("p",[t._v("example")]),t._v(" "),t._m(160),t._m(161),t._v(" "),a("p",[t._v("Calling the contract view method immediately returns the result and no transaction is generated")]),t._v(" "),t._m(162),t._v(" "),t._m(163),t._v(" "),a("p",[t._v("The return value")]),t._v(" "),t._m(164),a("p",[t._v("The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address")]),t._v(" "),t._m(165),t._m(166),t._v(" "),a("p",[t._v("To the specified contract address into the main network currency")]),t._v(" "),t._m(167),t._v(" "),t._m(168),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(169),a("p",[t._v("Example passes two NULS to the specified contract")]),t._v(" "),t._m(170),t._m(171),t._v(" "),a("p",[t._v("NRC20 token transfer")]),t._v(" "),t._m(172),t._v(" "),t._m(173),t._v(" "),a("p",[t._v("Returns: trading hash")]),t._v(" "),t._m(174),a("p",[t._v("example token transfer:")]),t._v(" "),t._m(175),t._m(176),t._v(" "),a("p",[t._v("Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results")]),t._v(" "),t._m(177),t._v(" "),t._m(178),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(179),a("p",[t._v("example")]),t._v(" "),t._m(180),t._m(181),t._v(" "),a("p",[t._v("Gets the execution result of a contract")]),t._v(" "),t._m(182),t._v(" "),t._m(183),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(184),a("p",[t._v("example")]),t._v(" "),t._m(185),t._m(186),t._v(" "),a("p",[t._v("Gets the list of parameters that need to be passed in to create the specified contract")]),t._v(" "),t._m(187),t._v(" "),t._m(188),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(189),a("p",[t._v("example")]),t._v(" "),t._m(190),t._m(191),t._v(" "),a("p",[t._v("Gets the list of contracts created by the specified account address")]),t._v(" "),t._m(192),t._v(" "),t._m(193),t._v(" "),a("p",[t._v("return value")]),t._v(" "),t._m(194),a("p",[t._v("example")]),t._v(" "),t._m(195),t._m(196),t._v(" "),a("p",[t._v("Query network basic information")]),t._v(" "),t._m(197),t._v(" "),a("p",[t._v("Return")]),t._v(" "),t._m(198),a("p",[t._v("Example")]),t._v(" "),t._m(199),t._m(200),t._v(" "),a("p",[t._v("Query the network node IP")]),t._v(" "),t._m(201),t._v(" "),a("p",[t._v("Return information")]),t._v(" "),t._m(202),a("p",[t._v("Example: get a block with the block height")]),t._v(" "),t._m(203),t._m(204),t._v(" "),a("p",[t._v("Exit the command line that operates the wallet, while it won’t stop the launched wallet node.")]),t._v(" "),t._m(205),t._v(" "),a("p",[t._v("Example")]),t._v(" "),t._m(206)])},[function(){var t=this.$createElement,e=this._self._c||t;return e("h1",{attrs:{id:"alpha-linux-cli-tutorial"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#alpha-linux-cli-tutorial","aria-hidden":"true"}},[this._v("#")]),this._v(" [Alpha]Linux CLI tutorial")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"introduction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#introduction","aria-hidden":"true"}},[this._v("#")]),this._v(" Introduction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"version-update-history"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#version-update-history","aria-hidden":"true"}},[this._v("#")]),this._v(" Version update history")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("Versions")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Date")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Contents")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("V1.0.0")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("2018-03-18")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("alpha")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"preparation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#preparation","aria-hidden":"true"}},[this._v("#")]),this._v(" Preparation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"server-hardware-configuration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#server-hardware-configuration","aria-hidden":"true"}},[this._v("#")]),this._v(" Server hardware configuration")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("The server for NULS node should be not lower than the following configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("4-Core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("16GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("128GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("20Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Recommended configuration:")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"center"}},[t._v("CPU")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Memory")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Disk space")]),t._v(" "),a("th",{staticStyle:{"text-align":"center"}},[t._v("Bandwidth")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"center"}},[t._v("8-core 3.0 GHz")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("32GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("256GB")]),t._v(" "),a("td",{staticStyle:{"text-align":"center"}},[t._v("100Mbps uplink")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"system-and-kernel-version"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#system-and-kernel-version","aria-hidden":"true"}},[this._v("#")]),this._v(" System and kernel version")])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[e("strong",[this._v("Linux system")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("CentOS 6, 7")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"get-started"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-started","aria-hidden":"true"}},[this._v("#")]),this._v(" Get started")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"download"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#download","aria-hidden":"true"}},[this._v("#")]),this._v(" Download")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"installation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#installation","aria-hidden":"true"}},[this._v("#")]),this._v(" Installation")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Extract the downloaded file in Linux")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"run"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#run","aria-hidden":"true"}},[this._v("#")]),this._v(" Run")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Enter the extracted directory and run the boot script to start the full node wallet")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd NULS-Wallet-linux64-2.0.0-alpha-1\n $ ./start.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"use-wallet"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#use-wallet","aria-hidden":"true"}},[this._v("#")]),this._v(" Use wallet")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"quick-start"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#quick-start","aria-hidden":"true"}},[this._v("#")]),this._v(" Quick start")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("After confirming that the wallet has been started, run the command line program of the wallet to operate the wallet.")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(" $ cd cmdclient/1.0.0\n $ ./cmd.sh\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("At this point, you can see the input prompt "),e("code",[this._v("nuls>>>")]),this._v(", now you can directly type NULS wallet command to operate.\nFor example, to create an account you can do like this:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v(' nuls>>> create\n Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\n Enter your password:*********\n Please confirm new password:*********\n [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]\n nuls>>>\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("Command "),e("code",[this._v("create")]),this._v(" means to create a single account, next enter your password, and once again confirm the new password. If successful, the address of the account will be returned.")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"convention"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#convention","aria-hidden":"true"}},[this._v("#")]),this._v(" Convention")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("Password rules: password length varies from 8 to 20 and must contain both letters and digits.")]),this._v(" "),e("li",[this._v('Command parameter description: < Parameter> means required parameter; [parameter] means optional parameter." |" means or, namely you can choose either the previous parameter or the latter.')])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h2",{attrs:{id:"wallet-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#wallet-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Wallet command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"help-command"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#help-command","aria-hidden":"true"}},[this._v("#")]),this._v(" Help command")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: help [-a]|[group]|[command]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[t._v("Parameter")]),t._v(" "),a("th",{staticStyle:{"text-align":"left"}},[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("-a")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("format the printed command, optional")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("command")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view instructions for the specific command")])]),t._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[t._v("group")]),t._v(" "),a("td",{staticStyle:{"text-align":"left"}},[t._v("view all instructions for the commands in the specific command group")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("getaccount
--get account information\n OPTIONS"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),this._v("\n
the account address - Required\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> help\nnuls>>> help -a\nnuls>>> help account\nnuls>>> help create\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-an-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-an-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Create an account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: create [number]")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[this._v("[number] the number of accounts you want to create, optional")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}})])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create \nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> create 3\nPlease enter the new password(8-20 characters, the combination of letters and numbers).\nEnter your new password:**********\nPlease confirm new password:**********\n["5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"back-up-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#back-up-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Back up account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: backup
[path]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("[path]")]),t._v(" "),a("td",[t._v("the directory where the generated backup file is included, current directory by default, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("pre",[e("code",[this._v("shell\nnuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj\nEnter account password\n***************\nThe path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\n")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"remove-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#remove-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Remove account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: remove
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\nEnter your password for account**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"modify-account-password"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modify-account-password","aria-hidden":"true"}},[this._v("#")]),this._v(" Modify account password")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:resetpwd
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("Success\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N\nEnter your old password:**********\nEnter new password**********\nPlease confirm new password:**********\nSuccess\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"set-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#set-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Set alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: setalias
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("alias name, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[this._v("txHash"),e("span",{pre:!0,attrs:{class:"token operator"}},[this._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[this._v("0020")]),this._v('f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj\nEnter your account password**********\ntxHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-keystore"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-keystore","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account keystore")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: importkeystore ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("path of the keystore file to be imported, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>>importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\n5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"import-account-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#import-account-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Import account private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: import ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account's private key, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346\nPlease enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.\nEnter your password:**********\nPlease confirm new password:**********\n5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccount
**")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",{staticStyle:{"text-align":"left"}},[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",{staticStyle:{"text-align":"left"}},[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // the encrypted private key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"baglance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // frozen assets \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // total assets\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("997999999800000")]),t._v(" // usable assets \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // account address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),t._v(" //public key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu\n{\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //encrypted private key \n "alias" : "zlj", //alias\n "baglance" : { \n "freeze" : 0, // frozen assets\n "total" : 997999999800000, // total assets\n "available" : 997999999800000 // usable assets\n },\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", // account address\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key \n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-list"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-list","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account list")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: getaccounts **")])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("page number indicating the page to query, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("number of rows displayed per page, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //alias\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //public key\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"')]),t._v(" //private key\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"alias"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zlj"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pubkeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"encryptedPrikeyHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccounts\n[ {\n "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //address\n "alias" : null, //alias\n "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //encrypted public key\n "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //encrypted private key\n}, {\n "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",\n "alias" : null,\n "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",\n "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"\n}, {\n "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",\n "alias" : "zlj",\n "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",\n "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-s-private-key"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-s-private-key","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account's private key")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getprikey
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token number"}},[this._v("00")]),this._v("a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9\nEnter your account password**********\n7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-account-balance"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-account-balance","aria-hidden":"true"}},[this._v("#")]),this._v(" Query account balance")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbalance
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("// balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"freeze"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // locked balance\n"),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"available"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"9999998.99"')]),t._v("// usable balance\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\n{\n "total" : "9999998.99",\n "freeze" : "0",\n "available" : "9999998.99"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfer | | [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address(Select any item with the fromAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address alias(Select any item with the fromAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAlias)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address(Select any item with the toAddress)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer\nPlease enter the password.\nEnter your password: *********\n"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-transaction-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-transaction-details","aria-hidden":"true"}},[this._v("#")]),this._v(" Query transaction details")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[this._v("** command: gettx **")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash, optional")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //transaction type (refer to the table below for Enumeration type description "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("Enumeration type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txData"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1552979783918")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"transactionSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg=="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"remark"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"6L2s6LSm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestAlgType"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestBytes"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"digestHex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f"')]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("341")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"status"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CONFIRMED"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //confirmation state\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("225")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inBlockIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"coinDataInstance"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"from"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABmAU91zVafgSLoRrxnHo7k3r/Azg="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nonce"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"79acNPim+aw="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"locked"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"to"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"OTABL/80LO1f8vxvfNXc5l9eeIDTGKM="')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsChainId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("12345")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"assetsId"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"amount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lockTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"fee"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100000")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //fee\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"multiSignTx"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f\n{\n "type" : 2, //transaction type (refer to the table below for Enumeration type description [Enumeration type])\n "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",\n "txData" : null,\n "time" : 1552979783918,\n "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",\n "remark" : "6L2s6LSm",\n "hash" : {\n "digestAlgType" : 0,\n "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", \n "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" \n },\n "blockHeight" : 341, //block height\n "status" : "CONFIRMED", //confirmation state\n "size" : 225,\n "inBlockIndex" : 0,\n "coinDataInstance" : { \n "from" : [ {\n "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100100000,\n "nonce" : "79acNPim+aw=",\n "locked" : 0\n } ],\n "to" : [ {\n "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",\n "assetsChainId" : 12345,\n "assetsId" : 1,\n "amount" : 100000000,\n "lockTime" : 0\n } ]\n },\n "fee" : 100000, //fee\n "multiSignTx" : false\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h4",{attrs:{id:"enumeration-type-description"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#enumeration-type-description","aria-hidden":"true"}},[this._v("#")]),this._v(" Enumeration type description")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("/** coinbase transaction*/\n int TX_TYPE_COINBASE = 1;\n /** transfer */\n int TX_TYPE_TRANSFER = 2;\n /** set alias */\n int TX_TYPE_ALIAS = 3;\n /** create consensus node */\n int TX_TYPE_REGISTER_AGENT = 4;\n /** agent (join consensus) */\n int TX_TYPE_JOIN_CONSENSUS = 5;\n /** cancel agent (cancel consensus)*/\n int TX_TYPE_CANCEL_DEPOSIT = 6;\n /** yellow punish */\n int TX_TYPE_YELLOW_PUNISH = 7;\n /** red punish */\n int TX_TYPE_RED_PUNISH = 8;\n /** stop node (stop consensus node)*/\n int TX_TYPE_STOP_AGENT = 9;\n /** cross-chain transfer */\n int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;\n /** register chain */\n int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;\n /** destroy chain*/\n int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;\n /** add asset to chain*/\n int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;\n /** remove asset from chain*/\n int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;\n /** create contract */\n int TX_TYPE_CREATE_CONTRACT = 100;\n /** call contract */\n int TX_TYPE_CALL_CONTRACT = 101;\n /** delete contract*/\n int TX_TYPE_DELETE_CONTRACT = 102;\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-by-alias"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-by-alias","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer by alias")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("order: transfer
[remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("sender address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("receiver address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount, required")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark, optional")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> transferbyalias zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000\nEnter your account password**********\n00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Create node")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: createagent ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address to create a node, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks)")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agent commission ratio with a range from 10 to 100, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit to create a node, no less than 2000 NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000\nPlease enter the password.\nEnter your password: **********\n"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"join-consensus-agent-node"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#join-consensus-agent-node","aria-hidden":"true"}},[this._v("#")]),this._v(" Join consensus (agent node)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: deposit
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("agentHash of the node, optional")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("deposit required to join consensus, no less than 2000NULS, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000\n"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"cancel-consensus-cancel-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#cancel-consensus-cancel-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Cancel consensus (cancel agent)")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: withdraw
")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("
")]),t._v(" "),a("td",[t._v("account address, required")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("hash of the agent transaction, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0\n"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"stop-agent"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#stop-agent","aria-hidden":"true"}},[this._v("#")]),this._v(" Stop agent")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: stopagent
")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("
")]),this._v(" "),e("td",[this._v("account address, required")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token string"}},[this._v('"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"')]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT\nPlease enter the password.\nEnter your password:**********\n"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-latest-information-of-block-header"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-latest-information-of-block-header","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the latest information of block header")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getbestblockheader")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block singnature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // packing address\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getbestblockheader\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",\n "time" : "2019-03-19 18:26:20.020",\n "height" : 1479,\n "txCount" : 0,\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",\n "size" : 0,\n "packingAddress" : null,\n "roundIndex" : 155299118,\n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1,\n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-block-header-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-block-header-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query block header information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: getblock | ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block hash")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("block height")])])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"preHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //previous block hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"merkleHash"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //merkle hash\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"time"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:20.020"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing time \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1479")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block height \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" // number of transactions included in the block\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockSignature"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block signature \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //block size \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingAddress"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" //packing address \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundIndex"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("155299118")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"consensusMemberCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"roundStartTime"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2019-03-19 18:26:10.010"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"packingIndexOfRound"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"mainVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"blockVersion"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"stateRoot"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token null"}},[t._v("null")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getblock 28115\n{\n "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash\n "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash\n "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash\n "time" : "2019-03-19 18:26:20.020", //packing time \n "height" : 1479, //block height \n "txCount" : 1, // number of transactions included in the block\n "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature \n "size" : 0, //block size \n "packingAddress" : null, //packing address \n "roundIndex" : 155299118, \n "consensusMemberCount" : 100,\n "roundStartTime" : "2019-03-19 18:26:10.010",\n "packingIndexOfRound" : 1, \n "mainVersion" : 1,\n "blockVersion" : 0,\n "stateRoot" : null\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"create-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#create-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Create smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:createcontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Create the account address for the smart contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Consumes of the gas for creating the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Hex code of the contract code")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //transaction hash\n "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo\nThe arguments structure: \n[ {\n "type" : "String",\n "name" : "name",\n "required" : true\n}, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n}, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n}, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n} ]\nPlease enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'").\nEnter the arguments:"KQB","KQB",10000,2\n{\n "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-basic-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-basic-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract basic information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractinfo ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("contract address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("Skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('\nnuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ngetcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\n{\n "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "createTime" : 1553563706022,\n "blockHeight" : 46,\n "isNrc20" : true,\n "nrc20TokenName" : "QKB",\n "nrc20TokenSymbol" : "QKB",\n "decimals" : 2,\n "totalSupply" : "200000000",\n "status" : "normal",\n "method" : [ {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },{\n "name" : "transfer",\n "desc" : "(Address to, BigInteger value) return boolean",\n "args" : [ {\n "type" : "Address",\n "name" : "to",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "value",\n "required" : true\n } ],\n "returnArg" : "boolean",\n "view" : false,\n "event" : false,\n "payable" : false\n }]\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"invoke-smart-contracts"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#invoke-smart-contracts","aria-hidden":"true"}},[this._v("#")]),this._v(" Invoke smart contracts")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:callcontract [-d methodDesc] [-r remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("This contract is the largest consumption of Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The method name of the contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("If transfer is to be made to the contract, the amount of transfer")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])]),t._v(" "),a("tr",[a("td",[t._v("[-r remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("p",[this._v("The example calls the nrc20-token transfer function for a specified contract, Example "),e("code",[this._v("tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L")]),this._v(" NRC20 contract address, number of input parameters for receiving address and account transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\ncallcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call\nPlease Enter your account passwordzhoujun172\n**********\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2\n"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"delete-smart-contract"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#delete-smart-contract","aria-hidden":"true"}},[this._v("#")]),this._v(" Delete smart contract")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontract ")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The account address of the invocation contract")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\ndeletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\nPlease enter your account passwordzhoujun172\n**********\n"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"call-the-contract-view-method"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#call-the-contract-view-method","aria-hidden":"true"}},[this._v("#")]),this._v(" Call the contract view method")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("commmand:deletecontractviewcontract [-d methodDesc] --view contract")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("The contract address of the call")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Method called")])]),t._v(" "),a("tr",[a("td",[t._v("[-d methodDesc]")]),t._v(" "),a("td",[t._v("Use this method to describe the parameter list if there is a method with the same name in the contract")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("The return value varies depending on the function being called\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nviewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf\nPlease enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "\'a\',2,[\'c\',4],\'\',\'e\'"),\nIf this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.\nEnter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"\n{\n "result" : "20000000"\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"transfer-money-to-the-contract-address"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#transfer-money-to-the-contract-address","aria-hidden":"true"}},[this._v("#")]),this._v(" Transfer money to the contract address")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:transfertocontract [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("Transfer out account address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark\nPlease enter your account password\n**********\n"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"token-transfer"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#token-transfer","aria-hidden":"true"}},[this._v("#")]),this._v(" token transfer")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:tokentransfer [remark]")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",[a("thead",[a("tr",[a("th",[t._v("Parameter")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("sender address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("contract address")])]),t._v(" "),a("tr",[a("td",[t._v("")]),t._v(" "),a("td",[t._v("transfer amount")])]),t._v(" "),a("tr",[a("td",[t._v("[remark]")]),t._v(" "),a("td",[t._v("remark")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000\nPlease enter your account password\n**********\n"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-contract-transaction"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-contract-transaction","aria-hidden":"true"}},[this._v("#")]),this._v(" Get contract transaction")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontracttx ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip \n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\ngetcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",\n "type" : "100",\n "time" : "2019-03-26 09:28:26",\n "blockHeight" : 46,\n "fee" : 0.0,\n "value" : 0.0,\n "remark" : null,\n "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",\n "status" : "confirm",\n "confirmCount" : 0,\n "size" : 6686,\n "inputs" : [ {\n "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "assetsChainId" : 2,\n "assetsId" : 1,\n "amount" : "5700000",\n "nonce" : "ffffffff",\n "locked" : 0,\n "value" : 0.0\n } ],\n "outputs" : [ ],\n "txData" : {\n "data" : {\n "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "value" : 0.0,\n "hexCode" : "504b03040a0000080...........31600000000",\n "gasLimit" : 200000,\n "price" : "0.00000025",\n "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]\n }\n },\n "contractResult" : {\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n }\n}\n\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-execution-result"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-execution-result","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract execution result")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractresult ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("transaction hash")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f\n{\n "success" : true,\n "errorMessage" : null,\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "result" : null,\n "gasLimit" : 200000,\n "gasUsed" : 14029,\n "price" : "0.00000025",\n "totalFee" : 0.0,\n "txSizeFee" : 0.0,\n "actualContractFee" : 0.0,\n "refundFee" : 0.0,\n "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",\n "value" : 0.0,\n "stackTrace" : null,\n "balance" : 0.0,\n "transfers" : [ ],\n "events" : [ "{\\"contractAddress\\":\\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\\",\\"blockNumber\\":46,\\"event\\":\\"TransferEvent\\",\\"payload\\":{\\"from\\":null,\\"to\\":\\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\\",\\"value\\":\\"200000000\\"}}" ],\n "tokenTransfers" : [ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "from" : null,\n "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",\n "value" : "200000000",\n "name" : "QKB",\n "symbol" : "QKB",\n "decimals" : 2\n } ],\n "remark" : "create"\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"get-the-contract-constructor"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#get-the-contract-constructor","aria-hidden":"true"}},[this._v("#")]),this._v(" Get the contract constructor")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getcontractcontructor ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("Hex code of the contract code")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("skip\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000\n{\n "constructor" : {\n "name" : "",\n "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",\n "args" : [ {\n "type" : "String",\n "name" : "name",\n "required" : true\n }, {\n "type" : "String",\n "name" : "symbol",\n "required" : true\n }, {\n "type" : "BigInteger",\n "name" : "initialAmount",\n "required" : true\n }, {\n "type" : "int",\n "name" : "decimals",\n "required" : true\n } ],\n "returnArg" : "void",\n "view" : false,\n "event" : false,\n "payable" : false\n },\n "isNrc20" : true\n}\n\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"gets-the-list-of-contracts-created-for-the-specified-account"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#gets-the-list-of-contracts-created-for-the-specified-account","aria-hidden":"true"}},[this._v("#")]),this._v(" Gets the list of contracts created for the specified account")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command:getaccountcontracts ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("table",[e("thead",[e("tr",[e("th",[this._v("Parameter")]),this._v(" "),e("th",[this._v("Description")])])]),this._v(" "),e("tbody",[e("tr",[e("td",[this._v("")]),this._v(" "),e("td",[this._v("account address")])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('{\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\n[ {\n "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",\n "createTime" : "2019-03-26 09:28:26.026",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 2,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",\n "createTime" : "2019-03-25 16:08:25.025",\n "height" : 253,\n "confirmCount" : 195,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n}, {\n "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",\n "createTime" : "2019-03-25 15:33:54.054",\n "height" : 46,\n "confirmCount" : 402,\n "remarkName" : null,\n "status" : 0,\n "msg" : null,\n "create" : true\n} ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-information"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-information","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network information")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network info")])])])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"localBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height locally \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"netBestHeight"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35317")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//latest block height of the network \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timeOffset"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0ms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//network time offset \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"inCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("//number of in-nodes \n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"outCount"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("//number of out-nodes \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network info\n{\n "localBestHeight" : 35317,\n "netBestHeight" : 35317,\n "timeOffset" : "0ms",\n "inCount" : 0,\n "outCount" : 1\n}\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"query-network-node-ip"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#query-network-node-ip","aria-hidden":"true"}},[this._v("#")]),this._v(" Query network node IP")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: network nodes")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[this._v('" 192.168.1.223 "')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[this._v("]")]),this._v("\n")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v('nuls>>> network nodes\n[ "192.168.1.223" ]\n')])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("h3",{attrs:{id:"exit-the-wallet-cli"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#exit-the-wallet-cli","aria-hidden":"true"}},[this._v("#")]),this._v(" Exit the wallet CLI")])},function(){var t=this.$createElement,e=this._self._c||t;return e("ul",[e("li",[e("strong",[this._v("command: exit")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"language-shell extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[this._v("nuls>>> exit\n")])])])}],!1,null,null,null);n.options.__file="linuxTutorial.md";e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/99.22c2d988.js b/docs/.vuepress/dist/assets/js/99.22c2d988.js new file mode 100644 index 00000000..dad938e4 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/99.22c2d988.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[99],{967:function(t,a,s){"use strict";s.r(a);var n=s(0),e=Object(n.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"content"},[s("h1",{attrs:{id:"wallet-adds-a-random-seed"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#wallet-adds-a-random-seed","aria-hidden":"true"}},[t._v("#")]),t._v(" Wallet adds a random seed")]),t._v(" "),s("h2",{attrs:{id:"一、wallet-adds-a-random-seed-rpc-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、wallet-adds-a-random-seed-rpc-interface","aria-hidden":"true"}},[t._v("#")]),t._v(" 一、Wallet adds a random seed RPC interface")]),t._v(" "),s("p",[t._v("The random seed you get is a big number, and notice, it could be a negative number")]),t._v(" "),s("h3",{attrs:{id:"get-a-random-seed-list-based-on-the-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-a-random-seed-list-based-on-the-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get a random seed list based on the height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cutoff height, cannot exceed startHeight+1000")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"get-random-seed-list-according-to-height-interval"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#get-random-seed-list-according-to-height-interval","aria-hidden":"true"}},[t._v("#")]),t._v(" Get random seed list according to height interval")]),t._v(" "),s("p",[t._v("URL:/random/seeds/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("array")]),t._v(" "),s("td",[t._v("The seed array")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": [\n "8486473738212806059384942122915964966516544811115122625378589706648696927875",\n "5763677830362183770819418466587054532227472729077319516033962399030101482330",\n "-21576822359476915572374120992682286995340746526938743512234391635989859550499",\n "21657748356022199241379814087980601843534504184851063250908405386419429001546",\n "-31320197741848993348465901825403870475226356831977749494101003161293910010564",\n "16054257794265746474880657765642725318937086559191102027715411501558318980478",\n "39222628335763902261547055653161137231901517785016195993008289217415793052023",\n "28759812140738813907858073405869390691919557824743093132519210315994120629868",\n "26779511442264535228335930919961858598639368721086477781863239801135250744386",\n "-23481782415506504277094909296039579696138464413290902597168011374639343982630"\n ]\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-through-height-interval-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/height")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("startHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Initial height of interval")])]),t._v(" "),s("tr",[s("td",[t._v("endHeight")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Interval cut-off height,endHeight-startHeight<=1000")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "sha3",\n "count": 10\n }\n}\n')])])]),s("h3",{attrs:{id:"according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#according-to-the-algorithm-the-list-of-random-seeds-obtained-by-height-and-quantity-is-calculated-as-a-random-seed-and-the-following-is-returned","aria-hidden":"true"}},[t._v("#")]),t._v(" According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned")]),t._v(" "),s("p",[t._v("URL:/random/seed/count")]),t._v(" "),s("p",[t._v("Method:GET")]),t._v(" "),s("p",[t._v("Prams:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("parameter")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Required")]),t._v(" "),s("th",[t._v("remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("height")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Gets the maximum height of the seed list")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("Long")]),t._v(" "),s("td",[t._v("True")]),t._v(" "),s("td",[t._v("Random seed count, no more than 128")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("false")]),t._v(" "),s("td",[t._v("The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm")])])])]),t._v(" "),s("p",[t._v("Returns:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("field")]),t._v(" "),s("th",[t._v("type")]),t._v(" "),s("th",[t._v("Remark")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("success")]),t._v(" "),s("td",[t._v("boolean")]),t._v(" "),s("td",[t._v("Successful or not")])]),t._v(" "),s("tr",[s("td",[t._v("data")]),t._v(" "),s("td",[t._v("Object")]),t._v(" "),s("td",[t._v("The result object")])]),t._v(" "),s("tr",[s("td",[t._v("seed")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Calculate the random seed result")])]),t._v(" "),s("tr",[s("td",[t._v("algorithm")]),t._v(" "),s("td",[t._v("String")]),t._v(" "),s("td",[t._v("Computational algorithm")])]),t._v(" "),s("tr",[s("td",[t._v("count")]),t._v(" "),s("td",[t._v("int")]),t._v(" "),s("td",[t._v("Number of original random seeds")])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("p",[t._v("Request:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"\n')])])]),s("p",[t._v("Response:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v('{\n "success": true,\n "data": {\n "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",\n "algorithm": "merkle",\n "count": 10\n }\n}\n')])])]),s("h2",{attrs:{id:"二、smart-contracts-support-random-numbers-in-the-underlying-chain"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、smart-contracts-support-random-numbers-in-the-underlying-chain","aria-hidden":"true"}},[t._v("#")]),t._v(" 二、Smart contracts support random Numbers in the underlying chain")]),t._v(" "),s("p",[t._v("Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code.\nTake one of these methods as an example"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")]),t._v(" Shows how to generate random Numbers using random number seeds.")]),t._v(" "),s("h3",{attrs:{id:"_1)-io-nuls-contract-sdk-utils"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1)-io-nuls-contract-sdk-utils","aria-hidden":"true"}},[t._v("#")]),t._v(" 1) io.nuls.contract.sdk.Utils")]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the height range, a specific algorithm is used to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight Number of original seeds\n * @param algorithm Hash algorithm identification\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" String algorithm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" BigInteger "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SHA3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained\n *\n * @param endHeight End height\n * @param seedCount Number of original seeds\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" seedCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * [Testnet]Get the set of original seeds according to the height range\n *\n * @param startHeight Start height\n * @param endHeight End height\n * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))\n */")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("native")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeedList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" startHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"_2)-a-dice-example-shaking-at-the-same-time-n"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2)-a-dice-example-shaking-at-the-same-time-n","aria-hidden":"true"}},[t._v("#")]),t._v(" 2) A dice "),s("code",[t._v("example")]),t._v(" shaking at the same time N")]),t._v(" "),s("h4",{attrs:{id:"_2-1-calculation-method-1"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-calculation-method-1","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.1) Calculation method 1")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("The original seed is multiplied by the number of tosses, resulting in an array of bytes")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dice")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h4",{attrs:{id:"_2-2-calculation-method-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-calculation-method-2","aria-hidden":"true"}},[t._v("#")]),t._v(" 2.2) Calculation method 2")]),t._v(" "),s("ul",[s("li",[t._v("Get the original seed"),s("code",[t._v("Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)")])]),t._v(" "),s("li",[t._v("The first random number is modeled according to the range of the dice")]),t._v(" "),s("li",[t._v("The next random number\n"),s("ul",[s("li",[t._v("Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array")]),t._v(" "),s("li",[t._v("The byte array is hashed with sha3-256 to get a 32-bit byte array")]),t._v(" "),s("li",[t._v("Converts the byte array of this Hash to BigInteger")]),t._v(" "),s("li",[t._v("Use this BigInteger to model the next random number based on the range of the dice")]),t._v(" "),s("li",[t._v("And so on")])])])]),t._v(" "),s("p",[s("strong",[t._v("Refer to the following code")])]),t._v(" "),s("div",{staticClass:"language-java extra-class"},[s("pre",{pre:!0,attrs:{class:"language-java"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("diceAnother")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),t._v(" endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n BigInteger orginSeed "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getRandomSeed")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("endHeight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sha3"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("equals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ZERO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" null"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n BigInteger wrapperRange "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("long")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" range"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n List"),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" resultList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArrayList")]),s("span",{pre:!0,attrs:{class:"token generics function"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String orginStr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" times"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginStr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("charAt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger multiply "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" orginSeed"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("multiply")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("BigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("valueOf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n String s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sha3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("multiply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("toByteArray")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" decode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n BigInteger bigInteger "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BigInteger")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("decode"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n mod "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" bigInteger"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mod")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapperRange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("intValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" resultList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("decode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("String hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" bts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("length")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("byte")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hexString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("substring")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" bts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}],!1,null,null,null);e.options.__file="randomRPC.md";a.default=e.exports}}]); \ No newline at end of file diff --git a/docs/.vuepress/dist/assets/js/app.15dd29f7.js b/docs/.vuepress/dist/assets/js/app.15dd29f7.js new file mode 100644 index 00000000..383b2037 --- /dev/null +++ b/docs/.vuepress/dist/assets/js/app.15dd29f7.js @@ -0,0 +1,8 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var l,r,a=t[0],s=t[1],u=t[2],d=0,v=[];d0?i(l(e),9007199254740991):0}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){for(var l=n(20),i=n(28),o=n(11),r=n(3),a=n(10),s=n(18),u=n(1),c=u("iterator"),d=u("toStringTag"),v=s.Array,f={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(f),h=0;h=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),o.Arguments=o.Array,l("keys"),l("values"),l("entries")},function(e,t,n){"use strict";var l=n(6);e.exports=function(e,t){return!!e&&l(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){"use strict";var l=n(2),i=n(32)(3);l(l.P+l.F*!n(21)([].some,!0),"Array",{some:function(e){return i(this,e,arguments[1])}})},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n=0,l=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+l).toString(36))}},function(e,t){var n=Math.ceil,l=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?l:n)(e)}},function(e,t,n){var l=n(8).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&l(e,o,{configurable:!0,value:t})}},function(e,t,n){var l=n(2);l(l.S+l.F,"Object",{assign:n(103)})},function(e,t,n){var l=n(80),i=n(62);e.exports=Object.keys||function(e){return l(e,i)}},function(e,t,n){var l=n(60),i=n(16);e.exports=function(e){return l(i(e))}},function(e,t,n){var l=n(19),i=n(28);n(83)("keys",function(){return function(e){return i(l(e))}})},function(e,t,n){"use strict";var l=n(2),i=n(32)(0),o=n(21)([].forEach,!0);l(l.P+l.F*!o,"Array",{forEach:function(e){return i(this,e,arguments[1])}})},function(e,t,n){var l=n(9),i=n(60),o=n(19),r=n(15),a=n(111);e.exports=function(e,t){var n=1==e,s=2==e,u=3==e,c=4==e,d=6==e,v=5==e||d,f=t||a;return function(t,a,p){for(var h,g,m=o(t),b=i(m),y=l(a,p,3),_=r(b.length),S=0,k=n?f(t,_):s?f(t,0):void 0;_>S;S++)if((v||S in b)&&(g=y(h=b[S],S,m),e))if(n)k[S]=g;else if(g)switch(e){case 3:return!0;case 5:return h;case 6:return S;case 2:k.push(h)}else if(c)return!1;return d?-1:u||c?c:k}}},function(e,t,n){"use strict";var l=n(2),i=n(32)(2);l(l.P+l.F*!n(21)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var l=n(2),i=n(32)(1);l(l.P+l.F*!n(21)([].map,!0),"Array",{map:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var l=n(5),i=n(19),o=n(15),r=n(25),a=n(67),s=n(68),u=Math.max,c=Math.min,d=Math.floor,v=/\$([$&`']|\d\d?|<[^>]*>)/g,f=/\$([$&`']|\d\d?)/g;n(70)("replace",2,function(e,t,n,p){return[function(l,i){var o=e(this),r=null==l?void 0:l[t];return void 0!==r?r.call(l,o,i):n.call(String(o),l,i)},function(e,t){var i=p(n,e,this,t);if(i.done)return i.value;var d=l(e),v=String(this),f="function"==typeof t;f||(t=String(t));var g=d.global;if(g){var m=d.unicode;d.lastIndex=0}for(var b=[];;){var y=s(d,v);if(null===y)break;if(b.push(y),!g)break;""===String(y[0])&&(d.lastIndex=a(v,o(d.lastIndex),m))}for(var _,S="",k=0,w=0;w=k&&(S+=v.slice(k,U)+E,k=U+C.length)}return S+v.slice(k)}];function h(e,t,l,o,r,a){var s=l+e.length,u=o.length,c=f;return void 0!==r&&(r=i(r),c=v),n.call(a,c,function(n,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,l);case"'":return t.slice(s);case"<":a=r[i.slice(1,-1)];break;default:var c=+i;if(0===c)return i;if(c>u){var v=d(c/10);return 0===v?i:v<=u?void 0===o[v-1]?i.charAt(1):o[v-1]+i.charAt(1):i}a=o[c-1]}return void 0===a?"":a})}})},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){var l,i; +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */void 0===(i="function"==typeof(l=function(){var e,t,n={version:"0.2.0"},l=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function i(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(l[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=i(e,l.minimum,1),n.status=1===e?null:e;var s=n.render(!t),u=s.querySelector(l.barSelector),c=l.speed,d=l.easing;return s.offsetWidth,r(function(t){""===l.positionUsing&&(l.positionUsing=n.getPositioningCSS()),a(u,function(e,t,n){var i;return(i="translate3d"===l.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===l.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,i}(e,c,d)),1===e?(a(s,{transition:"none",opacity:1}),s.offsetWidth,setTimeout(function(){a(s,{transition:"all "+c+"ms linear",opacity:0}),setTimeout(function(){n.remove(),t()},c)},c)):setTimeout(t,c)}),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout(function(){n.status&&(n.trickle(),e())},l.trickleSpeed)};return l.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*i(Math.random()*t,.1,.95)),t=i(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*l.trickleRate)},e=0,t=0,n.promise=function(l){return l&&"resolved"!==l.state()?(0===t&&n.start(),e++,t++,l.always(function(){0==--t?(e=0,n.done()):n.set((e-t)/e)}),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=l.template;var i,r=t.querySelector(l.barSelector),s=e?"-100":o(n.status||0),c=document.querySelector(l.parent);return a(r,{transition:"all 0 linear",transform:"translate3d("+s+"%,0,0)"}),l.showSpinner||(i=t.querySelector(l.spinnerSelector))&&v(i),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){c(document.documentElement,"nprogress-busy"),c(document.querySelector(l.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&v(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var r=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),a=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()}),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var l,i=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((l=e[i]+o)in n)return l;return t}(n))}function l(e,t,l){t=n(t),e.style[t]=l}return function(e,t){var n,i,o=arguments;if(2==o.length)for(n in t)void 0!==(i=t[n])&&t.hasOwnProperty(n)&&l(e,n,i);else l(e,o[1],o[2])}}();function s(e,t){var n="string"==typeof e?e:d(e);return n.indexOf(" "+t+" ")>=0}function u(e,t){var n=d(e),l=n+t;s(n,t)||(e.className=l.substring(1))}function c(e,t){var n,l=d(e);s(e,t)&&(n=l.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function d(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function v(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?l.call(t,n,t,e):l)||(e.exports=i)},function(e,t){e.exports=!1},function(e,t,n){var l=n(12),i=n(1)("toStringTag"),o="Arguments"==l(function(){return arguments}());e.exports=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),i))?n:o?l(t):"Object"==(r=l(t))&&"function"==typeof t.callee?"Arguments":r}},function(e,t,n){var l=n(4),i=n(3).document,o=l(i)&&l(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=function(e,t,n,l){if(!(e instanceof t)||void 0!==l&&l in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var l=n(9),i=n(95),o=n(96),r=n(5),a=n(15),s=n(97),u={},c={};(t=e.exports=function(e,t,n,d,v){var f,p,h,g,m=v?function(){return e}:s(e),b=l(n,d,t?2:1),y=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(f=a(e.length);f>y;y++)if((g=t?b(r(p=e[y])[0],p[1]):b(e[y]))===u||g===c)return g}else for(h=m.call(e);!(p=h.next()).done;)if((g=i(h,b,p.value,t))===u||g===c)return g}).BREAK=u,t.RETURN=c},function(e,t,n){var l=n(11);e.exports=function(e,t,n){for(var i in t)l(e,i,t[i],n);return e}},function(e,t,n){"use strict";var l=n(3),i=n(8),o=n(7),r=n(1)("species");e.exports=function(e){var t=l[e];o&&t&&!t[r]&&i.f(t,r,{configurable:!0,get:function(){return this}})}},function(e,t,n){var l=n(12);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==l(e)?e.split(""):Object(e)}},function(e,t,n){var l=n(72)("keys"),i=n(24);e.exports=function(e){return l[e]||(l[e]=i(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var l=n(24)("meta"),i=n(4),o=n(14),r=n(8).f,a=0,s=Object.isExtensible||function(){return!0},u=!n(6)(function(){return s(Object.preventExtensions({}))}),c=function(e){r(e,l,{value:{i:"O"+ ++a,w:{}}})},d=e.exports={KEY:l,NEED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,l)){if(!s(e))return"F";if(!t)return"E";c(e)}return e[l].i},getWeak:function(e,t){if(!o(e,l)){if(!s(e))return!0;if(!t)return!1;c(e)}return e[l].w},onFreeze:function(e){return u&&d.NEED&&s(e)&&!o(e,l)&&c(e),e}}},function(e,t,n){"use strict";var l=n(52),i=n(2),o=n(11),r=n(10),a=n(18),s=n(108),u=n(26),c=n(110),d=n(1)("iterator"),v=!([].keys&&"next"in[].keys()),f=function(){return this};e.exports=function(e,t,n,p,h,g,m){s(n,t,p);var b,y,_,S=function(e){if(!v&&e in U)return U[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},k=t+" Iterator",w="values"==h,C=!1,U=e.prototype,N=U[d]||U["@@iterator"]||h&&U[h],I=N||S(h),L=h?w?S("entries"):I:void 0,x="Array"==t&&U.entries||N;if(x&&(_=c(x.call(new e)))!==Object.prototype&&_.next&&(u(_,k,!0),l||"function"==typeof _[d]||r(_,d,f)),w&&N&&"values"!==N.name&&(C=!0,I=function(){return N.call(this)}),l&&!m||!v&&!C&&U[d]||r(U,d,I),a[t]=I,a[k]=f,h)if(b={values:w?I:S("values"),keys:g?I:S("keys"),entries:L},m)for(y in b)y in U||o(U,y,b[y]);else i(i.P+i.F*(v||C),t,b);return b}},function(e,t,n){var l=n(8).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||n(7)&&l(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(e){return""}}})},function(e,t,n){"use strict";var l=n(2),i=n(81)(!1),o=[].indexOf,r=!!o&&1/[1].indexOf(1,-0)<0;l(l.P+l.F*(r||!n(21)(o)),"Array",{indexOf:function(e){return r?o.apply(this,arguments)||0:i(this,e,arguments[1])}})},function(e,t,n){"use strict";var l=n(88)(!0);e.exports=function(e,t,n){return t+(n?l(e,t).length:1)}},function(e,t,n){"use strict";var l=n(53),i=RegExp.prototype.exec;e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw new TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==l(e))throw new TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)}},function(e,t,n){"use strict";var l,i,o=n(89),r=RegExp.prototype.exec,a=String.prototype.replace,s=r,u=(l=/a/,i=/b*/g,r.call(l,"a"),r.call(i,"a"),0!==l.lastIndex||0!==i.lastIndex),c=void 0!==/()??/.exec("")[1];(u||c)&&(s=function(e){var t,n,l,i,s=this;return c&&(n=new RegExp("^"+s.source+"$(?!\\s)",o.call(s))),u&&(t=s.lastIndex),l=r.call(s,e),u&&l&&(s.lastIndex=s.global?l.index+l[0].length:t),c&&l&&l.length>1&&a.call(l[0],n,function(){for(i=1;i")}),d=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var v=a(e),f=!o(function(){var t={};return t[v]=function(){return 7},7!=""[e](t)}),p=f?!o(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[u]=function(){return n}),n[v](""),!t}):void 0;if(!f||!p||"replace"===e&&!c||"split"===e&&!d){var h=/./[v],g=n(r,v,""[e],function(e,t,n,l,i){return t.exec===s?f&&!i?{done:!0,value:h.call(t,n,l)}:{done:!0,value:e.call(n,t,l)}:{done:!1}}),m=g[0],b=g[1];l(String.prototype,e,m),i(RegExp.prototype,v,2==t?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}}},function(e,t,n){"use strict";var l,i,o,r,a=n(52),s=n(3),u=n(9),c=n(53),d=n(2),v=n(4),f=n(23),p=n(56),h=n(57),g=n(75),m=n(76).set,b=n(99)(),y=n(78),_=n(100),S=n(101),k=n(102),w=s.TypeError,C=s.process,U=C&&C.versions,N=U&&U.v8||"",I=s.Promise,L="process"==c(C),x=function(){},E=i=y.f,P=!!function(){try{var e=I.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(x,x)};return(L||"function"==typeof PromiseRejectionEvent)&&e.then(x)instanceof t&&0!==N.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(e){}}(),T=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},A=function(e,t){if(!e._n){e._n=!0;var n=e._c;b(function(){for(var l=e._v,i=1==e._s,o=0,r=function(t){var n,o,r,a=i?t.ok:t.fail,s=t.resolve,u=t.reject,c=t.domain;try{a?(i||(2==e._h&&$(e),e._h=1),!0===a?n=l:(c&&c.enter(),n=a(l),c&&(c.exit(),r=!0)),n===t.promise?u(w("Promise-chain cycle")):(o=T(n))?o.call(n,s,u):s(n)):u(l)}catch(e){c&&!r&&c.exit(),u(e)}};n.length>o;)r(n[o++]);e._c=[],e._n=!1,t&&!e._h&&M(e)})}},M=function(e){m.call(s,function(){var t,n,l,i=e._v,o=O(e);if(o&&(t=_(function(){L?C.emit("unhandledRejection",i,e):(n=s.onunhandledrejection)?n({promise:e,reason:i}):(l=s.console)&&l.error&&l.error("Unhandled promise rejection",i)}),e._h=L||O(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},O=function(e){return 1!==e._h&&0===(e._a||e._c).length},$=function(e){m.call(s,function(){var t;L?C.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},j=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),A(t,!0))},D=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw w("Promise can't be resolved itself");(t=T(e))?b(function(){var l={_w:n,_d:!1};try{t.call(e,u(D,l,1),u(j,l,1))}catch(e){j.call(l,e)}}):(n._v=e,n._s=1,A(n,!1))}catch(e){j.call({_w:n,_d:!1},e)}}};P||(I=function(e){p(this,I,"Promise","_h"),f(e),l.call(this);try{e(u(D,this,1),u(j,this,1))}catch(e){j.call(this,e)}},(l=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(58)(I.prototype,{then:function(e,t){var n=E(g(this,I));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=L?C.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&A(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new l;this.promise=e,this.resolve=u(D,e,1),this.reject=u(j,e,1)},y.f=E=function(e){return e===I||e===r?new o(e):i(e)}),d(d.G+d.W+d.F*!P,{Promise:I}),n(26)(I,"Promise"),n(59)("Promise"),r=n(13).Promise,d(d.S+d.F*!P,"Promise",{reject:function(e){var t=E(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(a||!P),"Promise",{resolve:function(e){return k(a&&this===r?I:this,e)}}),d(d.S+d.F*!(P&&n(79)(function(e){I.all(e).catch(x)})),"Promise",{all:function(e){var t=this,n=E(t),l=n.resolve,i=n.reject,o=_(function(){var n=[],o=0,r=1;h(e,!1,function(e){var a=o++,s=!1;n.push(void 0),r++,t.resolve(e).then(function(e){s||(s=!0,n[a]=e,--r||l(n))},i)}),--r||l(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=E(t),l=n.reject,i=_(function(){h(e,!1,function(e){t.resolve(e).then(n.resolve,l)})});return i.e&&l(i.v),n.promise}})},function(e,t,n){var l=n(13),i=n(3),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:l.version,mode:n(52)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){e.exports=!n(7)&&!n(6)(function(){return 7!=Object.defineProperty(n(54)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var l=n(4);e.exports=function(e,t){if(!l(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!l(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!l(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!l(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var l=n(5),i=n(23),o=n(1)("species");e.exports=function(e,t){var n,r=l(e).constructor;return void 0===r||null==(n=l(r)[o])?t:i(n)}},function(e,t,n){var l,i,o,r=n(9),a=n(98),s=n(77),u=n(54),c=n(3),d=c.process,v=c.setImmediate,f=c.clearImmediate,p=c.MessageChannel,h=c.Dispatch,g=0,m={},b=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},y=function(e){b.call(e.data)};v&&f||(v=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return m[++g]=function(){a("function"==typeof e?e:Function(e),t)},l(g),g},f=function(e){delete m[e]},"process"==n(12)(d)?l=function(e){d.nextTick(r(b,e,1))}:h&&h.now?l=function(e){h.now(r(b,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=y,l=r(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(l=function(e){c.postMessage(e+"","*")},c.addEventListener("message",y,!1)):l="onreadystatechange"in u("script")?function(e){s.appendChild(u("script")).onreadystatechange=function(){s.removeChild(this),b.call(e)}}:function(e){setTimeout(r(b,e,1),0)}),e.exports={set:v,clear:f}},function(e,t,n){var l=n(3).document;e.exports=l&&l.documentElement},function(e,t,n){"use strict";var l=n(23);function i(e){var t,n;this.promise=new e(function(e,l){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=l}),this.resolve=l(t),this.reject=l(n)}e.exports.f=function(e){return new i(e)}},function(e,t,n){var l=n(1)("iterator"),i=!1;try{var o=[7][l]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],r=o[l]();r.next=function(){return{done:n=!0}},o[l]=function(){return r},e(o)}catch(e){}return n}},function(e,t,n){var l=n(14),i=n(29),o=n(81)(!1),r=n(61)("IE_PROTO");e.exports=function(e,t){var n,a=i(e),s=0,u=[];for(n in a)n!=r&&l(a,n)&&u.push(n);for(;t.length>s;)l(a,n=t[s++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var l=n(29),i=n(15),o=n(104);e.exports=function(e){return function(t,n,r){var a,s=l(t),u=i(s.length),c=o(r,u);if(e&&n!=n){for(;u>c;)if((a=s[c++])!=a)return!0}else for(;u>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return!e&&-1}}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var l=n(2),i=n(13),o=n(6);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],r={};r[e]=t(n),l(l.S+l.F*o(function(){n(1)}),"Object",r)}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){var l=n(5),i=n(109),o=n(62),r=n(61)("IE_PROTO"),a=function(){},s=function(){var e,t=n(54)("iframe"),l=o.length;for(t.style.display="none",n(77).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write(" + + diff --git a/docs/.vuepress/dist/community/ambassadorRules.html b/docs/.vuepress/dist/community/ambassadorRules.html new file mode 100644 index 00000000..e6d31e4a --- /dev/null +++ b/docs/.vuepress/dist/community/ambassadorRules.html @@ -0,0 +1,21 @@ + + + + + + Ambassadors participate in the election rules | NULS + + + + + + + +

Ambassadors participate in the election rules

1. Introduction of NULS Ambassadors

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

2. Duties and Compensation for NULS Ambassadors

a. A candidate for the NULS ambassador is required to create a NULS node.

b. A candidate is required to agree with the values of NULS, understand the core knowledge of NULS, and respect members of the NULS community.

c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.

d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.

e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.

f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.

g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.

h. NULS ambassadors can apply for a budget from the NULS Foundation for major developments. The budget is open to all community members, and a budget vote will be initiated for it. The voting period is 15 days, and if the voting volume exceeds 10 million NULS tokens, and the supporting votes reach 70% or higher, the vote is considered passed and the NULS Foundation will execute.

3. How to participate in the election

a. Publish the work report for the previous month and the work plan for the next month:

Please post on the NULS forum: https://community.nuls.world/t/elections

b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!

c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.

Final Tribute to your efforts:

• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.

• Start your work of community-building and outreach!

• Help NULS dock more DApps!

• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.

For all ambassador related discussions, please post on the NULS forum at https://community.nuls.world/t/elections

Welcome to the NULS community! Let’s work together to create a brighter future for NULS!

If you can deliver more, we have these expectations of you:

1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;

2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;

3. Share the story of NULS to the community;

4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;

6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;

7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;

8. Help NULS with publicity and be committed to NULS press releases through your local media.

Ambassador Guide

Preface

Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:

  • Transparency
  • Freedom
  • Autonomy
  • Evolution

The vision of the NULS project is based on the following mission

  • Making blockchain technology easy and simple
  • Breaking through the bottleneck of blockchain performance and adoption
  • Reducing the cost of using blockchain technology
  • Increasing security and reliability of data

NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.

As an Ambassador of NULS, you will obtain

  1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.
  2. Rewards produced by one node. Rewards are used to develop the local NULS community.
  3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.
  4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.

As an Ambassador of NULS, Your Mission is

A. Community Development

  1. Let others know about NULS via Internet or offline communications.
  2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS.
  3. Share the development from other areas of the NULS community with your local community.
  4. Continuously share the progress, planning, news, etc. of the NULS project to the local community.
  5. Contact local media and forums to help NULS publicize presentations or news.
  6. Share the story of NULS with the local community.
  7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.
  8. Share videos or other content produced by the team in the local language of the people in your country/region.
  9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.
  10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.

B. Community Activities

  1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.
  2. Participate in any possible cryptocurrency gatherings in your area and represent NULS.
  3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.
  4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.
  5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.

Get Started With Everything You Need Here

  1. NULS Ambassador Board ([Click to enter]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.
  2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.
  3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.
  4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.
  5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.
  6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.
  7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).
  8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum nuls.community.

Recruit Volunteers to Organize Local Communities

  1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.
  2. Organize some offline meet-ups.
  3. Introduce more blockchain investors to NULS and guide them towards investing in NULS.
  4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.

Develop a Local NULS Ecology

  1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.
  2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.
  3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.

Spread the Concepts and Features of NULS Technology with Local Communities

  1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.
  2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.
  3. Use local mainstream media websites to spread the news and progress of NULS.

NULStar Guidelines And Duties

  • Requirements for becoming a NULStar
  1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.
  2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.
  3. Must live in a city with over 350k population.
  • Duties of a NULStar
  1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.
  2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.
  • Rewards for NULStars
  1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.
  2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.
Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/community/communityConstitution.html b/docs/.vuepress/dist/community/communityConstitution.html new file mode 100644 index 00000000..828b959f --- /dev/null +++ b/docs/.vuepress/dist/community/communityConstitution.html @@ -0,0 +1,21 @@ + + + + + + NULS Community Constitution | NULS + + + + + + + +

NULS Community Constitution

I. NULS Community Profile

NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

II. NULS Foundation

NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.

(I) Objectives of NULS Foundation

Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:

  1. Code writing
  2. Applications development
  3. Operation and promotion
  4. Other actions in favor of NULS community ecology development

(II) Source of NULS Foundation

20,000,000 NULS from the NULS and entrusted revenues from the contributors.

(III) Management of NULS Foundation

The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.

III. Council members

(I) Introduction to Council members

As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.

(II) Appointment of Council members

The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers (developer council member) elected based on a ballot participated by all developers; and 7 members elected by ballot within the community (standing council member). The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.

  1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.
  2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.
  3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.
  4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.

(III) Rights and responsibilities of Council member

  1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:

    (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.

  • Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.

    (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.

  • Adjustment of lower node agency commission.

  • Adjustment of transfer commission.

  • Adjustment of contract call commission.

  • Adjustment of Council member proposal commission.

  • Adjustment of adjustable system parameter in other systems.

    (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.

  • Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.

  • Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.

  • Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.

  1. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.
  2. Responsibilities of Council member.
  • Council member shall communicate with the community in good time.

  • Act in strict accordance with the community’s Constitution.

  • Share the same vision and purpose with NULS.

  • Take it as its own mission to protect community members’ interests.

Note: All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.

IV. CODE CRAFT COUNCIL (CCC)

(I) Introduction to the CCC

The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.

(II) Philosophy of the CCC

We stick to the following philosophy in the technology community:

  1. Equal: the technology community and core team are equal and work together for joint development.

  2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.

  3. Sharing:

  • The whole community shares the achievements of NULS technology.

  • The whole community shares the development dividend of NULS.

  • The whole community shares NULS’s influence and reputation.

  • The industry shares the technical innovation brought by NULS.

  • The industry shares NULS’s standard establishment to promote industry development.

  1. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.

  2. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.

(III) Appointment of the CCC member

The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).

The process of joining CCC is:

  1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.
  2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.
  3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.
  4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.

(IV) Rights and responsibilities of the CCC member

  1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.

  2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.

  3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.

  4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.

  5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.

V. Contributor

(I) Contributor for campaign

Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at nuls.community.

(II) Permanent contributor

Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.

VI. Project Budget

(I) With respect to contributor

Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.

(II) With respect to other transaction funds

The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.

VII. Other votes

(I) Start a vote

  1. The Council member shall start a vote and only the transaction fee is required.

  2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.

(II) Vote by proxy

  • Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.

  • Any NULS user can be an agent.

  • Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.

  • The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).

VIII. Feedback

We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:

NULS community website: https://nuls.community

Feedback post: https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/community/communityFund.html b/docs/.vuepress/dist/community/communityFund.html new file mode 100644 index 00000000..15e32361 --- /dev/null +++ b/docs/.vuepress/dist/community/communityFund.html @@ -0,0 +1,21 @@ + + + + + + Community Fund Management and Use of Process | NULS + + + + + + + +

Community Fund Management and Use of Process

img

I. Community Fund Management

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Community Fund Account Address:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.

The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.

Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.

**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **

II. The Application Member

1. Ordinary Members

All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.

2. Contributor Role

Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process. The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.

III. The Type of Application

1. Proposal to Pay Funds

The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.

2. Proposal Budget Item

The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.

3. The Proposal to Create a Node

Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.

4. Proposal Entrusted Funds

Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.

IV. The Application Process

1. The Plan is Openly and Thoroughly Discussed

(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;

(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;

(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;

(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;

(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;

(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;

(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;

(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;

2. Council Member Proposal

(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;

(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;

(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;

(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.

3. Foundation Implementation Proposal

(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;

(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).

V. Process Explanation

All community discussion suggestions are made at nuls.community .

This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.

Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.

The specific node generates revenue with reference to the NULS POC consensus mechanism.

Attachment: Current Contributor Role Delegation and Node:

Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC Members

Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck’s staking – Same as above

Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe’s staking – Same as above

Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/community/joinCCC.html b/docs/.vuepress/dist/community/joinCCC.html new file mode 100644 index 00000000..34f592e6 --- /dev/null +++ b/docs/.vuepress/dist/community/joinCCC.html @@ -0,0 +1,30 @@ + + + + + + Invitation of community developers | NULS + + + + + + + +

Invitation of community developers

1. Introduction

NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology.

NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration.

In the community, we adhere to the following vision:

  • Equal: Members from both the technical community and the core dev team are equal and they shall work together.
  • Synergetic: The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem.
  • Sharing: +
    • Technical achievements of NULS are shared with the community;
    • Development bonuses of NULS are shared with the community;
    • The influence and brand of NULS are shared with the community;
    • Technical innovation of NULS is shared with the whole industry;
  • All the industrial standards set by NULS are shared with the whole industry.
  • Fair: Reward for each developer is based on his/her contribution.
  • Innovative: A strong technical community is the guarantee for the innovation in the blockchain field.

2. Are you the one?

NULS technical community is open for all developers. +If you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us:

Please join the NULS dev Telegram group: +https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ

Notice: We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground!

3. What are we offering?

The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution. +Currently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool. +Note: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well.

4. Our plan

Make it easy to build a blockchain!

First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life. +The NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository.

Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months. +For all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives.

Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more!

5. Current situation of the technical community

A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently. +B. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests.

6. How to join us

  1. For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group.
  2. Talk to our community developer Moshe. Briefly introduce your experience, background, etc. +Community developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future.

We also strongly recommend you to learn more about NULS through these links below:

  1. You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool:

https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh

  1. In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward.

7. Refer to task list

https://nuls.community/d/9-invitation-of-community-developers/4 (Continuously updated)

Last Updated: 1/15/2019, 2:00:51 PM
+ + + diff --git a/docs/.vuepress/dist/community/toolsGuide.html b/docs/.vuepress/dist/community/toolsGuide.html new file mode 100644 index 00000000..6485af6e --- /dev/null +++ b/docs/.vuepress/dist/community/toolsGuide.html @@ -0,0 +1,21 @@ + + + + + + Guide to Community Vote | NULS + + + + + + + +

Guide to Community Vote

1 Voting

If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list.

1542526165310

Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded.

1542526178695

If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote.

The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B.

The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N.

Each option in the voting details page is clickable to show the current or final distribution of votes.

2 Changing and Updating Your Vote

As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission.

1542526190286

There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type.

1542526202833

3 Checking My Votes

In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow.

1542526213174

If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules.

4 Creating A Community Vote

In the voting list, click “Create Voting" to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee.

In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked.

1542526223816

When creating a community vote, please fill in the item contents carefully. Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed.

Last Updated: 1/11/2019, 1:47:19 PM
+ + + diff --git a/docs/.vuepress/dist/developerTools/APIManual.html b/docs/.vuepress/dist/developerTools/APIManual.html new file mode 100644 index 00000000..6a5216e6 --- /dev/null +++ b/docs/.vuepress/dist/developerTools/APIManual.html @@ -0,0 +1,21 @@ + + + + + + API手册 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/developerTools/clientCLI.html b/docs/.vuepress/dist/developerTools/clientCLI.html new file mode 100644 index 00000000..9c2082fc --- /dev/null +++ b/docs/.vuepress/dist/developerTools/clientCLI.html @@ -0,0 +1,706 @@ + + + + + + CLI User Manual | NULS + + + + + + + +

CLI User Manual

Introduction

​ The User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server.

Version Update Records

Version Date updated Contents
V1.0.0 2018-07-12 All functions of official version

Preparation

Server hardware

Server for creating NULS nodes shall be with configurations not lower than the following

CPU Memory Hard Disk Broadband
Quad-core 3.0GHz 16G 128G Hard Disk 20M Uplink

Recommendation

CPU Memory Hard Disk Broadband
8-core 3.0GHz 32G 256G Hard Disk 100M Uplink

Version of system and core

Linux system

  • CentOS (recommended)

It is recommended to use core of version 2.6.32 or higher.

Start

Download

  • NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet

  • GitHub:https://github.com/nuls-io/nuls-wallet-release

  • Enter wallet download on NULS website,and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users.

    The following is for downloading wallet (v1.0.0) in Linux system:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    Note: the downloading link for the subsequent versions is subject to change.

Install

  • Extract downloaded files in Linux system

    $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz
    +

Operate

  • Enter bin catalogue and run startup script to start full-node wallet

    $ cd bin
    +$ ./start.sh
    +

Use wallet

Quick-start

  • Upon confirming the wallet is started, start the command line of wallet to run it.

    Enter bin catalogue to execute the following commands:

    $ ./cmd.sh
    +

    Display NULS naming prompt nuls>>>, and then directly input NULS wallet operation command to run it.

    The following gives an example of account creating:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    Command create is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully.

Conventions

  • For password: it must be 8 to 20 digits, including letters and figures.
  • Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required.

Wallet command

Help command

All commands for output and printing

  • **Command: help [-a] **
Parameter Description
-a Formatting printing command, optional

Return message help

getaccount <address> --get account information
+

Return message help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

Example

nuls>>> help
+nuls>>> help -a
+

Create account

Create account and return to account addresses collection

  • **Command: create [number] **
Parameter Description
[number] Quantity of accounts created, optional

Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter;

Return accounts collection

[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

Example, to create 2 accounts without password

nuls>>> create 2
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:
+[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

Backup account

For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account

  • Command: backup <address> [path]
Parameter Description
<address> Account address, required
[path] The target folder of backup files, defaults to be the current folder, optional

Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe.

Return message

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Example: backup of an account with password

nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

Remove account

Remove local account according to account address; if the account is encrypted, insert password.

  • **Command: remove <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+Success
+

Set account password

Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts.

  • **Command: setpwd <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

Change account password

Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one.

  • **Command: resetpwd <address> **
Parameter Description
<address> Account address, required

Return message

Success
+

Example

nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Enter your old password:**********
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

Set nickname

Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source.

  • Command:setalias <address> <alias>
Parameter Description
<address> Account address, required
<alias> Nickname, required

Return message, transaction hash

"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Example

nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias
+"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

Imported account keystore

Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account.

  • **Command: import keystore <path> **
Parameter Description
<path> Address of keystore files to be imported, required

Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required.

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Imported account’s private key

Import account’s private key and create a local account. Receive failure to import if there is an existing local account.

  • **Command:import <privatekey> **
Parameter Description
<privatekey> Account’s private key, required

注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Imported account’s private key (overwritten)

Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account.

  • **Command:import <privatekey> **
Parameter Description
<privatekey> Account’s private key, required

Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password.

Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import).

Return message, imported account address

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Example

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

Inquire account information

Inquire account information based on account address

  • Command:getaccount <address>
Parameter Description
<address> Account address, required

Return message

{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address
+  "alias" : null,//Nickname
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//Public key
+  "priKey" : "",//Private key (unavailable if the account is encrypted)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//Private key after encryption (unavailable if the account is encrypted)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//Creation time
+  "encrypted" : true//Encrypted or not (set password or not)
+}
+

Example

nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}
+

Inquire list of accounts

Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time

  • Command:getaccounts <pageNumber> <pageSize>
Parameter Description
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message, output accounts collection

[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address
+  "alias" : null,//Nickname
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",// Public key
+  "priKey" : "",//Private key (unavailable if the account is encrypted)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",// Private key after encryption (unavailable if the account is encrypted)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//Creation time
+  "encrypted" : true//Encrypted or not (set password or not)
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

Example: to get list of accounts, showing page 1, 2 items per page

nuls>>> getaccounts 1 2
+[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

Inquire account’s private key

Inquire account’s private key based on account address; if the account is encrypted, insert password.

  • **Command:getprikey <address> **
Parameter Description
<address> Account address, required

Return message, imported account address

"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

Example

nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

Inquire account balance

Inquire account balance based on account address

  • **Command:getbalance <address> **
Parameter Description
<address> Account address, required

Return message, imported account address

{
+  "balance" : "9999998.99",//Balance
+  "locked" : "0",//Locked balance
+  "usable" : "9999998.99"//Available balance
+}
+

Example

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "balance" : "9999998.99",
+  "locked" : "0",
+  "usable" : "9999998.99"
+}
+

Transfer

Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly.

  • **Command: transfer <address> <toAddress> <amount> [remark] **
Parameter Description
<address> transferring address, required
<toAddress> receiving address, required
<amount> transferred amount, round to 8 decimals in total (in NULS), required
[remark] Remarks, required

Return message, transfer transaction hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Example

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

Inquire transaction details

Inquire transaction details as per transaction hash

  • Command:gettx <hash>
Parameter Description
<hash> Transaction hash, required

Return message, transaction details

{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash
+  "type" : "transfer",//Transaction type (transfer transaction as an example)
+  "time" : "2018-07-16 11:21:46",//Transaction time
+  "blockHeight" : 26269,//Block height of package transaction
+  "fee" : "0.001",//Transaction service charge
+  "value" : "100",//(Transfer) transaction amount
+  "remark" : "Transfer",//remarks
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//Signature
+  "status" : "confirm",//Status of transaction confirmation (confirmed or unconfirmed)
+  "confirmCount" : 46,//Times of confirmation
+  "size" : 254,//Size of transaction
+  "inputs" : [ {//Input of transaction
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {//Output of transaction
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"// Target address of transaction output (means to transfer 100 to the target address)
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//Target address of transaction output (means to give users changes)
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

Example, to inquire transfer transaction

nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596
+{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "type" : "transfer",
+  "time" : "2018-07-16 11:21:46",
+  "blockHeight" : 26269,
+  "fee" : "0.001",
+  "value" : "100",
+  "remark" : "Transfer",
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",
+  "status" : "confirm",
+  "confirmCount" : 46,
+  "size" : 254,
+  "inputs" : [ {
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

Inquire list of transactions

Inquire list of transactions in this account based on account address

  • Command:gettxlist <address> <pageNumber> <pageSize>
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message, transaction details

[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//Transaction hash
+  "blockHeight" : 26473,//Block height of transaction
+  "time" : "2018-07-16 11:55:43",//Transaction time
+  "txType" : "transfer",//Transaction type
+  "status" : 1,//Status of confirmation
+  "info" : "+100"//Message
+},{
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

Example

nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10
+[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",
+  "blockHeight" : 26473,
+  "time" : "2018-07-16 11:55:43",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+}, {
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

Create node

Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least.

  • **Command:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> **
Parameter Description
<agentAddress> Account address of nodes created, required
<packingAddress> Node account package address, required (note: the account shall have no password, otherwise the node cannot package)
<commissionRate> Agent commission proportion, with a range of 10~100, required
<deposit> Node creating deposit of 2 at least, required

Return message, agent hash of return node

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

Include consensus (agency node)

Include consensus of 2000NULS at least based on account address and node agent hash

  • **Command:deposit <address> <agentHash> <deposit> **
Parameter Description
<address> Account address, required
<agentHash> Node agent hash, required
<deposit> Include consensus deposit, not less than 2000NULS, required

Return message, transaction hash for including consensus; to exit the consensus, require such hash.

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Example

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

Exit the consensus (agency)

Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent.

  • **Command: withdraw <address> <txHash> **
Parameter Description
<address> Account address, required
<txHash> Transaction hash upon agency, required

Return message, transaction hash upon exiting the consensus

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Example

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

Stop node

Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours.

  • **Command:stopagent <address> **
Parameter Description
<address> Account address, required

Return message, transaction hash of stop node

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Example

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

Get node details

Get node details as per agent hash of node

  • **Command: getagent <agentHash> **
Parameter Description
<agentHash> Node agent hash, required

Return message

{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 60.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "35024DE6",//Node ID
+  "time" : "2018-07-16 16:33:38",//Time for creating node
+  "blockHeight" : 28141,// Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",// Status
+  "creditVal" : 0.05,//Credit value
+  "totalDeposit" : "208000",//Current total agency amount of node
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//Quantity of participants
+}
+

Example

nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6
+{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.05,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}
+

Get list of nodes

As per list of consensus nodes

  • **Command:getagents <pageNumber> <pageSize> **
Parameter Description
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message

[{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 60.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "35024DE6",//Node ID
+  "time" : "2018-07-16 16:33:38",//Time for creating node
+  "blockHeight" : 28141,//Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Status
+  "creditVal" : 0.05,//Credit value
+  "totalDeposit" : "208000",//Current total agent amount of node
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//Quantity of participants
+}]
+

Example

nuls>>> getagents 1 2
+[ {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.18,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}, {
+  "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",
+  "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "deposit" : "20000",
+  "commissionRate" : 10.0,
+  "agentName" : null,
+  "agentId" : "5CE291D8",
+  "time" : "2018-07-16 16:31:12",
+  "blockHeight" : 28126,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.16,
+  "totalDeposit" : "208000",
+  "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "memberCount" : 5
+} ]
+

Get total information of network consensuses

Inquire total information of network consensuses

  • **Command:getconsensus **

Return message

{
+  "agentCount" : 6,//Quantity of nodes
+  "totalDeposit" : "1758000",//Total quantity of agents
+  "rewardOfDay" : "0",//Bonus
+  "consensusAccountNumber" : 6,//Quantity of consensus accounts
+  "packingAgentCount" : 6//Quantity of package addresses
+}
+

Example

nuls>>> getconsensus
+{
+  "agentCount" : 6,
+  "totalDeposit" : "1758000",
+  "rewardOfDay" : "0",
+  "consensusAccountNumber" : 6,
+  "packingAgentCount" : 6
+}
+

Get general of agents in single account

Get the general of all agents (consensuses) information of the account based on account address

  • **Command:getdepositedinfo <address> **
Parameter Description
<address> Account address, required

Return message

{
+  "agentCount" : 1,//Quantity of nodes created
+  "totalDeposit" : "1600000",// Quantity of total agents
+  "joinAgentCount" : 6,//Quantity of nodes in agency
+  "usableBalance" : "8048998.869",//Available balance
+  "reward" : "219.65910271",//Total bonuses gained
+  "rewardOfDay" : "219.65910271",//Bonuses gained a day
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//Node hash
+}
+

Example

nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "agentCount" : 1,
+  "totalDeposit" : "1600000",
+  "joinAgentCount" : 6,
+  "usableBalance" : "8048998.869",
+  "reward" : "219.65910271",
+  "rewardOfDay" : "219.65910271",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"
+}
+

Get list of agent information of single account

Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash.

  • **Command:getdepositeds <address> <pageNumber> <pageSize> [agentHash] **
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required
[agentHash] Node hash, optional

Return message

[{
+  "deposit" : "2000",//Agency amount
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Address of agent
+  "time" : "2018-07-16 16:38:25",//Time
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//Agency transaction hash
+  "blockHeight" : 28148,//Block height of transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Node status
+  "agentName" : "35024DE6",//Node name
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//Node address
+}]
+

Example

nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "deposit" : "2000",
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:25",
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",
+  "blockHeight" : 28148,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "35024DE6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"
+}, {
+  "deposit" : "2000",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:43",
+  "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",
+  "blockHeight" : 28149,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "E09EB7FD",
+  "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"
+} ]
+

Get list of agency nodes of single account

Inquire list of agency nodes asper address (return list of node information)

  • **Command:getdepositedagents <address> <pageNumber> <pageSize> **
Parameter Description
<address> Account address, required
<pageNumber> Page, to get the data on which page, required
<pageSize> Number of data displayed on each page, required

Return message

[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//Node hash
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Account address for creating node
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//Node package (block) address
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Bonus address (default to be address for creating node)
+  "deposit" : "20000",//Deposit for creating node
+  "commissionRate" : 40.0,//Agent commission proportion
+  "agentName" : null,//Node name (source)
+  "agentId" : "0198ACAF",// Node ID
+  "time" : "2018-07-16 16:32:52",//Time for creating node
+  "blockHeight" : 28136,//Block height of node creating transaction
+  "delHeight" : -1,
+  "status" : "consensus",//Status
+  "creditVal" : -0.91,//Credit value
+  "totalDeposit" : "204000",//Current total agent amount of node
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3// Quantity of participants
+}]
+

Example, to get page 1, display 2 items per page

nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "deposit" : "20000",
+  "commissionRate" : 40.0,
+  "agentName" : null,
+  "agentId" : "0198ACAF",
+  "time" : "2018-07-16 16:32:52",
+  "blockHeight" : 28136,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.91,
+  "totalDeposit" : "204000",
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3
+}, {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.91,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+} ]
+

Get the latest block head information

Get the latest block head information

  • Command:getbestblockheader

Return message

{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//Block hash
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//Former block hash
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//Merkle hash
+  "time" : "2018-07-17 10:25:40",//Block generation time
+  "height" : 33950,//Block height
+  "txCount" : 1,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 668413,//Rounds of consensuses 
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-17 10:25:30",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0",//Consensus bonus 
+  "fee" : "0",//Package service charge of block
+  "confirmCount" : 0,//Times of confirmation
+  "size" : 204,//Size of block
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"// Signature
+}
+

Example

nuls>>> getbestblockheader
+{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",
+  "time" : "2018-07-17 10:25:40",
+  "height" : 33950,
+  "txCount" : 1,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 668413,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-17 10:25:30",
+  "packingIndexOfRound" : 1,
+  "reward" : "0",
+  "fee" : "0",
+  "confirmCount" : 0,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"
+}
+

Inquire block information

Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.

  • **Command:getblock <hash> | <height> **
Parameter Description
<hash> Block hash
<height> Height of block

Return message

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash
+  "time" : "2018-07-16 16:29:30",//Block generation time
+  "height" : 28115,//Block height
+  "txCount" : 2,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 662578,//Rounds of consensuses 
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0.001",//Consensus bonus 
+  "fee" : "0.001",//Package service charge of block
+  "confirmCount" : 6174,//Times of confirmation
+  "size" : 507,//Size of block
+  "txList" : [ {//Transaction collection
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//Transaction hash
+    "type" : "coinbase",//Transaction type
+    "time" : "2018-07-16 16:29:30",//Transaction time
+    "blockHeight" : 28115,//Block height of transaction
+    "fee" : "0",//Transaction service charge
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],//Transaction input
+    "outputs" : [ //Transaction output
+        {
+          "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+          "value" : 100000,
+          "lockTime" : 29115
+        }
+    ]
+  }],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature
+}
+

Example: to get block as per height

nuls>>> getblock 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6174,
+  "size" : 507,
+  "txList" : [ {
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",
+    "type" : "coinbase",
+    "time" : "2018-07-16 16:29:30",
+    "blockHeight" : 28115,
+    "fee" : "0",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],
+    "outputs" : [ {
+      "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+      "value" : 100000,
+      "lockTime" : 29115
+    } ]
+  }, {
+    "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",
+    "type" : "transfer",
+    "time" : "2018-07-16 16:29:27",
+    "blockHeight" : 28115,
+    "fee" : "0.001",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 249,
+    "inputs" : [ {
+      "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",
+      "fromIndex" : 1,
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 972899896100000
+    } ],
+    "outputs" : [ {
+      "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",
+      "value" : 3000000000000,
+      "lockTime" : 0
+    }, {
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 969899896000000,
+      "lockTime" : 0
+    } ]
+  } ],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

Inquire block head information

Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition.

  • **Command:getblockheader <hash> | <height> **
Parameter Description
<hash> Block hash
<height> Block height

Return message

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash
+  "time" : "2018-07-16 16:29:30",//Block generation time
+  "height" : 28115,//Block height
+  "txCount" : 2,//Quantity of block package transactions
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address
+  "roundIndex" : 662578,//Rounds of consensuses
+  "consensusMemberCount" : 1,//Quantity of participants in consensus
+  "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round
+  "packingIndexOfRound" : 1,//Rank of package and block in current round
+  "reward" : "0.001",//Consensus bonus 
+  "fee" : "0.001",//Package service charge of block
+  "confirmCount" : 6174,//Times of confirmation
+  "size" : 507,//Size of block
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature
+}
+

Example: to get block as per height

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

Inquire network information

Inquire network basic information

  • **Command:getnetinfo **

Return message

{
+  "localBestHeight" : 35317,//Height of local latest block
+  "netBestHeight" : 35317,//Height of latest block online
+  "timeOffset" : "0ms",//Offset of network time
+  "inCount" : 0,//Quantity of passive connecting nodes
+  "outCount" : 1//Quantity of active connecting nodes
+}
+

Example

nuls>>> getnetinfo
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

Inquire network node IP

Inquire network node IP

  • **Command: getnetnodes **

Return message

[ "192.168.1.223" ]
+

Example: get block as per height

nuls>>> getnetnodes
+[ "192.168.1.223" ]
+

Inquire current version information

Inquire current version number

  • **Command:version **

Return message

[ "192.168.1.223" ]
+

Example

nuls>>> version
+{
+  "myVersion" : "1.0.0",
+  "newestVersion" : "0.9.11",
+  "upgradable" : false,
+  "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing"
+}
+

Version update

Inquire current version number

  • **Command:upgrade <version> **

Example

nuls>>> version 1.0.0
+

Exit wallet command program

Exiting from wallet command line program does not mean exiting from wallet node started.

  • Command:exit

Example

nuls>>> exit
+
Last Updated: 1/14/2019, 6:17:19 PM
+ + + diff --git a/docs/.vuepress/dist/developerTools/sdk.html b/docs/.vuepress/dist/developerTools/sdk.html new file mode 100644 index 00000000..3bb0317e --- /dev/null +++ b/docs/.vuepress/dist/developerTools/sdk.html @@ -0,0 +1,993 @@ + + + + + + SDK | NULS + + + + + + + +

SDK

Introduction

This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service.

Convention

  • All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article)
  • The return object described in each interface refers to the content of the data attribute in the Result
  • Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na
  • Before running the SDK, you need to confirm that the NULS service is started and running normally
  • JDK1.8+ is recommended

Releases History

Version Release Date Release Notes
v0.9.11.0 2018-06-19 Provide interfaces for docking basic functions of the NULS service
v0.9.11.1 2018-06-22 Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1
v0.9.14 2018-07-04 Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.)
v0.9.15 2018-07-07 Add four consensus interfaces (4.1-4.4)
v0.9.16 2018-07-11 Add interface 4.5
v1.0.1 2018-07-13 Add error code
v1.1.0 2018-09-28 Add multi-account transfer interface

Quick Start

1. Importing files

Import jar files by using build tool

  • Use maven
<dependency>
+   <groupId>io.nuls.sdk</groupId>
+   <artifactId>sdk-all</artifactId>
+   <version>1.0.1</version>
+</dependency>
+

2. Creating SDK instance

First introduce SDK namespace

// introduce the namespace of the SDK boot class 
+import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+// introduce the namespace of the SDK calls tool   
+import io.nuls.sdk.tool.NulsSDKTool;
+

After importing, create a client instance using the following code

  • Initiate SDK
  • If no parameters are passed in initialization method, the default PRC IP and Port respectively are 127.0.0.1, 8001
//By default 
+SDKBootstrap.init();
+// Pass in the NULS service’s IP and Port
+SDKBootstrap.init("192.168.1.88", "8001");
+
  • Call interface methods using the tool class
Result result = NulsSDKTool.createAccount("nuls123456");
+

e.g a complete example of creating an account with password

import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+// introduce the namespace for corresponding modules as required 
+import io.nuls.sdk.tool.NulsSDKTool;
+
+public static void main(String[] args) {
+	SDKBootstrap.init();
+	Result result = NulsSDKTool.createAccount("nuls123456");
+}
+

--

Accounts AccountService

1.1 Creating account

Interface

Result createAccount(int count, String password);

Instructions

Creates one or more accounts with or without a password depending on the parameters passed in. +The information about the successfully created account will be persisted to the NULS service local database.

Returns a set of successfully created account addresses +
parameter type required or not note
count int optional account count to be created (default 1)
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data":{
+	    "list": [ // Return a set of the created account addresses
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv",
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"
+	    ]
+    }
+}
+

e.g Sample Code

//create an account without password
+createAccount();
+//create an account with password
+createAccount("nuls123456");
+// create three password-less accounts 
+createAccount(3);
+// create three accounts with passwords 
+createAccount(3, "nuls123456");
+

1.2 Creating offline account

Interface

Result createOfflineAccount(int count, String password)

Instructions

Directly create an offline account and return it completely, without underlying interaction with NULS and persistence +Creates an encrypted off-line account (Not saved to the database)

Result.data List<AccountInfo>

parameter type required or not note
count int optional account count to be created (default 1)
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+		"list":[
+			{
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+			},
+			{
+				"address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD",
+				"alias": null,
+				"pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb",
+				"extend": null,
+				"createTime": 1529314943624,
+				"encrypted": true,
+				"priKey": "",
+				"encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"
+			}
+		]
+	}
+}
+

e.g Sample Code

// create an offline account without password
+createOfflineAccount();
+// create an offline account with password
+createOfflineAccount("nuls123456");
+// create three password-less offline accounts
+createOfflineAccount(3);
+// create three offline accounts with passwords
+createOfflineAccount(3, "nuls123456");
+

1.3 Getting account

Interface

Result getAccount(String address)

Instructions

Gets information about the account by account address

Result.data AccountInfo

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if when a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+	}
+}
+

e.g Sample Code

getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.4 Getting the fee for setting alias

Interface

Result getAliasFee(String address, String alias)

Instructions

Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)> +Result.data double, unit is NULS

Note! The unit of the fee returned by this interface is NULS

parameter type required or not note
address String required account address
alias String required alias name to be set

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data":{
+		"value": 0.01 //( unit: NULS)
+	} 
+}
+

e.g Sample Code

getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666");
+

1.5 Getting account list

Interface

Result getAccountList(int pageNumber, int pageSize)

Instructions

Gets a list of accounts based on the paging parameters

Result.data Page List<AccountInfo>

parameter type required or not note
pageNumber int required page number, must be greater than 0
pageSize int required record size displayed per page, ranging from 1 to 100

Return

  • Return Result object in the following format:
{
+	"success": true,
+	"data": {
+		"pageNumber": 1,
+    	"pageSize": 10,
+    	"total": 100,
+     	"pages": 10,
+		"list": [
+			{
+				
+				"address": String, account address
+				"alias": String, account alias
+				"pubKey": String, public key
+				"extend": String, extension
+				"createTime": Long, create time
+				"encrypted": boolean, encrypted or not
+				"priKey": String, private key(not null only if a password-less offline account is created)
+				"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)			},
+			{
+				"address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP",
+				"alias": null,
+				"pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184",
+				"extend": null,
+				"createTime": 1529311250627,
+				"encrypted": true,
+				"priKey": null,
+				"encryptedPriKey": null
+			}
+			...
+			
+		]
+	}
+}
+

e.g Sample Code

getAccountList(1, 10);
+

1.6 Getting account address by account alias

Interface

Result getAddressByAlias(String alias)

Instructions

Gets the account address by the account alias

Result.data String

parameter type required or not note
alias String required account alias

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g Sample Code

 getAddressByAlias("factory666");
+

1.7 Getting account private key

Interface

Result getPrikey(String address, String password)

Instructions

Gets the private key of the account by account address and password, and returns the private key string

Result.data String

parameter type required or not note
address String required account address
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+		"value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"
+    }
+}
+

e.g Sample Code

// the way of calling the account with password
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+//the way of calling the password-less account
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.8 Verifying the availability of alias

Interface

Result isAliasUsable(String alias)

Instructions

Verifies that the alias is available (if it is not used) by alias name

Result

parameter type required or not note
address String required alias name

Return

  • Return Result object in the following format:
{	// indicate the alias is available
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return the case where the alias is unavailable
{	// indicate the alias is not available
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • Return error cases, such as a parameter error
{	// indicate an error 
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

isAliasUsable("factory666");
+

1.9 Account Backup

Interface

Result backupAccount(String address, String path, String password)

Instructions

Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing.

Result: the generated file address

parameter type required or not note
address String required account address
path String required the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service.
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+	    "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"
+    }
+}
+

e.g Sample Code

// Backup an password-less account to the current directory
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null);
+// Backup an account with password to the /backup directory
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456");
+

1.10 Importing account

Interface

Result importAccountByKeystore

Instrucions

Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified.

Result

parameter type required or not note
path/fileReader String/FileReader required the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file
password String optional the password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported
overwrite boolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g Sample Code

//import an account with password
+importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true);
+importAccountByKeystore(fileReader, "nuls123456", true);
+//import a password-less account
+importAccountByKeystore("/backup/XXXXXX.keystore", false);
+importAccountByKeystore(fileReader, false);
+

1.11 Importing account (private key)

Interface

Result importAccountByPriKey(String privateKey, String password, boolean overwrite)

Instructions

Imports an account by private key

Result

parameter type required or not note
privateKey String required private key of the account
password String optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
overwrite boolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"
+    }
+}
+

e.g Sample Code

// set a password when importing account
+importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true);
+// no password is set when importing account
+importAccountByPriKey("1f9d3ad044e0e120......", true);
+

1.12 Verifying account is encrypted

Interface

Result isEncrypted(String address)

Instructions

Verifies the account is encrypted

Result

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{	// indicate encrypted
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return unencrypted
{
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • Return error cases, such as a parameter error
{	//indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.13 Removing account

Interface

Result removeAccount(String address, String password)

Instructions

Removes an account

Result

parameter type required or not note
address String required account address
password String optional account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.13 Setting password

Interface

Result setPassword(String address, String password)

Instructions

Sets a password for an unencrypted account. Encrypted account cannot call this interface.

Result

parameter type required or not note
address String required account address
password String required set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.14 Modifying password

Interface

Result resetPassword(String address, String password, String newPassword)

Instructions

Modifys the password for an encrypted account. Unencrypted account cannot call this interface.

Result

parameter type required or not note
address String required account address
password String required the current password of the account
newPassword String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.

Return

  • Return Result object in the following format:
{	//indicate a success
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • Return failure and error cases, such as a parameter error
{	// indicate an error
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g Sample Code

resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111");
+

1.15 Setting alias

Interface

Result setAlias(String address, String alias, String password)

Instructions

Sets alias name for an account

Result: the hash of the transaction for setting the alias +
parameter type required or not note
address String required account address
alias String required alias name to be set
password String password account password, leave it blank if the account is not encrypted

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data":{		
+		"value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"
+	}
+}
+
  • Example for error
{
+    "success": false,
+     "data"{
+        "code": "ACT007",
+        "msg": "The account already set an alias"
+     }
+}
+

e.g Sample code

setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111");
+setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666");
+

1.16 Setting offline-account password

Interface

Result setPasswordOffline(String address, String priKey, String password)

Instructions

Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service

Result: the encrypted private key(encryptedPriKey)

parameter type required or not note
address String required account address
priKey String required account’s private key
password String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g Sample Code

setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456");
+

1.17 Modifying offline-account password

Interface

Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)

Instructions

Modifies the password of the offline account independently in SDK, without interaction with NULS service

Result: the encrypted private key generated by the new password (encryptedPriKey)

parameter type required or not note
address String required account address
encryptedPriKey String required encrypted private key
password String required original password
newPassword String required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g Sample Code

resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456");
+

Transactions AccountLedgerService

2.1 Creating transfer transaction

Interface

Result createTransaction(List<Input> inputs, List<Output> outputs, String remark)

Instructions

Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. The calculation of the fee will be explained in detail later

Result.data String: serialized transaction string in hexadecimal +
parameter type required or not note
inputs List<Input> required usable output referred by the transaction
outputs List<Output> required usable output newly generated by the transaction
remark String optional transaction remarks

e.g Sample Code

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+
+// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+// the outputs for assembly transaction, the attribute of the output in the example is mandatory.
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createTransaction(inputs, outputs, remark);
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:100000 NA/1KB

Calculation of transaction size:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

2.2 Transaction Signatures

Interface

Result signTransaction(String txHex, String priKey, String address, String password)

Instructions

Signs the transaction by private key

Result.data String: the signed transaction, serialized string in hexadecimal

parameter type required or not note
txHex String required serialized transaction data in hexadecimal
priKey String required private key of the transaction
address String required the address corresponding to the private key, used to verify the validity of the private key.
password String optional the password of the private key, leave it blank if the private key is not encrypted

e.g Sample Code

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8";
+String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM";
+String password = "NULS6352s!f";
+Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password);
+

2.3 Querying transaction details by transaction hash

Interface

Result getTxByHash(String hash)

Instructions

Queries transaction details by transaction hash

Result.data: Transaction

parameter type required or not note
hash String required transaction hash

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+        "type": 2,
+        "time": 1529323198461,
+        "blockHeight": 1884,
+        "fee": 100000,
+        "value": 99900000000,
+        "remark": "transfer",
+        "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+        "status": 1,
+        "confirmCount": 14,
+        "size": 255,
+        "inputs": [
+            {
+                "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                "fromIndex": 0,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9999899000000
+            }
+        ],
+        "outputs": [
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 0,
+                "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                "value": 99900000000,
+                "lockTime": 0,
+                "status": 0
+            },
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 1,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9899998900000,
+                "lockTime": 0,
+                "status": 0
+            }
+        ]
+    }
+}
+

e.g Sample Code

getTxByHash("041f3d2ceed........");
+

2.4 Transfers

Interface

Result transfer(String address, String toAddress, String password, long amount, String remark)

Instructions

Initiates a transfer transaction

Result: the transaction hash

parameter type required or not note
address String required address of the transferor account
toAddress String required address of the transferee account
password String optional password of the transferor account, leave it blank if the account is not encrypted.
amount long required transfer amount (unit: Na)
remark String required remarks

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"
+    }
+}
+

e.g Sample Code

	//account with password
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "remarks 1NULS=10000000Na");
+//account without password
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, " remarks 1NULS=10000000Na");
+

2.5 Querying account balance

Interface

Result getBalance(String address)

Instructions

Gets the account balance

Result.data BalanceInfo

parameter type required or not note
address String required account address

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "balance": 1009899998900000,
+        "usable": 1009899998900000,
+        "locked": 0
+    }
+}
+

e.g Sample Code

getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS");
+

2.6 Broadcasting transaction

Interface

Result broadcastTransaction(String txHex);

Instruction

Broadcasts a transaction

Result.data String: transaction hash

parameter type required or not note
txHex String required serialized transaction data in hexadecimal

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+    	"value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"
+    }
+}
+
+

e.g Sample Code

String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24";
+Result result = service.broadcastTransaction(txHex);
+if(result.isSuccess()) {
+   String txHash = (String)result.getData();
+}
+

2.7 Creating multi-address transfer transaction

Interface

Result createMultipleInputAddressTransaction(List<Input> inputs, List<Output> outputs, String remark)

Instructions

Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. The calculation of the fee will be explained in detail later

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
inputs List<Input> required usable output referred by the transaction
outputs List<Output> required usable output newly generated by the transaction
nInputAccount int required input account number
remark String optional transaction remarks

e.g Sample Code

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+int nInputAccount = 2;
+
+//the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//the outputs for assembly transaction, the attribute of the output in the example is mandatory.
+ Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark);
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:100000 NA/1KB

Calculation of transaction size:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

2.8 Signing multi-address transfer transaction

Interface

Result signMultipleAddressTransaction(String txHex, List<String> privKeys, List<String> passwords)

Instructions

Signs a transaction by private key

Result.data String: signed transaction, serialized string in hexadecimal

parameter type required or not note
txHex String required serialized transaction data in hexadecimal
privKeys List required private key of the transaction
passwords List required password corresponding to the private key (passwords for multiple accounts must be the same) +

e.g Sample Code

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+List<String> priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d");
+List<String> passwords = Arrays.asList("123456","123456");
+Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords);
+

Blocks BlockService

3.1 Getting block header by block height

Interface

Result getblockHeader(int height)

Instructions

Gets a block header by block height

Result.data BlockHeader

parameter type required or not note
height int required block height

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g Sample Code

getblockHeader(10);
+

3.2 Getting block header by block hash

Interface

Result getblockHeader(String hash)

Instructions

Gets a block header by block hash

Result.data BlockHeader

parameter type required or not note
hash String required block hash

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g Sample Code

getblockHeader("041f3d2ceed........");
+

3.3 Getting block by block height

Interface

Result getBlock(int height)

Instructions

Gets a block by block height

Result.data Block

parameter type required or not note
height int required block height

Return

  • Return Result object in the following formats:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "transfer",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g Sample Code

getBlock(10);
+

3.4 Getting block by block hash

Interface

Result getBlock(String hash)

Instructions

Gets a block by block hash

Result.data Block

parameter type required or not note
hash String required block hash

Return

-Return Result object in the following format:

{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "transfer",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g Sample Code

getBlock("041f3d2ceed........");
+

3.5 Getting the latest block header

Interface

Result getNewestBlockHash()

Instrucntions

Gets the latest block header

Result.data BlockHeader

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+
+

e.g Sample Code

getNewestBlockHash();
+

3.6 Getting the latest block’s height

Interface

Result getNewestBlockHight()

Instructions

Gets the height of the latest block

Result.data: height (Long)

Return

-Return Result object in the following format:

{
+    "success": true,
+    "data": {
+        "value": 5210
+    }
+}}
+
+

e.g Sample Code

getNewestBlockHight();
+

3.7 Getting the latest block’s Hash

Interface

Result getNewestBlockHash()

Instructions

Gets the block Hash of the latest block

Result.data: Hash (String)

Return

  • Return Result object in the following format:
{
+    "success": true,
+    "data": {
+        "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"
+    }
+}}
+
+

e.g Sample Code

getNewestBlockHash();
+

Consensus ConsensusService

4.1 Offline assembling transaction for creating node

Interface

Result createAgentTransaction(AgentInfo agentInfo, List<Input> inputs, Na fee)

Instructions

Assembles transaction for creating node offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
agentInfo Object required the information about the node to be created
inputs List required input information
fee Object required transaction fee

e.g Sample Code

// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+// the information about the node to be created, the attribute of AgentInfo in the example is mandatory.
+AgentInfo info = new AgentInfo();
+info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");       // the agent address of the consensus node
+info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ");     // the address of the node actually packing block
+info.setDeposit(200000 * 100000000L);// deposit for creating a node, not less than 20000NULS and not more than 200000NULS
+info.setCommissionRate(10.0); // commission ratio ranging from 1 to 100
+
+//fee for creating a node
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

** Calculation of transaction fee **: unit price of the fee* transaction size

** unit price of the fee (min)**:1000000 NA/1KB

Calculation of transaction size:(288 + 50 * inputs.length)/1024 +210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

4.2 Offline assembling agent consensus transaction

Interface

Result createDepositTransaction(DepositInfo depositInfo, List<Input> inputs, Na fee)

Instructions

Assembles an agent consensus transaction offline.

Result.data String: serialized transaction data in hexadecimal

parameter type required or not note
depositInfo Object required the information about the node to be created
inputs List required input information
fee Object required transaction fee

e.g Sample Code

// the inputs for assembly transaction, the attribute of the input in the example is mandatory.
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory.
+DepositInfo info = new DepositInfo();
+info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");            //address of the agent consensus node
+info.setDeposit(300000 * 100000000L);// the agent token number ranging from 2000NULS to 500000NULS
+info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");// the id of the transaction for creating consensus node
+ 
+//fee for creating a node
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

** Calculation of fee for creating an agent transaction**: unit price of the fee* transaction size

** unit price of the fee (min)**:1000000 NA/1KB

Calculation of transaction size:(288 + 50 * inputs.length)/1024 +210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure.

4.3 Offline assembling transaction for canceling agent consensus

Interface

Result createCancelDepositTransaction(Output output)

Instructions

Assembles a transaction for canceling agent consensus offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
output Object required the output locked when participating in the consensus

e.g Sample Code

// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus.
+/ / use the output as a parameter to generate an transaction for canceling agent consensus
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setValue(20000000000000L);
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createCancelDepositTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.4 Offline assembling transaction for stopping consensus node

Interface

Result createStopAgentTransaction(Output output)

Instructions

Assembles a transaction for stopping consensus node offline

Result.data String: serialized transaction string in hexadecimal

parameter type required or not note
output Object required the output locked when creating a node

e.g Sample Code

// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. 
+/ / use the output as a parameter to generate a transaction for canceling agent consensus 
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setValue(20000000000000L);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createStopAgentTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.5 Getting list of agent consensus

Interface

Result getDeposits(String address, int pageNumber, int pageSize)

Instructions

Gets a list of agent consensus by agent address

Result.data List: a list of agent consensus

parameter type required or not note
address String required agent address
pageNumber int required page number
pageSize int required record size displayed per page ranging from 1 to 100<

Return

  • Return Result object in the following format:
{
+  "success":true,
+  "data":{
+    "pageNumber":1,
+    "pageSize":10,
+    "total":1,
+    "pages":1,
+      "list":[
+        {
+        "deposit":20000010000000,
+        "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c",
+        "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA",
+        "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e",
+        "blockHeight":98,
+        "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"
+        }
+      ]
+  }
+}
+

e.g Sample Code

Result result = NulsSDKTool.getDeposits(address, 1, 10);
+

Appendix

Example of Result returned by interface

Result
  • Indicate the normal access to the interface and the specific data returned by the business service.
{	
+"success": true,// interface executes correctly
+"data": data
+}
+
  • Indicate the normal access to the interface, and the business service returns true.
{	// indicate the normal access to the interface, and the business service returns true
+  "success": true,// interface executes correctly
+    "data": {
+		"value":true // the result returned by interface business function
+    }
+}
+
  • Indicate the normal access to the interface, and the business service returns false.
{	
+    "success": true, // interface executes correctly
+    	"data"{
+        "value": false // the result returned by interface business function
+     }
+}
+
  • Return error cases, such as a parameter error, exception, etc.
{	// indicate an error 
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+
  • This is the full result of creating an offline account with password.
{
+    "success": true,
+    //data为List<account>
+    "data": {
+    	"list":[
+        	{
+	           "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr",
+	            "alias": null,
+	            "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0",
+	            "extend": null,
+	            "createTime": 1529041525794,
+	            "encrypted": false,
+	            "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a",
+	            "encryptedPriKey": ""
+	    	}
+	    ]
+    }
+}
+

Account
{
+	"address": String, account address
+	"alias": String, account alias
+	"pubKey": String, public key
+	"extend": String, extension
+	"createTime": Long, create time
+	"encrypted": boolean, encrypted or not
+	"priKey": String, private key(not null only if a password-less offline account is created)
+	"encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created)
+}
+

Input
 {
+	"fromHash": String, txHash of the output         
+	"fromIndex": Integer, outIndexof the output
+	"address": String, transfer-in address                   
+	"value": Long, transfer-in amount
+    "lockTime": Long, lock time
+}
+

Output
 {
+	"txHash": String, transaction hash
+	"index": Integer, index
+	"address": String, address
+	"value": Long, amount
+	"lockTime": Long, lock time
+	"status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent)
+}
+

Transaction
{
+	"hash": String, transaction hash
+	"type": Integer, transaction type
+	"time": Long, transaction initiation time 
+	"blockHeight": Long, block height
+	"fee": Long, transaction fee
+	"value": Long, transaction amount
+	"remark": String, remarks
+	"scriptSig": String, signature
+	"status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed)
+	"confirmCount": Long, confirmation count
+	"size": int, size
+	"inputs": [
+		{
+"fromHash": String, txHash of the output         
+			"fromIndex": Integer, outIndexof the output
+			"address": String, transfer-in address                   
+			"value": Long, transfer-in amount
+
+		}
+		],
+	"outputs": [
+		{
+			"txHash": String, transaction hash
+			"index": Integer, index
+			"address": String, address
+			"value": Long, amount
+			"lockTime": Long, lock time
+			"status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent)
+		}
+	]
+}
+

BalanceInfo
{
+	"balance": long, balance
+	"usable": long, available balance
+	“locked": long, locked balance
+}
+

BlockHeader
{
+	"hash": String, transaction hash
+	"preHash": String, hash value of the previous block
+	"merkleHash": String, merkle hash
+	"time": Long, block generation time
+	"height": Long, block height
+	"txCount": Long, count of transactions packaged by the block
+	"packingAddress": String, packing address
+	"scriptSig": String, signature
+	"roundIndex": Long, consensus round
+	"consensusMemberCount": Integer, count of members participating in the consensus
+	"roundStartTime": Long, the start time of the current consensus round
+	"packingIndexOfRound": Integer, the packing index of the current round
+	"confirmCount": Long, confirmation count
+	"reward": Long, consensus reward
+	"fee": Long, packing fee obtained
+	"size": int, size
+}
+

Block
{
+	"hash": String, transaction hash
+	"preHash": String, hash value of the previous block
+	"merkleHash": String, merkle hash
+	"time": Long, block generation time
+	"height": Long, block height
+	"txCount": Long, count of transactions packaged by the block
+	"packingAddress": String, packing address
+	"scriptSig": String, signature
+	"roundIndex": Long, consensus round
+	"consensusMemberCount": Integer, count of members participating in the consensus
+	"roundStartTime": Long, the start time of the current consensus round
+	"packingIndexOfRound": Integer, the packing index of the current round
+	"confirmCount": Long, confirmation count
+	"reward": Long, consensus reward
+	"fee": Long, packing fee obtained
+	"size": int, size
+	"txList": [
+		{
+			"hash": String, transaction hash
+			"type": Integer, transaction type
+			"time": Long, transaction initiation time
+			"blockHeight": Long, block time
+			"fee": Long, transaction fee
+			"value": Long, transaction amount
+			"remark": String, remarks
+			"scriptSig": String, signature
+			"status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed)
+			"confirmCount": Long, confirmation count
+			"size": int, size
+			"inputs": [inputs
+				{
+		"fromHash": String, txHash of the output         
+					"fromIndex": Integer, outIndexof the output
+					"address": String, transfer-in address
+					"value": Long transfer-in amount
+				}
+			],
+			"outputs": [ outputs
+				{
+					"address": String, address
+					"value": Long, amount
+					"lockTime": Long, lock time
+				}
+			]
+		}
+	]
+}
+
Last Updated: 1/15/2019, 1:39:53 PM
+ + + diff --git a/docs/.vuepress/dist/developerTools/smartContractIDEAPlugin.html b/docs/.vuepress/dist/developerTools/smartContractIDEAPlugin.html new file mode 100644 index 00000000..f9edbf43 --- /dev/null +++ b/docs/.vuepress/dist/developerTools/smartContractIDEAPlugin.html @@ -0,0 +1,23 @@ + + + + + + NULS IDEA Plugin User Manual | NULS + + + + + + + +

NULS IDEA Plugin User Manual

1 Install NULS Plugin on IDEA

  • Get NULS plugin ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk

Install

  • Select the said ZIP, and click OK

Install

  • Tick NULS plugin, and click Apply

Install

2 Create a NULS project

create

Input Project name, click finish

create

3 Compile smart contract

Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)

code

4 Set and deploy the node and account for contract

  • Click NULS plugin on the right, and call NULS plugin interface

    code

  • Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address.

    Click + on the top left corner of panel, and select Add Node.

    code

  • Input Node address and clock OK

    code

  • Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.

    code

5 Package contract

  • Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code

    code

  • Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).

    code

  • Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface

    code

    code

6 Deploy contract

  • On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.

    code

  • Parameters following JarFilePath are the parameters of the contract construction function.

    code

  • Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.

    code

  • Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.

    code

  • If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.

    code

  • Review the deployed contract on the top of panel

    code

  • Click the deployed contract to review all method of this contract

    code

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/guide/GUIGuide.html b/docs/.vuepress/dist/guide/GUIGuide.html new file mode 100644 index 00000000..e02d91ec --- /dev/null +++ b/docs/.vuepress/dist/guide/GUIGuide.html @@ -0,0 +1,21 @@ + + + + + + Client wallet user guide | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/guide/NULSTransaction.html b/docs/.vuepress/dist/guide/NULSTransaction.html new file mode 100644 index 00000000..5cb3daa0 --- /dev/null +++ b/docs/.vuepress/dist/guide/NULSTransaction.html @@ -0,0 +1,21 @@ + + + + + + Trading guide for NULS | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/guide/webGuide.html b/docs/.vuepress/dist/guide/webGuide.html new file mode 100644 index 00000000..0fd78783 --- /dev/null +++ b/docs/.vuepress/dist/guide/webGuide.html @@ -0,0 +1,21 @@ + + + + + + Light wallet user guide | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/icon.png b/docs/.vuepress/dist/icon.png new file mode 100755 index 00000000..b9a233fc Binary files /dev/null and b/docs/.vuepress/dist/icon.png differ diff --git a/docs/.vuepress/dist/index.html b/docs/.vuepress/dist/index.html new file mode 100644 index 00000000..35f4d445 --- /dev/null +++ b/docs/.vuepress/dist/index.html @@ -0,0 +1,21 @@ + + + + + + NULS Docs + + + + + + + +

Welcome to NULS

NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.

The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.

NULS2.0 Alpha Version is released

Dear users:

It is a great honor to announce that the NULS2.0 Alpha version has been released at 10:30 am, Beijing time: 2019-03-28. We sincerely invite you to participate in the internal test.

The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture.

The Alpha version test mainly includes:

  • Full functionality of the Linux wallet, such as account creation, import, transfer, node creation, etc
  • Build blockchain based on NULS2.0 core modules
  • Build blockchain including business module

Join Test:

1 Download linux client

2 linux CLI Manual

3 Apply for test NULS and reply: Alpha+address

4 Access blockchain explorer: http://alpha.nulscan.io/

5 Build Blockchain based on NULS2.0

6 Submit bug:https://github.com/nuls-io/nuls_2.0/issues

To learn more about us, visit nuls.io.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/GUIGuide.html b/docs/.vuepress/dist/learn/GUIGuide.html new file mode 100644 index 00000000..b8396ef1 --- /dev/null +++ b/docs/.vuepress/dist/learn/GUIGuide.html @@ -0,0 +1,21 @@ + + + + + + Client wallet user guide | NULS + + + + + + + +

Client wallet user guide

Community members are writing...

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NIP-1.html b/docs/.vuepress/dist/learn/NIP-1.html new file mode 100644 index 00000000..f0049419 --- /dev/null +++ b/docs/.vuepress/dist/learn/NIP-1.html @@ -0,0 +1,46 @@ + + + + + + NIP-1 NIP Purpose and Guidelines | NULS + + + + + + + +

NIP-1 NIP Purpose and Guidelines

NIP: 1
+Title: NIP Purpose and Guidelines
+Status: Last call
+Type: Process
+Author: Lin Yang <lin@nuls.io>
+Created: 2018-12-27
+

What is a NIP?

NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.

Reasons for NIP

  • We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.
  • For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.

NIP Types

There are six types of NIP:

  • A Core NIP describes improvements in the NULS core code, such as consensus mechanisms, network protocols, etc.
  • A Module NIP describes improvements in module submission and review requirements, such as the certain minimum criteria a NIP must meet to be accepted and merged into the module repository.
  • An Interface NIP describes improvements in the specifications and standards of the NULS client API/RPC, such as API name and method name.
  • An NRC Standards NIP describes improvements in application-level standards, such as contract standards, token standards, etc.
  • An Informational NIP describes a NULS design issue or provides general guidelines or information to the NULS community--but does not propose a new feature. Informational NIPs do not necessarily represent a NULS community consensus or recommendation, so users and implementers are free to ignore Informational NIPs or follow their advice.
  • A Process NIP describes improvements in all NULS-related operational processes, such as the ambassador election in the community. A Process NIP is not only a recommendation, but also a specification that community members need to follow to accomplish certain things, but it does not involve code-level specifications.

NIP Work Flow

The parties involved in the workflow include some or all of the following roles:

  • Most members of the community

    The main responsibility is to participate in the discussion and voting of the NIPs, making constructive comments as well.

  • NIP Authors

    Propose and improve NIPs and lead the community to discuss.

  • NIP Editors

    Manage and edit NIPs.

  • NULS Council

    The NIPs, about to “Final” or “Accepted”, can be rejected by the final decision of the Council via internal voting.

  • NULS Core Developers

    They are responsible for the audit and code implementation of the Core, Module, NRC Standards and Interface NIPs.

Vetting an idea publicly before going as far as writing a NIP is meant to save your time. Asking the community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions. It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where NULS is used. We recommend that comments can be collected in the community via voting, and the results will also help the NIP editors to make quicker decisions on whether to merge the NIP.

A successful NIP requires the following stages:

  [ Draft ]->[ Last Call ]->[ Accepted ]->[ Final ]
+

Each change to the NIP status should be submitted by the NIP author as a pull request (PR), and the NIP editors will review the NIP. It's a good idea to add a link to the discussion post when you submit a PR.

A complete NIP process is as follows:

  • The NIP author writes the NIP using the mandated format and style and shepherds the discussions in the community. The NIP author should first attempt to ascertain whether the idea is NIP-able, and then submit the NIP as a PR to the NIP repository, including a link to the discussion post. The NIP editors will handle these requests based on actual situation.

    • Draft: Once approved, the NIP editors will assign the NIP a number and squash commit the pull request onto master. The NIP editors will not unreasonably deny a NIP.
    • Draft: Reasons for denying NIP status include being unfocused or too broad, duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the NULS philosophy.
  • Updates to drafts may also be submitted by the author as pull requests before it can be considered mature enough and ready for the next status.

    • Last call: Once approved, the NIP editors will change the NIP status from Draft to last call and set the end date for the last call, usually 15 days.
    • Last call: Once the NIP has been published, it will be re-assigned to Draft status when necessary revisions are made on the NIP. We hope that a NIP will enter last call status only once to avoid unnecessary controversy in the community.
  • The NIP in last call status will be pinned at https://nuls.community/

    • Accepted (involved in Core, Module, NRC Standards and Interface NIPs only): If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Accepted” by the NIP editors.
    • Final (involved in Informational and Process NIPs only): If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Final” by the NIP editors.
    • Last call: The NIP will be re-assigned to Draft status if there are material changes or technical issues raised by the community cannot be solved during the last call period. In addition, if the Council has different views on the NIP, a vote can be initiated within the Council members. If more than 70% of the Council members reject the NIP (giving reasons), the NIP will be re-assigned to “Draft” status or directly “Rejected” according to actual reasons.
  • Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the NULS core developers must implement the NIPs in the form of code before they can be considered “Final”.

    • Final (involved in Core, Module, NRC Standards and Interface NIPs only): After the NIP is implemented in the form of code, and is running on the main-net stably for certain amount of time or has become effectively verified, with changes recognized by the community as well, the status can be changed to "Final".

Other exceptional statuses are:

  • Deferred: Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the developers do not complete the reference implementation as scheduled.
  • Rejected: A NIP can also be “Rejected”. Perhaps core developers reject to propose an implementation or the Council finds it unfeasible.
  • Superseded: A NIP used to “Final”, but it is no longer considered the most advanced. Another better NIP appears, referring to this NIP, and becomes the Final status.

What belongs in a successful NIP?

Each NIP should have the following parts:

  • Preamble: RFC 822 style headers containing meta-data about the NIP, including the NIP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. See NIP Header Preamble for details.
  • Summary: The NIP author needs to provide a simple and understandable summary of the NIP for the general public. If you can't explain it in a simple way, it means that you don't fully understand it.
  • Abstract:  A short (~200 word) description of the technical issue being addressed.
  • Motivation: The motivation is critical for NIPs that want to change the NULS protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the NIP solves. NIP submissions without sufficient motivation may be rejected outright.
  • Specification: The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current NULS platforms (NULS client, explorer).
  • Rationale: The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion.
  • Backwards Compatibility: All NIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The NIP must explain how the author proposes to deal with these incompatibilities. NIP submissions without a sufficient backwards compatibility treatise may be rejected outright.
  • Test Cases: For NIPs that affect the consensus mechanism, test cases for their implementation must be provided.
  • Reference Implementation: The reference implementation must be completed before any NIP is given status "Final", but it need not be completed before the NIP is accepted.
  • History: History records show the whole process of the NIP from being proposed to the Final state, which can be displayed as additional links.

NIP Formats and Templates

NIP should be written in markdown format.

NIP Header Preamble

Each NIP must use the RFC 822 style as the head of the document. The headers must be arranged in the following order. The headers marked with * are optional, others are required.

  Title: < NIP title>
+  Author: <list of authors' real names and optionally, email addrs>
+* Discussions-To: < links to official discussion channels>
+  Status: <Draft | Accepted | Final | Superseded | Deferred | Rejected>
+  Type: <Core | Module | Interface | NRC Standards | Informational | Process>
+  Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
+* Replaces: < NIP number>
+* Superseded-By: < NIP number>
+

Auxiliary Files

NIPs may include auxiliary files such as diagrams. Auxiliary files must be named NIP-XXXX-Y.ext, where "XXXX" is the NIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png").

Transferring NIP Ownership

It occasionally becomes necessary to transfer ownership of NIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred NIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the NIP process or has fallen off the face of the 'net' (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the NIP. We try to build consensus around a NIP, but if that's not possible, you can always submit a competing NIP.

If you are interested in assuming ownership of a NIP, send a message asking to take over, addressed to both the original author and the NIP editors. If the original author doesn't respond to email in a timely manner, the NIP editors will make a unilateral decision (it's not like such decisions can't be reversed).

NIP Editors

The current NIP editors are:

Niels <Niels@nuls.io>
+Pen <Pen@nuls.io>
+

NIP Editor Responsibilities

For each new NIP that comes in an editor does the following:

  • Read the NIP to check if it is ready: sound and complete. The ideas in the NIP must make technical sense, even if they don’t seem likely to be accepted.
  • The title should accurately describe the content.
  • Skim the NIP for obvious defects in language (spelling, grammar, sentence structure, etc.), markup (for Github style), and code style.

If the NIP isn't ready, an editor will send it back to the author for revision, with specific instructions. Once the NIP is ready for the repository, a NIP editor will:

  • Assign a NIP number (usually a PR number)
  • Merge the pull request
  • Send email back to the NIP author with next steps

Many NIPs are written and maintained by developers with write access to the NULS codebase. The NIP editors monitor NIP changes, and correct any structure, grammar, spelling, or markup mistakes they see. NIP editors don't pass judgment on NIPs. They merely do the administrative and editorial part.

History

This document was derived heavily from Bitcoin's Bitcoin's BIP-0001, written by Amir Taake, and the text he wrote was mainly from Python's PEP-0001. According to this situation, NIP makes some modifications based on their documents, such as adding the Council in the NIP process, modifying NIP types, etc. Please direct all comments to the NULS NIP editors.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NIP-2.html b/docs/.vuepress/dist/learn/NIP-2.html new file mode 100644 index 00000000..d79d7605 --- /dev/null +++ b/docs/.vuepress/dist/learn/NIP-2.html @@ -0,0 +1,36 @@ + + + + + + NIP-2 NULS Community Constitution | NULS + + + + + + + +

NIP-2 NULS Community Constitution

  NIP: 2
+  Title: NULS Community Constitution
+  Author: Reaper Ran <reaper@nuls.io>
+  Discussions-To: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207
+  Status: Last call
+  Type: Process
+  Created: 2018-12-28
+

Preamble

Due to the development requirement of NULS and to better facilitate the favorable operation of the NULS community and to make blockchain technology easier with NULS, the NULS community will constantly seek and implement NULS community autonomy for the realization of self-governance and self-evolution. This Constitution is hereby formulated based on the NULS community culture and philosophy.

NULS community culture: openness, freedom, autonomy, evolution

NULS community philosophy: share, inherit, grow, innovate

The following rules will be based on the NULS development consensus governance module. The Council members and Ambassadors will be appointed by a vote within the NULS core team before consensus governance module is set in motion.

NULS Foundation

December 2018

Abstract

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

Motivation

In order to build a good community operation mechanism, promote community autonomy, and promote the NULS project to enable the community to evolve and drive independently.

Specification

The following is a specification of the NULS Community Constitution.

NULS Community Constitution

I. NULS Community Profile

NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

II. NULS Foundation

NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.

(I) Objectives of NULS Foundation

Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:

  1. Code writing
  2. Applications development
  3. Operation and promotion
  4. Other actions in favor of NULS community ecology development

(II) Source of NULS Foundation

20,000,000 NULS from the NULS and entrusted revenues from the contributors.

(III) Management of NULS Foundation

The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.

III. Council members

(I) Introduction to Council members

As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.

(II) Appointment of Council members

The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers (developer council member) elected based on a ballot participated by all developers; and 7 members elected by ballot within the community (standing council member). The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.

  1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.
  2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.
  3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.
  4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.

(III) Rights and responsibilities of Council member

  1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:

    (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.

  • Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.

    (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.

  • Adjustment of lower node agency commission.

  • Adjustment of transfer commission.

  • Adjustment of contract call commission.

  • Adjustment of Council member proposal commission.

  • Adjustment of adjustable system parameter in other systems.

    (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.

  • Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.

  • Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.

  • Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.

  1. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.
  2. Responsibilities of Council member.
  • Council member shall communicate with the community in good time.

  • Act in strict accordance with the community’s Constitution.

  • Share the same vision and purpose with NULS.

  • Take it as its own mission to protect community members’ interests.

Note: All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.

IV. CODE CRAFT COUNCIL (CCC)

(I) Introduction to the CCC

The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.

(II) Philosophy of the CCC

We stick to the following philosophy in the technology community:

  1. Equal: the technology community and core team are equal and work together for joint development.

  2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.

  3. Sharing:

  • The whole community shares the achievements of NULS technology.

  • The whole community shares the development dividend of NULS.

  • The whole community shares NULS’s influence and reputation.

  • The industry shares the technical innovation brought by NULS.

  • The industry shares NULS’s standard establishment to promote industry development.

  1. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.

  2. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.

(III) Appointment of the CCC member

The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).

The process of joining CCC is:

  1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.
  2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.
  3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.
  4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.

(IV) Rights and responsibilities of the CCC member

  1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.

  2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.

  3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.

  4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.

  5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.

V. Contributor

(I) Contributor for campaign

Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at nuls.community.

(II) Permanent contributor

Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.

VI. Project Budget

(I) With respect to contributor

Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.

(II) With respect to other transaction funds

The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.

VII. Other votes

(I) Start a vote

  1. The Council member shall start a vote and only the transaction fee is required.

  2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.

(II) Vote by proxy

  • Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.

  • Any NULS user can be an agent.

  • Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.

  • The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).

VIII. Feedback

We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:

NULS community website: https://nuls.community

Feedback post: https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NIP-3.html b/docs/.vuepress/dist/learn/NIP-3.html new file mode 100644 index 00000000..93fe5706 --- /dev/null +++ b/docs/.vuepress/dist/learn/NIP-3.html @@ -0,0 +1,36 @@ + + + + + + NIP-3 Community Fund Management and Use of Process | NULS + + + + + + + +

NIP-3 Community Fund Management and Use of Process

  NIP: 3
+  Title: Community Fund Management and Use of Process
+  Author: Reaper Ran <reaper@nuls.io>
+  Discussions-To: https://nuls.community/d/262-community-fund-management-and-use-of-process-discussion-draft-ngc20181221
+  Status: Last call
+  Type: Process
+  Created: 2018-12-28
+

Abstract

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Motivation

In order to enable the community to have more talents to join, community funds are opened to the community for joint management and use.

Specification

The following is a specification of the Community Fund Management and Use of Process.

Community Fund Management and Use of Process

img

I. Community Fund Management

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Community Fund Account Address:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.

The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.

Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.

**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **

II. The Application Member

1. Ordinary Members

All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.

2. Contributor Role

Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process. The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.

III. The Type of Application

1. Proposal to Pay Funds

The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.

2. Proposal Budget Item

The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.

3. The Proposal to Create a Node

Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.

4. Proposal Entrusted Funds

Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.

IV. The Application Process

1. The Plan is Openly and Thoroughly Discussed

(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;

(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;

(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;

(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;

(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;

(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;

(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;

(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;

2. Council Member Proposal

(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;

(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;

(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;

(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.

3. Foundation Implementation Proposal

(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;

(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).

V. Process Explanation

All community discussion suggestions are made at nuls.community .

This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.

Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.

The specific node generates revenue with reference to the NULS POC consensus mechanism.

Attachment: Current Contributor Role Delegation and Node:

Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC Members

Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck’s staking – Same as above

Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe’s staking – Same as above

Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NIP-4.html b/docs/.vuepress/dist/learn/NIP-4.html new file mode 100644 index 00000000..8556fa33 --- /dev/null +++ b/docs/.vuepress/dist/learn/NIP-4.html @@ -0,0 +1,36 @@ + + + + + + NIP-4 Ambassadors participate in the election rules | NULS + + + + + + + +

NIP-4 Ambassadors participate in the election rules

  NIP: 4
+  Title: Ambassadors participate in the election rules
+  Author: Reaper Ran <reaper@nuls.io>   Penny <penny@nuls.io>
+  Discussions-To: https://nuls.community/d/206-ambassadors-participate-in-the-election-rules-ncg-20181114
+  Status: Last call
+  Type: Process
+  Created: 2019-2-15
+

Abstract

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

Motivation

During the period between September to November 2018, we have had 9 ambassadors who have actively worked within the NULS Community to attract more members and developers. Once smart contracts are launched on the NULS main-net, there will be a community voting tool. Appointments of the ambassadors should be decided by the community. During this time, community members have given many suggestions, so we have set up some new detailed campaigning rules for the ambassadors. This will be the first step toward community autonomy, which is an important goal for NULS. It requires many fundamental tools, as well as the support from everyone in the community.

Specification

The following is a specification of the Ambassadors participate in the election rules.

Ambassadors participate in the election rules

1. Introduction of NULS Ambassadors

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

2. Duties and Compensation for NULS Ambassadors

a. A candidate for the NULS ambassador is required to create a NULS node.

b. Identify with the NULS concepts of values, understand the core knowledge of NULS and respect the members of the NULS community. The election cycle is quarterly and requires a full 3 month commitment. Consider this commitment before running for election. Ambassadors are expected to meet the full term of the quarterly commitment.

c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.

d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.

e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.

f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.

g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.

h. Half of all rewards of the ambassador's nodes are rewarded to ambassador(for he need to pay the node server cost and he shall get the rewards of 20,000 NULS he is staking on this nodes). And the other half must be used as development fund of ambassador for community development.

i.About the resignation of ambassador, if the ambassador is voluntarily resigned or subject to recall by the community, please ambassador return the remaining development fund of ambassador to the community fund.

j.The ambassador is a community contributor. If you need to initiate other community fund applications, please carry them out based on the community fund use and management process.

3. How to participate in the election

a. Publish the work report for the previous month and the work plan for the next month:

Please post on the NULS forum: https://community.nuls.world/t/elections

b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!

c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.

Final Tribute to your efforts:

• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.

• Start your work of community-building and outreach!

• Help NULS dock more DApps!

• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.

For all ambassador related discussions, please post on the NULS forum at https://community.nuls.world/t/elections

Welcome to the NULS community! Let’s work together to create a brighter future for NULS!

If you can deliver more, we have these expectations of you:

1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;

2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;

3. Share the story of NULS to the community;

4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;

6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;

7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;

8. Help NULS with publicity and be committed to NULS press releases through your local media.

Ambassador Guide

Preface

Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:

  • Transparency
  • Freedom
  • Autonomy
  • Evolution

The vision of the NULS project is based on the following mission

  • Making blockchain technology easy and simple
  • Breaking through the bottleneck of blockchain performance and adoption
  • Reducing the cost of using blockchain technology
  • Increasing security and reliability of data

NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.

As an Ambassador of NULS, you will obtain

  1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.
  2. Rewards produced by one node. Rewards are used to develop the local NULS community.
  3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.
  4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.

As an Ambassador of NULS, Your Mission is

A. Community Development

  1. Let others know about NULS via Internet or offline communications.
  2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS.
  3. Share the development from other areas of the NULS community with your local community.
  4. Continuously share the progress, planning, news, etc. of the NULS project to the local community.
  5. Contact local media and forums to help NULS publicize presentations or news.
  6. Share the story of NULS with the local community.
  7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.
  8. Share videos or other content produced by the team in the local language of the people in your country/region.
  9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.
  10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.

B. Community Activities

  1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.
  2. Participate in any possible cryptocurrency gatherings in your area and represent NULS.
  3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.
  4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.
  5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.

Get Started With Everything You Need Here

  1. NULS Ambassador Board ([Click to enter]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.
  2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.
  3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.
  4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.
  5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.
  6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.
  7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).
  8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum nuls.community.

Recruit Volunteers to Organize Local Communities

  1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.
  2. Organize some offline meet-ups.
  3. Introduce more blockchain investors to NULS and guide them towards investing in NULS.
  4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.

Develop a Local NULS Ecology

  1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.
  2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.
  3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.

Spread the Concepts and Features of NULS Technology with Local Communities

  1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.
  2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.
  3. Use local mainstream media websites to spread the news and progress of NULS.

NULStar Guidelines And Duties

  • Requirements for becoming a NULStar
  1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.
  2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.
  3. Must live in a city with over 350k population.
  • Duties of a NULStar
  1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.
  2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.
  • Rewards for NULStars
  1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.
  2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NIPIntroduction.html b/docs/.vuepress/dist/learn/NIPIntroduction.html new file mode 100644 index 00000000..075556a3 --- /dev/null +++ b/docs/.vuepress/dist/learn/NIPIntroduction.html @@ -0,0 +1,29 @@ + + + + + + NIP introduction | NULS + + + + + + + +

NIP introduction

What is NIP?

NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.

Reasons for NIP

  • We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.

  • For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.

Get all the NIP

All NIP files are available through NULS's github:https://github.com/nuls-io/NIPs

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/NULSNav.html b/docs/.vuepress/dist/learn/NULSNav.html new file mode 100644 index 00000000..3ac5b9cb --- /dev/null +++ b/docs/.vuepress/dist/learn/NULSNav.html @@ -0,0 +1,25 @@ + + + + + + NULS Portal | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/learn/NULSTransaction.html b/docs/.vuepress/dist/learn/NULSTransaction.html new file mode 100644 index 00000000..4c050488 --- /dev/null +++ b/docs/.vuepress/dist/learn/NULSTransaction.html @@ -0,0 +1,29 @@ + + + + + + Trading guide for NULS | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/learn/ambassadorRules.html b/docs/.vuepress/dist/learn/ambassadorRules.html new file mode 100644 index 00000000..124ad698 --- /dev/null +++ b/docs/.vuepress/dist/learn/ambassadorRules.html @@ -0,0 +1,29 @@ + + + + + + Ambassadors participate in the election rules | NULS + + + + + + + +

Ambassadors participate in the election rules

1. Introduction of NULS Ambassadors

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

2. Duties and Compensation for NULS Ambassadors

a. A candidate for the NULS ambassador is required to create a NULS node.

b. A candidate is required to agree with the values of NULS, understand the core knowledge of NULS, and respect members of the NULS community.

c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.

d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.

e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.

f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.

g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.

h. NULS ambassadors can apply for a budget from the NULS Foundation for major developments. The budget is open to all community members, and a budget vote will be initiated for it. The voting period is 15 days, and if the voting volume exceeds 10 million NULS tokens, and the supporting votes reach 70% or higher, the vote is considered passed and the NULS Foundation will execute.

3. How to participate in the election

a. Publish the work report for the previous month and the work plan for the next month:

Please post on the NULS forum: https://community.nuls.world/t/elections

b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!

c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.

Final Tribute to your efforts:

• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.

• Start your work of community-building and outreach!

• Help NULS dock more DApps!

• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.

For all ambassador related discussions, please post on the NULS forum at https://community.nuls.world/t/elections

Welcome to the NULS community! Let’s work together to create a brighter future for NULS!

If you can deliver more, we have these expectations of you:

1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;

2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;

3. Share the story of NULS to the community;

4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;

6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;

7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;

8. Help NULS with publicity and be committed to NULS press releases through your local media.

Ambassador Guide

Preface

Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:

  • Transparency
  • Freedom
  • Autonomy
  • Evolution

The vision of the NULS project is based on the following mission

  • Making blockchain technology easy and simple
  • Breaking through the bottleneck of blockchain performance and adoption
  • Reducing the cost of using blockchain technology
  • Increasing security and reliability of data

NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.

As an Ambassador of NULS, you will obtain

  1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.
  2. Rewards produced by one node. Rewards are used to develop the local NULS community.
  3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.
  4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.

As an Ambassador of NULS, Your Mission is

A. Community Development

  1. Let others know about NULS via Internet or offline communications.
  2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS.
  3. Share the development from other areas of the NULS community with your local community.
  4. Continuously share the progress, planning, news, etc. of the NULS project to the local community.
  5. Contact local media and forums to help NULS publicize presentations or news.
  6. Share the story of NULS with the local community.
  7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.
  8. Share videos or other content produced by the team in the local language of the people in your country/region.
  9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.
  10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.

B. Community Activities

  1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.
  2. Participate in any possible cryptocurrency gatherings in your area and represent NULS.
  3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.
  4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.
  5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.

Get Started With Everything You Need Here

  1. NULS Ambassador Board ([Click to enter]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.
  2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.
  3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.
  4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.
  5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.
  6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.
  7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).
  8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum nuls.community.

Recruit Volunteers to Organize Local Communities

  1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.
  2. Organize some offline meet-ups.
  3. Introduce more blockchain investors to NULS and guide them towards investing in NULS.
  4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.

Develop a Local NULS Ecology

  1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.
  2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.
  3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.

Spread the Concepts and Features of NULS Technology with Local Communities

  1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.
  2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.
  3. Use local mainstream media websites to spread the news and progress of NULS.

NULStar Guidelines And Duties

  • Requirements for becoming a NULStar
  1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.
  2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.
  3. Must live in a city with over 350k population.
  • Duties of a NULStar
  1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.
  2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.
  • Rewards for NULStars
  1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.
  2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/communityConstitution.html b/docs/.vuepress/dist/learn/communityConstitution.html new file mode 100644 index 00000000..0381d15a --- /dev/null +++ b/docs/.vuepress/dist/learn/communityConstitution.html @@ -0,0 +1,29 @@ + + + + + + NULS Community Constitution | NULS + + + + + + + +

NULS Community Constitution

I. NULS Community Profile

NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

II. NULS Foundation

NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.

(I) Objectives of NULS Foundation

Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:

  1. Code writing
  2. Applications development
  3. Operation and promotion
  4. Other actions in favor of NULS community ecology development

(II) Source of NULS Foundation

20,000,000 NULS from the NULS and entrusted revenues from the contributors.

(III) Management of NULS Foundation

The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.

III. Council members

(I) Introduction to Council members

As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.

(II) Appointment of Council members

The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers (developer council member) elected based on a ballot participated by all developers; and 7 members elected by ballot within the community (standing council member). The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.

  1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.
  2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.
  3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.
  4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.

(III) Rights and responsibilities of Council member

  1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:

    (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.

  • Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.

    (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.

  • Adjustment of lower node agency commission.

  • Adjustment of transfer commission.

  • Adjustment of contract call commission.

  • Adjustment of Council member proposal commission.

  • Adjustment of adjustable system parameter in other systems.

    (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.

  • Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.

  • Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.

  • Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.

  1. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.
  2. Responsibilities of Council member.
  • Council member shall communicate with the community in good time.

  • Act in strict accordance with the community’s Constitution.

  • Share the same vision and purpose with NULS.

  • Take it as its own mission to protect community members’ interests.

Note: All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.

IV. CODE CRAFT COUNCIL (CCC)

(I) Introduction to the CCC

The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.

(II) Philosophy of the CCC

We stick to the following philosophy in the technology community:

  1. Equal: the technology community and core team are equal and work together for joint development.

  2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.

  3. Sharing:

  • The whole community shares the achievements of NULS technology.

  • The whole community shares the development dividend of NULS.

  • The whole community shares NULS’s influence and reputation.

  • The industry shares the technical innovation brought by NULS.

  • The industry shares NULS’s standard establishment to promote industry development.

  1. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.

  2. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.

(III) Appointment of the CCC member

The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).

The process of joining CCC is:

  1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.
  2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.
  3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.
  4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.

(IV) Rights and responsibilities of the CCC member

  1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.

  2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.

  3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.

  4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.

  5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.

V. Contributor

(I) Contributor for campaign

Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at nuls.community.

(II) Permanent contributor

Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.

VI. Project Budget

(I) With respect to contributor

Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.

(II) With respect to other transaction funds

The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.

VII. Other votes

(I) Start a vote

  1. The Council member shall start a vote and only the transaction fee is required.

  2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.

(II) Vote by proxy

  • Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.

  • Any NULS user can be an agent.

  • Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.

  • The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).

VIII. Feedback

We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:

NULS community website: https://nuls.community

Feedback post: https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/communityFund.html b/docs/.vuepress/dist/learn/communityFund.html new file mode 100644 index 00000000..c83fedc0 --- /dev/null +++ b/docs/.vuepress/dist/learn/communityFund.html @@ -0,0 +1,29 @@ + + + + + + Community Fund Management and Use of Process | NULS + + + + + + + +

Community Fund Management and Use of Process

img

I. Community Fund Management

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Community Fund Account Address:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.

The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.

Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.

**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **

II. The Application Member

1. Ordinary Members

All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.

2. Contributor Role

Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process. The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.

III. The Type of Application

1. Proposal to Pay Funds

The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.

2. Proposal Budget Item

The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.

3. The Proposal to Create a Node

Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.

4. Proposal Entrusted Funds

Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.

IV. The Application Process

1. The Plan is Openly and Thoroughly Discussed

(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;

(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;

(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;

(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;

(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;

(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;

(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;

(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;

2. Council Member Proposal

(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;

(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;

(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;

(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.

3. Foundation Implementation Proposal

(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;

(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).

V. Process Explanation

All community discussion suggestions are made at nuls.community .

This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.

Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.

The specific node generates revenue with reference to the NULS POC consensus mechanism.

Attachment: Current Contributor Role Delegation and Node:

Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC Members

Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck’s staking – Same as above

Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe’s staking – Same as above

Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/howToContribute.html b/docs/.vuepress/dist/learn/howToContribute.html new file mode 100644 index 00000000..37d37e2e --- /dev/null +++ b/docs/.vuepress/dist/learn/howToContribute.html @@ -0,0 +1,29 @@ + + + + + + How to contribute | NULS + + + + + + + +

How to contribute

The development of NULS is inseparable from the community and requires the participation of community members. We provide different ways for community members to participate, and you can choose what you are good at to contribute to NULS. For each contributor, the name of the contributor is published with its consent (we also attach the node name if the node is owned)

Join the Mainnet development

Although the main network is now in a stable state of operation, in order to cope with changes, the development of the main network is still in progress. We need the help of the community to solve the challenges in the development of the main network and improve the NULS blockchain infrastructure together. We urge developers in the community to join us and contribute, and your efforts will be rewarded.

Report bugs

In the software development process, although there are strict tests, we still can't avoid bugs in the program. So if you find bugs in the process of using our application or developing, please timely feedback to us, and we will actively deal with them. There are three ways to feed back bugs:

  • Feedback through community forum

    • Mainnet:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs
    • Testnet:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs
  • Send email to support@nuls.io

  • Direct feedback to the community manager or operations staff

Write document

NULS formulated the document writing incentive plan, invited the community to write NULS related documents together, and gave corresponding rewards according to the efforts of community members.

Translate document

As a global open source blockchain project, NULS needs a lot of bilingual documents in Chinese and English. If you are a professional in this field, we really need your help.

List of contributors

The rankings are arranged alphabetically, in no particular order

Name Email Node Alias/ID
Angang Tang tangangang@nuls.io --
Albert albert@nuls.io --
Charlie Li lichao@nuls.io ---
Cody Lan lanjinsheng@nuls.io ---
Davi Yang davi@nuls.io ---
Yuanchen Jiang jiangyuanchen@nuls.io ---
Yifeng Qin qinyifeng@nuls.io --
Niels niels@nuls.io niels
Pierre Luo luohao@nuls.io ---
Pen Luo pen@nuls.io ---
Siwei 13809668344@139.com siwei
Vivi Zhou zhouwei@nuls.io ---
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/index.html b/docs/.vuepress/dist/learn/index.html new file mode 100644 index 00000000..167bb0e2 --- /dev/null +++ b/docs/.vuepress/dist/learn/index.html @@ -0,0 +1,21 @@ + + + + + + Welcome to NULS | NULS + + + + + + + +

Welcome to NULS

NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.

The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects.

NULS2.0 Alpha Version is released

Have a try

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/introduction.html b/docs/.vuepress/dist/learn/introduction.html new file mode 100644 index 00000000..e7eadfcf --- /dev/null +++ b/docs/.vuepress/dist/learn/introduction.html @@ -0,0 +1,25 @@ + + + + + + What is NULS | NULS + + + + + + + +

What is NULS

NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.

Following the principles of pluggability, modularization and parallel expansion, NULS provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and usage, and to promote the application of blockchain in the commercial field and the interaction among chains

Upholding the "chain" as the core in the NULS development philosophy, NULS is striving for building its core product: "Chain Factory". In the meantime, NULS will realize the value circulation among chains through cross-chain module and build the ecosystem of blockchains.

1. Our Mission

  • Provide flexible blockchain technology that supports a wide variety of enterprise applications
  • Efficient, high performance technology to solve bottlenecks
  • Promote usage of blockchain technology by reducing the barrier of entry development cost
  • Provide the most powerful system of trust through a decentralized network

2. Whitepaper

The NULS whitepaper is an authoritative report that addresses what NULS’ goal is and how we plan to achieve it.

Learn more from whitepaper

3. Yellowpaper

The NULS yellowpaper is the technical detailed version of the whitepaper, which drills down into the underlying aspects of NULS.

Learn more from Yellowpaper

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/joinCCC.html b/docs/.vuepress/dist/learn/joinCCC.html new file mode 100644 index 00000000..bd0ba877 --- /dev/null +++ b/docs/.vuepress/dist/learn/joinCCC.html @@ -0,0 +1,38 @@ + + + + + + Invitation of community developers | NULS + + + + + + + +

Invitation of community developers

1. Introduction

NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology.

NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration.

In the community, we adhere to the following vision:

  • Equal: Members from both the technical community and the core dev team are equal and they shall work together.
  • Synergetic: The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem.
  • Sharing: +
    • Technical achievements of NULS are shared with the community;
    • Development bonuses of NULS are shared with the community;
    • The influence and brand of NULS are shared with the community;
    • Technical innovation of NULS is shared with the whole industry;
  • All the industrial standards set by NULS are shared with the whole industry.
  • Fair: Reward for each developer is based on his/her contribution.
  • Innovative: A strong technical community is the guarantee for the innovation in the blockchain field.

2. Are you the one?

NULS technical community is open for all developers. +If you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us:

Please join the NULS dev Telegram group: +https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ

Notice: We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground!

3. What are we offering?

The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution. +Currently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool. +Note: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well.

4. Our plan

Make it easy to build a blockchain!

First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life. +The NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository.

Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months. +For all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives.

Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more!

5. Current situation of the technical community

A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently. +B. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests.

6. How to join us

  1. For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group.
  2. Talk to our community developer Moshe. Briefly introduce your experience, background, etc. +Community developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future.

We also strongly recommend you to learn more about NULS through these links below:

  1. You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool:

https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh

  1. In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward.

7. Refer to task list

https://nuls.community/d/9-invitation-of-community-developers/4 (Continuously updated)

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/structure.html b/docs/.vuepress/dist/learn/structure.html new file mode 100644 index 00000000..22cfbd09 --- /dev/null +++ b/docs/.vuepress/dist/learn/structure.html @@ -0,0 +1,21 @@ + + + + + + Documentation structure | NULS + + + + + + + +

Documentation structure

This documentation consists of eight sections.

This section can help readers unfamiliar with NULS understand what NULS is and what can be done

If you are a beginner, here is what you need.

Blockchain projects are always community-based, and here you can learn about all aspects of the NULS community

Launch NULS to see what NULS can do, what different experiences NULS can bring to you

If you want to build a private chain, this section should help you

What is the modular design? What is NULS2.0? This section will answer these questions one by one. It elaborates on the design concept of NULS and the design details of each module

Do you want to develop DAPPs or do other cool things based on smart contracts? This section is what you want. It includes developer documents, NRC standards, plug-ins, and some interesting contract examples.

NULS has always been developer-friendly, and we continue to provide tools for developers. Developers can come here to see what they are.

All related proposals of NULS are here, where you can learn more about NULS's protocals, regulations ,standards and etc.

The NULS documentation portal is only a part of NULS. For more information and products about NULS Blockchain, you can find the access here.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/toolsGuide.html b/docs/.vuepress/dist/learn/toolsGuide.html new file mode 100644 index 00000000..81129840 --- /dev/null +++ b/docs/.vuepress/dist/learn/toolsGuide.html @@ -0,0 +1,29 @@ + + + + + + Guide to Community Vote | NULS + + + + + + + +

Guide to Community Vote

1 Voting

If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list.

1542526165310

Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded.

1542526178695

If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote.

The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B.

The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N.

Each option in the voting details page is clickable to show the current or final distribution of votes.

2 Changing and Updating Your Vote

As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission.

1542526190286

There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type.

1542526202833

3 Checking My Votes

In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow.

1542526213174

If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules.

4 Creating A Community Vote

In the voting list, click “Create Voting" to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee.

In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked.

1542526223816

When creating a community vote, please fill in the item contents carefully. Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed.

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/learn/webGuide.html b/docs/.vuepress/dist/learn/webGuide.html new file mode 100644 index 00000000..8d38a93e --- /dev/null +++ b/docs/.vuepress/dist/learn/webGuide.html @@ -0,0 +1,21 @@ + + + + + + Light wallet user guide | NULS + + + + + + + +

Light wallet user guide

Community members are writing...

Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/nips/NIP-1.html b/docs/.vuepress/dist/nips/NIP-1.html new file mode 100644 index 00000000..6f832dd2 --- /dev/null +++ b/docs/.vuepress/dist/nips/NIP-1.html @@ -0,0 +1,38 @@ + + + + + + NIP-1 NIP Purpose and Guidelines | NULS + + + + + + + +

NIP-1 NIP Purpose and Guidelines

NIP: 1
+Title: NIP Purpose and Guidelines
+Status: Last call
+Type: Process
+Author: Lin Yang <lin@nuls.io>
+Created: 2018-12-27
+

What is a NIP?

NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.

Reasons for NIP

  • We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.
  • For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.

NIP Types

There are six types of NIP:

  • A Core NIP describes improvements in the NULS core code, such as consensus mechanisms, network protocols, etc.
  • A Module NIP describes improvements in module submission and review requirements, such as the certain minimum criteria a NIP must meet to be accepted and merged into the module repository.
  • An Interface NIP describes improvements in the specifications and standards of the NULS client API/RPC, such as API name and method name.
  • An NRC Standards NIP describes improvements in application-level standards, such as contract standards, token standards, etc.
  • An Informational NIP describes a NULS design issue or provides general guidelines or information to the NULS community--but does not propose a new feature. Informational NIPs do not necessarily represent a NULS community consensus or recommendation, so users and implementers are free to ignore Informational NIPs or follow their advice.
  • A Process NIP describes improvements in all NULS-related operational processes, such as the ambassador election in the community. A Process NIP is not only a recommendation, but also a specification that community members need to follow to accomplish certain things, but it does not involve code-level specifications.

NIP Work Flow

The parties involved in the workflow include some or all of the following roles:

  • Most members of the community

    The main responsibility is to participate in the discussion and voting of the NIPs, making constructive comments as well.

  • NIP Authors

    Propose and improve NIPs and lead the community to discuss.

  • NIP Editors

    Manage and edit NIPs.

  • NULS Council

    The NIPs, about to “Final” or “Accepted”, can be rejected by the final decision of the Council via internal voting.

  • NULS Core Developers

    They are responsible for the audit and code implementation of the Core, Module, NRC Standards and Interface NIPs.

Vetting an idea publicly before going as far as writing a NIP is meant to save your time. Asking the community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions. It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where NULS is used. We recommend that comments can be collected in the community via voting, and the results will also help the NIP editors to make quicker decisions on whether to merge the NIP.

A successful NIP requires the following stages:

  [ Draft ]->[ Last Call ]->[ Accepted ]->[ Final ]
+

Each change to the NIP status should be submitted by the NIP author as a pull request (PR), and the NIP editors will review the NIP. It's a good idea to add a link to the discussion post when you submit a PR.

A complete NIP process is as follows:

  • The NIP author writes the NIP using the mandated format and style and shepherds the discussions in the community. The NIP author should first attempt to ascertain whether the idea is NIP-able, and then submit the NIP as a PR to the NIP repository, including a link to the discussion post. The NIP editors will handle these requests based on actual situation.

    • Draft: Once approved, the NIP editors will assign the NIP a number and squash commit the pull request onto master. The NIP editors will not unreasonably deny a NIP.
    • Draft: Reasons for denying NIP status include being unfocused or too broad, duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the NULS philosophy.
  • Updates to drafts may also be submitted by the author as pull requests before it can be considered mature enough and ready for the next status.

    • Last call: Once approved, the NIP editors will change the NIP status from Draft to last call and set the end date for the last call, usually 15 days.
    • Last call: Once the NIP has been published, it will be re-assigned to Draft status when necessary revisions are made on the NIP. We hope that a NIP will enter last call status only once to avoid unnecessary controversy in the community.
  • The NIP in last call status will be pinned at https://nuls.community/

    • Accepted (involved in Core, Module, NRC Standards and Interface NIPs only): If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Accepted” by the NIP editors.
    • Final (involved in Informational and Process NIPs only): If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Final” by the NIP editors.
    • Last call: The NIP will be re-assigned to Draft status if there are material changes or technical issues raised by the community cannot be solved during the last call period. In addition, if the Council has different views on the NIP, a vote can be initiated within the Council members. If more than 70% of the Council members reject the NIP (giving reasons), the NIP will be re-assigned to “Draft” status or directly “Rejected” according to actual reasons.
  • Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the NULS core developers must implement the NIPs in the form of code before they can be considered “Final”.

    • Final (involved in Core, Module, NRC Standards and Interface NIPs only): After the NIP is implemented in the form of code, and is running on the main-net stably for certain amount of time or has become effectively verified, with changes recognized by the community as well, the status can be changed to "Final".

Other exceptional statuses are:

  • Deferred: Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the developers do not complete the reference implementation as scheduled.
  • Rejected: A NIP can also be “Rejected”. Perhaps core developers reject to propose an implementation or the Council finds it unfeasible.
  • Superseded: A NIP used to “Final”, but it is no longer considered the most advanced. Another better NIP appears, referring to this NIP, and becomes the Final status.

What belongs in a successful NIP?

Each NIP should have the following parts:

  • Preamble: RFC 822 style headers containing meta-data about the NIP, including the NIP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. See NIP Header Preamble for details.
  • Summary: The NIP author needs to provide a simple and understandable summary of the NIP for the general public. If you can't explain it in a simple way, it means that you don't fully understand it.
  • Abstract:  A short (~200 word) description of the technical issue being addressed.
  • Motivation: The motivation is critical for NIPs that want to change the NULS protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the NIP solves. NIP submissions without sufficient motivation may be rejected outright.
  • Specification: The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current NULS platforms (NULS client, explorer).
  • Rationale: The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion.
  • Backwards Compatibility: All NIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The NIP must explain how the author proposes to deal with these incompatibilities. NIP submissions without a sufficient backwards compatibility treatise may be rejected outright.
  • Test Cases: For NIPs that affect the consensus mechanism, test cases for their implementation must be provided.
  • Reference Implementation: The reference implementation must be completed before any NIP is given status "Final", but it need not be completed before the NIP is accepted.
  • History: History records show the whole process of the NIP from being proposed to the Final state, which can be displayed as additional links.

NIP Formats and Templates

NIP should be written in markdown format.

NIP Header Preamble

Each NIP must use the RFC 822 style as the head of the document. The headers must be arranged in the following order. The headers marked with * are optional, others are required.

  Title: < NIP title>
+  Author: <list of authors' real names and optionally, email addrs>
+* Discussions-To: < links to official discussion channels>
+  Status: <Draft | Accepted | Final | Superseded | Deferred | Rejected>
+  Type: <Core | Module | Interface | NRC Standards | Informational | Process>
+  Created: <date created on, in ISO 8601 (yyyy-mm-dd) format>
+* Replaces: < NIP number>
+* Superseded-By: < NIP number>
+

Auxiliary Files

NIPs may include auxiliary files such as diagrams. Auxiliary files must be named NIP-XXXX-Y.ext, where "XXXX" is the NIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png").

Transferring NIP Ownership

It occasionally becomes necessary to transfer ownership of NIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred NIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the NIP process or has fallen off the face of the 'net' (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the NIP. We try to build consensus around a NIP, but if that's not possible, you can always submit a competing NIP.

If you are interested in assuming ownership of a NIP, send a message asking to take over, addressed to both the original author and the NIP editors. If the original author doesn't respond to email in a timely manner, the NIP editors will make a unilateral decision (it's not like such decisions can't be reversed).

NIP Editors

The current NIP editors are:

Niels <Niels@nuls.io>
+Pen <Pen@nuls.io>
+

NIP Editor Responsibilities

For each new NIP that comes in an editor does the following:

  • Read the NIP to check if it is ready: sound and complete. The ideas in the NIP must make technical sense, even if they don’t seem likely to be accepted.
  • The title should accurately describe the content.
  • Skim the NIP for obvious defects in language (spelling, grammar, sentence structure, etc.), markup (for Github style), and code style.

If the NIP isn't ready, an editor will send it back to the author for revision, with specific instructions. Once the NIP is ready for the repository, a NIP editor will:

  • Assign a NIP number (usually a PR number)
  • Merge the pull request
  • Send email back to the NIP author with next steps

Many NIPs are written and maintained by developers with write access to the NULS codebase. The NIP editors monitor NIP changes, and correct any structure, grammar, spelling, or markup mistakes they see. NIP editors don't pass judgment on NIPs. They merely do the administrative and editorial part.

History

This document was derived heavily from Bitcoin's Bitcoin's BIP-0001, written by Amir Taake, and the text he wrote was mainly from Python's PEP-0001. According to this situation, NIP makes some modifications based on their documents, such as adding the Council in the NIP process, modifying NIP types, etc. Please direct all comments to the NULS NIP editors.

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/nips/NIP-2.html b/docs/.vuepress/dist/nips/NIP-2.html new file mode 100644 index 00000000..7b7e4f2b --- /dev/null +++ b/docs/.vuepress/dist/nips/NIP-2.html @@ -0,0 +1,28 @@ + + + + + + NIP-2 NULS Community Constitution | NULS + + + + + + + +

NIP-2 NULS Community Constitution

  NIP: 2
+  Title: NULS Community Constitution
+  Author: Reaper Ran <reaper@nuls.io>
+  Discussions-To: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207
+  Status: Last call
+  Type: Process
+  Created: 2018-12-28
+

Preamble

Due to the development requirement of NULS and to better facilitate the favorable operation of the NULS community and to make blockchain technology easier with NULS, the NULS community will constantly seek and implement NULS community autonomy for the realization of self-governance and self-evolution. This Constitution is hereby formulated based on the NULS community culture and philosophy.

NULS community culture: openness, freedom, autonomy, evolution

NULS community philosophy: share, inherit, grow, innovate

The following rules will be based on the NULS development consensus governance module. The Council members and Ambassadors will be appointed by a vote within the NULS core team before consensus governance module is set in motion.

NULS Foundation

December 2018

Abstract

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

Motivation

In order to build a good community operation mechanism, promote community autonomy, and promote the NULS project to enable the community to evolve and drive independently.

Specification

The following is a specification of the NULS Community Constitution.

NULS Community Constitution

I. NULS Community Profile

NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts.

NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders.

II. NULS Foundation

NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology.

(I) Objectives of NULS Foundation

Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to:

  1. Code writing
  2. Applications development
  3. Operation and promotion
  4. Other actions in favor of NULS community ecology development

(II) Source of NULS Foundation

20,000,000 NULS from the NULS and entrusted revenues from the contributors.

(III) Management of NULS Foundation

The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain.

III. Council members

(I) Introduction to Council members

As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step.

(II) Appointment of Council members

The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers (developer council member) elected based on a ballot participated by all developers; and 7 members elected by ballot within the community (standing council member). The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members.

  1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address.
  2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members.
  3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system.
  4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again.

(III) Rights and responsibilities of Council member

  1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types:

    (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role.

  • Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role.

    (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid.

  • Adjustment of lower node agency commission.

  • Adjustment of transfer commission.

  • Adjustment of contract call commission.

  • Adjustment of Council member proposal commission.

  • Adjustment of adjustable system parameter in other systems.

    (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid.

  • Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role.

  • Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified.

  • Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer.

  • Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC.

  1. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type.
  2. Responsibilities of Council member.
  • Council member shall communicate with the community in good time.

  • Act in strict accordance with the community’s Constitution.

  • Share the same vision and purpose with NULS.

  • Take it as its own mission to protect community members’ interests.

Note: All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.

IV. CODE CRAFT COUNCIL (CCC)

(I) Introduction to the CCC

The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team.

(II) Philosophy of the CCC

We stick to the following philosophy in the technology community:

  1. Equal: the technology community and core team are equal and work together for joint development.

  2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together.

  3. Sharing:

  • The whole community shares the achievements of NULS technology.

  • The whole community shares the development dividend of NULS.

  • The whole community shares NULS’s influence and reputation.

  • The industry shares the technical innovation brought by NULS.

  • The industry shares NULS’s standard establishment to promote industry development.

  1. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice.

  2. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain.

(III) Appointment of the CCC member

The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally).

The process of joining CCC is:

  1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language.
  2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other.
  3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community.
  4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved.

(IV) Rights and responsibilities of the CCC member

  1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life.

  2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository.

  3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced.

  4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community.

  5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress.

V. Contributor

(I) Contributor for campaign

Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at nuls.community.

(II) Permanent contributor

Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management.

VI. Project Budget

(I) With respect to contributor

Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed.

(II) With respect to other transaction funds

The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned.

VII. Other votes

(I) Start a vote

  1. The Council member shall start a vote and only the transaction fee is required.

  2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee.

(II) Vote by proxy

  • Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her.

  • Any NULS user can be an agent.

  • Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right.

  • The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress).

VIII. Feedback

We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs:

NULS community website: https://nuls.community

Feedback post: https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/nips/NIP-3.html b/docs/.vuepress/dist/nips/NIP-3.html new file mode 100644 index 00000000..275c4550 --- /dev/null +++ b/docs/.vuepress/dist/nips/NIP-3.html @@ -0,0 +1,28 @@ + + + + + + NIP-3 Community Fund Management and Use of Process | NULS + + + + + + + +

NIP-3 Community Fund Management and Use of Process

  NIP: 3
+  Title: Community Fund Management and Use of Process
+  Author: Reaper Ran <reaper@nuls.io>
+  Discussions-To: https://nuls.community/d/262-community-fund-management-and-use-of-process-discussion-draft-ngc20181221
+  Status: Last call
+  Type: Process
+  Created: 2018-12-28
+

Abstract

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Motivation

In order to enable the community to have more talents to join, community funds are opened to the community for joint management and use.

Specification

The following is a specification of the Community Fund Management and Use of Process.

Community Fund Management and Use of Process

img

I. Community Fund Management

According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community.

Community Fund Account Address:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account.

The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%.

Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.

**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei **

II. The Application Member

1. Ordinary Members

All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days.

2. Contributor Role

Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process. The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days.

III. The Type of Application

1. Proposal to Pay Funds

The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS.

2. Proposal Budget Item

The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS.

3. The Proposal to Create a Node

Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS.

4. Proposal Entrusted Funds

Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS.

IV. The Application Process

1. The Plan is Openly and Thoroughly Discussed

(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community;

(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community;

(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds;

(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained;

(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates;

(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner;

(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner;

(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals;

2. Council Member Proposal

(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote;

(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem;

(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process;

(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles.

3. Foundation Implementation Proposal

(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations;

(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04).

V. Process Explanation

All community discussion suggestions are made at nuls.community .

This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities.

Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP.

The specific node generates revenue with reference to the NULS POC consensus mechanism.

Attachment: Current Contributor Role Delegation and Node:

Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC Members

Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck’s staking – Same as above

Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe’s staking – Same as above

Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/nips/NIP-4.html b/docs/.vuepress/dist/nips/NIP-4.html new file mode 100644 index 00000000..fbcc3b18 --- /dev/null +++ b/docs/.vuepress/dist/nips/NIP-4.html @@ -0,0 +1,28 @@ + + + + + + NIP-4 Ambassadors participate in the election rules | NULS + + + + + + + +

NIP-4 Ambassadors participate in the election rules

  NIP: 4
+  Title: Ambassadors participate in the election rules
+  Author: Reaper Ran <reaper@nuls.io>   Penny <penny@nuls.io>
+  Discussions-To: https://nuls.community/d/206-ambassadors-participate-in-the-election-rules-ncg-20181114
+  Status: Last call
+  Type: Process
+  Created: 2019-2-15
+

Abstract

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

Motivation

During the period between September to November 2018, we have had 9 ambassadors who have actively worked within the NULS Community to attract more members and developers. Once smart contracts are launched on the NULS main-net, there will be a community voting tool. Appointments of the ambassadors should be decided by the community. During this time, community members have given many suggestions, so we have set up some new detailed campaigning rules for the ambassadors. This will be the first step toward community autonomy, which is an important goal for NULS. It requires many fundamental tools, as well as the support from everyone in the community.

Specification

The following is a specification of the Ambassadors participate in the election rules.

Ambassadors participate in the election rules

1. Introduction of NULS Ambassadors

The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador.

The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly.

The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month.

If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum.

Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors).

The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter.

2. Duties and Compensation for NULS Ambassadors

a. A candidate for the NULS ambassador is required to create a NULS node.

b. Identify with the NULS concepts of values, understand the core knowledge of NULS and respect the members of the NULS community. The election cycle is quarterly and requires a full 3 month commitment. Consider this commitment before running for election. Ambassadors are expected to meet the full term of the quarterly commitment.

c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected.

d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month.

e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months.

f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund.

g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute.

h. Half of all rewards of the ambassador's nodes are rewarded to ambassador(for he need to pay the node server cost and he shall get the rewards of 20,000 NULS he is staking on this nodes). And the other half must be used as development fund of ambassador for community development.

i.About the resignation of ambassador, if the ambassador is voluntarily resigned or subject to recall by the community, please ambassador return the remaining development fund of ambassador to the community fund.

j.The ambassador is a community contributor. If you need to initiate other community fund applications, please carry them out based on the community fund use and management process.

3. How to participate in the election

a. Publish the work report for the previous month and the work plan for the next month:

Please post on the NULS forum: https://community.nuls.world/t/elections

b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign!

c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node.

Final Tribute to your efforts:

• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you.

• Start your work of community-building and outreach!

• Help NULS dock more DApps!

• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum.

For all ambassador related discussions, please post on the NULS forum at https://community.nuls.world/t/elections

Welcome to the NULS community! Let’s work together to create a brighter future for NULS!

If you can deliver more, we have these expectations of you:

1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;

2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;

3. Share the story of NULS to the community;

4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;

6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;

7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;

8. Help NULS with publicity and be committed to NULS press releases through your local media.

Ambassador Guide

Preface

Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of:

  • Transparency
  • Freedom
  • Autonomy
  • Evolution

The vision of the NULS project is based on the following mission

  • Making blockchain technology easy and simple
  • Breaking through the bottleneck of blockchain performance and adoption
  • Reducing the cost of using blockchain technology
  • Increasing security and reliability of data

NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem.

As an Ambassador of NULS, you will obtain

  1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data.
  2. Rewards produced by one node. Rewards are used to develop the local NULS community.
  3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS.
  4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect.

As an Ambassador of NULS, Your Mission is

A. Community Development

  1. Let others know about NULS via Internet or offline communications.
  2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS.
  3. Share the development from other areas of the NULS community with your local community.
  4. Continuously share the progress, planning, news, etc. of the NULS project to the local community.
  5. Contact local media and forums to help NULS publicize presentations or news.
  6. Share the story of NULS with the local community.
  7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles.
  8. Share videos or other content produced by the team in the local language of the people in your country/region.
  9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs.
  10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps.

B. Community Activities

  1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS.
  2. Participate in any possible cryptocurrency gatherings in your area and represent NULS.
  3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS.
  4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities.
  5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title.

Get Started With Everything You Need Here

  1. NULS Ambassador Board ([Click to enter]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts.
  2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc.
  3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board.
  4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible.
  5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you.
  6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues.
  7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/).
  8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum nuls.community.

Recruit Volunteers to Organize Local Communities

  1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS.
  2. Organize some offline meet-ups.
  3. Introduce more blockchain investors to NULS and guide them towards investing in NULS.
  4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community.

Develop a Local NULS Ecology

  1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team.
  2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS.
  3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS.

Spread the Concepts and Features of NULS Technology with Local Communities

  1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants.
  2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news.
  3. Use local mainstream media websites to spread the news and progress of NULS.

NULStar Guidelines And Duties

  • Requirements for becoming a NULStar
  1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action.
  2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project.
  3. Must live in a city with over 350k population.
  • Duties of a NULStar
  1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar.
  2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events.
  • Rewards for NULStars
  1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador.
  2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region.
Last Updated: 2/19/2019, 10:38:50 AM
+ + + diff --git a/docs/.vuepress/dist/nips/NIPIntroduction.html b/docs/.vuepress/dist/nips/NIPIntroduction.html new file mode 100644 index 00000000..8b07e301 --- /dev/null +++ b/docs/.vuepress/dist/nips/NIPIntroduction.html @@ -0,0 +1,21 @@ + + + + + + NIP introduction | NULS + + + + + + + +

NIP introduction

What is NIP?

NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions.

Reasons for NIP

  • We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal.

  • For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library.

Get all the NIP

All NIP files are available through NULS's github:https://github.com/nuls-io/NIPs

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/nulsNav/NULSNav.html b/docs/.vuepress/dist/nulsNav/NULSNav.html new file mode 100644 index 00000000..b090aa4b --- /dev/null +++ b/docs/.vuepress/dist/nulsNav/NULSNav.html @@ -0,0 +1,21 @@ + + + + + + NULS Portal | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/overview/howToContribute.html b/docs/.vuepress/dist/overview/howToContribute.html new file mode 100644 index 00000000..fd07e221 --- /dev/null +++ b/docs/.vuepress/dist/overview/howToContribute.html @@ -0,0 +1,21 @@ + + + + + + How to contribute | NULS + + + + + + + +

How to contribute

The development of NULS is inseparable from the community and requires the participation of community members. We provide different ways for community members to participate, and you can choose what you are good at to contribute to NULS. For each contributor, the name of the contributor is published with its consent (we also attach the node name if the node is owned)

Join the Mainnet development

Although the main network is now in a stable state of operation, in order to cope with changes, the development of the main network is still in progress. We need the help of the community to solve the challenges in the development of the main network and improve the NULS blockchain infrastructure together. We urge developers in the community to join us and contribute, and your efforts will be rewarded.

Report bugs

In the software development process, although there are strict tests, we still can't avoid bugs in the program. So if you find bugs in the process of using our application or developing, please timely feedback to us, and we will actively deal with them. There are three ways to feed back bugs:

  • Feedback through community forum

    • Mainnet:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs
    • Testnet:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs
  • Send email to support@nuls.io

  • Direct feedback to the community manager or operations staff

Write document

NULS formulated the document writing incentive plan, invited the community to write NULS related documents together, and gave corresponding rewards according to the efforts of community members.

Translate document

As a global open source blockchain project, NULS needs a lot of bilingual documents in Chinese and English. If you are a professional in this field, we really need your help.

List of contributors

The rankings are arranged alphabetically, in no particular order

Name Email Node Alias/ID
Angang Tang tangangang@nuls.io --
Albert albert@nuls.io --
Charlie Li lichao@nuls.io ---
Cody Lan lanjinsheng@nuls.io ---
Davi Yang davi@nuls.io ---
Yuanchen Jiang jiangyuanchen@nuls.io ---
Yifeng Qin qinyifeng@nuls.io --
Niels niels@nuls.io niels
Pierre Luo luohao@nuls.io ---
Pen Luo pen@nuls.io ---
Siwei 13809668344@139.com siwei
Vivi Zhou zhouwei@nuls.io ---
Last Updated: 1/25/2019, 1:51:56 PM
+ + + diff --git a/docs/.vuepress/dist/overview/introduction.html b/docs/.vuepress/dist/overview/introduction.html new file mode 100644 index 00000000..a93654b9 --- /dev/null +++ b/docs/.vuepress/dist/overview/introduction.html @@ -0,0 +1,21 @@ + + + + + + What is NULS | NULS + + + + + + + +

What is NULS

NULS is a blockchain infrastructure for customizable services, driven by our global open-source community.

Following the principles of pluggability, modularization and parallel expansion, NULS provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and usage, and to promote the application of blockchain in the commercial field and the interaction among chains

Upholding the "chain" as the core in the NULS development philosophy, NULS is striving for building its core product: "Chain Factory". In the meantime, NULS will realize the value circulation among chains through cross-chain module and build the ecosystem of blockchains.

1. Our Mission

  • Provide flexible blockchain technology that supports a wide variety of enterprise applications
  • Efficient, high performance technology to solve bottlenecks
  • Promote usage of blockchain technology by reducing the barrier of entry development cost
  • Provide the most powerful system of trust through a decentralized network

2. Whitepaper

The NULS whitepaper is an authoritative report that addresses what NULS’ goal is and how we plan to achieve it.

Learn more from whitepaper

3. Yellowpaper

The NULS yellowpaper is the technical detailed version of the whitepaper, which drills down into the underlying aspects of NULS.

Learn more from Yellowpaper

Last Updated: 1/11/2019, 2:41:41 PM
+ + + diff --git a/docs/.vuepress/dist/overview/structure.html b/docs/.vuepress/dist/overview/structure.html new file mode 100644 index 00000000..d79f9ab4 --- /dev/null +++ b/docs/.vuepress/dist/overview/structure.html @@ -0,0 +1,21 @@ + + + + + + Documentation structure | NULS + + + + + + + +

Documentation structure

This documentation consists of eight sections.

This section can help readers unfamiliar with NULS understand what NULS is and what can be done

If you are a beginner, here is what you need.

Blockchain projects are always community-based, and here you can learn about all aspects of the NULS community

Launch NULS to see what NULS can do, what different experiences NULS can bring to you

If you want to build a private chain, this section should help you

What is the modular design? What is NULS2.0? This section will answer these questions one by one. It elaborates on the design concept of NULS and the design details of each module

Do you want to develop DAPPs or do other cool things based on smart contracts? This section is what you want. It includes developer documents, NRC standards, plug-ins, and some interesting contract examples.

NULS has always been developer-friendly, and we continue to provide tools for developers. Developers can come here to see what they are.

All related proposals of NULS are here, where you can learn more about NULS's protocals, regulations ,standards and etc.

The NULS documentation portal is only a part of NULS. For more information and products about NULS Blockchain, you can find the access here.

Last Updated: 3/26/2019, 10:50:05 AM
+ + + diff --git a/docs/.vuepress/dist/smartContract/GUIForSmartContract.html b/docs/.vuepress/dist/smartContract/GUIForSmartContract.html new file mode 100644 index 00000000..842f7c89 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/GUIForSmartContract.html @@ -0,0 +1,24 @@ + + + + + + User Document of Wallet Smart Contract | NULS + + + + + + + +

User Document of Wallet Smart Contract

Deploy contract

1 Start wallet, click [contract] and then click [deploy contract] tab page

deploy

2 Insert Hex code of contract in textbox

3 Insert contract construction function parameter, and note the required item and value type. If not, it will fail the table verification.

deploy

4 Click [advanced option] to alter default value of GasLimit and GasPrice. Other additional information can be inserted too. Such filed must be required. (Optional step)

deploy

5 After filling out, click [test contract]. Wallet will conduct a trial deployment for this contract to verify contract legality.

deploy

6 After passing this test, click [deploy contract]. In case of password, insert password, and then click [confirm]. If no password, click [confirm]. Then, the system will go to [my contracts] page on which the confirmation progress of deployed contract can be reviewed.

Review the confirmation progress of deployed contract.

deploy

7 After confirmation completion

  • Click [to call] on the right of table to go to [call contract] page

  • Click contract address to access to contract overview page

Review contract

1 Start wallet, click [contract] and click [review contract] tab page

access

2 Insert legal contract address in box, and click [access], showing a panel below it

  • Click [pull-down list] in the panel to select the contract method to call
  • Click star mark beside the contract address to collect this contract to the list of my contracts

access

3 Have two cases after selecting a method

  • If read-only method, click [call], get the deployment results after network requests met

    access

  • If readable method (to be linked), click advanced option to alter default value of GasLimit and GasPrice. After clicking [call], generate a transaction, which will consume nuls. Therefore, in case of account password, insert your password. After transaction confirmation, feedback the results.

    View smart contract fee details

    Transaction on calling contract under confirmation

    access

    Transaction on calling contract confirmed

    access

4 If calling linking method, click TxID in panel, to review the details of this transaction to call contract

access

Details of this transaction to call contract

access

My contracts

1 List of my contracts displays the created and collected contracts

access

  • Click contract address to access to contract overview page

    access

  • Click [to call] to access to the [call contract] page

    access

  • Click [cancel collection] to remove this contract from the list of [my contracts]

3 [Transaction records] display the transactions in this contract. Click TxID to review the details about this transaction.

access

4 [Contract details] display all methods of this contract, corresponding parameters and returned value type.

access

5 If the contract is created by current account, click [delete] on the top right of contract overview to delete this contract. After that, contract details are also available, but the method of contract cannot be called.

access

Account multiple assets

After releasing Token via smart contract or transferring in different kinds of Token from other accounts, the account have multiple assets.

1 Access to wallet, to review all kinds of assets under this account address.

access

2 Click [transfer] to access to transfer interface of this kind of asset, insert payee address and transfer amount, to finish transfer of such asset.

access

3 Click [transaction records] to access to transaction records page of this kind of asset

access

4 Click [pull-down list] on [transaction records] page to switch among transaction records of different kinds of assets.

access

5 Click TxID to review the details of this transaction.


Hex coding of NRC-20 Token

504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000
+
+
+
Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/NRC-20TokenStandard.html b/docs/.vuepress/dist/smartContract/NRC-20TokenStandard.html new file mode 100644 index 00000000..7ce15d77 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/NRC-20TokenStandard.html @@ -0,0 +1,42 @@ + + + + + + NRC-20 Token Standard | NULS + + + + + + + +

NRC-20 Token Standard

Simple Summary

A standard interface for tokens.

Abstract

The following standard allows for the implementation of a standard API for tokens within smart contracts. +This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party.

Motivation

A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges.

Specification

Token

Methods

NOTE: Callers MUST handle false from return boolean. Callers MUST NOT assume that false is never returned!

name

Returns the name of the token - e.g. "MyToken".

@View
+public String name();
+

symbol

Returns the symbol of the token. E.g. "MT".

@View
+public String symbol();
+

decimals

Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

@View
+public int decimals();
+

totalSupply

Returns the total token supply.

@View
+public BigInteger totalSupply();
+

balanceOf

Returns the account balance of another account with address owner.

@View
+public BigInteger balanceOf(@Required Address owner);
+

transfer

Transfers value amount of tokens to address to, and MUST fire the TransferEvent event. +The function SHOULD revert if the from account balance does not have enough tokens to spend.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transfer(@Required Address to, @Required BigInteger value);
+

transferFrom

Transfers value amount of tokens from address from to address to, and MUST fire the TransferEvent event.

The transferFrom method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. +This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. +The function SHOULD revert unless the from account has deliberately authorized the sender of the message via some mechanism, such as calling approve(@Required Address spender, @Required BigInteger value).

Note Transfers of 0 values MUST be treated as normal transfers and fire the TransferEvent event.

public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value);
+

approve

Allows spender to withdraw from your account multiple times, up to the value amount. If this function is called again it overwrites the current allowance with value.

public boolean approve(@Required Address spender, @Required BigInteger value);
+

allowance

Returns the amount which spender is still allowed to withdraw from owner.

@View
+public BigInteger allowance(@Required Address owner, @Required Address spender);
+

Events

TransferEvent

MUST trigger when tokens are transferred, including zero value transfers.

A token contract which creates new tokens SHOULD trigger a Transfer event with the from address set to null when tokens are created.

public TransferEvent(Address from, @Required Address to, @Required BigInteger value)
+

ApprovalEvent

MUST trigger on any successful call to approve(@Required Address spender, @Required BigInteger value).

public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value)
+

Implementation

Example implementations are available at

  • https://github.com/nuls-io/nuls-nrc20
Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/developerManual.html b/docs/.vuepress/dist/smartContract/developerManual.html new file mode 100644 index 00000000..f60fff92 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/developerManual.html @@ -0,0 +1,788 @@ + + + + + + Smart Contract Development Manual | NULS + + + + + + + +

Smart Contract Development Manual

1. Introduction

NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3.

2. Development environment

2.1 Setup of NULS wallet

2.2 Setup of JDK 8

2.3 Setup of IntelliJ IDEA

NULS smart contract adopts IntelliJ IDEA as development tool

2.4 Setup of NULS smart contract plug-ins

Click to download the plugin

NULS smart contract plug-ins provide the following main functions:

  • Newly create NULS contract project
  • Provide the unavailable Java properties, classes ad methods
  • Compile, package and deploy contracts
  • Display and call contract methods

3. NULS smart contract specifications and syntax

NULS smart contract syntax is a subset of Java syntax, with some restrictions

3.1 NULS smart contract specifications

Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract.

3.2 Keywords

Java key words are listed as follows and those not applicable for NULS smart contract will be marked

Access control

  • public
  • protected
  • private

Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class

  • class
  • interface
  • abstract
  • implements
  • extends
  • new

Key words of package

  • import
  • package

Key words of data type

  • byte
  • char
  • boolean
  • short
  • int
  • float
  • long
  • double
  • void
  • null
  • true
  • false

Conditional loops (process control)

  • if
  • else
  • while
  • for
  • switch
  • case
  • default
  • do
  • break
  • continue
  • return
  • instanceof

Error processing

  • catch
  • try
  • finally
  • throw
  • throws

Modification method, class, property and variables

  • static
  • final
  • super
  • this
  • native(not supported)
  • strictfp(not supported)
  • synchronized(not supported)
  • transient(not supported)
  • volatile(not supported)

other

  • enum(not supported)
  • assert(not supported)

3.3 Basic syntax

The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java

  • Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign
  • Basic data type: byte short int long float double char boolean
  • Reference data type: class, interface, array
  • Arithmetic operators: + - * /%++ -
  • Relational operator: > <> = <= ==! =
  • Logical Operators: ! &| ^ && ||
  • Bit operator: &| ^~>> << >>>
  • Assignment operator: =
  • Extension assignment operators: + = - = * = / =
  • String link operator: +
  • Conditional operators: ? :
  • Process control sentence (if, switch, for, while, do...while)

3.4 Available class

NULS smart contract can be developed with the following class

  • io.nuls.contract.sdk.Address
  • io.nuls.contract.sdk.Block
  • io.nuls.contract.sdk.BlockHeader
  • io.nuls.contract.sdk.Contract
  • io.nuls.contract.sdk.Event
  • io.nuls.contract.sdk.Msg
  • io.nuls.contract.sdk.Utils
  • io.nuls.contract.sdk.annotation.View
  • io.nuls.contract.sdk.annotation.Required
  • io.nuls.contract.sdk.annotation.Payable
  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Short
  • java.lang.Character
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Float
  • java.lang.Double
  • java.lang.String
  • java.lang.StringBuilder
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.util.Collection
  • java.util.List
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Map
  • java.util.HashMap
  • java.util.LinkedHashMap
  • java.util.Set
  • java.util.HashSet

3.5 Other restrictions

  • Contract class can have one construction method. No restriction for other classes
  • The maximum gas consumption for executing a contract method once is 10 million, including the method of the @View type, Make sure to optimize the contract code as much as possible.

4. Nuls smart contract example

a simple contract

Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract


+package contracts.examples;
+
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+public class SimpleStorage implements Contract {
+
+    private String storedData;
+
+    @View
+    public String getStoredData() {
+        return storedData;
+    }
+
+    @Payable
+    public void setStoredData(@Required String storedData) {
+        this.storedData = storedData;
+    }
+
+}
+

In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details +The project has several classes and interfaces

When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class

After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status

Explanatory comments

@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Required labels the parameter of @Required. When it is called, there must be transfer-in value

Go to download NULS source code on github, and get some contract examples

5. NULS Contract SDK

Contract SDK provides several classes to be convenient for contract development:

io.nuls.contract.sdk.Address

public class Address {
+
+    private final String address;
+
+    public Address(String address) {
+        valid(address);
+        this.address = address;
+    }
+
+    /**
+     * Get the balance of the address (only the balance of contract address)
+     *
+     * @return
+     */
+    public native BigInteger balance();
+
+    /**
+     * Transfer amount to the address from contract 
+     *
+     * @param value transfer amount (in Na)
+     */
+    public native void transfer(BigInteger value);
+
+    /**
+     * Contract method to call the address
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     */
+    public native void call(String methodName, String methodDesc, String[][] args, BigInteger value);
+
+	/**
+     * Call the contract method of this address with a return value(String)
+     *
+     * @param Method name
+     * @param Method signature
+     * @param Parameters       
+     * @param value  Incidental currency (in Na)
+     * @return return value after calling the contract
+     */
+    public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value);
+    
+    /**
+     * Verify the address 
+     *
+     * @param address
+     * @see io.nuls.kernel.utils.AddressTool#validAddress(String)
+     */
+    private native void valid(String address);
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Address address1 = (Address) o;
+        return address != null ? address.equals(address1.address) : address1.address == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return address != null ? address.hashCode() : 0;
+    }
+
+    @Override
+    public String toString() {
+        return address;
+    }
+
+}
+

io.nuls.contract.sdk.Block

public class Block {
+
+    /**
+     * Given block’s head
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static native BlockHeader getBlockHeader(long blockNumber);
+
+    /**
+     * Current block’s head
+     *
+     * @return
+     */
+    public static native BlockHeader currentBlockHeader();
+    
+    /**
+     * Newest block’s head
+     *
+     * @return 
+     */
+    public static native BlockHeader newestBlockHeader();
+
+    /**
+     * Given block’s hash
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static String blockhash(long blockNumber) {
+        return getBlockHeader(blockNumber).getHash();
+    }
+
+    /**
+     * 
+     * CCurrent block’s miner address
+     *
+     * @return
+     */
+    public static Address coinbase() {
+        return currentBlockHeader().getPackingAddress();
+    }
+
+    /**
+     * 
+     * Current block’s No.
+     *
+     * @return
+     */
+    public static long number() {
+        return currentBlockHeader().getHeight();
+    }
+
+    /**
+     * 
+     * Current block’s time stamp
+     *
+     * @return
+     */
+    public static long timestamp() {
+        return currentBlockHeader().getTime();
+    }
+    
+}
+

io.nuls.contract.sdk.BlockHeader

public class BlockHeader {
+
+    private String hash;
+    private long time;
+    private long height;
+    private long txCount;
+    private Address packingAddress;
+    private String stateRoot;
+
+    public String getHash() {
+        return hash;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getTxCount() {
+        return txCount;
+    }
+
+    public Address getPackingAddress() {
+        return packingAddress;
+    }
+
+    public String getStateRoot() {
+        return stateRoot;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BlockHeader that = (BlockHeader) o;
+
+        if (time != that.time) return false;
+        if (height != that.height) return false;
+        if (txCount != that.txCount) return false;
+        if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
+        if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
+            return false;
+        return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = hash != null ? hash.hashCode() : 0;
+        result = 31 * result + (int) (time ^ (time >>> 32));
+        result = 31 * result + (int) (height ^ (height >>> 32));
+        result = 31 * result + (int) (txCount ^ (txCount >>> 32));
+        result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
+        result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "BlockHeader{" +
+                "hash='" + hash + '\'' +
+                ", time=" + time +
+                ", height=" + height +
+                ", txCount=" + txCount +
+                ", packingAddress=" + packingAddress +
+                ", stateRoot='" + stateRoot + '\'' +
+                '}';
+    }
+
+}
+

io.nuls.contract.sdk.Contract

/**
+ *  Contract interface, implemented by contract class
+ */
+public interface Contract {
+
+    /**
+     * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation.
+     */
+    default void _payable() {
+    }
+
+}
+

io.nuls.contract.sdk.Event

/**
+* Event interface, implemented by event class
+*/
+public interface Event {
+}
+

io.nuls.contract.sdk.Msg

public class Msg {
+
+    /**
+     * Remaining gas
+     *
+     * @return
+     */
+    public static native long gasleft();
+
+    /**
+     * sender of the contract
+     *
+     * @return
+     */
+    public static native Address sender();
+
+    /**
+     * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na
+     *
+     * @return
+     */
+    public static native BigInteger value();
+
+    /**
+     * Gas price
+     *
+     * @return
+     */
+    public static native long gasprice();
+
+    /**
+     * Contract address
+     *
+     * @return
+     */
+    public static native Address address();
+
+}
+

io.nuls.contract.sdk.Utils

public class Utils {
+
+    private Utils() {
+    }
+
+    /**
+     *  Check conditions; if conditions are not met, it will roll back.
+     *
+     * @param expression
+     */
+    public static void require(boolean expression) {
+        if (!expression) {
+            revert();
+        }
+    }
+
+    /**
+     * Check conditions; if conditions are not met, it will roll back
+     *
+     * @param expression
+     * @param errorMessage
+     */
+    public static void require(boolean expression, String errorMessage) {
+        if (!expression) {
+            revert(errorMessage);
+        }
+    }
+
+    /**
+     * Terminate implementation and restore status
+     */
+    public static void revert() {
+        revert(null);
+    }
+
+    /**
+     * Terminate implementation and restore status
+     *
+     * @param errorMessage
+     */
+    public static native void revert(String errorMessage);
+
+    /**
+     * Send events
+     *
+     * @param event
+     */
+    public static native void emit(Event event);
+
+	/**
+     * @param seed a private seed
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom(long seed) {
+        int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode();
+        int hash2 = Msg.address().toString().substring(2).hashCode();
+        int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0;
+        int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode();
+
+        long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4;
+
+        seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+        return ((int) (seed >>> 24) / (float) (1 << 24));
+    }
+
+    /**
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom() {
+        return pseudoRandom(0x5DEECE66DL);
+    }
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param src source string (hex encoding string)
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(String hexString);
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param bytes source byte array
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(byte[] bytes);
+    
+    /**
+     * [Testnet]verify signature data(ECDSA)
+     *
+     * @param data(hex encoding string)
+     * @param signature(hex encoding string)
+     * @param pubkey(hex encoding string)
+     * @return verify result
+     */
+    public static native boolean verifySignatureData(String data, String signature, String pubkey);
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @param algorithm Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds.
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+        return getRandomSeed(endHeight, seedCount, "SHA3");
+    }
+
+    /**
+     * [Testnet]Generate a random seed with a specific algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @param algorithm   Hash algorithm identifier
+     * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+    /**
+     * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)).
+     */
+    public static BigInteger getRandomSeed(long startHeight, long endHeight){
+        return getRandomSeed(startHeight, endHeight, "SHA3");
+    }
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds
+     *
+     * @param endHeight the cutoff block height
+     * @param seedCount the number of original seeds
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+    /**
+     * [Testnet]Get a collection of raw seeds based on the block height range
+     *
+     * @param startHeight the starting block height
+     * @param endHeight   the cutoff block height
+     * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes)))
+     */
+    public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+    
+}
+

io.nuls.contract.sdk.annotation.Payable

@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Payable {
+}
+

io.nuls.contract.sdk.annotation.Required

@Required labels the parameter of @Required. When it is called, there must be transfer-in value.

@Target({ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Required {
+}
+

io.nuls.contract.sdk.annotation.View

@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface View {
+}
+

6. Main RPC interface of smart contract

See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/)

The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001

6.1 Create smart contract

  • POST /api/contract/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
gasLimit* long max. gas consumption
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "gasLimit": 4687,
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "remark": "asd",
+  "args": []
+}
+

6.2 Estimate the gas consumption for creating smart contract

  • POST /api/contract/imputedgas/create
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
price* long unit price of implementation contract
contractCode* string smart contract code (byte code’s Hex coded string)
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "args": []
+}
+

6.3 Call smart contract

  • POST /api/contract/call
Parameter Type Description
sender* string transaction creator
password* string password of transaction creator
contractAddress* string address of smart contract
gasLimit* long max. gas consumption
price* long unit price of implementation contract
value long amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)
methodName* string method name
methodDesc string method signature which may be not transferred if the method name is not repeated
remark string remark
args string[][] Parameter list
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "password": "",
+  "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U",
+  "gasLimit": 8000,
+  "price": 20,
+  "value": 0,
+  "methodName": "balance",
+  "methodDesc": "",
+  "remark": "qwe"
+  "args": []
+}
+

6.4 Estimate the gas consumption for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedgas/call

6.5 Estimate the price for calling smart contract (see Swagger UI)

  • POST /api/contract/imputedprice

6.6 Terminate smart contract (see Swagger UI)

  • POST /api/contract/delete

6.7 Call the smart contract function which is not linked to blockchain (see Swagger UI)

  • POST /api/contract/view

6.8 Get the implementation results of smart contract (see Swagger UI)

  • GET /api/contract/result/{hash}

6.9 Get the basic information of smart contract (see Swagger UI)

  • GET /api/contract/info/{address}

6.10 Verify if it is contract address (see Swagger UI)

  • GET /api/contract/{address}

6.11 Get the NULS balance of smart contract address (see Swagger UI)

  • GET /api/contract/balance/{address}

6.12 Get the transaction details of smart contract (see Swagger UI)

  • GET /api/contract/tx/{hash}

6.13 Get the transaction list of smart contract (see Swagger UI)

  • GET /api/contract/tx/list/{address}

6.14 Inquire contract UTXO as per address and limit (see Swagger UI)

  • GET /api/contract/limit/{address}/{limit}

6.15 Inquire contract UTXO as per address and amount (see Swagger UI)

  • GET /api/contract/amount/{address}/{amount}

6.16 Transfer amount to smart contract (see Swagger UI)

  • POST /api/contract/transfer

7. Example

7.1 Voting smart contract code segments are as follows

Full code: https://github.com/nuls-io/nuls-vote

package io.nuls.vote.contract;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Utils;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.View;
+import io.nuls.vote.contract.func.BaseVote;
+import io.nuls.vote.contract.func.VoteInterface;
+import io.nuls.vote.contract.model.VoteConfig;
+import io.nuls.vote.contract.model.VoteEntity;
+
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Map;
+
+public class VoteContract implements Contract {
+
+    private VoteInterface baseVote;
+
+    public VoteContract(long minRecognizance) {
+        baseVote = new BaseVote(BigInteger.valueOf(minRecognizance));
+    }
+
+    @Payable
+    public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) {
+        VoteEntity voteEntity = baseVote.create(title, desc, items);
+
+        VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify);
+        boolean success = baseVote.init(voteEntity.getId(), config);
+
+        Utils.require(success);
+
+        return voteEntity;
+    }
+
+    public boolean vote(long voteId, long[] itemIds) {
+        return baseVote.vote(voteId, itemIds);
+    }
+
+    public boolean redemption(long voteId) {
+        return baseVote.redemption(voteId);
+    }
+
+    @View
+    public boolean canVote(long voteId) {
+        return baseVote.canVote(voteId);
+    }
+
+    @View
+    public VoteEntity queryVote(long voteId) {
+        return baseVote.queryVote(voteId);
+    }
+
+    @View
+    public Map<Address, List<Long>> queryVoteResult(long voteId) {
+        return baseVote.queryVoteResult(voteId);
+    }
+
+    @View
+    public boolean queryAddressHasVote(long voteId, Address address) {
+        return baseVote.queryAddressHasVote(voteId, address);
+    }
+}
+
+

If the methods of smart contract include the parameter of array type, please use the following method to transfer parameters

Refer to the create method in the aforesaid voting contract code

{
+  "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf",
+  "password": "",
+  "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4",
+  "gasLimit": 200000,
+  "price": 1,
+  "value": 10000000000,
+  "methodName": "create",
+  "methodDesc": "",
+  "remark": "",
+  "args": [
+     "Test voting 1",
+     "Voting contract 1",
+     [
+       "Option 1",
+       "Option 2",
+       "Option 3"
+     ],
+     1536044066056, 1536184066056, false, 300, false
+   ]
+}
+

7.2 Standard Token Smart contract code segments

Full code: https://github.com/nuls-io/nuls-nrc20

package io.nuls.contract.token;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import static io.nuls.contract.sdk.Utils.emit;
+import static io.nuls.contract.sdk.Utils.require;
+
+public class SimpleToken implements Contract, Token {
+
+    private final String name;
+    private final String symbol;
+    private final int decimals;
+    private BigInteger totalSupply = BigInteger.ZERO;
+
+    private Map<Address, BigInteger> balances = new HashMap<Address, BigInteger>();
+    private Map<Address, Map<Address, BigInteger>> allowed = new HashMap<Address, Map<Address, BigInteger>>();
+
+    @Override
+    @View
+    public String name() {
+        return name;
+    }
+
+    @Override
+    @View
+    public String symbol() {
+        return symbol;
+    }
+
+    @Override
+    @View
+    public int decimals() {
+        return decimals;
+    }
+
+    @Override
+    @View
+    public BigInteger totalSupply() {
+        return totalSupply;
+    }
+
+    public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) {
+        this.name = name;
+        this.symbol = symbol;
+        this.decimals = decimals;
+        totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));;
+        balances.put(Msg.sender(), totalSupply);
+        emit(new TransferEvent(null, Msg.sender(), totalSupply));
+    }
+
+    @Override
+    @View
+    public BigInteger allowance(@Required Address owner, @Required Address spender) {
+        Map<Address, BigInteger> ownerAllowed = allowed.get(owner);
+        if (ownerAllowed == null) {
+            return BigInteger.ZERO;
+        }
+        BigInteger value = ownerAllowed.get(spender);
+        if (value == null) {
+            value = BigInteger.ZERO;
+        }
+        return value;
+    }
+
+    @Override
+    public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) {
+        subtractAllowed(from, Msg.sender(), value);
+        subtractBalance(from, value);
+        addBalance(to, value);
+        emit(new TransferEvent(from, to, value));
+        return true;
+    }
+
+    @Override
+    @View
+    public BigInteger balanceOf(@Required Address owner) {
+        require(owner != null);
+        BigInteger balance = balances.get(owner);
+        if (balance == null) {
+            balance = BigInteger.ZERO;
+        }
+        return balance;
+    }
+
+    @Override
+    public boolean transfer(@Required Address to, @Required BigInteger value) {
+        subtractBalance(Msg.sender(), value);
+        addBalance(to, value);
+        emit(new TransferEvent(Msg.sender(), to, value));
+        return true;
+    }
+
+    @Override
+    public boolean approve(@Required Address spender, @Required BigInteger value) {
+        setAllowed(Msg.sender(), spender, value);
+        emit(new ApprovalEvent(Msg.sender(), spender, value));
+        return true;
+    }
+
+    public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) {
+        addAllowed(Msg.sender(), spender, addedValue);
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) {
+        check(subtractedValue);
+        BigInteger oldValue = allowance(Msg.sender(), spender);
+        if (subtractedValue.compareTo(oldValue) > 0) {
+            setAllowed(Msg.sender(), spender, BigInteger.ZERO);
+        } else {
+            subtractAllowed(Msg.sender(), spender, subtractedValue);
+        }
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    private void addAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance);
+        check(value);
+        setAllowed(address1, address2, allowance.add(value));
+    }
+
+    private void subtractAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance, value, "Insufficient approved token");
+        setAllowed(address1, address2, allowance.subtract(value));
+    }
+
+    private void setAllowed(Address address1, Address address2, BigInteger value) {
+        check(value);
+        Map<Address, BigInteger> address1Allowed = allowed.get(address1);
+        if (address1Allowed == null) {
+            address1Allowed = new HashMap<Address, BigInteger>();
+            allowed.put(address1, address1Allowed);
+        }
+        address1Allowed.put(address2, value);
+    }
+
+    private void addBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(value, "The value must be greater than or equal to 0.");
+        check(balance);
+        balances.put(address, balance.add(value));
+    }
+
+    private void subtractBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(balance, value, "Insufficient balance of token.");
+        balances.put(address, balance.subtract(value));
+    }
+
+    private void check(BigInteger value) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
+    }
+
+    private void check(BigInteger value1, BigInteger value2) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0);
+    }
+
+    private void check(BigInteger value, String msg) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg);
+    }
+
+    private void check(BigInteger value1, BigInteger value2, String msg) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0, msg);
+    }
+
+
+
+}
+
+
Last Updated: 3/28/2019, 12:38:23 AM
+ + + diff --git a/docs/.vuepress/dist/smartContract/ideaPlugin.html b/docs/.vuepress/dist/smartContract/ideaPlugin.html new file mode 100644 index 00000000..3dd55941 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/ideaPlugin.html @@ -0,0 +1,23 @@ + + + + + + NULS IDEA Plugin User Manual | NULS + + + + + + + +

NULS IDEA Plugin User Manual

1 Install NULS Plugin on IDEA

  • Get NULS plugin ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk

Install

  • Select the said ZIP, and click OK

Install

  • Tick NULS plugin, and click Apply

Install

2 Create a NULS project

create

Input Project name, click finish

create

3 Compile smart contract

Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/)

code

4 Set and deploy the node and account for contract

  • Click NULS plugin on the right, and call NULS plugin interface

    code

  • Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address.

    Click + on the top left corner of panel, and select Add Node.

    code

  • Input Node address and clock OK

    code

  • Click + on the top left corner of panel, and select Add Account. Input Account address and click OK.

    code

5 Package contract

  • Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code

    code

  • Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step).

    code

  • Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface

    code

    code

6 Deploy contract

  • On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step.

    code

  • Parameters following JarFilePath are the parameters of the contract construction function.

    code

  • Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract.

    code

  • Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success.

    code

  • If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment.

    code

  • Review the deployed contract on the top of panel

    code

  • Click the deployed contract to review all method of this contract

    code

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/randomImplementations.html b/docs/.vuepress/dist/smartContract/randomImplementations.html new file mode 100644 index 00000000..9cb9d5fc --- /dev/null +++ b/docs/.vuepress/dist/smartContract/randomImplementations.html @@ -0,0 +1,29 @@ + + + + + + Ways of creating random numbers for NULS | NULS + + + + + + + +

Ways of creating random numbers for NULS

References:

[Solidity Pitfalls: Random Number Generation for Ethereum] +(https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/)

[Predicting Random Numbers in Ethereum Smart Contracts] +(https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620)

1. Linear Congruential Generator (LCG): algorithm to generate pseudorandom numbers

The NULS smart contract SDK provides a way to create random numbers. It takes the current block's miner address, contract address, contract invoker address, and current block’s timestamp as random factors, and uses the algorithm linear congruential generator (LCG) to generate pseudorandom numbers

Invoking like this:

io.nuls.contract.sdk.Utils.pseudoRandom();
+/**
+ * add a random factor
+ */
+io.nuls.contract.sdk.Utils.pseudoRandom(long seed);
+

--

2. Using the BlockHash of the future block

Taking lottery as an example, it needs to invoke contract transactions twice - close the lottery and pick the winner.

Once the lottery is closed, record the current block height H1 and generate a number N. Pick the winner when the height of the future block reaches H1+N

When picking the winner, add up the recorded block height H1 and block number in interval (0~80] (to be determined) to the block height H2, and take the BlockHash of the block H2 as a random seed.

ETH cannot use this way for the following reasons: +

--

3. Random seeds limited to participants

In the case of lottery, we need more arbitrary data for picking our winner. When we determine the winner, we can use the addresses of the players that have entered our lottery smart contract as random factors to generate random numbers.

--

4. commit-reveal

Also take the lottery as an example.

  • The contract sets aside awards for the random number.

  • Each user generates own secret random number N.

  • Users can hash their N and address to generate the hash value of their secret random numbers: String hash = sha3(N + Msg.sender()).

Note: step 2 and 3 should be performed locally, for instance, the user submits N to the lottery application, which performs the hash operation.

  • Users submit their hash to the smart contract.

  • Submission is open until the number of blocks reaches a certain value, or until enough participants join.

  • Once the submission is closed, it’s time to pick the winner.

  • Each user submits their random number N to the smart contract.

  • The contract verifies sha3 (N + Msg.sender()) to match the original submission.

  • If the user fails to submit a valid N in time, his deposit will be forfeited.

  • Perform XOR operation on all-verified N to get random numbers.

  • These numbers are used to determine the winners --> (N % numUsers).

Last Updated: 1/11/2019, 1:47:19 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/randomRPC.html b/docs/.vuepress/dist/smartContract/randomRPC.html new file mode 100644 index 00000000..fcfea4a2 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/randomRPC.html @@ -0,0 +1,193 @@ + + + + + + Wallet adds a random seed | NULS + + + + + + + +

Wallet adds a random seed

一、Wallet adds a random seed RPC interface

The random seed you get is a big number, and notice, it could be a negative number

Get a random seed list based on the height interval

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cutoff height, cannot exceed startHeight+1000

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

Get random seed list according to height interval

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128

Returns:

field type Remark
success boolean Successful or not
data array The seed array

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True Initial height of interval
endHeight Long True Interval cut-off height,endHeight-startHeight<=1000
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True Gets the maximum height of the seed list
count Long True Random seed count, no more than 128
algorithm String false The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm

Returns:

field type Remark
success boolean Successful or not
data Object The result object
seed String Calculate the random seed result
algorithm String Computational algorithm
count int Number of original random seeds

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

二、Smart contracts support random Numbers in the underlying chain

Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code. +Take one of these methods as an exampleUtils.getRandomSeed(long endHeight, int seedCount, String algorithm) Shows how to generate random Numbers using random number seeds.

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @param algorithm Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]According to the height range, a specific algorithm is used to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   Number of original seeds
+ * @param algorithm   Hash algorithm identification
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained
+ *
+ * @param endHeight End height
+ * @param seedCount Number of original seeds
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]Get the set of original seeds according to the height range
+ *
+ * @param startHeight Start height
+ * @param endHeight   End height
+ * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) A dice example shaking at the same time N

2.1) Calculation method 1

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • The original seed is multiplied by the number of tosses, resulting in an array of bytes
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) Calculation method 2

  • Get the original seedUtils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • The first random number is modeled according to the range of the dice
  • The next random number +
    • Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array
    • The byte array is hashed with sha3-256 to get a 32-bit byte array
    • Converts the byte array of this Hash to BigInteger
    • Use this BigInteger to model the next random number based on the range of the dice
    • And so on

Refer to the following code

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 2/19/2019, 2:26:14 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/smartContractFee.html b/docs/.vuepress/dist/smartContract/smartContractFee.html new file mode 100644 index 00000000..82cdab61 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/smartContractFee.html @@ -0,0 +1,41 @@ + + + + + + Service charge for smart contracts | NULS + + + + + + + +

Service charge for smart contracts

1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge?

Background: Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards.

In the main-net, there are now three more types of transactions: creating a smart contract, invoking a smart contract, deleting a smart contract

The difference between those three transactions and other transactions such as transfer is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards.

  • Calculation of smart contract service charge
public static final int COMPARISON = 1 ; //Compare bytecode 
+public static final int CONSTANT = 1 ; //Simple numeric type bytecode 
+public static final int LDC = 1 ; //Numeric constant, string constant (length * LDC) 
+public static final int CONTROL = . 5 ; //Control bytecode 
+public static final int TABLESWITCH = 2 ; //Switch bytecode (size * TABLESWITCH) 
+public static final int LOOKUPSWITCH = 2 ; //Switch bytecode (size * LOOKUPSWITCH) 
+public static final int CONVERSION = 1 ; //Value conversion 
+public static final int EXTENDED = 1 ; //Null determine 
+public static final int MULTIANEWARRAY = 1 ; //Multidimensional Array (size * MULTIANEWARRAY) 
+public static final int LOAD = 1 ; / /Send the local variable to the top of the stack 
+public static final int ARRAYLOAD = 5 ; / /Send an item of the array to the top of the stack
+public static final int MATH = 1 ; //Mathematical operations and shift operations 
+public static final int REFERENCE = 10 ; //Object related operations 
+public static final int NEWARRAY = 1 ; //One-dimensional array (size * NEWARRAY) 
+public static final int STACK = 2 ; //Stack operation 
+public static final int STORE = 1 ; // Save the value in the top of the stack to a local variable 
+public static final int ARRAYSTORE = 5; //Save the value of the stack to an array 
+public static final int TRANSFER = 1000 ; //Transfer transaction
+
+
  • Total service charge for invoking a smart contract +The total service charge for a contract transaction consists of three parts
  • The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS.

  • The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na.

For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS.

  • The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward.

Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • How much does a contract invoker pay?

To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block.

  • Who receives the service charge?

Precondition:This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block.

The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part.

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/smartContract/startSmartContract.html b/docs/.vuepress/dist/smartContract/startSmartContract.html new file mode 100644 index 00000000..2397bff3 --- /dev/null +++ b/docs/.vuepress/dist/smartContract/startSmartContract.html @@ -0,0 +1,71 @@ + + + + + + Quick Start | NULS + + + + + + + +

Quick Start

1. Running the test-net environment, creating an account, and claiming test tokens.

Preparations for deployment and invocation of smart contracts

2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins

Preparations for the development of smart contract code

[Downloading JDK8] +(https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted)

[Downloading IntelliJ IDEA] (https://www.jetbrains.com/idea/download/) (Installation omitted)

[Downloading NULS smart contract plug-ins] +(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)

[Installing the NULS smart contract plug-ins] (https://dev.nuls.io/zh-cn/contract/IdeaPlugin.html)

3. Smart contract example

_Quickly compile and deploy a smart contract with the example _

  • Simple example

+Import io.nuls.contract.sdk.Contract;
+Import io.nuls.contract.sdk.Msg;
+Import io.nuls.contract.sdk.annotation.Payable;
+Import io.nuls.contract.sdk.annotation.Required;
+Import io.nuls.contract.sdk.annotation.View;
+
+Import java.math.BigDecimal;
+Import java.math.BigInteger;
+
+Public class SimpleContract implements Contract {
+
+    Private String sayContent;
+
+    @Override
+    @Payable
+    Public void _payable() {
+        // override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets
+        // you can do something else
+        // ...
+    }
+
+    Public String sayContent(@Required String content) {
+        this.sayContent = content;
+        Return "you want say " + content;
+    }
+
+    @Payable
+    Public String transferToContract() {
+        // mark the @Payable annotation. Smart contract can receive NULS when invoking this method
+        BigInteger value = Msg.value();
+        BigDecimal nuls = new BigDecimal(value).movePointLeft(8);
+        // you can do something else
+        // ...
+
+        Return "I received your transfer amount: " + nuls.toPlainString();
+    }
+
+    @View
+    Public String sayWhat() {
+        If(sayContent != null) {
+            Return "you want say " + sayContent;
+        }
+        Return "you want say nothing.";
+    }
+}
+
+

4. Smart contract repository

[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts)

[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract)

[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain)

[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract)

5. Deploying and invoking smart contracts

[How to deploy and invoke the wallet smart contract] +(https://dev.nuls.io/zh-cn/contract/smartContract.html)

6. Smart contract specifications and syntax

[Smart contract specifications and syntax] (https://dev.nuls.io/zh-cn/contract/index.html)

Last Updated: 1/11/2019, 4:09:02 PM
+ + + diff --git a/docs/.vuepress/dist/startNULS/connectMainnet.html b/docs/.vuepress/dist/startNULS/connectMainnet.html new file mode 100644 index 00000000..89ab5977 --- /dev/null +++ b/docs/.vuepress/dist/startNULS/connectMainnet.html @@ -0,0 +1,21 @@ + + + + + + How to connect wallet to NULS main-net | NULS + + + + + + + +

How to connect wallet to NULS main-net

Downloading wallet

The NULS main-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.

Option 1: downloading from the official website (https://nuls.io/newWallet)

1546518367717

Option 2: downloading from github (https://github.com/nuls-io/nuls/releases)

1546518556230

Note: The version marked [Main-net] is the main-net wallet.

Launching wallet

After the wallet is downloaded, unzip it according to specific operating systems.

For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546518956812

Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:

1546519370742

When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:

1546519548787

The appearance of block synchronization means the successful connection to the NULS main-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:

1546520020388

For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546520382686

Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the main-net has been successfully connected, as shown below:

1546520727643

Users can also track the nuls.log in the logs folder to check the latest status of the wallet.

For MAC users, steps are almost the same as the Windows users, so let’s skip it.

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/startNULS/connectTestnet.html b/docs/.vuepress/dist/startNULS/connectTestnet.html new file mode 100644 index 00000000..de1ef5d9 --- /dev/null +++ b/docs/.vuepress/dist/startNULS/connectTestnet.html @@ -0,0 +1,21 @@ + + + + + + How to connect wallet to NULS test-net | NULS + + + + + + + +

How to connect wallet to NULS test-net

Downloading wallet

The NULS test-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice.

Download: downloading from github (https://github.com/nuls-io/nuls/releases)

!1546586728639

Note: The version marked [Testnet] is the test-net wallet.

Launching wallet

After the wallet is downloaded, unzip it according to specific operating systems.

For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546518956812

Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below:

1546519370742

When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below:

1546519548787

The appearance of block synchronization means the successful connection to the NULS test-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below:

1546520020388

For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet.

1546520382686

Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the test-net has been successfully connected, as shown below:

1546520727643

Users can also track the nuls.log in the logs folder to check the latest status of the wallet.

For MAC users, steps are almost the same as the Windows users, so let’s skip it.

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/startNULS/sourceCodeStartNULS.html b/docs/.vuepress/dist/startNULS/sourceCodeStartNULS.html new file mode 100644 index 00000000..e63703a3 --- /dev/null +++ b/docs/.vuepress/dist/startNULS/sourceCodeStartNULS.html @@ -0,0 +1,39 @@ + + + + + + Launching NULS with source code | NULS + + + + + + + +

Launching NULS with source code

Downloading source code

Visit the NULS project on github: https://github.com/nuls-io/nuls

Option 1: downloading the source code directly

After accessing the github, click the "Clone or download" button and select Download ZIP to download the source-code package.
+

Option 2: running the git command to clone the NULS repository

` git clone https://github.com/nuls-io/nuls.git`
+

Option 3: (recommended): cloning the NULS repository with development tools such as IntelliJ IDEA.

Environment description

Operating Systems: macOS, Windows
+
+Building Tools: maven
+
+Development Tools: IntelliJ IDEA
+
+Development Language: Java (JDK1.8)
+

Basic introduction of launching NULS

Since blockchain is a decentralized network composed of multiple nodes, it makes no sense to launch a node with NULS source code alone, and it is also not feasible. This tutorial assumes an existing custom test-net running with NULS source code, and the source code other than the network parameters is not modified when building the network. How can we run the NULS source code and join the network 
+
  1. First install jdk1.8 and the build tool - maven.

2. Run IntelliJ IDEA +     - If you download the source code package, extract it and import the NULS project via IntelliJ IDEA +     - If you download the source code by running git command to clone the NULS repository, import the NULS project via IntelliJ IDEA. +     - Clone the NULS repository via IntelliJ IDEA’s Git plugin. + 3. Configure network environment parameters consistent with the existing network. +     - Open the module.ini configuration file in the client-module project +     - It is recommended to replace the module.ini file with that of other nodes in the known custom test-net to ensure the consistency of the network environment parameters. + 4. Run the NULS boot class Bootstrap.java in the client-module project, located in io.nuls.client package. + 5. The NULS wallet interface will be opened during start-up process and the block height of the custom test-net will be synchronized, indicating that the startup is successful.

Last Updated: 1/9/2019, 4:46:46 PM
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/APIManual.html b/docs/.vuepress/dist/zh/NULS1.0/APIManual.html new file mode 100644 index 00000000..85f13ea0 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/APIManual.html @@ -0,0 +1,21 @@ + + + + + + API手册 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/GUIForSmartContract.html b/docs/.vuepress/dist/zh/NULS1.0/GUIForSmartContract.html new file mode 100644 index 00000000..e8d60889 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/GUIForSmartContract.html @@ -0,0 +1,32 @@ + + + + + + 智能合约钱包操作手册 | NULS + + + + + + + +

智能合约钱包操作手册

部署合约

1 启动钱包,点击【合约】,点击【部署合约】tab页

deploy

2 在文本框中填入合约的Hex编码

文章底部有发行NRC-20Token的合约hex编码示例

3 填写合约构造函数参数,注意必填项和值类型,否则表单校验无法通过

deploy

4 点击【高级选项】,可更改GasLimit和GasPrice的默认值,还可继续填写附加信息,该字段为非必填项。(此步骤为可选操作)

deploy

5 表单填写完成后,点击【测试合约】,钱包将对该合约进行一次测试部署,验证合约的合法性。

deploy

6 测试通过后,点击【部署合约】,若当前账户有密码则输入密码,然后点击【确认】。无密码,则直接点击【确认】。此时系统会跳转到【我的合约】页面,可在此页面查看部署合约的确认进度。

查看部署合约的确认进度

deploy

7 确认完成后

  • 点击表格右方的操作【去调用】可直接进入【调用合约】页面

  • 点击合约地址可直接进入合约概览的页面

查看合约

1 启动钱包,点击【合约】,点击【查看合约】tab页

access

2 在输入框中输入合法的合约地址,点击【访问】,下方会出现一个面板

  • 点击面板中的【下拉列表】,可以选择要调用的合约方法
  • 点击合约地址旁的星星图标,可以收藏该合约至我的合约列表

access

3 选择某一个方法后有以下两种情况

  • 方法为只读方法,点击【调用】则会在网络请求完成后立即返回调用结果

    access

  • 方法为可写方法(需上链),可点击高级选项,更改GasLimit和GasPrice的默认值,点击【调用】后,该操作会发起一个交易,需要消耗nuls,因此若设置了账户密码,则需要输入密码。交易确认后,返回调用结果。

    查看智能合约手续费详情

    调用合约交易确认中

    access

    调用合约交易已确认

    access

4 若调用的上链方法,可点击面板中的TxID查看本次调用合约交易的详情

access

调用合约交易详情

access

我的合约

1 我的合约列表中展示了当前账户创建的合约和收藏的合约

access

  • 点击合约地址,可进入合约概览页面

    access

  • 点击去调用,可进入该合约的【调用合约】页面

    access

  • 点击【取消收藏】可将该合约从【我的合约】列表中移除

3 【交易记录】中展示的是该合约内部的交易,点击TxID,可查看该条交易的详情

access

4 【合约详情】中展示的是该合约的所有方法,对应的参数和返回值类型

access

5 若合约由当前账户创建,可点击合约概览右上方的【删除】图标删除该合约,合约被删除后,可继续查看合约详细信息,但无法继续调用合约的方法

access

账户多资产

通过智能合约发行Token或由其他账户转入不同类型Token后,账户就会出现多资产

1 进入钱包,可查看当前账户地址下的所有类型资产

access

2 点击【转账】可进入该类型资产的转账界面,输入收款地址和转账金额,可进行该类型资产的转账操作

access

3 点击【交易记录】可进入该类型资产的交易记录页面

access

4 在【交易记录】页面可通过点击下拉列表进行切换不同类型资产的交易记录

access

5 点击TxID可查看该条交易记录详情


发行NRC-20 Token的合约hex编码示例

504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000
+
+
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/NRC-20TokenStandard.html b/docs/.vuepress/dist/zh/NULS1.0/NRC-20TokenStandard.html new file mode 100644 index 00000000..e5334a69 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/NRC-20TokenStandard.html @@ -0,0 +1,47 @@ + + + + + + NRC-20合约标准 | NULS + + + + + + + +

NRC-20合约标准

简述

token的接口标准

摘要

以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。

动机

标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。

规则

Token

方法

注意: 调用者必须处理返回falsereturn boolean.调用者绝对不能假设返回false的情况不存在。

name

返回令牌的名称 - 例如 "MyToken".

@View
+public String name();
+

symbol

返回令牌的符号 - 例如 "MT".

@View
+public String symbol();
+

decimals

返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。

@View
+public int decimals();
+

totalSupply

返回总令牌供应量。

@View
+public BigInteger totalSupply();
+

balanceOf

返回地址为“owner”的帐户余额。

@View
+public BigInteger balanceOf(@Required Address owner);
+

transfer

转移value的token数量到的地址to,并且必须触发TransferEvent事件。 如果from帐户余额没有足够的令牌来支出,该函数应该被revert。

创建新令牌的令牌合同应该在创建令牌时将from地址设置为null触发TransferEvent事件。

注意 0值的传输必须被视为正常传输并触发TransferEvent事件。

public boolean transfer(@Required Address to, @Required BigInteger value);
+

transferFrom

从地址from发送数量为value的token到地址to,必须触发TransferEvent事件。

transferFrom方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了from帐户已经通过某种机制(比如调用approve(@Required Address spender, @Required BigInteger value))故意地授权消息的发送者之外,否则该函数应该revert

注意 0值的传输必须被视为正常传输并触发传输事件。

public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value);
+

approve

允许spender多次支配您的帐户,最高达value金额。 如果再次调用此函数,它将以value覆盖当前的余量。

public boolean approve(@Required Address spender, @Required BigInteger value);
+

allowance

返回spender仍然被允许从owner提取的金额。 +Returns the amount which spender is still allowed to withdraw from owner.

@View
+public BigInteger allowance(@Required Address owner, @Required Address spender);
+

Events

TransferEvent

当token被转移(包括0值),必须被触发。

创建新令牌的令牌合同应该在创建令牌时将from地址设置为null触发TransferEvent事件。

public TransferEvent(Address from, @Required Address to, @Required BigInteger value)
+

ApprovalEvent

当任何成功调用approve(@Required Address spender, @Required BigInteger value)后,必须被触发。

public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value)
+

Implementation

Example implementations are available at

  • https://github.com/nuls-io/nuls-nrc20
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/buildPrivateChain.html b/docs/.vuepress/dist/zh/NULS1.0/buildPrivateChain.html new file mode 100644 index 00000000..6c7d466f --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/buildPrivateChain.html @@ -0,0 +1,44 @@ + + + + + + 搭建区块链 | NULS + + + + + + + +

搭建区块链

简介

​ 本教程是基于NULS源代码介绍如何搭建私链,目的是为了方便学习了解NULS区块链网络运行,开发或者实验。自己搭建一条链来全方位的了解各节点是如何运行以及数据交互等,可以更好的把握NULS区块链网络的整体运行机制,有助于更深一步的研究。我们默认本文阅读者是具备Java开发环境的构建和调试技能的。

环境搭建

  • 操作系统:macOS、Windows
  • 构建工具:Maven
  • 开发工具:IntelliJ IDEA
  • NULS源码github地址:https://github.com/nuls-io/nuls

开始

​ 由于区块链是去中心化网络,是由多个节点组成,我们将以3个节点搭建一条私链为例进行介绍。虽然我们建议使用Linux服务器来作为运行NULS主网共识节点的服务器,但由于涉及到开发调试的需求,本文我们将在可以搭建Java开发环境的macOS系统上运行调试节点。

开发环境

​ 首先使用IntelliJ IDEA克隆NULS源代码,并打开项目。确保Java使用的是jdk1.8,以及Maven工具配置正确。

如何搭建

​ 1.打开module.ini 文件,该文件为加入或组建网络的配置文件,此示例是NULS测试网的配置信息。

image-20190103193901967

2.我们将用3个节点来搭建一条私链,首先需要准备可供3个节点运行的设备(可以是虚拟机)。

  • 节点A:192.168.1.1
  • 节点B:192.168.1.2
  • 节点C:192.168.1.3

我们还需要设置一个种子节点,用来进行维持区块链的运行,即打包出块。同时我们还需要准备一个出块地址(包括私钥,用于在种子节点导入该地址),可以事先准备。

本例我们准备的初始出块地址为:Nse4zpZHsUuU7h5ymv28pcGbwHju3joV

PS:如果你比较细心你可能为发现我们准备的地址和图中测试网的地址的开头字母是不一样的,那是为了让用户更容易识别测试网地址和主网地址,以免混淆导致不良后果,我们特意将测试网地址设置为以"TT"开头,将主网地址设置为"Ns"开头,而本教程使用的是NULS主分支代码,所以使用"Ns"开头的地址。如果您想自定义私链的账户地址开头字母,可以尝试修改nuls.ini文件中的chain.id参数,同一条链的节点该参数必须一致。

  1. 假设节点A为种子节点,那么将A、B、C三个节点的module.ini配置文件的network、consensus节都按照以下配置进行修改:
[network]
+bootstrap=io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap
+network.server.port=8003
+network.magic=20190101
+network.max.in=100
+network.max.out=10
+network.seed.ip=192.168.1.1:8003
+
+[consensus]
+bootstrap=io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap
+partake.packing=true
+min.upgrade.delay=1000
+seed.nodes=Nse4zpZHsUuU7h5ymv28pcGbwHju3joV
+
  • work.seed.ip修改为种子节点的ip和端口。
  • seed.nodes修改为出块地址。
  • 必须保证私链所有节点的魔法参数network.magic一致
  1. 通过IntelliJ IDEA分别将3个节点运行起来,如果只需要调试其中一个节点,那么其他两个节点可以用maven打包发送到Linux服务器中运行,但是要注意的是需要准备一个jre放到NULS根目录中才能正常运行。
  2. 这3个节点启动后直到IntelliJ IDEA控制台有类似以下日志输出,则表示3个节点已近组成一个私有链的网络,但是没有打包出块,高度为0。如果没有日志输出,需要打开logback.xml中<appender-ref ref="STDOUT"/>的注释。
io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash:xxxxxxx,192.168.1.2:8003,192.168.1.2:8003
+
+
  1. 这时在种子节点A的钱包界面中,导入事先准备的出块账户Nse4zpZHsUuU7h5ymv28pcGbwHju3joV,稍等一会儿,则可以看见控制台的最新高度在增加了,表示网络已经在打包出块了,而与此同时B节点、C节点高度也会增加并且3个节点高度保持一致,此时表示私有链网络已经搭建完成。

总结

​ 本文主要介绍使用最简便的方式搭建一个用于开发调试NULS的私链,并没有修改NULS的源代码。如果您需要更进一步探索NULS,可以查阅NULS的相关文档并在此基础上对源码进行修改调试,或许您会发现更多的奥秘!

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/clientCLI.html b/docs/.vuepress/dist/zh/NULS1.0/clientCLI.html new file mode 100644 index 00000000..6760c11d --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/clientCLI.html @@ -0,0 +1,710 @@ + + + + + + Linux CLI 手册 | NULS + + + + + + + +

Linux CLI 手册

介绍

​ 本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。

版本更新记录

版本 更新日期 内容
V1.0.0 2018-07-12 主网正式版全部功能

准备

服务器硬件配置

建立NULS节点的服务器不低于如下配置:

CPU 内存 硬盘 宽带
四核 3.0GHz 16G 128G硬盘 20M上行

推荐配置:

CPU 内存 硬盘 宽带
八核 3.0GHz 32G 256G硬盘 100M上行

系统及内核版本

Linux系统

  • CentOS (推荐)

Linux内核版本推荐使用 2.6.32及以上

开始

下载

  • 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release

  • 进入NULS官网钱包下载界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。

    Linux系统中下载v1.0.0版的钱包可以使用如下命令:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    注:如果后续有其他版本,下载地址可能会不同。

安装

  • 在Linux中解压已下载的文件

    $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz
    +

运行

  • 进入解压后的bin目录,并运行启动脚本,启动全节点钱包

    $ cd bin
    +$ ./start.sh
    +

使用钱包

快速入门

  • 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。

    进入bin目录,执行如下命令:

    $ ./cmd.sh
    +

    将会出现NULS命名输入提示符nuls>>> ,然后可直接输入NULS钱包操作命令,来进行操作。

    例如,创建账户的示例如下:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    执行create命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。

约定

  • 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。
  • 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。

钱包命令

帮助命令

输出打印所有的命令,

  • **命令: help [-a] **
参数 说明
-a 格式化打印命令,选填

返回信息 help

getaccount <address> --get account information
+

返回信息 help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

示例

nuls>>> help
+nuls>>> help -a
+

创建账户

创建账户,返回账户地址集合

  • **命令: create [number] **
参数 说明
[number] 创建账户的数量,选填

创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter;

返回账户集合

[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

示例 创建2个没有密码的账户

nuls>>> create 2
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:
+[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

备份账户

备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件

  • 命令:backup <address> [path]
参数 说明
<address> 账户地址,必填
[path] 文件生成备份文件的目标文件夹,默认为当前文件夹,选填

注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。

返回信息

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

示例 备份一个有密码的账户

nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

移除账户

根据账户地址移除本地账户,如果账户已加密,则需要输入密码

  • **命令:remove <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+Success
+

设置账户密码

根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。

  • **命令:setpwd <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

修改账户密码

根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。

  • **命令:resetpwd <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Enter your old password:**********
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

设置别名

给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示

  • 命令:setalias <address> <alias>
参数 说明
<address> 账户的地址,必填
<alias> 别名名称,必填

返回信息 交易hash

"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

示例

nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias
+"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

导入账户keystore

导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。

  • **命令:importkeystore <path> **
参数 说明
<path> 待导入的keystore文件地址,必填

注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

导入账户私钥

导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。

  • **命令:import <privatekey> **
参数 说明
<privatekey> 账户的私钥,必填

注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

导入账户私钥(覆盖导入)

导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。

  • **命令:import <privatekey> **
参数 说明
<privatekey> 账户的私钥,必填

注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。

覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

查询账户信息

根据账户地址查询账户信息

  • 命令:getaccount <address>
参数 说明
<address> 账户地址,必填

返回信息

{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址
+  "alias" : null,//别名
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥
+  "priKey" : "",//私钥(如果账户设置了密码,该项为空)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//创建时间
+  "encrypted" : true//是否加密(是否设置了密码)
+}
+

示例

nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}
+

查询账户列表

根据分页参数查询账户列表,所有账户以创建时间倒序输出。

  • 命令:getaccounts <pageNumber> <pageSize>
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息,将输出账户集合

[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址
+  "alias" : null,//别名
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥
+  "priKey" : "",//私钥(如果账户设置了密码,该项为空)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//创建时间
+  "encrypted" : true//是否加密(是否设置了密码)
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

示例 获取账户列表 显示第一页,每页显示2条

nuls>>> getaccounts 1 2
+[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

查询账户私钥

根据账户地址查询账户私钥,如果账户已加密,则需要输入密码

  • **命令:getprikey <address> **
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

示例

nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

查询账户余额

根据账户地址查询账户余额

  • **命令:getbalance <address> **
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

{
+  "balance" : "9999998.99",//余额
+  "locked" : "0",//已锁定余额
+  "usable" : "9999998.99"//可用余额
+}
+

示例

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "balance" : "9999998.99",
+  "locked" : "0",
+  "usable" : "9999998.99"
+}
+

转账

根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。

  • **命令:transfer <address> <toAddress> <amount> [remark] **
参数 说明
<address> 转出地址,必填
<toAddress> 接收地址,必填
<amount> 转账数量,最多可以有8位小数(单位:NULS),必填
[remark] 备注信息,选填

返回信息 转账交易hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

示例

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

查询交易详情

根据交易hash查询交易详细信息

  • 命令:gettx <hash>
参数 说明
<hash> 交易hash,必填

返回信息 交易详细信息

{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash
+  "type" : "transfer",//交易类型(此示例为转账交易)
+  "time" : "2018-07-16 11:21:46",//交易时间
+  "blockHeight" : 26269,//打包交易的区块高度
+  "fee" : "0.001",//交易手续费
+  "value" : "100",//(转账)交易数量
+  "remark" : "转账",//备注
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//签名
+  "status" : "confirm",//交易确认状态(已确认或者未确认)
+  "confirmCount" : 46,//确认次数
+  "size" : 254,//交易大小
+  "inputs" : [ {//交易的输入
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {//交易的输出
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"//交易输出的目标地址(此数据相当于转出100给目标地址)
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//交易输出的目标地址(此数据相当于找零给自己)
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

示例 查询转账交易

nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596
+{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "type" : "transfer",
+  "time" : "2018-07-16 11:21:46",
+  "blockHeight" : 26269,
+  "fee" : "0.001",
+  "value" : "100",
+  "remark" : "转账",
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",
+  "status" : "confirm",
+  "confirmCount" : 46,
+  "size" : 254,
+  "inputs" : [ {
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

查询交易列表

根据账户地址,查询该账户的交易列表

  • 命令:gettxlist <address> <pageNumber> <pageSize>
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息 交易详细信息

[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//交易hash
+  "blockHeight" : 26473,//交易的区块高度
+  "time" : "2018-07-16 11:55:43",//交易时间
+  "txType" : "transfer",//交易类型
+  "status" : 1,//确认状态
+  "info" : "+100"//信息
+},{
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

示例

nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10
+[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",
+  "blockHeight" : 26473,
+  "time" : "2018-07-16 11:55:43",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+}, {
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

创建节点

根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。

  • **命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> **
参数 说明
<agentAddress> 创建节点的账户地址,必填
<packingAddress> 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)
<commissionRate> 代理佣金比例,范围:10~100,必填
<deposit> 创建节点的保证金,不能低于20000NULS,必填

返回信息 返回节点的agent hash

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

示例 创建一个节点,佣金比例为10%,押金20000NULS。

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

加入共识(委托节点)

根据账户地址和节点agentHash,加入共识,至少需要2000NULS

  • **命令:deposit <address> <agentHash> <deposit> **
参数 说明
<address> 账户地址,必填
<agentHash> 节点的agentHash,必填
<deposit> 加入共识保证金,不能低于2000NULS,必填

返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

示例

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

退出共识(退出委托)

根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。

  • **命令:withdraw <address> <txHash> **
参数 说明
<address> 账户地址,必填
<txHash> 委托时的交易hash,必填

返回信息 退出共识交易hash

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

示例

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

停止节点

停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。

  • **命令:stopagent <address> **
参数 说明
<address> 账户地址,必填

返回信息 停止节点交易hash

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

示例

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

获取节点详情

根据节点agentHash获取节点详情

  • **命令:getagent <agentHash> **
参数 说明
<agentHash> 节点agentHash值,必填

返回信息

{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 60.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "35024DE6",//节点ID
+  "time" : "2018-07-16 16:33:38",//创建节点时间
+  "blockHeight" : 28141,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : 0.05,//信用值
+  "totalDeposit" : "208000",//节点当前委托总额
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//参与数
+}
+

示例

nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6
+{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.05,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}
+

获取节点列表

根据共识节点列表

  • **命令:getagents <pageNumber> <pageSize> **
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息

[{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 60.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "35024DE6",//节点ID
+  "time" : "2018-07-16 16:33:38",//创建节点时间
+  "blockHeight" : 28141,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : 0.05,//信用值
+  "totalDeposit" : "208000",//节点当前委托总额
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//参与数
+}]
+

示例

nuls>>> getagents 1 2
+[ {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.18,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}, {
+  "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",
+  "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "deposit" : "20000",
+  "commissionRate" : 10.0,
+  "agentName" : null,
+  "agentId" : "5CE291D8",
+  "time" : "2018-07-16 16:31:12",
+  "blockHeight" : 28126,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.16,
+  "totalDeposit" : "208000",
+  "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "memberCount" : 5
+} ]
+

获取全网共识总体信息

查询全网共识总体信息

  • **命令:getconsensus **

返回信息

{
+  "agentCount" : 6,//节点数
+  "totalDeposit" : "1758000",//总委托数
+  "rewardOfDay" : "0",//奖励
+  "consensusAccountNumber" : 6,//共识账户数量
+  "packingAgentCount" : 6//打包地址数量
+}
+

示例

nuls>>> getconsensus
+{
+  "agentCount" : 6,
+  "totalDeposit" : "1758000",
+  "rewardOfDay" : "0",
+  "consensusAccountNumber" : 6,
+  "packingAgentCount" : 6
+}
+

获取单个账户的委托总览

根据账户地址获取该账户参与的所有委托(共识)信息的总览

  • **命令:getdepositedinfo <address> **
参数 说明
<address> 账户地址,必填

返回信息

{
+  "agentCount" : 1,//创建的节点数
+  "totalDeposit" : "1600000",//总共委托的数量
+  "joinAgentCount" : 6,//加入委托的节点数
+  "usableBalance" : "8048998.869",//可用余额
+  "reward" : "219.65910271",//得到的奖励总数
+  "rewardOfDay" : "219.65910271",//一天得到的奖励数
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//节点hash
+}
+

示例

nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "agentCount" : 1,
+  "totalDeposit" : "1600000",
+  "joinAgentCount" : 6,
+  "usableBalance" : "8048998.869",
+  "reward" : "219.65910271",
+  "rewardOfDay" : "219.65910271",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"
+}
+

获取单个账户的委托信息列表

根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表

  • **命令:getdepositeds <address> <pageNumber> <pageSize> [agentHash] **
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填
[agentHash] 节点Hash,选填

返回信息

[{
+  "deposit" : "2000",//委托金额
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//委托者地址
+  "time" : "2018-07-16 16:38:25",//时间
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//委托交易hash
+  "blockHeight" : 28148,//交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//节点状态
+  "agentName" : "35024DE6",//节点名
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//节点地址
+}]
+

示例

nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "deposit" : "2000",
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:25",
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",
+  "blockHeight" : 28148,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "35024DE6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"
+}, {
+  "deposit" : "2000",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:43",
+  "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",
+  "blockHeight" : 28149,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "E09EB7FD",
+  "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"
+} ]
+

获取单个账户的委托节点列表

根据地址查询该账户委托的节点列表(返回节点信息列表)

  • **命令:getdepositedagents <address> <pageNumber> <pageSize> **
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息

[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//节点hash
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//创建节点的账户地址
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//节点打包(出块)地址
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 40.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "0198ACAF",//节点ID
+  "time" : "2018-07-16 16:32:52",//创建节点时间
+  "blockHeight" : 28136,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : -0.91,//信用值
+  "totalDeposit" : "204000",//节点当前委托总额
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3//参与数
+}]
+

示例 获取第一页,每页显示两条

nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "deposit" : "20000",
+  "commissionRate" : 40.0,
+  "agentName" : null,
+  "agentId" : "0198ACAF",
+  "time" : "2018-07-16 16:32:52",
+  "blockHeight" : 28136,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.91,
+  "totalDeposit" : "204000",
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3
+}, {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.91,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+} ]
+

获取最新的区块头信息

获取最新的区块头信息

  • 命令:getbestblockheader

返回信息

{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//区块hash
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//前一区块hash
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//梅克尔hash
+  "time" : "2018-07-17 10:25:40",//区块生成时间
+  "height" : 33950,//区块高度
+  "txCount" : 1,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 668413,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-17 10:25:30",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0",//共识奖励
+  "fee" : "0",//区块的打包手续费
+  "confirmCount" : 0,//确认次数
+  "size" : 204,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"//签名
+}
+

示例

nuls>>> getbestblockheader
+{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",
+  "time" : "2018-07-17 10:25:40",
+  "height" : 33950,
+  "txCount" : 1,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 668413,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-17 10:25:30",
+  "packingIndexOfRound" : 1,
+  "reward" : "0",
+  "fee" : "0",
+  "confirmCount" : 0,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"
+}
+

查询区块信息

根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。

  • **命令:getblock <hash> | <height> **
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "txList" : [ {//交易集合
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//交易hash
+    "type" : "coinbase",//交易类型
+    "time" : "2018-07-16 16:29:30",//交易时间
+    "blockHeight" : 28115,//交易所在区块高度
+    "fee" : "0",//交易手续费
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],//交易的输入
+    "outputs" : [ //交易的输出
+        {
+          "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+          "value" : 100000,
+          "lockTime" : 29115
+        }
+    ]
+  }],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块

nuls>>> getblock 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6174,
+  "size" : 507,
+  "txList" : [ {
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",
+    "type" : "coinbase",
+    "time" : "2018-07-16 16:29:30",
+    "blockHeight" : 28115,
+    "fee" : "0",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],
+    "outputs" : [ {
+      "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+      "value" : 100000,
+      "lockTime" : 29115
+    } ]
+  }, {
+    "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",
+    "type" : "transfer",
+    "time" : "2018-07-16 16:29:27",
+    "blockHeight" : 28115,
+    "fee" : "0.001",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 249,
+    "inputs" : [ {
+      "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",
+      "fromIndex" : 1,
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 972899896100000
+    } ],
+    "outputs" : [ {
+      "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",
+      "value" : 3000000000000,
+      "lockTime" : 0
+    }, {
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 969899896000000,
+      "lockTime" : 0
+    } ]
+  } ],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。

  • **命令:getblockheader <hash> | <height> **
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块头

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

查询网络信息

查询网络基本信息

  • **命令:getnetinfo **

返回信息

{
+  "localBestHeight" : 35317,//本地最新区块高度
+  "netBestHeight" : 35317,//网络最新区块高度
+  "timeOffset" : "0ms",//网络时间偏移值
+  "inCount" : 0,//被动连接节点数量
+  "outCount" : 1//主动连接节点数量
+}
+

示例

nuls>>> getnetinfo
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

查询网络节点IP

查询网络节点IP

  • **命令:getnetnodes **

返回信息

[ "192.168.1.223" ]
+

示例 根据高度获取区块

nuls>>> getnetnodes
+[ "192.168.1.223" ]
+

查询当前版本信息

查询当前版本号

  • **命令:version **

返回信息

[ "192.168.1.223" ]
+

示例

nuls>>> version
+{
+  "myVersion" : "1.0.0",
+  "newestVersion" : "0.9.11",
+  "upgradable" : false,
+  "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization"
+}
+

版本更新

查询当前版本号

  • **命令:upgrade <version> **

示例

nuls>>> version 1.0.0
+

退出钱包命令程序

退出操作钱包的命令行程序,不会退出已启动的钱包节点。

  • 命令:exit

示例

nuls>>> exit
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/connectMainnet.html b/docs/.vuepress/dist/zh/NULS1.0/connectMainnet.html new file mode 100644 index 00000000..94f938c3 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/connectMainnet.html @@ -0,0 +1,29 @@ + + + + + + 连接主网 | NULS + + + + + + + +

连接主网

下载钱包

NULS全节点钱包,有Windows、Linux、Mac三个版本,且持续更新,用户可以根据自己的服务器系统下载。

方式1:官网下载(https://nuls.io/newWallet)

1546518367717

方式2:github下载(https://github.com/nuls-io/nuls/releases)

1546518556230

注:版本号后标注了[Main-net]的版本为主网的钱包

运行钱包

钱包下载好后,根据不同的操作系统解压

Windows系统钱包解压后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。

1546518956812

双击NULS-Wallet.exe启动并运行钱包,系统默认浏览器会自动打开钱包界面,如下图:

1546519370742

首次打开界面时,页面还会提示当前正在同步区块中,如下图:

1546519548787

出现正在同步区块后,表面已成功连接上NULS主网,待区块同步完成后,即可正常使用钱包。用户为节约时间不想从第一个区块开始重新同步数据,也可以到github上下载每个版本对应的最新区块数据包,如下图:

1546520020388

Linux系统解压钱包后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。

1546520382686

执行命令 sh bin/start.sh 启动钱包,启动后可根据命令 sh bin/cmd.sh 进入nuls钱包命令行,在命令行里执行getnetinfo命令,查看当前网络状态,当localBestHeight出现增长时,则表明连接主网成功。如下图:

1546520727643

用户也可跟踪logs文件夹下的nuls.log日志文件,查看钱包最新状态

MAC版本的钱包运行与Windows钱包基本一致,不再复述。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/connectTestnet.html b/docs/.vuepress/dist/zh/NULS1.0/connectTestnet.html new file mode 100644 index 00000000..c4c1c928 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/connectTestnet.html @@ -0,0 +1,29 @@ + + + + + + 连接测试网 | NULS + + + + + + + +

连接测试网

下载钱包

NULS全节点公测网钱包,有Windows、Linux、Mac三个版本,且持续更新,用户可以根据自己的服务器系统下载。

下载方式:github下载(https://github.com/nuls-io/nuls/releases)

!1546586728639

注:版本号后标注了[Testnet]的版本为测试网的钱包

运行钱包

钱包下载好后,根据不同的操作系统解压

Windows系统钱包解压后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。

1546518956812

双击NULS-Wallet.exe启动并运行钱包,系统默认浏览器会自动打开钱包界面,如下图:

1546519370742

首次打开界面时,页面还会提示当前正在同步区块中,如下图:

1546519548787

出现正在同步区块后,表面已成功连接上NULS主网,待区块同步完成后,即可正常使用钱包。用户为节约时间不想从第一个区块开始重新同步数据,也可以到github上下载每个版本对应的最新区块数据包,如下图:

1546520020388

Linux系统解压钱包后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。

1546520382686

执行命令 sh bin/start.sh 启动钱包,启动后可根据命令 sh bin/cmd.sh 进入nuls钱包命令行,在命令行里执行getnetinfo命令,查看当前网络状态,当localBestHeight出现增长时,则表明连接主网成功。如下图:

1546520727643

用户也可跟踪logs文件夹下的nuls.log日志文件,查看钱包最新状态

MAC版本的钱包运行与Windows钱包基本一致,不再复述。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/developerManual.html b/docs/.vuepress/dist/zh/NULS1.0/developerManual.html new file mode 100644 index 00000000..1182c9dd --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/developerManual.html @@ -0,0 +1,802 @@ + + + + + + 开发手册 | NULS + + + + + + + +

开发手册

1. 简介

NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。

2. 开发环境

2.1 安装NULS钱包

2.2 安装JDK 8

2.3 安装IntelliJ IDEA

Nuls智能合约使用的开发工具为IntelliJ IDEA。

2.4 安装NULS智能合约插件

点击下载插件

NULS智能合约插件提供的主要功能:

  • 新建NULS合约工程
  • 提示不支持的Java特性、Java类、Java方法
  • 编译、打包、部署合约
  • 展示、调用合约方法。

3. NULS智能合约规范与语法

Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。

3.1 NULS智能合约规范

合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。

3.2 关键字

下面列出Java关键字,其中将标注NULS智能合约不支持的关键字

访问控制

  • public
  • protected
  • private

定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象

  • class
  • interface
  • abstract
  • implements
  • extends
  • new

包的关键字

  • import
  • package

数据类型的关键字

  • byte
  • char
  • boolean
  • short
  • int
  • float
  • long
  • double
  • void
  • null
  • true
  • false

条件循环(流程控制)

  • if
  • else
  • while
  • for
  • switch
  • case
  • default
  • do
  • break
  • continue
  • return
  • instanceof

错误处理

  • catch
  • try
  • finally
  • throw
  • throws

修饰方法、类、属性和变量

  • static
  • final
  • super
  • this
  • native(不支持)
  • strictfp(不支持)
  • synchronized(不支持)
  • transient(不支持)
  • volatile(不支持)

其他

  • enum(不支持)
  • assert(不支持)

3.3 基本语法

下面的语法与Java相同,只是简单列出,具体可参考Java相关文档

  • 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头
  • 基本数据类型:byte short int long float double char boolean
  • 引用数据类型:类、接口、数组
  • 算术运算符:+ - * / % ++ --
  • 关系运算符:> < >= <= == !=
  • 逻辑运算符:! & | ^ && ||
  • 位运算符:& | ^ ~ >> << >>>
  • 赋值运算符:=
  • 拓展赋值运算符:+ = -= *= /=
  • 字符串链接运算符:+
  • 三目条件运算符 ? :
  • 流程控制语句(if,switch,for,while,do...while)

3.4 支持的类

Nuls智能合约只能使用下面的类进行开发

  • io.nuls.contract.sdk.Address
  • io.nuls.contract.sdk.Block
  • io.nuls.contract.sdk.BlockHeader
  • io.nuls.contract.sdk.Contract
  • io.nuls.contract.sdk.Event
  • io.nuls.contract.sdk.Msg
  • io.nuls.contract.sdk.Utils
  • io.nuls.contract.sdk.annotation.View
  • io.nuls.contract.sdk.annotation.Required
  • io.nuls.contract.sdk.annotation.Payable
  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Short
  • java.lang.Character
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Float
  • java.lang.Double
  • java.lang.String
  • java.lang.StringBuilder
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.util.Collection
  • java.util.List
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Map
  • java.util.HashMap
  • java.util.LinkedHashMap
  • java.util.Set
  • java.util.HashSet

3.5 其他限制

  • 合约类只能有一个构造方法,其他类不限制
  • 执行一次合约方法最大的Gas消耗是1000万,包括@View类型的方法调用,请保证尽可能的优化合约代码

4. NULS智能合约简单示例

一个简单的合约

合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。

package contracts.examples;
+
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+public class SimpleStorage implements Contract {
+
+    private String storedData;
+
+    @View
+    public String getStoredData() {
+        return storedData;
+    }
+
+    @Payable
+    public void setStoredData(@Required String storedData) {
+        this.storedData = storedData;
+    }
+
+}
+

在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。 +项目中可以有多个类和接口。

合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 +合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。

注解说明

@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。

@Payable 标记@Payable的方法,才能在调用时候传入金额

@Required 标记@Required的参数,调用时候必须传入值

去github下载NULS源码,里面有一些合约示例。

5. NULS Contract SDK

合约SDK提供了几个类,方便合约开发:

io.nuls.contract.sdk.Address

public class Address {
+
+    private final String address;
+
+    public Address(String address) {
+        valid(address);
+        this.address = address;
+    }
+
+    /**
+     * 获取该地址的余额(只能获取合约地址余额)
+     *
+     * @return
+     */
+    public native BigInteger balance();
+
+    /**
+     * 合约向该地址转账
+     *
+     * @param value 转账金额(多少Na)
+     */
+    public native void transfer(BigInteger value);
+
+    /**
+     * 调用该地址的合约方法
+     *
+     * @param methodName 方法名
+     * @param methodDesc 方法签名
+     * @param args       参数
+     * @param value      附带的货币量(多少Na)
+     */
+    public native void call(String methodName, String methodDesc, String[][] args, BigInteger value);
+
+	/**
+     * 调用该地址的合约方法并带有返回值(String)
+     *
+     * @param methodName 方法名
+     * @param methodDesc 方法签名
+     * @param args       参数
+     * @param value      附带的货币量(多少Na)
+     * @return 调用合约后的返回值
+     */
+    public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value);
+    
+    /**
+     * 验证地址
+     *
+     * @param address
+     * @see io.nuls.kernel.utils.AddressTool#validAddress(String)
+     */
+    private native void valid(String address);
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Address address1 = (Address) o;
+        return address != null ? address.equals(address1.address) : address1.address == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return address != null ? address.hashCode() : 0;
+    }
+
+    @Override
+    public String toString() {
+        return address;
+    }
+
+}
+

io.nuls.contract.sdk.Block

public class Block {
+
+    /**
+     * 给定块的区块头
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static native BlockHeader getBlockHeader(long blockNumber);
+
+    /**
+     * 当前块的区块头
+     *
+     * @return
+     */
+    public static native BlockHeader currentBlockHeader();
+    
+    /**
+     * 最新块的区块头
+     *
+     * @return 最新块的区块头
+     */
+    public static native BlockHeader newestBlockHeader();
+
+    /**
+     * 给定块的哈希值
+     * hash of the given block
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static String blockhash(long blockNumber) {
+        return getBlockHeader(blockNumber).getHash();
+    }
+
+    /**
+     * 当前块矿工地址
+     * current block miner’s address
+     *
+     * @return
+     */
+    public static Address coinbase() {
+        return currentBlockHeader().getPackingAddress();
+    }
+
+    /**
+     * 当前块编号
+     * current block number
+     *
+     * @return
+     */
+    public static long number() {
+        return currentBlockHeader().getHeight();
+    }
+
+    /**
+     * 当前块时间戳
+     * current block timestamp
+     *
+     * @return
+     */
+    public static long timestamp() {
+        return currentBlockHeader().getTime();
+    }
+    
+}
+

io.nuls.contract.sdk.BlockHeader

public class BlockHeader {
+
+    private String hash;
+    private long time;
+    private long height;
+    private long txCount;
+    private Address packingAddress;
+    private String stateRoot;
+
+    public String getHash() {
+        return hash;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getTxCount() {
+        return txCount;
+    }
+
+    public Address getPackingAddress() {
+        return packingAddress;
+    }
+
+    public String getStateRoot() {
+        return stateRoot;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BlockHeader that = (BlockHeader) o;
+
+        if (time != that.time) return false;
+        if (height != that.height) return false;
+        if (txCount != that.txCount) return false;
+        if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
+        if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
+            return false;
+        return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = hash != null ? hash.hashCode() : 0;
+        result = 31 * result + (int) (time ^ (time >>> 32));
+        result = 31 * result + (int) (height ^ (height >>> 32));
+        result = 31 * result + (int) (txCount ^ (txCount >>> 32));
+        result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
+        result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "BlockHeader{" +
+                "hash='" + hash + '\'' +
+                ", time=" + time +
+                ", height=" + height +
+                ", txCount=" + txCount +
+                ", packingAddress=" + packingAddress +
+                ", stateRoot='" + stateRoot + '\'' +
+                '}';
+    }
+
+}
+

io.nuls.contract.sdk.Contract

/**
+ * 合约接口,合约类实现这个接口
+ */
+public interface Contract {
+
+    /**
+     * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。
+     */
+    default void _payable() {
+    }
+
+}
+

io.nuls.contract.sdk.Event

/**
+* 事件接口,事件类实现这个接口
+*/
+public interface Event {
+}
+

io.nuls.contract.sdk.Msg

public class Msg {
+
+    /**
+     * 剩余Gas
+     * remaining gas
+     *
+     * @return
+     */
+    public static native long gasleft();
+
+    /**
+     * 合约发送者地址
+     * sender of the contract
+     *
+     * @return
+     */
+    public static native Address sender();
+
+    /**
+     * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na
+     * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na
+     *
+     * @return
+     */
+    public static native BigInteger value();
+
+    /**
+     * Gas价格
+     * gas price
+     *
+     * @return
+     */
+    public static native long gasprice();
+
+    /**
+     * 合约地址
+     * contract address
+     *
+     * @return
+     */
+    public static native Address address();
+
+}
+

io.nuls.contract.sdk.Utils

public class Utils {
+
+    private Utils() {
+    }
+
+    /**
+     * 检查条件,如果条件不满足则回滚
+     *
+     * @param expression
+     */
+    public static void require(boolean expression) {
+        if (!expression) {
+            revert();
+        }
+    }
+
+    /**
+     * 检查条件,如果条件不满足则回滚
+     *
+     * @param expression
+     * @param errorMessage
+     */
+    public static void require(boolean expression, String errorMessage) {
+        if (!expression) {
+            revert(errorMessage);
+        }
+    }
+
+    /**
+     * 终止执行并还原改变的状态
+     */
+    public static void revert() {
+        revert(null);
+    }
+
+    /**
+     * 终止执行并还原改变的状态
+     *
+     * @param errorMessage
+     */
+    public static native void revert(String errorMessage);
+
+    /**
+     * 发送事件
+     *
+     * @param event
+     */
+    public static native void emit(Event event);
+
+	/**
+     * @param seed a private seed
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom(long seed) {
+        int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode();
+        int hash2 = Msg.address().toString().substring(2).hashCode();
+        int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0;
+        int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode();
+
+        long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4;
+
+        seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+        return ((int) (seed >>> 24) / (float) (1 << 24));
+    }
+
+    /**
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom() {
+        return pseudoRandom(0x5DEECE66DL);
+    }
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param src source string (hex encoding string)
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(String hexString);
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param bytes source byte array
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(byte[] bytes);
+    
+    /**
+     * [Testnet]verify signature data(ECDSA)
+     *
+     * @param data(hex encoding string)
+     * @param signature(hex encoding string)
+     * @param pubkey(hex encoding string)
+     * @return verify result
+     */
+    public static native boolean verifySignatureData(String data, String signature, String pubkey);
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @param algorithm hash算法标识
+     * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+        return getRandomSeed(endHeight, seedCount, "SHA3");
+    }
+
+    /**
+     * [Testnet]根据高度范围,用特定的算法生成一个随机种子
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @param algorithm   hash算法标识
+     * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+    /**
+     * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static BigInteger getRandomSeed(long startHeight, long endHeight){
+        return getRandomSeed(startHeight, endHeight, "SHA3");
+    }
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+    /**
+     * [Testnet]根据高度范围,获取原始种子的集合
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+    
+}
+

io.nuls.contract.sdk.annotation.Payable

@Payable 标记@Payable的方法,才能在调用时候转入金额

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Payable {
+}
+

io.nuls.contract.sdk.annotation.Required

@Required 标记@Required的参数,调用时候必须传入值

@Target({ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Required {
+}
+

io.nuls.contract.sdk.annotation.View

@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface View {
+}
+

6. 智能合约主要的RPC接口

这里列举几个接口的参数结构及简单实例,其他接口请参见Swagger UI

测试网的Swagger UI的端口默认是8001,正式网的端口默认是6001

6.1 创建智能合约

  • POST /api/contract/create
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
gasLimit* long 最大gas消耗
price* long 执行合约单价
contractCode* string 智能合约代码(字节码的Hex编码字符串)
remark string 备注
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "gasLimit": 4687,
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "remark": "asd",
+  "args": []
+}
+

6.2 估算创建智能合约的Gas消耗

  • POST /api/contract/imputedgas/create
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
price* long 执行合约单价
contractCode* string 智能合约代码(字节码的Hex编码字符串)
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "args": []
+}
+

6.3 调用智能合约

  • POST /api/contract/call
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
contractAddress* string 智能合约地址
gasLimit* long 最大Gas消耗
price* long 执行合约单价
value long 交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)
methodName* string 方法名
methodDesc string 方法签名,如果方法名不重复,可以不传
remark string 备注
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "password": "",
+  "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U",
+  "gasLimit": 8000,
+  "price": 20,
+  "value": 0,
+  "methodName": "balance",
+  "methodDesc": "",
+  "remark": "qwe"
+  "args": []
+}
+

6.4 估算调用智能合约的Gas消耗(参见Swagger UI)

  • POST /api/contract/imputedgas/call

6.5 估算智能合约的price(参见Swagger UI)

  • POST /api/contract/imputedprice

6.6 终止智能合约(参见Swagger UI)

  • POST /api/contract/delete

6.7 调用不上链的智能合约函数(参见Swagger UI)

  • POST /api/contract/view

6.8 获取智能合约执行结果(参见Swagger UI)

  • GET /api/contract/result/{hash}

6.9 获取智能合约基本信息(参见Swagger UI)

  • GET /api/contract/info/{address}

6.10 验证是否为合约地址(参见Swagger UI)

  • GET /api/contract/{address}

6.11 获取智能合约地址的NULS余额(参见Swagger UI)

  • GET /api/contract/balance/{address}

6.12 获取智能合约交易详情(参见Swagger UI)

  • GET /api/contract/tx/{hash}

6.13 获取智能合约的交易列表(参见Swagger UI)

  • GET /api/contract/tx/list/{address}

6.14 根据address和limit查询合约UTXO(参见Swagger UI)

  • GET /api/contract/limit/{address}/{limit}

6.15 根据address和amount查询合约UTXO(参见Swagger UI)

  • GET /api/contract/amount/{address}/{amount}

6.16 向智能合约转账(参见Swagger UI)

  • POST /api/contract/transfer

7. 示例

7.1 投票智能合约代码片段, 如下

完整代码: https://github.com/nuls-io/nuls-vote

package io.nuls.vote.contract;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Utils;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.View;
+import io.nuls.vote.contract.func.BaseVote;
+import io.nuls.vote.contract.func.VoteInterface;
+import io.nuls.vote.contract.model.VoteConfig;
+import io.nuls.vote.contract.model.VoteEntity;
+
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Map;
+
+public class VoteContract implements Contract {
+
+    private VoteInterface baseVote;
+
+    public VoteContract(long minRecognizance) {
+        baseVote = new BaseVote(BigInteger.valueOf(minRecognizance));
+    }
+
+    @Payable
+    public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) {
+        VoteEntity voteEntity = baseVote.create(title, desc, items);
+
+        VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify);
+        boolean success = baseVote.init(voteEntity.getId(), config);
+
+        Utils.require(success);
+
+        return voteEntity;
+    }
+
+    public boolean vote(long voteId, long[] itemIds) {
+        return baseVote.vote(voteId, itemIds);
+    }
+
+    public boolean redemption(long voteId) {
+        return baseVote.redemption(voteId);
+    }
+
+    @View
+    public boolean canVote(long voteId) {
+        return baseVote.canVote(voteId);
+    }
+
+    @View
+    public VoteEntity queryVote(long voteId) {
+        return baseVote.queryVote(voteId);
+    }
+
+    @View
+    public Map<Address, List<Long>> queryVoteResult(long voteId) {
+        return baseVote.queryVoteResult(voteId);
+    }
+
+    @View
+    public boolean queryAddressHasVote(long voteId, Address address) {
+        return baseVote.queryAddressHasVote(voteId, address);
+    }
+}
+
+

智能合约的方法中如果有数组类型的参数,请使用如下方式传递参数

参考以上投票合约代码中的create方法

{
+  "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf",
+  "password": "",
+  "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4",
+  "gasLimit": 200000,
+  "price": 1,
+  "value": 10000000000,
+  "methodName": "create",
+  "methodDesc": "",
+  "remark": "",
+  "args": [
+    "测试投票1",
+    "第一个投票合约",
+    [
+      "第一个选项",
+      "第二个选项",
+      "第三个选项"
+    ],
+    1536044066056, 1536184066056, false, 300, false
+  ]
+}
+

7.2 Standard Token 智能合约代码片段

完整代码: https://github.com/nuls-io/nuls-nrc20

package io.nuls.contract.token;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import static io.nuls.contract.sdk.Utils.emit;
+import static io.nuls.contract.sdk.Utils.require;
+
+public class SimpleToken implements Contract, Token {
+
+    private final String name;
+    private final String symbol;
+    private final int decimals;
+    private BigInteger totalSupply = BigInteger.ZERO;
+
+    private Map<Address, BigInteger> balances = new HashMap<Address, BigInteger>();
+    private Map<Address, Map<Address, BigInteger>> allowed = new HashMap<Address, Map<Address, BigInteger>>();
+
+    @Override
+    @View
+    public String name() {
+        return name;
+    }
+
+    @Override
+    @View
+    public String symbol() {
+        return symbol;
+    }
+
+    @Override
+    @View
+    public int decimals() {
+        return decimals;
+    }
+
+    @Override
+    @View
+    public BigInteger totalSupply() {
+        return totalSupply;
+    }
+
+    public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) {
+        this.name = name;
+        this.symbol = symbol;
+        this.decimals = decimals;
+        totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));;
+        balances.put(Msg.sender(), totalSupply);
+        emit(new TransferEvent(null, Msg.sender(), totalSupply));
+    }
+
+    @Override
+    @View
+    public BigInteger allowance(@Required Address owner, @Required Address spender) {
+        Map<Address, BigInteger> ownerAllowed = allowed.get(owner);
+        if (ownerAllowed == null) {
+            return BigInteger.ZERO;
+        }
+        BigInteger value = ownerAllowed.get(spender);
+        if (value == null) {
+            value = BigInteger.ZERO;
+        }
+        return value;
+    }
+
+    @Override
+    public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) {
+        subtractAllowed(from, Msg.sender(), value);
+        subtractBalance(from, value);
+        addBalance(to, value);
+        emit(new TransferEvent(from, to, value));
+        return true;
+    }
+
+    @Override
+    @View
+    public BigInteger balanceOf(@Required Address owner) {
+        require(owner != null);
+        BigInteger balance = balances.get(owner);
+        if (balance == null) {
+            balance = BigInteger.ZERO;
+        }
+        return balance;
+    }
+
+    @Override
+    public boolean transfer(@Required Address to, @Required BigInteger value) {
+        subtractBalance(Msg.sender(), value);
+        addBalance(to, value);
+        emit(new TransferEvent(Msg.sender(), to, value));
+        return true;
+    }
+
+    @Override
+    public boolean approve(@Required Address spender, @Required BigInteger value) {
+        setAllowed(Msg.sender(), spender, value);
+        emit(new ApprovalEvent(Msg.sender(), spender, value));
+        return true;
+    }
+
+    public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) {
+        addAllowed(Msg.sender(), spender, addedValue);
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) {
+        check(subtractedValue);
+        BigInteger oldValue = allowance(Msg.sender(), spender);
+        if (subtractedValue.compareTo(oldValue) > 0) {
+            setAllowed(Msg.sender(), spender, BigInteger.ZERO);
+        } else {
+            subtractAllowed(Msg.sender(), spender, subtractedValue);
+        }
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    private void addAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance);
+        check(value);
+        setAllowed(address1, address2, allowance.add(value));
+    }
+
+    private void subtractAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance, value, "Insufficient approved token");
+        setAllowed(address1, address2, allowance.subtract(value));
+    }
+
+    private void setAllowed(Address address1, Address address2, BigInteger value) {
+        check(value);
+        Map<Address, BigInteger> address1Allowed = allowed.get(address1);
+        if (address1Allowed == null) {
+            address1Allowed = new HashMap<Address, BigInteger>();
+            allowed.put(address1, address1Allowed);
+        }
+        address1Allowed.put(address2, value);
+    }
+
+    private void addBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(value, "The value must be greater than or equal to 0.");
+        check(balance);
+        balances.put(address, balance.add(value));
+    }
+
+    private void subtractBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(balance, value, "Insufficient balance of token.");
+        balances.put(address, balance.subtract(value));
+    }
+
+    private void check(BigInteger value) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
+    }
+
+    private void check(BigInteger value1, BigInteger value2) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0);
+    }
+
+    private void check(BigInteger value, String msg) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg);
+    }
+
+    private void check(BigInteger value1, BigInteger value2, String msg) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0, msg);
+    }
+
+
+
+}
+
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/guessTheSize.html b/docs/.vuepress/dist/zh/NULS1.0/guessTheSize.html new file mode 100644 index 00000000..7d2357f6 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/guessTheSize.html @@ -0,0 +1,29 @@ + + + + + + 猜大小游戏客户端操作手册 | NULS + + + + + + + +

猜大小游戏客户端操作手册

目前猜大小游戏合约部署在测试网上运行,如果需要测试网NULS,可进行申请

合约地址:TTb4653R7bUL9Pw2qKLtS4K7FiWKnZ8N

查找合约

1 打开钱包客户端,点击顶部【合约】菜单

2 点击【查找合约】,在输入框中填入合约地址,点击访问。即可查找到该合约

1547780793

3 还可点击合约右侧的星进行收藏。收藏后可在【我的合约】中看到该合约

创建游戏

1 下拉列表中选择【createGame】方法

2 在【selection】输入框中填写值:

  • 0代表【猜小】
  • 1代表【猜大】

3 点击【高级选项】,在【value】输入框中填入值,该值代表本轮猜大小游戏中你所下注的NULS数量

1547628483706

4 点击【调用】按钮,创建本轮游戏

5 从返回结果中找到该轮游戏的ID

1547628433529

加入游戏

1 从游戏创建者或等待参与的游戏列表中拿到想要参与的某轮游戏ID

2 在下拉列表中选择【joinGame】方法,在【gameId】输入框中填入本轮游戏的ID

3 点击【高级选项】,在【value】输入框中填入下注的NULS数量,且该数量要和创建者的下注数量相同

1547628433529

4 点击【调用】按钮,加入游戏

开奖

为防止技术作弊,合约会要求随机确认几个块才可开奖,上限为10。因此加入游戏后最多确认10个块之后即可进行开奖

1 下拉列表中选择【draw】方法,【gameID】输入框中填入本轮游戏的ID

1547629113708

2 点击【调用】按钮,进行开奖。调用完成后会返回游戏结果,且合约会将赢得的NULS和抵押的NULS一起转入获胜账户地址

由于需防止技术作弊,

1547629614931

撤销游戏

若创建游戏100个块之后还没有参与者,则本轮游戏创建者可选择撤销游戏,拿回下注的NULS

1 下拉列表中选择【interrupt】

2 【gameId】输入框中填入想要撤销游戏的Id,点击【调用】按钮,即可撤销该轮游戏

1547631195826

查看游戏详情

1 下拉列表中选择【viewGameDetail】

2 【gameId】输入框中填入想要查询游戏的Id,点击【调用】按钮,即可获取该轮游戏详情

1547630048933

查看本合约创建了多少个游戏

下拉列表中选择【viewGamesTotalCount】方法,点击【调用】按钮即可

1547630351497

查看等待参与的游戏

下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可

1547630438203

查看等待开奖的游戏

下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可

1547630589355

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/ideaPlugin.html b/docs/.vuepress/dist/zh/NULS1.0/ideaPlugin.html new file mode 100644 index 00000000..ace00b0a --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/ideaPlugin.html @@ -0,0 +1,30 @@ + + + + + + IDEA插件 | NULS + + + + + + + +

IDEA插件

1 在IDEA安装NULS插件

  • 获取NULS插件ZIP包,存放在磁盘 +点击File->Settings->Plugin->Install plugin from disk

Install

  • 选择之前获取到的ZIP包,然后点击OK

Install

  • 勾选上NULS插件,点击Apply

Install

2 创建一个NULS项目

create

输入Project名,点击finish

create

3 编写智能合约

智能合约代码编写可查看开发者文档

code

4 设置部署合约的节点和账户

  • 点击右方的NULS插件,调出NULS插件面板

    code

  • 插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址

    点击面板左上角的+号,选择Add Node

    code

  • 输入Node地址,点击OK

    code

  • 点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK

    code

5 打包合约

  • 点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码

    code

  • 可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤)

    code

  • 点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面

    code

    code

6 部署合约

  • 在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径

    code

  • 紧接JarFilePath的参数为该合约构造函数的参数

    code

  • 点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败

    code

  • 点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息

    code

  • 若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功

    code

  • 可在面板上方查看已部署的合约

    code

  • 点击部署成功的合约,可查看该合约的所有方法

    code

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/index.html b/docs/.vuepress/dist/zh/NULS1.0/index.html new file mode 100644 index 00000000..f80f834d --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/index.html @@ -0,0 +1,21 @@ + + + + + + 欢迎来到NULS | NULS + + + + + + + +

欢迎来到NULS

NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动

NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等

NULS2.0 Alpha版本已发布

前往体验

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/randomImplementations.html b/docs/.vuepress/dist/zh/NULS1.0/randomImplementations.html new file mode 100644 index 00000000..a91d4e65 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/randomImplementations.html @@ -0,0 +1,36 @@ + + + + + + 随机数的几种实现方式 | NULS + + + + + + + +

随机数的几种实现方式

参考资料:

Solidity Pitfalls: Random Number Generation for Ethereum

Predicting Random Numbers in Ethereum Smart Contracts

1. 线性同余发生器(LCG)算法获取伪随机数

NULS智能合约的SDK中提供了一种获取随机数的方式,它采用当前块的矿工地址、合约地址、合约调用者地址、当前块的时间戳作为随机因子,使用线性同余发生器(LCG)算法获取伪随机数

调用方式如下:

io.nuls.contract.sdk.Utils.pseudoRandom();
+/**
+ * 增加一个随机因子
+ */
+io.nuls.contract.sdk.Utils.pseudoRandom(long seed);
+

--

2. 使用未来块的BlockHash

以彩票为例,抽奖需要调用两次合约交易,第一次,结束彩票,第二次,抽奖

第一次结束彩票后,记录当前块高度H1,并生成一个数字N,在未来区块高度达到H1+N的时候,才能抽奖

第二次抽奖时,根据第一次记录的块高度H1再加上(0~80]个块(待定)得到块高度H2,获取H2这个块的BlockHash,以它作为随机种子

ETH不能使用这种方式的原因如下: +

--

3. 随机种子限定在参与者内

以彩票为例,我们需要更多任意数据来挑选我们的赢家。当我们开奖时,我们可以使用已经进入我们的彩票智能合约的玩家的地址作为随机因子,以此产生随机数。

--

4. commit-reveal

同样以彩票为例

  • 合约为随机数留出奖励。

  • 每个用户生成他们自己的秘密随机数 N。

  • 用户通过散列他们N和地址来创建他们的秘密随机数的哈希值:String hash = sha3(N + Msg.sender())。

      注意:步骤2和3应在本地秘密进行,例如用户把N提交到彩票应用中,彩票应用完成hash运算
    +
  • 用户将其哈希值发送给智能合约。

  • 提交的内容将持续一定数量的块,或者直到有足够的参与者加入。

  • 一旦提交轮次结束,揭幕轮开始。

  • 每个用户将其随机数提交N给智能合约。

  • 合约验证sha3(N + Msg.sender())匹配原始提交。

  • 如果用户未及时提交有效N,则他的存款将被没收。

  • 把所有验证过的N 进行 XOR 异或运算得到随机数。

  • 该数字用于确定哪些参与者获得奖励 --->(N % numUsers)。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/randomRPC.html b/docs/.vuepress/dist/zh/NULS1.0/randomRPC.html new file mode 100644 index 00000000..485984c6 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/randomRPC.html @@ -0,0 +1,201 @@ + + + + + + 钱包增加随机种子 | NULS + + + + + + + +

钱包增加随机种子

一 、钱包增加随机种子RPC接口

获取的随机种子是大数字,注意,它可能是负数

根据高度区间获取随机种子列表:

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True 区间起始高度
endHeight Long True 区间截止高度,不能超过startHeight+1000

Returns:

field type Remark
success boolean 是否成功
data array 种子数组

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

根据高度区间获取随机种子列表:

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True 获取种子列表的最高高度
count Long True 随机种子数量,不能超过128

Returns:

field type Remark
success boolean 是否成功
data array 种子数组

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True 区间起始高度
endHeight Long True 区间截止高度,endHeight-startHeight<=1000
algorithm String false 默认为sha3算法,支持sha3、KECCAK、merkle算法

Returns:

field type Remark
success boolean 是否成功
data Object 结果对象
seed String 计算的随机种子结果
algorithm String 计算的 算法
count int 原始随机种子个数

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True 获取种子列表的最高高度
count Long True 随机种子数量,不能超过128
algorithm String false 默认为sha3算法,支持sha3、KECCAK、merkle算法

Returns:

field type Remark
success boolean 是否成功
data Object 结果对象
seed String 计算的随机种子结果
algorithm String 计算的 算法
count int 原始随机种子个数

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

二、智能合约支持底层链随机数

与以上RPC接口相同,在智能合约SDK中支持了相同的方法来获取底层区块链提供的随机数种子,如以下代码。 +后面将以其中一个方法Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)为例,展示如何使用随机数种子产生随机数。

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @param algorithm hash算法标识
+ * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]根据高度范围,用特定的算法生成一个随机种子
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @param algorithm   hash算法标识
+ * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]根据高度范围,获取原始种子的集合
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) 例子同时摇N一个骰子

2.1) 计算方式一

  • 获取原始种子Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • 根据骰子范围求模得到第一个随机数
  • 下一个随机数的计算方式 +
    • 原始种子乘以投掷次数,得到的结果转换成字节数组
    • 把字节数组进行SHA3-256得到32位字节数组的Hash
    • 把此Hash的字节数组转换为BigInteger大数字
    • 将此BigInteger大数字根据骰子范围求模得到下一个随机数
    • 以此类推

参考以下代码

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) 计算方式二

  • 获取原始种子Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • 根据骰子范围求模得到第一个随机数
  • 下一个随机数的计算方式 +
    • 获取原始种子大数字的末位数字(根据投掷次数获取倒数第几位),将此末位数字乘以原始种子,得到的结果转换成字节数组
    • 把字节数组进行SHA3-256得到32位字节数组的Hash
    • 把此Hash的字节数组转换为BigInteger大数字
    • 将此BigInteger大数字根据骰子范围求模得到下一个随机数
    • 以此类推

参考以下代码

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/rpcToolWebsocketDesign.html b/docs/.vuepress/dist/zh/NULS1.0/rpcToolWebsocketDesign.html new file mode 100644 index 00000000..42881d4b --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/rpcToolWebsocketDesign.html @@ -0,0 +1,339 @@ + + + + + + RPC-Tool-WebSocket设计 | NULS + + + + + + + +

RPC-Tool-WebSocket设计

Websocket-Tool设计文档——第四版

[TOC]

写在最前的话

如果想知道websocket的具体设计,请逐步阅读本文档
+
+如果只想知道如何使用,请跳转到章节《7.1 如何使用》
+

一、总体描述

1.1 概述

1.1.1 为什么要有《Websocket-Tool》

  • NULS 2.0根据功能划分模块,所有模块隔离,可以独立运行。
  • 模块间通过《Websocket-Tool》调用接口
  • 模块只要实现了规定接口,可以用任何语言实现
  • 模块可以分布式部署
  • 《Websocket-Tool》会打包成jar包,供各模块引用

1.1.2 《Websocket-Tool》要做什么

所有模块间的接口调用都通过《Websocket-Tool》进行

  • 启动Websocket Server
  • 注册当前模块的所有cmd命令
  • 把当前模块信息汇报给kernel
  • 接收从kernel推送的所有模块信息
  • 启动Websocket Client
  • 维护调用过程产生的数据
  • 封装所有数据中间处理过程,各模块只需要关心 +
    • 输入
    • 输出
  • 各模块通过尽可能简单的方式调用cmd命令

1.1.3 《Websocket-Tool》在系统中的定位

《Websocket-Tool》是底层框架,任何模块都会依赖

《Websocket-Tool》维护各模块基础信息,但是不涉及具体业务

二、功能设计

2.1 架构图

三、接口设计

四、事件说明

五、协议

5.1 通信协议 – Json/WebSockets

微服务的行为不像标准的客户端 - 服务器基础设施,因为每个微服务同时是客户端和服务器,因此需要全双工通信协议,这允许实现特殊类型的发布 - 订阅模式; 在这个实现中,方法只能被调用一次,然后调用者可以通过两种不同的方式接收不断的更新:

  • 基于事件:当方法在预定义数量的事件之后发送通知时
  • 基于时间:当方法在预定义的秒数后发送通知时

WebSocket是一种成熟的选项,可以本机提供全双工连接,其他选项如标准Json-RPC不提供双向通道。 +消息将使用JSon格式进行编码,因为它是最广泛用于消息交换的,并且易于调试。

5.2 消息结构

所有消息都有一个由5个字段组成的公共基础结构:

  • MessageID:这是一个标识请求的字符串。 它的长度不应超过256个字符
  • Timestamp:自纪元以来的秒数(1970年1月1日格林威治标准时间00:00:00)
  • TimeZone:发起请求的时区,它应为介于-12和12之间的数字
  • MessageType:消息类型,这些在第3节中指定
  • MessageData:保存消息有效负载的Json对象

示例:

{  
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"NegotiateConnection",
+    "MessageData":{
+        "CompressionRate":"3",
+        "CompressionAlgorithm":"zlib"
+    }
+}
+

5.3 Message Types

目前只定义了9种类型的消息:NegotiateConnection, NegotiateConnectionResponse, Request, Unsubscribe, Response, Ack, Notificatioin, RegisterCompoundMethod, UnregisterCompoundMethod

5.3.1 NegotiateConnection

这应该是在与微服务建立连接时应该发送的第一个对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。

它由两个字段组成:

  • CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。
  • CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩

示例:

{
+    "messageId":"1",
+    "timestamp":"1543133816985",
+    "timezone":"9",
+    "messageType":"NegotiateConnection",
+    "messageData":{
+        "protocolVersion":"1.0",
+        "compressionAlgorithm":"zlib",
+        "compressionRate":"0"
+    }
+}
+

5.3.2 NegotiateConnectionResponse

仅在响应先前传入的NegotiateConnection消息时发送此类消息。 它由两个字段组成:

  • NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1
  • NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"NegotiateConnectionReponse",
+    "MessageData":{
+        "NegotiationStatus":"0",
+        "NegotiationComment":"Incompatible protocol version"
+    }
+}
+

5.3.3 Request

调用者服务必须发送一个Request对象来执行Nulstar网络内某些服务提供的方法。

如果在单个请求对象中包含两个或更多方法,则应按顺序执行方法,然后发送一个response包喊所有回执信息,如果其中一个请求失败,则整个操作被视为失败。

它由六个字段组成:

  • RequestAck(默认值:0):这是一个布尔值

    • 0:发出的请求只需要一条Response消息,如果它订阅了该函数,那么它可能会有很多响应消息
    • 1:发出的请求需要Ack和Response(译者注:有的请求可能需要一段时间处理,不会立刻返回Response,但是我要确保对方接收到了我的请求),如果它订阅了该函数,那么它可能会有很多响应消息
  • SubscriptionEventCounter(默认值:0):这是一个无符号整数,指定目标方法发送Response的值的改变次数。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每改变两次就发送。以此类推。

  • SubscriptionPeriod(默认值:0):这是一个无符号整数,指定目标方法发送Response的时间间隔。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每2秒都会检测是否发送。以此类推。

  • SubscriptionRange:如果请求的事件返回的是一个数字,则定义何时返回这个数字。 +这是一个字符串,表示将触发响应的条件。 字符串是一对带符号的十进制数,第一个是下限,第二个是上限,如果不可用则为空。 如果该对分别以“(”或“)”开始或结束,则表示该数字不包括在内,如果该对分别以“[”或“]”开始或结束,则表示该数字包括在内。

    示例:假设我们只希望仅在余额等于或大于1000时收到通知。然后,getbalance请求应以“[1000,)”字符串作为SubscriptionRange参数发送

  • ResponseMaxSize(默认值:0):无符号整数,指定方法应返回的最大对象数,值为零(默认值)表示无限制。只针对返回结果为List有效,指定的是返回的记录个数。

  • RequestMethods:一个数组,包含所请求的所有方法及其各自的参数

示例:

{
+    "messageId":"3",
+    "timestamp":"1543133968578",
+    "timezone":"9",
+    "messageType":"Request",
+    "messageData":{
+        "requestAck":"0",
+        "subscriptionEventCounter":"0",
+        "subscriptionPeriod":"5",
+        "subscriptionRange":"0",
+        "responseMaxSize":"0",
+        "requestMethods":{
+            "getHeight":{
+                "paramName":"value",
+                "version":"1.0"
+            }
+        }
+    }
+}
+

5.3.4 Unsubscribe

当服务不再希望从其订阅的方法接收响应时,它必须向目标服务发送Unsubscribe消息。

它由一个字段组成:

  • UnsubscribeMethods:一个数组,包含调用者想要取消订阅的所有方法

示例:

{
+    "messageId":"4",
+    "timestamp":"1543134296019",
+    "timezone":"9",
+    "messageType":"Unsubscribe",
+    "messageData":{
+        "unsubscribeMethods":[
+            "getHeight"
+        ]
+    }
+}
+

5.3.5 Response

当目标服务完成处理请求时,应该发送响应以及操作结果。

它由六个字段组成:

  • RequestID:这是引用的原始Request消息请求ID
  • ResponseProcessingTime:目标服务处理请求所用的时间(以毫秒为单位)
  • ResponseStatus:响应状态,如果成功则为1,否则为0
  • ResponseComment:一个字符串,可以提供有关该过程结果的更多说明
  • ResponseMaxSize:响应包含每个请求的最大对象数
  • ResponseData:一个对象数组,包含已处理方法的结果,每个请求一个对象

示例:

{
+    "messageId":"9",
+    "timestamp":"1543134299030",
+    "timezone":"9",
+    "messageType":"Response",
+    "messageData":{
+        "requestId":"5",
+        "responseProcessingTime":"1",
+        "responseStatus":"1",
+        "responseComment":"Congratulations! Processing completed!",
+        "responseMaxSize":"0",
+        "responseData":{
+            "getHeight":"getHeight->1.3"
+        }
+    }
+}
+

3.5.6 Ack

其唯一目的是通知呼叫者已成功接收请求。

它由一个字段组成:

  • RequestID:这是引用的原始Request消息请求ID

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"Ack",
+    "MessageData":{
+        "RequestID":"sdj8jcf8899ekffEFefee"
+    }
+}
+

3.5.7 Notification

当需要将某些事件通知给连接的组件而不期望响应消息时(例如,即将对服务执行升级时),将发送此消息类型。 通知将信息推送到其他组件,因此通知只应由Manager,Controller和Connector模块使用

它由四个字段组成:

  • NotificationAck :(默认值:0):这是一个布尔值 +
    • 0:发出的通知不期望任何类型的消息作为回执
    • 1:发出的通知需要一条Ack消息
  • NotificationType:通知的类别,每个服务都可以定义自己的类型,因此不需要接收方处理此字段
  • NotificationComment:字符串注释,提供有关通知原因的更多信息
  • NotificationData:与通知相关的数据,接收方不需要处理此字段

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"Notification",
+    "MessageData":{
+        "NotificationAck":"1",
+        "NotificationType":"SystemUpgrade",
+        "NotificationComment":"A system upgrade is about to be performed!",
+        "NotificationData":{
+            "Date":"2018-11-11",
+            "Time":"23:00:00",
+            "NewVersion":"1.1.6"
+        }
+    }
+}
+

3.5.8 RegisterCompoundMethod

请求可以由多个方法组成,使用此消息类型,我们注册一个虚拟方法,该方法将按顺序执行其各个实际方法,如果其子方法之一失败,则虚方法返回失败。

某些子方法可能共享相同的参数名称,因此可以创建别名,如示例中所示。

它由三个字段组成:

  • CompoundMethodName:这是标识虚方法的字符串
  • CompoundMethodDescription:描述方法功能,在查询API以获取帮助时将提供描述
  • CompoundMethods:这是一个数组,包含构成虚方法的各自参数别名的方法

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"RegisterCompoundMethod",
+    "MessageData":{
+        "CompoundMethodName":"GetMyInfo",
+        "CompoundMethodDescription":"Get useful information.",
+        "CompoundMethods":{
+            "GetBalance":{
+                "Address":"GetBalanceAddress"
+            },
+            "GetHeight":{
+
+            }
+        }
+    }
+}
+

在该示例中,正在注册一个名为GetMyInfo的虚方法,它由GetBalance和GetHeight方法组成,还为Address参数创建了一个名为GetBalanceAddress的别名。 +GetMyInfo的请求可以作为标准方法发送。

(我确实没看懂这个的意义在哪,感觉就是单纯为了多这么个功能,有疑问请直接找Berzeck或者坚哥,哈哈)

3.5.9 UnregisterCompoundMethod

此消息类型用于取消注册复合(虚拟)方法。

它由一个字段组成:

  • UnregisterCompoundMethodName:这是标识虚方法的字符串。 如果它为空,则应取消注册调用者注册的所有虚拟方法

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"UnregisterCompoundMethod",
+    "MessageData":{
+        "UnregisterCompoundMethodName":"GetMyInfo"
+    }
+}
+

5.4 具体细节

  • 传输过程的所有属性都是string类型

  • 如果是boolean类型,"1"代表true,"0"代表false

  • 当调用一个方法的时候,调用者需要知道:提供方法的角色,以及方法的使用方式

  • 注册的时候,Role1有method1,Role2有method2,如何定义? +答:不需要定义,这是写在文档中的。 +apiMethods = Role1Methods + Role2Methods。因此注册的时候不需要知道每个Role都包含什么方法,这些应该在文档中体现。

  • 注册接口的字符串格式

    {
    +    "messageId":"2",
    +    "timestamp":"1543204508986",
    +    "timezone":"9",
    +    "messageType":"Request",
    +    "messageData":{
    +        "requestAck":"0",
    +        "subscriptionEventCounter":"0",
    +        "subscriptionPeriod":"0",
    +        "subscriptionRange":"0",
    +        "responseMaxSize":"0",
    +        "requestMethods":{
    +            "registerAPI":{
    +                "apiMethods":[
    +                    {
    +                        "methodName":"getHeight",
    +                        "methodDescription":"test getHeight 1.1",
    +                        "methodMinEvent":"0",
    +                        "methodMinPeriod":"0",
    +                        "methodScope":"private",
    +                        "parameters":[
    +                            {
    +                                "parameterName":"aaa",
    +                                "parameterType":"int",
    +                                "parameterValidRange":"(1,100]",
    +                                "parameterValidRegExp":""
    +                            },
    +                            {
    +                                "parameterName":"bbb",
    +                                "parameterType":"string",
    +                                "parameterValidRange":"",
    +                                "parameterValidRegExp":"^[A-Za-z0-9\\-]+$"
    +                            }
    +                        ]
    +                    },
    +                    {
    +                        "methodName":"getHeight",
    +                        "methodDescription":"test getHeight 2.0",
    +                        "methodMinEvent":"0",
    +                        "methodMinPeriod":"0",
    +                        "methodScope":"private",
    +                        "parameters":[
    +
    +                        ]
    +                    }
    +                ],
    +                "dependencies":{
    +                    "Role_Ledger":"1.1"
    +                },
    +                "connectionInformation":{
    +                    "IP":"192.168.1.65",
    +                    "Port":"17733"
    +                },
    +                "moduleDomain":"nuls.io",
    +                "moduleRoles":{
    +                    "cm":[
    +                        "1.1",
    +                        "1.2"
    +                    ]
    +                },
    +                "moduleVersion":"1.2",
    +                "moduleAbbreviation":"cm",
    +                "moduleName":"Chain Manager"
    +            }
    +        }
    +    }
    +}
    +
  • Manager返回各模块连接信息的字符串格式

    {
    +    "messageId":"8",
    +    "timestamp":"1543204714006",
    +    "timezone":"9",
    +    "messageType":"Response",
    +    "messageData":{
    +        "requestId":"2",
    +        "responseProcessingTime":"1",
    +        "responseStatus":"1",
    +        "responseComment":"Congratulations! Processing completed!",
    +        "responseMaxSize":"0",
    +        "responseData":{
    +            "registerAPI":{
    +                "Dependencies":{
    +                    "test":{
    +                        "APIVersion":[
    +                            "1.0"
    +                        ],
    +                        "IP":"192.168.1.65",
    +                        "Port":"14694"
    +                    },
    +                    "ke":{
    +                        "APIVersion":null,
    +                        "IP":"192.168.1.65",
    +                        "Port":"8887"
    +                    },
    +                    "cm":{
    +                        "APIVersion":[
    +                            "1.1",
    +                            "1.2"
    +                        ],
    +                        "IP":"192.168.1.65",
    +                        "Port":"17733"
    +                    }
    +                }
    +            }
    +        }
    +    }
    +}
    +

六、配置

七、Java特有的设计

7.1 设计

io.nuls.rpc

client

WsClient:与其他模块建立连接的对象,完全封装,不需要开发人员关注

ClientRuntime:客户端运行时需要的数据,方法

CmdDispatcher:开发人员应该只使用它来调用接口

cmd

cmd_package_1

cmd_package_2

BaseCmd:所有对外提供方法的类的父类,提供success, failed方法返回Response对象

info

Constants:常量

HostInfo:获取IP地址,随机获得端口

model

message

Message:所有消息都应该用该对象进行传输

MessageType:消息类型(包含以下9种)

Ack:确认收到消息

NegotiateConnection:握手

NegotiateConnectionResponse:回复握手

Notification:通知

Request:请求调用远程方法

Response:回复Request

Unsubscribe:取消订阅的远程方法

RegisterCompoundMethod:订阅多个远程方法

UnregisterCompoundMethod:取消订阅多个远程方法

CmdAnnotation:注解类,有该注解的方法可以对外提供接口

Parameter:注解类,用以描述对外提供接口的参数信息

Parameters:注解类,Parameter的集合

CmdDetail:对外提供的方法的具体信息

CmdParameter:对外提供的方法的参数信息

ModuleE:枚举类型,NULS2.0基础架构下的模块信息

RegisterApi:一个模块对外提供的所有方法的合集

server

CmdHandler:根据Request消息,调用正确的方法

ServerRuntime:服务器运行时需要的参数,方法

WsProcessor:处理收到的消息队列

WsServer:服务器对象,负责接收消息,然后放入消息队列

7.2 如何使用

Websocket-Tool会做成JAR包供各模块引用

7.2.1 测试专用:模拟kernel

非常重要!

各模块接口是在kernel中进行维护,但是kernel由社区成员开发,因此这一部分是内部测试的模拟代码,可以直接复制使用,无需额外操作。

(test/java/io.nuls.test.WsKernel)

@Test
+public void kernel() throws Exception {
+    // url: "ws://127.0.0.1:8887"
+    WsServer.mockKernel();
+}
+

7.2.2 自定义cmd

scope的值:public,private,admin

  • public:暴露出去,第三方应用/平台也能调用的公开接口
  • private:只有模块间内部才能调用的接口
  • admin:专门为管理员设计的特定接口(管理员定义在在Berzeck的connector中,我们并不需要关心)
/*
+ * 该类所在的包需要通过7.1.3中的方法进行扫描
+ */
+public class MyCmd extends BaseCmd {
+
+    @CmdAnnotation(cmd = "getHeight", version = 1.0, scope = "private", minEvent = 0, minPeriod = 0,
+            description = "test getHeight 1.0")
+    @Parameter(parameterName = "aaa", parameterType = "int", parameterValidRange = "(1,100]", parameterValidRegExp = "")
+    @Parameter(parameterName = "bbb", parameterType = "string")
+    public Object getHeight1(Map map) {
+        Log.info("getHeight version 1");
+        // success
+        return success("Here is your real return value");
+        // 预定义错误
+        return failed(ErrorCode);
+        // 非预定义错误
+        return failed(String)
+    }
+}
+

7.2.3 启动Server

// Start server instance
+WsServer.getInstance(ModuleE.CM)
+    .moduleRoles(new String[]{"1.0", "2.4"})
+    .moduleVersion("1.2")
+    .dependencies(ModuleE.LG.abbr, "1.1")
+    .dependencies(ModuleE.BL.abbr, "2.1")
+    .scanPackage("io.nuls.rpc.cmd.test")
+    .connect("ws://127.0.0.1:8887");
+
+// Get information from kernel
+CmdDispatcher.syncKernel();
+

7.2.4 为kernel提供的接口

现阶段忽略!


+

7.2.5 调用cmd

/*
+  单元测试专用:单元测试时需要告知内核地址,以及同步接口列表
+  如果不是单元测试,在模块中进行连调测试,下面两句话是不需要的
+  */
+WsServer.mockModule();
+/*
+  单元测试专用结束
+  */
+
+
+// Build params map
+Map<String, Object> params = new HashMap<>();
+// Version information ("1.1" or 1.1 is both available)
+params.put(Constants.VERSION_KEY_STR, "1.0");
+params.put("paramName", "value");
+
+// 可以看成是一个同步方法,发送Request,获得Response
+Response response = CmdDispatcher.requestAndResponse(ModuleE.CM.abbr, "getHeight", params);
+
+// 发送Request,当有Response的时候会自动调用预设的方法,返回的messageId是为了取消订阅
+String messageId = CmdDispatcher.requestAndInvoke(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2");
+
+// 与requestAndInvoke一样,但是必须在收到Ack之后才会返回messageId
+String messageId = CmdDispatcher.requestAndInvokeWithAck(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2");
+
+// 取消订阅
+CmdDispatcher.unsubscribe(messageId);
+System.out.println("我已经取消了订阅");
+
+

八、补充内容

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/sdk.html b/docs/.vuepress/dist/zh/NULS1.0/sdk.html new file mode 100644 index 00000000..3d1828e3 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/sdk.html @@ -0,0 +1,995 @@ + + + + + + SDK | NULS + + + + + + + +

SDK

介绍

本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。

约定

  • 所有SDK接口统一返回Result(说明见文末附件数据解释)
  • 每个接口描述的返回对象是指Result中data属性的内容
  • 除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na
  • 运行SDK前,需要确认NULS节点服务已经启动并工作正常
  • 推荐使用JDK1.8+

版本更新记录

版本 更新日期 更新内容
v0.9.11.0 2018-06-19 对接NULS服务各项基础功能的接口
v0.9.11.1 2018-06-22 新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1
v0.9.14 2018-07-04 修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等)
v0.9.15 2018-07-07 新增4个共识接口,4.1——4.4
v0.9.16 2018-07-11 新增接口4.5
v1.0.1 2018-07-13 新增错误码
v1.1.0 2018-09-28 新增多账户转账接口

快速入门

1.引入文件

使用构建工具导入jar包

  • maven方式
<dependency>
+   <groupId>io.nuls.sdk</groupId>
+   <artifactId>sdk-all</artifactId>
+   <version>1.0.1</version>
+</dependency>
+

2.创建SDK实例

首先添加SDK命名空间

//SDK启动类命名空间
+import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+//引入SDK调用工具的命名空间
+import io.nuls.sdk.tool.NulsSDKTool;
+

引入后 使用下列代码生成一个实例client

  • 初始化SDK
  • 初始化方法不传参数时,默认PRC ip和端口分别为127.0.0.18001
//默认 
+SDKBootstrap.init();
+//传入NULS服务的ip,port
+SDKBootstrap.init("192.168.1.88", "8001");
+
  • 使用工具类调用接口方法
Result result = NulsSDKTool.createAccount("nuls123456");
+

e.g 创建一个带密码的账户的完整示例

import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+//根据需求引入对应模块的命名空间
+import io.nuls.sdk.tool.NulsSDKTool;
+
+public static void main(String[] args) {
+	SDKBootstrap.init();
+	Result result = NulsSDKTool.createAccount("nuls123456");
+}
+

--

账户 AccountService

1.1 创建账户

接口

Result createAccount(int count, String password);

说明

创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户; +成功创建的账户信息将被持久化至NULS服务本地数据库中。

返回成功创建的账户地址集合

参数 类型 是否必填 说明
count int 非必填 创建账户的数量(默认1)
password String 非必填 设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data":{
+	    "list": [ //返回创建账户的地址集合
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv",
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"
+	    ]
+    }
+}
+

e.g 示例代码

//创建一个没有密码的账户
+createAccount();
+//创建一个有密码的账户
+createAccount("nuls123456");
+//创建3个没有密码的账户
+createAccount(3);
+//创建3个有密码的账户
+createAccount(3, "nuls123456");
+

1.2 创建离线账户

接口

Result createOfflineAccount(int count, String password)

说明

直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作 +Create encrypted off-line accounts (Not saved to the database)

Result.data List<AccountInfo>

参数 类型 是否必填 说明
count int 非必填 创建账户的数量(默认1)
password String 非必填 设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"list":[
+			{
+				"address": String, 账户地址
+				"alias": String, 账户别名
+				"pubKey": String, 公钥
+				"extend": String, 扩展
+				"createTime": Long, 创建时间
+				"encrypted": boolean, 是否加密
+				"priKey": String, 私钥(创建无密码离线账户时才会有值)
+				"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+			},
+			{
+				"address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD",
+				"alias": null,
+				"pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb",
+				"extend": null,
+				"createTime": 1529314943624,
+				"encrypted": true,
+				"priKey": "",
+				"encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"
+			}
+		]
+	}
+}
+

e.g 示例代码

//创建一个没有密码的离线账户
+createOfflineAccount();
+//创建一个有密码的离线账户
+createOfflineAccount("nuls123456");
+//创建3个没有密码的离线账户
+createOfflineAccount(3);
+//创建3个有密码的离线账户
+createOfflineAccount(3, "nuls123456");
+

1.3 获取账户

接口

Result getAccount(String address)

说明

根据账户地址获取一个账户的信息

Result.data AccountInfo

参数 类型 是否必填 说明
address String 必填 账户的地址

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"address": String, 账户地址
+		"alias": String, 账户别名
+		"pubKey": String, 公钥
+		"extend": String, 扩展
+		"createTime": Long, 创建时间
+		"encrypted": boolean, 是否加密
+		"priKey": String, 私钥(创建无密码离线账户时才会有值)
+		"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+	}
+}
+

e.g 示例代码

getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.4 获取设置别名的手续费

接口

Result getAliasFee(String address, String alias)

说明

根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费)

Result.data double, unit is NULS

注意! 此接口返回的手续费单位为NULS

参数 类型 是否必填 说明
address String 必填 账户的地址
alias String 必填 待设置的别名名称

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data":{
+		"value": 0.01 //(单位为NULS)
+	} 
+}
+

e.g 示例代码

getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666");
+

1.5 获取账户列表

接口

Result getAccountList(int pageNumber, int pageSize)

说明

根据分页参数获取账户列表

Result.data Page List<AccountInfo>

参数 类型 是否必填 说明
pageNumber int 必填 页码,必须大于0
pageSize int 必填 每页返回数据记录数量, 取值范围1~100

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"pageNumber": 1,
+    	"pageSize": 10,
+    	"total": 100,
+     	"pages": 10,
+		"list": [
+			{
+				"address": String, 账户地址
+				"alias": String, 账户别名
+				"pubKey": String, 公钥
+				"extend": String, 扩展
+				"createTime": Long, 创建时间
+				"encrypted": boolean, 是否加密
+				"priKey": String, 私钥(创建无密码离线账户时才会有值)
+				"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+			},
+			{
+				"address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP",
+				"alias": null,
+				"pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184",
+				"extend": null,
+				"createTime": 1529311250627,
+				"encrypted": true,
+				"priKey": null,
+				"encryptedPriKey": null
+			}
+			...
+			
+		]
+	}
+}
+

e.g 示例代码

getAccountList(1, 10);
+

1.6 根据账户别名获取账户地址

接口

Result getAddressByAlias(String alias)

说明

根据账户别名获取账户地址字符串

Result.data String

参数 类型 是否必填 说明
alias String 必填 账户别名

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g 示例代码

 getAddressByAlias("factory666");
+

1.7 获取账户私钥

接口

Result getPrikey(String address, String password)

说明

根据账户地址和密码获取账户私钥,返回私钥字符串

Result.data String

参数 类型 是否必填 说明
address String 必填 账户地址
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+		"value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"
+    }
+}
+

e.g 示例代码

//有密码的账户调用方式
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+//无密码的账户调用方式
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.8 验证别名是否可以使用

接口

Result isAliasUsable(String alias)

说明

根据别名名称验证别名是否可用(是否没有被使用)

Result

参数 类型 是否必填 说明
alias String 必填 别名名称

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示别名可以使用
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回 别名不可用的情况
{	//表示别名不可以使用
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • 返回错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

isAliasUsable("factory666");
+

1.9 备份账户

接口

Result backupAccount(String address, String path, String password)

说明

根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码

Result 返回生成的文件地址

参数 类型 是否必填 说明
address String 必填 账户的地址
path String 必填 将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+	    "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"
+    }
+}
+

e.g 示例代码

//备份一个没有密码的账户至当前目录
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null);
+//备份一个有密码的账户至/backup目录
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456");
+

1.10 导入账户

接口

Result importAccountByKeystore

说明

根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。

Result

参数 类型 是否必填 说明
path/fileReader String/FileReader 必填 待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象
password String 非必填 .keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填
overwrite boolean 必填 true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g 示例代码

//导入一个有密码的账户
+importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true);
+importAccountByKeystore(fileReader, "nuls123456", true);
+//导入一个没有密码的账户
+importAccountByKeystore("/backup/XXXXXX.keystore", false);
+importAccountByKeystore(fileReader, false);
+

1.11 导入账户(私钥)

接口

Result importAccountByPriKey(String privateKey, String password, boolean overwrite)

说明

根据私钥导入账户

Result

参数 类型 是否必填 说明
privateKey String 必填 账户私钥
password String 非必填 设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
overwrite boolean 必填 true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"
+    }
+}
+

e.g 示例代码

//导入账户时设置密码
+importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true);
+//导入账户时不设置密码
+importAccountByPriKey("1f9d3ad044e0e120......", true);
+

1.12 验证账户是否加密

接口

Result isEncrypted(String address)

说明

验证账户是否加密

Result

参数 类型 是否必填 说明
address String 必填 账户地址

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示已加密
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回 未加密
{
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • 返回错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.13 移除账户

接口

Result removeAccount(String address, String password)

说明

移除账户

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.13 设置密码

接口

Result setPassword(String address, String password)

说明

为未加密的账户设置密码,已加密账户不能调用此接口

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 必填 设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.14 修改密码

接口

Result resetPassword(String address, String password, String newPassword)

说明

为已加密的账户修改密码,未加密账户不能调用此接口

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 必填 账户当前密码
newPassword String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111");
+

1.15 设置别名

接口

Result setAlias(String address, String alias, String password)

说明

为账户设置一个别名

Result 返回设置别名的交易hash

参数 类型 是否必填 说明
address String 必填 账户的地址
alias String 必填 待设置的别名名称
password String 密码 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data":{		
+		"value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"
+	}
+}
+
  • 错误示例
{
+    "success": false,
+     "data"{
+        "code": "ACT007",
+        "msg": "The account already set an alias"
+     }
+}
+

e.g 示例代码

setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111");
+setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666");
+

1.16 设置离线账户密码

接口

Result setPasswordOffline(String address, String priKey, String password)

说明

设置离线账户密码, sdk中独立加密,不与NULS服务交互

Result 返回加密后的私钥(encryptedPriKey)

参数 类型 是否必填 说明
address String 必填 账户地址
priKey String 必填 账户的私钥
password String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g 示例代码

setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456");
+

1.17 修改离线账户密码

接口

Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)

接口

修改离线账户密码, sdk中独立修改, 不与NULS服务交互

Result 返回新密码生成的加密后的私钥(encryptedPriKey)

参数 类型 是否必填 说明
address String 必填 账户的地址
encryptedPriKey String 必填 加密后的私钥
password String 必填 原密码
newPassword String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g 示例代码

resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456");
+

交易 AccountLedgerService

2.1 创建转账交易

接口

Result createTransaction(List<Input> inputs, List<Output> outputs, String remark)

说明

通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。示例中input和output的属性都为必填项。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。有关手续费的计算会在后面详细说明

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
inputs List<Input> 必填 交易引用的未花费输出
outputs List<Output> 必填 交易新生成的未花费输出
remark String 非必填 交易备注

e.g 示例代码

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+
+//组装交易的inputs,示例中的input属性均必填
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//组装交易的outputs,示例中的output属性均必填
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createTransaction(inputs, outputs, remark);
+

交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):100000 NA/1KB

交易大小的计算:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

2.2 交易签名

接口

Result signTransaction(String txHex, String priKey, String address, String password)

说明

通过私钥,给交易签名

Result.data String 签名后的交易,16进制后的序列化字符串

参数 类型 是否必填 说明
txHex String 必填 十六进制的交易序列化数据
priKey String 必填 交易的私钥
address String 必填 私钥对应的地址,用于验证私钥合法性
password String 非必填 私钥的密码,如果私钥未加密可不传

e.g 示例代码

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8";
+String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM";
+String password = "NULS6352s!f";
+Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password);
+

2.3 根据交易hash查询交易详情

接口

Result getTxByHash(String hash)

说明

根据交易hash查询交易详情

Result.data Transaction

参数 类型 是否必填 说明
hash String 必填 交易的hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+        "type": 2,
+        "time": 1529323198461,
+        "blockHeight": 1884,
+        "fee": 100000,
+        "value": 99900000000,
+        "remark": "转账",
+        "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+        "status": 1,
+        "confirmCount": 14,
+        "size": 255,
+        "inputs": [
+            {
+                "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                "fromIndex": 0,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9999899000000
+            }
+        ],
+        "outputs": [
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 0,
+                "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                "value": 99900000000,
+                "lockTime": 0,
+                "status": 0
+            },
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 1,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9899998900000,
+                "lockTime": 0,
+                "status": 0
+            }
+        ]
+    }
+}
+

e.g 示例代码

getTxByHash("041f3d2ceed........");
+

2.4 转账

接口

Result transfer(String address, String toAddress, String password, long amount, String remark)

说明

发起转账交易

Result 返回交易hash

参数 类型 是否必填 说明
address String 必填 转出者账户的地址
toAddress String 必填 接收者账户的地址
password String 非必填 转出者账户的密码,如果账户没有加密则不填
amount long 必填 转账金额(单位:Na)
remark String 必填 备注

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"
+    }
+}
+

e.g 示例代码

	//账户有密码
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "备注1NULS=10000000Na");
+//账户没有密码
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, "备注1NULS=10000000Na");
+

2.5 查询账户余额

接口

Result getBalance(String address)

说明

获取账户余额

Result.data BalanceInfo

参数 类型 是否必填 说明
address String 必填 账户地址

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "balance": 1009899998900000,
+        "usable": 1009899998900000,
+        "locked": 0
+    }
+}
+

e.g 示例代码

getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS");
+

2.6 广播交易

接口

Result broadcastTransaction(String txHex);

说明

广播交易

Result.data String 返回交易hash

参数 类型 是否必填 说明
txHex String 必填 十六进制交易序列化数据

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"
+    }
+}
+
+

e.g 示例代码

String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24";
+Result result = service.broadcastTransaction(txHex);
+if(result.isSuccess()) {
+   String txHash = (String)result.getData();
+}
+

2.7 创建多地址转账交易

接口

Result createMultipleInputAddressTransaction(List<Input> inputs, List<Output> outputs, String remark)

说明

通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。示例中input和output的属性都为必填项。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。有关手续费的计算会在后面详细说明

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
inputs List<Input> 必填 交易引用的未花费输出
outputs List<Output> 必填 交易新生成的未花费输出
nInputAccount int 必填 输入账户数
remark String 非必填 交易备注

e.g 示例代码

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+int nInputAccount = 2;
+
+//组装交易的inputs,示例中的input属性均必填
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//组装交易的outputs,示例中的output属性均必填
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark);
+

交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):100000 NA/1KB

交易大小的计算:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

2.8 多地址转账交易签名

接口

Result signMultipleAddressTransaction(String txHex, List<String> privKeys, List<String> passwords)

说明

通过私钥,给交易签名

Result.data String 签名后的交易,16进制后的序列化字符串

参数 类型 是否必填 说明
txHex String 必填 十六进制的交易序列化数据
privKeys List 必填 交易的私钥
passwords List 必填 私钥对应的密码(多个账户密码必须一样)

e.g 示例代码

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+List<String> priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d");
+List<String> passwords = Arrays.asList("123456","123456");
+Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords);
+

区块 BlockService

3.1 根据区块高度获取区块头

接口

Result getblockHeader(int height)

说明

根据区块高度获取区块头信息

Result.data BlockHeader

参数 类型 是否必填 说明
height int 必填 区块高度

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g 示例代码

getblockHeader(10);
+

3.2 根据区块hash获取区块头

接口

Result getblockHeader(String hash)

说明

根据区块hash获取区块头

Result.data BlockHeader

参数 类型 是否必填 说明
hash String 必填 区块hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g 示例代码

getblockHeader("041f3d2ceed........");
+

3.3 根据区块高度获取区块

接口

Result getBlock(int height)

说明

根据区块高度获取区块

Result.data Block

参数 类型 是否必填 说明
height int 必填 区块高度

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "转账",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g 示例代码

getBlock(10);
+

3.4 根据区块hash获取区块

接口

Result getBlock(String hash)

说明

根据区块hash获取区块

Result.data Block

参数 类型 是否必填 说明
hash String 必填 区块hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "转账",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g 示例代码

getBlock("041f3d2ceed........");
+

3.5 获取最新区块头

接口

Result getNewestBlockHash()

说明

获取最新的区块头

Result.data BlockHeader

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+
+

e.g 示例代码

getNewestBlockHash();
+

3.6 获取最新区块的高度

接口

Result getNewestBlockHight()

说明

获取最新区块的高度

Result.data 高度(Long)

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "value": 5210
+    }
+}}
+
+

e.g 示例代码

getNewestBlockHight();
+

3.7 获取最新区块的块Hash

接口

Result getNewestBlockHash()

说明

获取最新区块的块Hash

Result.data Hash值(String)

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"
+    }
+}}
+
+

e.g 示例代码

getNewestBlockHash();
+

共识 ConsensusService

4.1 离线组装创建节点交易

接口

Result createAgentTransaction(AgentInfo agentInfo, List<Input> inputs, Na fee)

说明

离线组装创建节点交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
agentInfo Object 必填 创建节点信息
inputs List 必填 输入信息
fee Object 必填 交易手续费

e.g 示例代码

//组装交易的inputs,示例中的input属性均必填
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+//创建节点信息,示例总AgentInfo的属性均必填
+AgentInfo info = new AgentInfo();
+info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");       //申请共识节点的地址
+info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ");     //实际打包区块的地址
+info.setDeposit(200000 * 100000000L);//创建节点的保证金, 最低20000NULS,最高200000NULS     
+info.setCommissionRate(10.0); //佣金比例 1-100
+
+//创建节点的手续费
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

创建共识节点交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):1000000 NA/1KB

交易大小的计算:(288 + 50 * inputs.length)/1024 , +其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

4.2 离线组装委托共识交易

接口

Result createDepositTransaction(DepositInfo depositInfo, List<Input> inputs, Na fee)

说明

离线组装委托共识交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
depositInfo Object 必填 创建节点信息
inputs List 必填 输入信息
fee Object 必填 交易手续费

e.g 示例代码

//组装交易的inputs,示例中的input属性均必填
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+//委托共识信息,示例中DepositInfo的属性均必填
+DepositInfo info = new DepositInfo();
+info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");            //委托共识的地址
+info.setDeposit(300000 * 100000000L);//委托代币数量:2000NULS —— 500000NULS
+info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");//创建共识节点的交易id
+
+//创建节点的手续费
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

创建委托交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):1000000 NA/1KB

交易大小的计算:(288 + 50 * inputs.length)/1024 , +其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

4.3 离线组装退出委托共识交易

接口

Result createCancelDepositTransaction(Output output)

说明

离线组装退出委托共识交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
output Object 必填 参与共识时被锁定的那条output

e.g 示例代码

//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额,
+//将output作为参数,生成退出委托共识交易
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setValue(20000000000000L);
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createCancelDepositTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.4 离线组装删除共识节点交易

接口

Result createStopAgentTransaction(Output output)

说明

离线组装删除共识节点交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
output Object 必填 创建节点时被锁定的那条output

e.g 示例代码

//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金,
+//将output作为参数,生成退出委托共识交易
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setValue(20000000000000L);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createStopAgentTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.5 获取委托共识列表

接口

Result getDeposits(String address, int pageNumber, int pageSize)

说明

获取地址的委托共识列表

Result.data List委托列表信息

参数 类型 是否必填 说明
address String 必填 委托地址
pageNumber Int 必填 页码
pageSize Int 必填 每页显示条数,1-100之间

返回结果

  • 返回结果为Result对象,格式如下:
{
+  "success":true,
+  "data":{
+    "pageNumber":1,
+    "pageSize":10,
+    "total":1,
+    "pages":1,
+      "list":[
+        {
+        "deposit":20000010000000,
+        "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c",
+        "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA",
+        "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e",
+        "blockHeight":98,
+        "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"
+        }
+      ]
+  }
+}
+

e.g 示例代码

Result result = NulsSDKTool.getDeposits(address, 1, 10);
+

附录

接口返回Result示例

Result
  • 表示接口访问正常,业务返回具体的数据
{	
+    "success": true,//接口执行的正确性
+    "data": data
+}
+
  • 表示接口访问正常,业务返回true
{	//表示接口访问正常,业务返回true
+    "success": true,//接口执行的正确性
+    "data": {
+		"value":true //接口业务功能的返回结果
+    }
+}
+
  • 表示接口访问正常,业务返回false
{	
+    "success": true, //接口执行的正确性
+     "data"{
+        "value": false //接口业务功能的返回结果
+     }
+}
+
  • 返回错误的情况,例如参数错误,异常等
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+
  • 这是创建一个带密码的离线账户的完整返回结果
{
+    "success": true,
+    //data为List<account>
+    "data": {
+    	"list":[
+        	{
+	           "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr",
+	            "alias": null,
+	            "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0",
+	            "extend": null,
+	            "createTime": 1529041525794,
+	            "encrypted": false,
+	            "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a",
+	            "encryptedPriKey": ""
+	    	}
+	    ]
+    }
+}
+

Account
{
+	"address": String, 账户地址
+	"alias": String, 账户别名
+	"pubKey": String, 公钥
+	"extend": String, 扩展
+	"createTime": Long, 创建时间
+	"encrypted": boolean, 是否加密
+	"priKey": String, 私钥(创建无密码离线账户时才会有值)
+	"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+}
+

Input
 {
+	"fromHash": String, 来源output的txHash         
+	"fromIndex": Integer, 来源output的outIndex
+	"address": String, 转入地址                   
+	"value": Long 转入金额
+    "lockTime": Long 锁定时间
+}
+

Output
 {
+	"txHash": String, 交易hash
+	"index": Integer, 索引
+	"address": String, 地址
+	"value": Long, 数量
+	"lockTime": Long, 锁定时间
+	"status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费)
+}
+

Transaction
{
+	"hash": String, 交易的hash值
+	"type": Integer, 交易类型
+	"time": Long, 交易发起时间
+	"blockHeight": Long, 区块高度
+	"fee": Long, 交易手续费
+	"value": Long, 交易金额
+	"remark": String, 备注
+	"scriptSig": String, 签名
+	"status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认)
+	"confirmCount": Long, 确认次数
+	"size": int, 大小
+	"inputs": [
+		{
+			"fromHash": String, 来源output的txHash
+			"fromIndex": Integer, 来源output的outIndex
+			"address": String, 转入地址
+			"value": Long 转入金额
+		}
+		],
+	"outputs": [
+		{
+			"txHash": String, 交易hash
+			"index": Integer, 索引
+			"address": String, 地址
+			"value": Long, 数量
+			"lockTime": Long, 锁定时间
+			"status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费)
+		}
+	]
+}
+

BalanceInfo
{
+	"balance": long, 余额
+	"usable": long, 可用余额
+	locked": long 锁定余额
+}
+

BlockHeader
{
+	"hash": String, 区块的hash值
+	"preHash": String, 上一个区块的hash值
+	"merkleHash": String, 梅克尔hash
+	"time": Long, 区块生成时间
+	"height": Long, 区块高度
+	"txCount": Long, 区块打包交易数量
+	"packingAddress": String, 打包地址
+	"scriptSig": String, 签名
+	"roundIndex": Long, 共识轮次
+	"consensusMemberCount": Integer, 参与共识成员数量
+	"roundStartTime": Long, 当前共识轮开始时间
+	"packingIndexOfRound": Integer, 当前轮次打包出块的名次
+	"confirmCount": Long, 确认次数
+	"reward": Long, 共识奖励
+	"fee": Long, 获取的打包手续费
+	"size": int, 大小
+}
+

Block
{
+	"hash": String, 区块的hash值
+	"preHash": String, 上一个区块的hash值
+	"merkleHash": String, 梅克尔hash
+	"time": Long, 区块生成时间
+	"height": Long, 区块高度
+	"txCount": Long, 区块打包交易数量
+	"packingAddress": String, 打包地址
+	"scriptSig": String, 签名
+	"roundIndex": Long, 共识轮次
+	"consensusMemberCount": Integer, 参与共识成员数量
+	"roundStartTime": Long, 当前共识轮开始时间
+	"packingIndexOfRound": Integer, 当前轮次打包出块的名次
+	"confirmCount": Long, 确认次数
+	"reward": Long, 共识奖励
+	"fee": Long, 获取的打包手续费
+	"size": int, 大小
+	"txList": [
+		{
+			"hash": String, 交易的hash值
+			"type": Integer, 交易类型
+			"time": Long, 交易发起时间
+			"blockHeight": Long, 区块高度
+			"fee": Long, 交易手续费
+			"value": Long, 交易金额
+			"remark": String, 备注
+			"scriptSig": String, 签名
+			"status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认)
+			"confirmCount": Long, 确认次数
+			"size": int, 大小
+			"inputs": [ 输入
+				{
+					"fromHash": String, 来源output的txHash
+					"fromIndex": Integer, 来源output的outIndex
+					"address": String, 转入地址
+					"value": Long 转入金额
+				}
+			],
+			"outputs": [ 输出
+				{
+					"address": String, 地址
+					"value": Long, 数量
+					"lockTime": Long, 锁定时间
+				}
+			]
+		}
+	]
+}
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/smartContractDemo.html b/docs/.vuepress/dist/zh/NULS1.0/smartContractDemo.html new file mode 100644 index 00000000..03bb647f --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/smartContractDemo.html @@ -0,0 +1,21 @@ + + + + + + 示例 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/smartContractFee.html b/docs/.vuepress/dist/zh/NULS1.0/smartContractFee.html new file mode 100644 index 00000000..4eb53e54 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/smartContractFee.html @@ -0,0 +1,48 @@ + + + + + + 手续费 | NULS + + + + + + + +

手续费

1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?

背景:由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一

在主链上,多出三个类型的交易,创建智能合约, 调用智能合约, 删除智能合约

三个交易与其他交易如转账不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一

  • 智能合约收费计算方式
public static final int COMPARISON = 1;//比较字节码
+public static final int CONSTANT = 1;//简单数值类型字节码
+public static final int LDC = 1;//数值常量,字符串常量(长度 * LDC)
+public static final int CONTROL = 5;//控制字节码
+public static final int TABLESWITCH = 2;//switch字节码(大小 * TABLESWITCH)
+public static final int LOOKUPSWITCH = 2;//switch字节码(大小 * LOOKUPSWITCH)
+public static final int CONVERSION = 1;//数值转换
+public static final int EXTENDED = 1;//null判断
+public static final int MULTIANEWARRAY = 1;//多维数组(大小 * MULTIANEWARRAY)
+public static final int LOAD = 1;//把本地变量送到栈顶
+public static final int ARRAYLOAD = 5;//把数组的某项送到栈顶
+public static final int MATH = 1;//数学操作及移位操作
+public static final int REFERENCE = 10;//对象相关操作
+public static final int NEWARRAY = 1;//一维数组(大小 * NEWARRAY)
+public static final int STACK = 2;//栈操作
+public static final int STORE = 1;//把栈顶的值存入本地变量
+public static final int ARRAYSTORE = 5;//把栈项的值存到数组里
+public static final int TRANSFER = 1000;//转账交易
+
+
  • 一次智能合约总手续费

    一次合约交易的总手续费由三部分构成

    • 第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费

    • 第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na

    举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是20000 * 20 = 400000,既是0.004NULS

    • 第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还

    举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是10000 * 20 = 200000,既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方

  • 合约调用方付多少钱?

    在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方

  • 由谁收到了这些费用?

    前提:这部分费用都体现在区块的CoinBase交易(共识奖励)中

    区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/sourceCodeStartNULS.html b/docs/.vuepress/dist/zh/NULS1.0/sourceCodeStartNULS.html new file mode 100644 index 00000000..9fc5846a --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/sourceCodeStartNULS.html @@ -0,0 +1,25 @@ + + + + + + 源码启动NULS | NULS + + + + + + + +

源码启动NULS

下载源码

访问NULS项目github地址:https://github.com/nuls-io/nuls

方式一:直接下载源代码

​ 进入github地址后,点击"Clone or download" 按钮,选择Download ZIP 下载源码包。

方式二:通过git命令克隆NULS仓库

$ git clone https://github.com/nuls-io/nuls.git

方式三(推荐):通过开发工具,例如IntelliJ IDEA,克隆NULS仓库。

环境说明

​ 操作系统:macOS、Windows

​ 构建工具:maven

​ 开发工具:IntelliJ IDEA

​ 开发语言:Java (JDK1.8)

NULS启动基本介绍

​ 由于区块链是去中心化网络,是由多个节点组成,所以单独用NULS源代码启动一个节点是没有意义的,也是不可行的。本文假定一个已经存在的利用NULS源码运行的自定义测试网络,并且搭建该网络时没有修改除网络参数以外的源代码,我们该如何启动NULS源代码,并加入该网络。

  1. 首先安装jdk1.8和maven构建工具。

    1. 运行IntelliJ IDEA
    • 如果下载的源码包,则先解压然后通过IntelliJ IDEA导入NULS项目
    • 如果通过git命令克隆NULS仓库下载的源代码,再通过IntelliJ IDEA导入NULS项目
    • 通过IntelliJ IDEA的Git插件克隆NULS仓库。
    1. 配置与已存在网络一致的网络环境参数
    • 打开client-module项目中module.ini配置文件文件
    • 建议用已知自定义测试网络中其他节点的module.ini配置文件来将此module.ini文件替换掉,来保证网络环境参数一致。
    1. 运行client-module项目中NULS启动类Bootstrap.java。位置:io.nuls.client 包中。
    2. 启动过程中将打开NULS网钱包界面,并开始同步该自定义测试网高度,表示启动成功。
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS1.0/startSmartContract.html b/docs/.vuepress/dist/zh/NULS1.0/startSmartContract.html new file mode 100644 index 00000000..8b21d48a --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS1.0/startSmartContract.html @@ -0,0 +1,76 @@ + + + + + + 快速入门 | NULS + + + + + + + +

快速入门

一、运行公测环境,创建账户,领取测试币

为部署、调用智能合约做准备

二、安装JDK8、IntelliJ IDEA、NULS智能合约插件

为开发智能合约代码做准备

下载JDK8(安装略)

下载IntelliJ IDEA(安装略)

下载NULS智能合约插件

安装NULS智能合约插件

三、智能合约代码示例

用示例快速编译、部署一个智能合约

  • 简单示例

+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public class SimpleContract implements Contract {
+
+    private String sayContent;
+
+    @Override
+    @Payable
+    public void _payable() {
+        // 覆写这个方法并标记@Payable注解,这个智能合约可以接收全节点钱包NULS资产的直接转账
+        // you can do something else
+        // ...
+    }
+
+    public String sayContent(@Required String content) {
+        this.sayContent = content;
+        return "you want say " + content;
+    }
+
+    @Payable
+    public String transferToContract() {
+        // 标记@Payable注解,调用这个方法时,智能合约可接受NULS转入
+        BigInteger value = Msg.value();
+        BigDecimal nuls = new BigDecimal(value).movePointLeft(8);
+        // you can do something else
+        // ...
+
+        return "I received your transfer amount: " + nuls.toPlainString();
+    }
+
+    @View
+    public String sayWhat() {
+        if(sayContent != null) {
+            return "you want say " + sayContent;
+        }
+        return "you want say nothing.";
+    }
+}
+
+

四、智能合约代码仓库

NULS官方收集的智能合约代码仓库

社区成员Angelillou的智能合约-合作委托挖矿

社区成员Angelillou的智能合约-彩票

社区成员Naveen的智能合约-评论

五、智能合约部署与调用

全节点钱包智能合约部署与调用方式

六、智能合约代码规范与语法

智能合约代码规范与语法说明

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/NRC-20TokenStandard.html b/docs/.vuepress/dist/zh/NULS2.0/NRC-20TokenStandard.html new file mode 100644 index 00000000..cec60238 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/NRC-20TokenStandard.html @@ -0,0 +1,47 @@ + + + + + + NRC-20合约标准 | NULS + + + + + + + +

NRC-20合约标准

简述

token的接口标准

摘要

以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。

动机

标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。

规则

Token

方法

注意: 调用者必须处理返回falsereturn boolean.调用者绝对不能假设返回false的情况不存在。

name

返回令牌的名称 - 例如 "MyToken".

@View
+public String name();
+

symbol

返回令牌的符号 - 例如 "MT".

@View
+public String symbol();
+

decimals

返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。

@View
+public int decimals();
+

totalSupply

返回总令牌供应量。

@View
+public BigInteger totalSupply();
+

balanceOf

返回地址为“owner”的帐户余额。

@View
+public BigInteger balanceOf(@Required Address owner);
+

transfer

转移value的token数量到的地址to,并且必须触发TransferEvent事件。 如果from帐户余额没有足够的令牌来支出,该函数应该被revert。

创建新令牌的令牌合同应该在创建令牌时将from地址设置为null触发TransferEvent事件。

注意 0值的传输必须被视为正常传输并触发TransferEvent事件。

public boolean transfer(@Required Address to, @Required BigInteger value);
+

transferFrom

从地址from发送数量为value的token到地址to,必须触发TransferEvent事件。

transferFrom方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了from帐户已经通过某种机制(比如调用approve(@Required Address spender, @Required BigInteger value))故意地授权消息的发送者之外,否则该函数应该revert

注意 0值的传输必须被视为正常传输并触发传输事件。

public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value);
+

approve

允许spender多次支配您的帐户,最高达value金额。 如果再次调用此函数,它将以value覆盖当前的余量。

public boolean approve(@Required Address spender, @Required BigInteger value);
+

allowance

返回spender仍然被允许从owner提取的金额。 +Returns the amount which spender is still allowed to withdraw from owner.

@View
+public BigInteger allowance(@Required Address owner, @Required Address spender);
+

Events

TransferEvent

当token被转移(包括0值),必须被触发。

创建新令牌的令牌合同应该在创建令牌时将from地址设置为null触发TransferEvent事件。

public TransferEvent(Address from, @Required Address to, @Required BigInteger value)
+

ApprovalEvent

当任何成功调用approve(@Required Address spender, @Required BigInteger value)后,必须被触发。

public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value)
+

Implementation

Example implementations are available at

  • https://github.com/nuls-io/nuls-nrc20
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/NULS2.0Introduction.html b/docs/.vuepress/dist/zh/NULS2.0/NULS2.0Introduction.html new file mode 100644 index 00000000..cb9a29e8 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/NULS2.0Introduction.html @@ -0,0 +1,27 @@ + + + + + + NULS 2.0 介绍 | NULS + + + + + + + +

NULS 2.0 介绍

为什么要做NULS2.0

NULS创立的目的就是为了让区块链更简单,所以在2017年9月的时候,核心团队就定义了NULS 的基本架构为模块化,就是为了让更多开发者和用户能更容易的使用和编写模块。NULS目前完成了编码层的模块化,但存在模块之间耦合度较高的问题,开发者想使用某个模块或参与某个模块的开发,需要同时了解与其相关联的其他模块的设计,并且只能用特定的语言进行开发,这对NULS技术社区深度参与NULS架构的设计和开发,以及用户简单低成本的运用模块不够友好。

NULS在创立之初,就致力于成为一个由全球社区驱动的开源项目。我们认为,能不断催生创新思维的社区发展路线,才是区块链项目区别于其他商业项目的一大特点。不断的迭代与创新是开源项目发展过程中必然会产生的现象,也是区块链的魅力所在。为了让开源技术社区可以无任何障碍的融入NULS底层设计和开发中,以及为了革命性产品“链工厂”中的重要组成部分“模块仓库”的搭建和易用,有以下几个难点必须克服:

1、模块的耦合度降低,模块之间不在编写和使用上彼此依赖 ;

2、 模块可扩展、修改、替换,每一个模块都是简单的、纯粹的,不受到区块链程序整体复杂度的影响;

3、 彻底打破编程语言障碍。

核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。

在NULS2.0设计期间,NULS技术社区开发者还成立了NULS CCC(Code Craft Council),初步开始了技术社区的自治。无独有偶的是,CCC成员BERZECK也一直在思考用微服务的设计方式来重构NULS架构。核心团队阅览了BERZECK的设计方案后,大感欣慰,他提出了更完善的微服务设计思路,他的想法和我们想要达到的更加灵活的区块链底层设施不谋而合。Berzeck的设计方案分为三层系统架构设计:

第一层为微服务基础架构层;

第二层为区块链基础服务层;

第三层为DAPP应用层。

这个设计站在一个脱离区块链的角度来重构NULS,是一个更高层次的认知,它将把NULS带入NULS IS EVERYTHING的新时代。核心团队决定在这个架构基础上来进行NULS2.0的架构重构。可以预见,NULS成为一个真正的强大灵活平台之后的景象。 +

此构架使得我们可以在第二层上开发更高级的应用系统(比如交易所的分布式系统,数据服务系统,甚至类似于滴滴打车的整个系统都可以构建在第二层之上)。构建在NULS体系上的,不仅仅是多个链和多个DAPP,还可以是有意向往区块链发展的其他大中小型互联网、移动互联网、物联网、车联网等等商业系统。

这样的设计让NULS将不仅仅是区块链底层基础设施,还是与区块链系统无缝结合的分布式系统基础架构,它将成为一个不同系统间(区块链以及其他系统)可以进行无缝通信的平台,这将使围绕NULS构建的企业能够更快地蓬勃发展,同时大大降低开发成本。这种整体上的优化,使得NULS生态具备先天的竞争优势。 +

NULS2.0的设计思维

NULS2.0的微服务架构是逐渐演化而成,想深入了解其是如何形成的,可阅读文档NULS2.0设计思维,文档中详细阐述了NULS2.0的演化之路。

Last Updated: 2019-3-28 11:34:44
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/developModule.html b/docs/.vuepress/dist/zh/NULS2.0/developModule.html new file mode 100644 index 00000000..b8bcb0f5 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/developModule.html @@ -0,0 +1,29 @@ + + + + + + 开发业务模块 | NULS + + + + + + + +

开发业务模块

​ 阅读本文之前,请先阅读生成程序包

​ NULS2.0是基于模块化开发的区块链项目。根据区块链的特点以及NULS特有的POC共识机制,我们已内置账户、账本、网络、区块管理、交易管理、共识、智能合约模块,这些模块已经可以满足NULS2.0区块链节点的正常运行。但基础模块不可能满足所有的业务需求,本文会引导开发者如何添加自己的模块以及如何添加自己的协议。

​ 在添加模块之前,我们首先应该对业务做需求分析,需要明确的知道,添加的模块只是对现有协议的封装与加工处理,还是说现有的协议不满足业务的需求,必须要新增加协议与协议的逻辑处理来实现功能。

​ 本文用api-module和account两个已开发的模块来举例说明如何添加自己的模块(两个模块均为JAVA开发,可到https://github.com/nuls-io/nuls_2.0上下载源码阅读)。

​添加模块但不增加协议

​ api-module模块负责对钱包内已存储的区块数据做二次解析,给钱包页面和浏览器提供可展示的信息。因此模块不需要额外增加协议。

  1. 在ModuleE枚举类里添加新模块

1553663833553

  1. 创建模块的Bootstrap启动类

    启动类需继承RpcModule类,便于mykernel核心模块管理。继承之后需要实现特有方法,如下图所示:

    1553663980380

添加依赖模块:如果你的模块需要调用其他模块的接口查询相关数据,或者是需要其他模块运行之后,你的模块才能正常运行,就需要在这里添加所依赖的模块。如下图所示:

1553664139545

模块初始化:如果模块有需要初始化的数据,可以在这里实现,init方法里必须调用super.init(),确保依赖注入成功。如下图所示:

1553670103524

启动运行:启动运行里可以启动自己的服务进程,启动成功后返回true,若启动失败,程序捕获异常后返回false,告知mykernel核心模块。如下图所示:

1553672430011

依赖模块已启动: 走到这一步表面你所依赖的模块都已经成功启动,这个时候就可以调用其他模块的接口了。

api-module模块主要功能就是查询其他模块的接口,然后解析数据返回给钱包页面展示,因此模块真正的运行是在scheduleManager.start()这一步做的,内部的实现详见源码。

1553673258491

到此为止,api-module模块已经成功加入nusl2.0。由于没有新增的协议,模块内部只需要编写模块本身的业务功能即可。

添加新协议

​ 我们用账户模块的别名交易来举例说明如何新增协议。别名交易顾名思义就是账户发送一个交易,交易里带有账户想要设置的别名信息,一旦交易被共识节点成功打包到区块中,就表明账户设置别名成功。页面在显示该账户信息的时候都会显示账户别名。

​ 第一步:添加交易类型

​ 每一种交易都需要单独设置自己的交易类型。交易类型不能与其他模块的交易类型重复。有关其他模块的交易类型,详见RPC文档。

​ 第二步:创建交易逻辑对象

​ 交易逻辑对象属于交易里存储的业务逻辑数据,例如别名交易里就存的别名信息,对象需继承TransactionLogicData类。如下图:

1553678236166

​ 由于逻辑数据最终会序列化为byte数组在网络中广播,因此还需要实现序列化和反序列化的方法。如下图:

1553678379934

第三步:创建交易相关RPC接口。接口应包括创建交易、验证交易、处理交易、回滚处理交易。

用户通过创建交易接口能顺利组装交易并广播到全网;

验证交易接口会由交易管理模块统一调用,验证失败的交易会丢弃;

验证通过的交易会由共识模块统一调用处理交易接口,存储到本地数据库中;

当有区块回滚时,由区块管理模块统一调用回滚交易接口,将存储在本地的交易相关数据清除;

有关代码的实现详见:io.nuls.account.rpc.cmd.AliasCmd

第四步:启动模块注册交易

模块在启动的时候,需要在doStart()里向交易管理模块注册自己模块新增的交易,以及对应的验证器和处理器,如下图:

1553680391073

1553680314226

之后就和api-module一样,在自己的模块里添加其他业务逻辑相关的代码实现即可。

最后,记得在模块的类下添加module.ncf配置文件,如下图:

1553680677761

1553680686807

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/developerManual.html b/docs/.vuepress/dist/zh/NULS2.0/developerManual.html new file mode 100644 index 00000000..d0336dfb --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/developerManual.html @@ -0,0 +1,802 @@ + + + + + + 开发手册 | NULS + + + + + + + +

开发手册

1. 简介

NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。

2. 开发环境

2.1 安装NULS钱包

2.2 安装JDK 8

2.3 安装IntelliJ IDEA

Nuls智能合约使用的开发工具为IntelliJ IDEA。

2.4 安装NULS智能合约插件

点击下载插件

NULS智能合约插件提供的主要功能:

  • 新建NULS合约工程
  • 提示不支持的Java特性、Java类、Java方法
  • 编译、打包、部署合约
  • 展示、调用合约方法。

3. NULS智能合约规范与语法

Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。

3.1 NULS智能合约规范

合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。

3.2 关键字

下面列出Java关键字,其中将标注NULS智能合约不支持的关键字

访问控制

  • public
  • protected
  • private

定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象

  • class
  • interface
  • abstract
  • implements
  • extends
  • new

包的关键字

  • import
  • package

数据类型的关键字

  • byte
  • char
  • boolean
  • short
  • int
  • float
  • long
  • double
  • void
  • null
  • true
  • false

条件循环(流程控制)

  • if
  • else
  • while
  • for
  • switch
  • case
  • default
  • do
  • break
  • continue
  • return
  • instanceof

错误处理

  • catch
  • try
  • finally
  • throw
  • throws

修饰方法、类、属性和变量

  • static
  • final
  • super
  • this
  • native(不支持)
  • strictfp(不支持)
  • synchronized(不支持)
  • transient(不支持)
  • volatile(不支持)

其他

  • enum(不支持)
  • assert(不支持)

3.3 基本语法

下面的语法与Java相同,只是简单列出,具体可参考Java相关文档

  • 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头
  • 基本数据类型:byte short int long float double char boolean
  • 引用数据类型:类、接口、数组
  • 算术运算符:+ - * / % ++ --
  • 关系运算符:> < >= <= == !=
  • 逻辑运算符:! & | ^ && ||
  • 位运算符:& | ^ ~ >> << >>>
  • 赋值运算符:=
  • 拓展赋值运算符:+ = -= *= /=
  • 字符串链接运算符:+
  • 三目条件运算符 ? :
  • 流程控制语句(if,switch,for,while,do...while)

3.4 支持的类

Nuls智能合约只能使用下面的类进行开发

  • io.nuls.contract.sdk.Address
  • io.nuls.contract.sdk.Block
  • io.nuls.contract.sdk.BlockHeader
  • io.nuls.contract.sdk.Contract
  • io.nuls.contract.sdk.Event
  • io.nuls.contract.sdk.Msg
  • io.nuls.contract.sdk.Utils
  • io.nuls.contract.sdk.annotation.View
  • io.nuls.contract.sdk.annotation.Required
  • io.nuls.contract.sdk.annotation.Payable
  • java.lang.Boolean
  • java.lang.Byte
  • java.lang.Short
  • java.lang.Character
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Float
  • java.lang.Double
  • java.lang.String
  • java.lang.StringBuilder
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.util.Collection
  • java.util.List
  • java.util.ArrayList
  • java.util.LinkedList
  • java.util.Map
  • java.util.HashMap
  • java.util.LinkedHashMap
  • java.util.Set
  • java.util.HashSet

3.5 其他限制

  • 合约类只能有一个构造方法,其他类不限制
  • 执行一次合约方法最大的Gas消耗是1000万,包括@View类型的方法调用,请保证尽可能的优化合约代码

4. NULS智能合约简单示例

一个简单的合约

合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。

package contracts.examples;
+
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+public class SimpleStorage implements Contract {
+
+    private String storedData;
+
+    @View
+    public String getStoredData() {
+        return storedData;
+    }
+
+    @Payable
+    public void setStoredData(@Required String storedData) {
+        this.storedData = storedData;
+    }
+
+}
+

在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。 +项目中可以有多个类和接口。

合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 +合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。

注解说明

@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。

@Payable 标记@Payable的方法,才能在调用时候传入金额

@Required 标记@Required的参数,调用时候必须传入值

去github下载NULS源码,里面有一些合约示例。

5. NULS Contract SDK

合约SDK提供了几个类,方便合约开发:

io.nuls.contract.sdk.Address

public class Address {
+
+    private final String address;
+
+    public Address(String address) {
+        valid(address);
+        this.address = address;
+    }
+
+    /**
+     * 获取该地址的余额(只能获取合约地址余额)
+     *
+     * @return
+     */
+    public native BigInteger balance();
+
+    /**
+     * 合约向该地址转账
+     *
+     * @param value 转账金额(多少Na)
+     */
+    public native void transfer(BigInteger value);
+
+    /**
+     * 调用该地址的合约方法
+     *
+     * @param methodName 方法名
+     * @param methodDesc 方法签名
+     * @param args       参数
+     * @param value      附带的货币量(多少Na)
+     */
+    public native void call(String methodName, String methodDesc, String[][] args, BigInteger value);
+
+	/**
+     * 调用该地址的合约方法并带有返回值(String)
+     *
+     * @param methodName 方法名
+     * @param methodDesc 方法签名
+     * @param args       参数
+     * @param value      附带的货币量(多少Na)
+     * @return 调用合约后的返回值
+     */
+    public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value);
+    
+    /**
+     * 验证地址
+     *
+     * @param address
+     * @see io.nuls.kernel.utils.AddressTool#validAddress(String)
+     */
+    private native void valid(String address);
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        Address address1 = (Address) o;
+        return address != null ? address.equals(address1.address) : address1.address == null;
+    }
+
+    @Override
+    public int hashCode() {
+        return address != null ? address.hashCode() : 0;
+    }
+
+    @Override
+    public String toString() {
+        return address;
+    }
+
+}
+

io.nuls.contract.sdk.Block

public class Block {
+
+    /**
+     * 给定块的区块头
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static native BlockHeader getBlockHeader(long blockNumber);
+
+    /**
+     * 当前块的区块头
+     *
+     * @return
+     */
+    public static native BlockHeader currentBlockHeader();
+    
+    /**
+     * 最新块的区块头
+     *
+     * @return 最新块的区块头
+     */
+    public static native BlockHeader newestBlockHeader();
+
+    /**
+     * 给定块的哈希值
+     * hash of the given block
+     *
+     * @param blockNumber
+     * @return
+     */
+    public static String blockhash(long blockNumber) {
+        return getBlockHeader(blockNumber).getHash();
+    }
+
+    /**
+     * 当前块矿工地址
+     * current block miner’s address
+     *
+     * @return
+     */
+    public static Address coinbase() {
+        return currentBlockHeader().getPackingAddress();
+    }
+
+    /**
+     * 当前块编号
+     * current block number
+     *
+     * @return
+     */
+    public static long number() {
+        return currentBlockHeader().getHeight();
+    }
+
+    /**
+     * 当前块时间戳
+     * current block timestamp
+     *
+     * @return
+     */
+    public static long timestamp() {
+        return currentBlockHeader().getTime();
+    }
+    
+}
+

io.nuls.contract.sdk.BlockHeader

public class BlockHeader {
+
+    private String hash;
+    private long time;
+    private long height;
+    private long txCount;
+    private Address packingAddress;
+    private String stateRoot;
+
+    public String getHash() {
+        return hash;
+    }
+
+    public long getTime() {
+        return time;
+    }
+
+    public long getHeight() {
+        return height;
+    }
+
+    public long getTxCount() {
+        return txCount;
+    }
+
+    public Address getPackingAddress() {
+        return packingAddress;
+    }
+
+    public String getStateRoot() {
+        return stateRoot;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        BlockHeader that = (BlockHeader) o;
+
+        if (time != that.time) return false;
+        if (height != that.height) return false;
+        if (txCount != that.txCount) return false;
+        if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false;
+        if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null)
+            return false;
+        return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = hash != null ? hash.hashCode() : 0;
+        result = 31 * result + (int) (time ^ (time >>> 32));
+        result = 31 * result + (int) (height ^ (height >>> 32));
+        result = 31 * result + (int) (txCount ^ (txCount >>> 32));
+        result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0);
+        result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        return "BlockHeader{" +
+                "hash='" + hash + '\'' +
+                ", time=" + time +
+                ", height=" + height +
+                ", txCount=" + txCount +
+                ", packingAddress=" + packingAddress +
+                ", stateRoot='" + stateRoot + '\'' +
+                '}';
+    }
+
+}
+

io.nuls.contract.sdk.Contract

/**
+ * 合约接口,合约类实现这个接口
+ */
+public interface Contract {
+
+    /**
+     * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。
+     */
+    default void _payable() {
+    }
+
+}
+

io.nuls.contract.sdk.Event

/**
+* 事件接口,事件类实现这个接口
+*/
+public interface Event {
+}
+

io.nuls.contract.sdk.Msg

public class Msg {
+
+    /**
+     * 剩余Gas
+     * remaining gas
+     *
+     * @return
+     */
+    public static native long gasleft();
+
+    /**
+     * 合约发送者地址
+     * sender of the contract
+     *
+     * @return
+     */
+    public static native Address sender();
+
+    /**
+     * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na
+     * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na
+     *
+     * @return
+     */
+    public static native BigInteger value();
+
+    /**
+     * Gas价格
+     * gas price
+     *
+     * @return
+     */
+    public static native long gasprice();
+
+    /**
+     * 合约地址
+     * contract address
+     *
+     * @return
+     */
+    public static native Address address();
+
+}
+

io.nuls.contract.sdk.Utils

public class Utils {
+
+    private Utils() {
+    }
+
+    /**
+     * 检查条件,如果条件不满足则回滚
+     *
+     * @param expression
+     */
+    public static void require(boolean expression) {
+        if (!expression) {
+            revert();
+        }
+    }
+
+    /**
+     * 检查条件,如果条件不满足则回滚
+     *
+     * @param expression
+     * @param errorMessage
+     */
+    public static void require(boolean expression, String errorMessage) {
+        if (!expression) {
+            revert(errorMessage);
+        }
+    }
+
+    /**
+     * 终止执行并还原改变的状态
+     */
+    public static void revert() {
+        revert(null);
+    }
+
+    /**
+     * 终止执行并还原改变的状态
+     *
+     * @param errorMessage
+     */
+    public static native void revert(String errorMessage);
+
+    /**
+     * 发送事件
+     *
+     * @param event
+     */
+    public static native void emit(Event event);
+
+	/**
+     * @param seed a private seed
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom(long seed) {
+        int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode();
+        int hash2 = Msg.address().toString().substring(2).hashCode();
+        int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0;
+        int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode();
+
+        long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4;
+
+        seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1);
+        return ((int) (seed >>> 24) / (float) (1 << 24));
+    }
+
+    /**
+     * @return pseudo random number (0 ~ 1)
+     */
+    public static float pseudoRandom() {
+        return pseudoRandom(0x5DEECE66DL);
+    }
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param src source string (hex encoding string)
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(String hexString);
+
+    /**
+     *
+     * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256.
+     *
+     * @param bytes source byte array
+     * @return sha3-256 hash (hex encoding string)
+     */
+    public static native String sha3(byte[] bytes);
+    
+    /**
+     * [Testnet]verify signature data(ECDSA)
+     *
+     * @param data(hex encoding string)
+     * @param signature(hex encoding string)
+     * @param pubkey(hex encoding string)
+     * @return verify result
+     */
+    public static native boolean verifySignatureData(String data, String signature, String pubkey);
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @param algorithm hash算法标识
+     * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+        return getRandomSeed(endHeight, seedCount, "SHA3");
+    }
+
+    /**
+     * [Testnet]根据高度范围,用特定的算法生成一个随机种子
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @param algorithm   hash算法标识
+     * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+    /**
+     * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static BigInteger getRandomSeed(long startHeight, long endHeight){
+        return getRandomSeed(startHeight, endHeight, "SHA3");
+    }
+
+    /**
+     * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合
+     *
+     * @param endHeight 截止高度
+     * @param seedCount 原始种子数量
+     * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+    /**
+     * [Testnet]根据高度范围,获取原始种子的集合
+     *
+     * @param startHeight 起始高度
+     * @param endHeight   截止高度
+     * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+     */
+    public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+    
+}
+

io.nuls.contract.sdk.annotation.Payable

@Payable 标记@Payable的方法,才能在调用时候转入金额

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Payable {
+}
+

io.nuls.contract.sdk.annotation.Required

@Required 标记@Required的参数,调用时候必须传入值

@Target({ElementType.PARAMETER})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Required {
+}
+

io.nuls.contract.sdk.annotation.View

@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。

@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface View {
+}
+

6. 智能合约主要的RPC接口

这里列举几个接口的参数结构及简单实例,其他接口请参见Swagger UI

测试网的Swagger UI的端口默认是8001,正式网的端口默认是6001

6.1 创建智能合约

  • POST /api/contract/create
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
gasLimit* long 最大gas消耗
price* long 执行合约单价
contractCode* string 智能合约代码(字节码的Hex编码字符串)
remark string 备注
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "gasLimit": 4687,
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "remark": "asd",
+  "args": []
+}
+

6.2 估算创建智能合约的Gas消耗

  • POST /api/contract/imputedgas/create
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
price* long 执行合约单价
contractCode* string 智能合约代码(字节码的Hex编码字符串)
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "price": 20,
+  "password": "xxx",
+  "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000",
+  "args": []
+}
+

6.3 调用智能合约

  • POST /api/contract/call
参数 类型 说明
sender* string 交易创建者
password* string 交易创建者账户密码
contractAddress* string 智能合约地址
gasLimit* long 最大Gas消耗
price* long 执行合约单价
value long 交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)
methodName* string 方法名
methodDesc string 方法签名,如果方法名不重复,可以不传
remark string 备注
args string[][] 参数列表
  • Example Value
{
+  "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M",
+  "password": "",
+  "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U",
+  "gasLimit": 8000,
+  "price": 20,
+  "value": 0,
+  "methodName": "balance",
+  "methodDesc": "",
+  "remark": "qwe"
+  "args": []
+}
+

6.4 估算调用智能合约的Gas消耗(参见Swagger UI)

  • POST /api/contract/imputedgas/call

6.5 估算智能合约的price(参见Swagger UI)

  • POST /api/contract/imputedprice

6.6 终止智能合约(参见Swagger UI)

  • POST /api/contract/delete

6.7 调用不上链的智能合约函数(参见Swagger UI)

  • POST /api/contract/view

6.8 获取智能合约执行结果(参见Swagger UI)

  • GET /api/contract/result/{hash}

6.9 获取智能合约基本信息(参见Swagger UI)

  • GET /api/contract/info/{address}

6.10 验证是否为合约地址(参见Swagger UI)

  • GET /api/contract/{address}

6.11 获取智能合约地址的NULS余额(参见Swagger UI)

  • GET /api/contract/balance/{address}

6.12 获取智能合约交易详情(参见Swagger UI)

  • GET /api/contract/tx/{hash}

6.13 获取智能合约的交易列表(参见Swagger UI)

  • GET /api/contract/tx/list/{address}

6.14 根据address和limit查询合约UTXO(参见Swagger UI)

  • GET /api/contract/limit/{address}/{limit}

6.15 根据address和amount查询合约UTXO(参见Swagger UI)

  • GET /api/contract/amount/{address}/{amount}

6.16 向智能合约转账(参见Swagger UI)

  • POST /api/contract/transfer

7. 示例

7.1 投票智能合约代码片段, 如下

完整代码: https://github.com/nuls-io/nuls-vote

package io.nuls.vote.contract;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Utils;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.View;
+import io.nuls.vote.contract.func.BaseVote;
+import io.nuls.vote.contract.func.VoteInterface;
+import io.nuls.vote.contract.model.VoteConfig;
+import io.nuls.vote.contract.model.VoteEntity;
+
+import java.math.BigInteger;
+import java.util.List;
+import java.util.Map;
+
+public class VoteContract implements Contract {
+
+    private VoteInterface baseVote;
+
+    public VoteContract(long minRecognizance) {
+        baseVote = new BaseVote(BigInteger.valueOf(minRecognizance));
+    }
+
+    @Payable
+    public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) {
+        VoteEntity voteEntity = baseVote.create(title, desc, items);
+
+        VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify);
+        boolean success = baseVote.init(voteEntity.getId(), config);
+
+        Utils.require(success);
+
+        return voteEntity;
+    }
+
+    public boolean vote(long voteId, long[] itemIds) {
+        return baseVote.vote(voteId, itemIds);
+    }
+
+    public boolean redemption(long voteId) {
+        return baseVote.redemption(voteId);
+    }
+
+    @View
+    public boolean canVote(long voteId) {
+        return baseVote.canVote(voteId);
+    }
+
+    @View
+    public VoteEntity queryVote(long voteId) {
+        return baseVote.queryVote(voteId);
+    }
+
+    @View
+    public Map<Address, List<Long>> queryVoteResult(long voteId) {
+        return baseVote.queryVoteResult(voteId);
+    }
+
+    @View
+    public boolean queryAddressHasVote(long voteId, Address address) {
+        return baseVote.queryAddressHasVote(voteId, address);
+    }
+}
+
+

智能合约的方法中如果有数组类型的参数,请使用如下方式传递参数

参考以上投票合约代码中的create方法

{
+  "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf",
+  "password": "",
+  "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4",
+  "gasLimit": 200000,
+  "price": 1,
+  "value": 10000000000,
+  "methodName": "create",
+  "methodDesc": "",
+  "remark": "",
+  "args": [
+    "测试投票1",
+    "第一个投票合约",
+    [
+      "第一个选项",
+      "第二个选项",
+      "第三个选项"
+    ],
+    1536044066056, 1536184066056, false, 300, false
+  ]
+}
+

7.2 Standard Token 智能合约代码片段

完整代码: https://github.com/nuls-io/nuls-nrc20

package io.nuls.contract.token;
+
+import io.nuls.contract.sdk.Address;
+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
+import static io.nuls.contract.sdk.Utils.emit;
+import static io.nuls.contract.sdk.Utils.require;
+
+public class SimpleToken implements Contract, Token {
+
+    private final String name;
+    private final String symbol;
+    private final int decimals;
+    private BigInteger totalSupply = BigInteger.ZERO;
+
+    private Map<Address, BigInteger> balances = new HashMap<Address, BigInteger>();
+    private Map<Address, Map<Address, BigInteger>> allowed = new HashMap<Address, Map<Address, BigInteger>>();
+
+    @Override
+    @View
+    public String name() {
+        return name;
+    }
+
+    @Override
+    @View
+    public String symbol() {
+        return symbol;
+    }
+
+    @Override
+    @View
+    public int decimals() {
+        return decimals;
+    }
+
+    @Override
+    @View
+    public BigInteger totalSupply() {
+        return totalSupply;
+    }
+
+    public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) {
+        this.name = name;
+        this.symbol = symbol;
+        this.decimals = decimals;
+        totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));;
+        balances.put(Msg.sender(), totalSupply);
+        emit(new TransferEvent(null, Msg.sender(), totalSupply));
+    }
+
+    @Override
+    @View
+    public BigInteger allowance(@Required Address owner, @Required Address spender) {
+        Map<Address, BigInteger> ownerAllowed = allowed.get(owner);
+        if (ownerAllowed == null) {
+            return BigInteger.ZERO;
+        }
+        BigInteger value = ownerAllowed.get(spender);
+        if (value == null) {
+            value = BigInteger.ZERO;
+        }
+        return value;
+    }
+
+    @Override
+    public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) {
+        subtractAllowed(from, Msg.sender(), value);
+        subtractBalance(from, value);
+        addBalance(to, value);
+        emit(new TransferEvent(from, to, value));
+        return true;
+    }
+
+    @Override
+    @View
+    public BigInteger balanceOf(@Required Address owner) {
+        require(owner != null);
+        BigInteger balance = balances.get(owner);
+        if (balance == null) {
+            balance = BigInteger.ZERO;
+        }
+        return balance;
+    }
+
+    @Override
+    public boolean transfer(@Required Address to, @Required BigInteger value) {
+        subtractBalance(Msg.sender(), value);
+        addBalance(to, value);
+        emit(new TransferEvent(Msg.sender(), to, value));
+        return true;
+    }
+
+    @Override
+    public boolean approve(@Required Address spender, @Required BigInteger value) {
+        setAllowed(Msg.sender(), spender, value);
+        emit(new ApprovalEvent(Msg.sender(), spender, value));
+        return true;
+    }
+
+    public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) {
+        addAllowed(Msg.sender(), spender, addedValue);
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) {
+        check(subtractedValue);
+        BigInteger oldValue = allowance(Msg.sender(), spender);
+        if (subtractedValue.compareTo(oldValue) > 0) {
+            setAllowed(Msg.sender(), spender, BigInteger.ZERO);
+        } else {
+            subtractAllowed(Msg.sender(), spender, subtractedValue);
+        }
+        emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender)));
+        return true;
+    }
+
+    private void addAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance);
+        check(value);
+        setAllowed(address1, address2, allowance.add(value));
+    }
+
+    private void subtractAllowed(Address address1, Address address2, BigInteger value) {
+        BigInteger allowance = allowance(address1, address2);
+        check(allowance, value, "Insufficient approved token");
+        setAllowed(address1, address2, allowance.subtract(value));
+    }
+
+    private void setAllowed(Address address1, Address address2, BigInteger value) {
+        check(value);
+        Map<Address, BigInteger> address1Allowed = allowed.get(address1);
+        if (address1Allowed == null) {
+            address1Allowed = new HashMap<Address, BigInteger>();
+            allowed.put(address1, address1Allowed);
+        }
+        address1Allowed.put(address2, value);
+    }
+
+    private void addBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(value, "The value must be greater than or equal to 0.");
+        check(balance);
+        balances.put(address, balance.add(value));
+    }
+
+    private void subtractBalance(Address address, BigInteger value) {
+        BigInteger balance = balanceOf(address);
+        check(balance, value, "Insufficient balance of token.");
+        balances.put(address, balance.subtract(value));
+    }
+
+    private void check(BigInteger value) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0);
+    }
+
+    private void check(BigInteger value1, BigInteger value2) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0);
+    }
+
+    private void check(BigInteger value, String msg) {
+        require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg);
+    }
+
+    private void check(BigInteger value1, BigInteger value2, String msg) {
+        check(value1);
+        check(value2);
+        require(value1.compareTo(value2) >= 0, msg);
+    }
+
+
+
+}
+
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/howToUseNulsBuildChain.html b/docs/.vuepress/dist/zh/NULS2.0/howToUseNulsBuildChain.html new file mode 100644 index 00000000..4c54e50b --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/howToUseNulsBuildChain.html @@ -0,0 +1,104 @@ + + + + + + 搭建区块链 | NULS + + + + + + + +

搭建区块链

NULS2.0 开发环境搭建

NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。

1 环境准备

  • 安装JDK
  • 安装Maven
  • 安装IntelliJ IDEA开发工具
  • 安装git

2 clone源代码

git clone git@github.com:nuls-io/nuls_2.0.git

3 IDEA导入nuls_2.0中所有maven项目

4 建立自己的maven项目

5 运行所有需要启动的模块

使用NULS2.0核心模块搭建基础链

NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。

NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。

1 理解NULS 2.0的微服务架构

img

NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。

因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。

理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。

2 修改基础配置信息

一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。

NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf

modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:

section param name remark
common chain.id 本链id Uint16,NULS主网为1,测试网为2
common address.prefix 地址前缀 大小字母+数字,2-5个字符
common data.root.dir 数据存储路径 为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径
common encoding 编码方式 默认UTF-8,不建议修改
common asset.id 本来主资产编码 NULS为1
common log.root.dir 日志根目录 用于存放各个模块的日志文件
common log.level 日志级别 日志打印级别debug/info/warn/error.
block data.folder data子文件夹 用于存储block模块数据,该文件夹放在#{data.root.dir}下
block block.max.size 区块最大size 区块大小限制,避免太大区块太高参与门槛
block block.interval 出块间隔
block max.rollback 最大回滚数量 当超过这个数量后,系统将停止回滚,避免出现重大问题
block header.extend.max.size 扩展最大size 区块头中的扩展字段的大小限制
block genesis.block.json.path 创世块描述文件 创世块的描述文件
consensus data.folder data子文件夹 用于存储共识模块数据,该文件夹放在#{data.root.dir}下
consensus packing.interval 出块间隔
consensus inflation.token.count 每年增发数量 增发数量用于通过coinbase交易奖励给节点
consensus block.max.size 区块最大size
consensus seed.addresses 共识种子地址 多个地址用","分隔
consensus packing.address.pwd 地址密码 用于打包的地址的密码
consensus agent.deposit.min 创建节点时最小保证金数量
consensus agent.deposit.max 创建节点时最大保证金数量
consensus commission.rate.max 佣金比例最大值,不能大于100
consensus commission.rate.min 佣金比例最小值
consensus deposit.min 单笔委托最小金额
consensus agent.total.deposit.max 节点接受委托的最大金额
consensus packing.token.min 当节点的委托达到该值则开始出块
consensus red.punish.lock.time 红牌锁定时间
consensus agent.stop.lock.time 停止节点锁定时间
network data.folder data子文件夹
network seeds 种子节点,多个之间用","隔开
network magic.number 魔法数字,用于隔离其他网络
network port 端口
network nuls.seed 需要进行跨链时,配置NULS2.0种子节点
network cross.listener.port
network nuls.magic.number
contract nrc20.file.path NRC20协议描述json文件路径
tx data.folder data子文件夹
Ledger data.folder data子文件夹
api mongodb.ip mongodb地址
api mongodb.port mongodb端口
api rpc.listener.ips rpc监听ip 可以配置多个
api rpc.port rpc监听端口
api req.allow.per.s 并发限制

表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。

3 打包和启动

链的配置项修改完成后,则可直接参考本文档的第4部分:打包和启动

搭建包含业务模块的区块链

在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。

1 业务模块说明

1.1 何为业务模块

基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。

业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。

1.2 如何扩展协议

NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:

  • 通过转账交易的remark字段进行扩展

将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。

  • 通过制定的业务扩展交易进行扩展

NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。

示例:

假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。

1 功能设计

1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;
+
+2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;
+
+3. 解密查看:从数据库中获取记录,解密,展示解密结果
+
+4. 删除记事:app本地删除,不删除区块链中数据
+

2 区块链交互

以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。

  • 第一个功能的实现思路如下:
首先设计数据格式,如下
+
+{
+
+  address:"",//记事所属人
+
+  time:"",//记事时间点
+
+  content:""//加密后的记事内容
+
+}
+
+根据数据格式,组装上链数据:address+time+content;
+
+确定应用的魔法数字,假设为12345678.
+
+则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。
+
  • 第二个功能的实现思路如下:
监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,
+如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)
+如果成功解析了数据,则将数据存储到本地数据库中
+

3 其他业务实现

所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。

使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。

2 需求分析

在动手开发模块之前,首先要确定几个问题:

  • 自己需要的是什么样的功能?
  • 是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?
  • 用哪种方式实现这个模块? +
    • 扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。
    • 增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要
    • 修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。

3 模块设计

在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。

那么如何设计自己的业务?举例说明:

3.1 扩展基础协议的方式:

第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。
+比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。
+
+第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。
+一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。
+

3.2 新增协议的方式

如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。
+这里我们就用nuls的poc共识机制来举例
+功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。
+nuls的poc共识机制的业务功能有:
+1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。
+2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。
+3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。
+4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。
+
+协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。
+poc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易
+交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。
+例如创建共识节点:
+	1)创建节点的账户不能重复多次创建共识节点;
+	2)保证金在2-20万nuls之间;
+	3)账户是否有过红牌记录;
+存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。
+例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等
+
+接口设计:需要对外提供的RPC接口
+例如:查询共识节点信息,查询共识委托信息等
+
+其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里
+

3.3 修改基础链的方式

本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。
+修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。
+

4 模块实现

首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。

1、nuls-service-base-lib(baselib):

通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。

2、module-self:

模块本身,在一下几方面需要做出自己的实现:

  • 模块管理

    1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。

    2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。

    3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理

  • 协议相关

    当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。

  • 网络消息

    当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。

  • 数据存储

    NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。

  • 功能实现

    如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。

  • 功能接口

    根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。

  • 日志记录

    NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。

总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。

5 定义自己的协议

  • 设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。

  • 网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。

  • 交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。

6 调试

完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。

1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;
+
+2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;
+
+3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;
+
+4、检查交易验证逻辑是否严谨,不要出现安全漏洞;
+
+5、测试自身模块的业务是否正确、完整。
+

全部测试都完成后,便可进入打包和启动阶段了

打包和启动

1 打包

NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试

cd /home/nuls2/nuls_2.0
+./package.sh -m
+

确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。

2 启动

  • 编译成功 会生成如下路径文件
/home/nuls2/nuls_2.0/RELEASE/bin
+
  • 执行如下命令,即可一键批量启动所有模块
cd /home/nuls2/nuls_2.0/RELEASE/bin
+./start.sh -c ./moudle.json(指定moudle.json配置文件启动)
+
  • linux指令 jps 查看所有模块进程:
 ./start.sh  --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws
+
  • 查看模块启动状态
./checkstatus.sh  
+
  • 停止 工程模块:
kill  进程号(进程号对应jps显示出来的 mykernel 模块的进程)
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/ideaPlugin.html b/docs/.vuepress/dist/zh/NULS2.0/ideaPlugin.html new file mode 100644 index 00000000..e30f5bd1 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/ideaPlugin.html @@ -0,0 +1,30 @@ + + + + + + IDEA插件 | NULS + + + + + + + +

IDEA插件

1 在IDEA安装NULS插件

  • 获取NULS插件ZIP包,存放在磁盘 +点击File->Settings->Plugin->Install plugin from disk

Install

  • 选择之前获取到的ZIP包,然后点击OK

Install

  • 勾选上NULS插件,点击Apply

Install

2 创建一个NULS项目

create

输入Project名,点击finish

create

3 编写智能合约

智能合约代码编写可查看开发者文档

code

4 设置部署合约的节点和账户

  • 点击右方的NULS插件,调出NULS插件面板

    code

  • 插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址

    点击面板左上角的+号,选择Add Node

    code

  • 输入Node地址,点击OK

    code

  • 点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK

    code

5 打包合约

  • 点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码

    code

  • 可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤)

    code

  • 点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面

    code

    code

6 部署合约

  • 在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径

    code

  • 紧接JarFilePath的参数为该合约构造函数的参数

    code

  • 点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败

    code

  • 点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息

    code

  • 若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功

    code

  • 可在面板上方查看已部署的合约

    code

  • 点击部署成功的合约,可查看该合约的所有方法

    code

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/index.html b/docs/.vuepress/dist/zh/NULS2.0/index.html new file mode 100644 index 00000000..4eaa8569 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/index.html @@ -0,0 +1,21 @@ + + + + + + NULS2.0 Alpha版本已发布 | NULS + + + + + + + +

NULS2.0 Alpha版本已发布

亲爱的用户:

很荣幸的宣布,NULS2.0 Alpha版本已于北京时间:2019-03-28日上午10:30发布,诚邀您参与内测。

NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。

此次Alpha版本测试内容主要包含:

  • Linux钱包全部功能,例如:账户创建、导入、转账和创建节点等等
  • 基于NULS2.0核心模块搭建区块链
  • 搭建包含业务模块的区块链

参与测试:

1 下载linux客户端

2 linux钱包使用教程

3 申请测试币并在帖子中回复:Alpha+地址

4 访问区块链浏览器:http://alpha.nulscan.io/

5 使用NULS2.0搭建区块链

6 提交bug:https://github.com/nuls-io/nuls_2.0/issues

相关链接

想了解更多与NULS相关的信息,可以访问我们的官网

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/linuxTutorial.html b/docs/.vuepress/dist/zh/NULS2.0/linuxTutorial.html new file mode 100644 index 00000000..9c2e8f14 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/linuxTutorial.html @@ -0,0 +1,712 @@ + + + + + + Linux CLI 手册 | NULS + + + + + + + +

Linux CLI 手册

介绍

本文档为NULS2.0 alpha版本测试网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。

版本更新记录

版本 更新日期 内容
V1.0.0 2018-03-18 alpha版功能

准备

服务器硬件配置

建立NULS节点的服务器不低于如下配置:

CPU 内存 硬盘 宽带
四核 3.0GHz 16G 128G硬盘 20M上行

推荐配置:

CPU 内存 硬盘 宽带
八核 3.0GHz 32G 256G硬盘 100M上行

系统及内核版本

Linux系统

  • CentOS 6,7

Linux内核版本推荐使用 2.6.32及以上

开始

下载

  • 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release

  • 进入NULS官网钱包下载界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。

    Linux系统中下载v2.0.0-alpha-1版的钱包可以使用如下命令:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    注:如果后续有其他版本,下载地址可能会不同。

安装

  • 在Linux中解压已下载的文件

    $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz
    +

运行

  • 进入解压后的目录,并运行启动脚本,启动全节点钱包

    $ cd NULS-Wallet-linux64-2.0.0-alpha-1
    +$ ./start.sh
    +

使用钱包

快速入门

  • 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。

    进入cmdclient/1.0.0目录,执行如下命令:

    $ cd cmdclient/1.0.0
    +$ ./cmd.sh
    +

    将会出现NULS命名输入提示符nuls>>> ,然后可直接输入NULS钱包操作命令,来进行操作。

    例如,创建账户的示例如下:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    执行create命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。

约定

  • 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。
  • 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。

钱包命令

帮助命令

输出打印所有的命令,

  • 命令: help [-a]|[group]|[command]
参数 说明
-a 格式化打印命令,选填
command 查看指定命令使用说明
group 查看指定命令组的所有命令使用说明

返回信息 help

getaccount <address> --get account information
+

返回信息 help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

示例

nuls>>> help
+nuls>>> help -a
+nuls>>> help account
+nuls>>> help create
+

创建账户

创建账户,返回账户地址集合

  • 命令: create [number]
参数 说明
[number] 创建账户的数量,选填

创建账户时,将会提示输入密码,为了保证资产安全,必须给账户设置密码;

返回账户集合

[ "5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r", "5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p" ]
+

示例

创建1个账户

nuls>>> create 
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]
+

一次创建多个账户

nuls>>> create 3
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]
+

备份账户

备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件

  • 命令:backup <address> [path]
参数 说明
<address> 账户地址,必填
[path] 文件生成备份文件的目标文件夹,默认为当前文件夹,选填

返回信息

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

示例 备份一个有密码的账户

nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj
+Enter account password
+***************
+The path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+

移除账户

根据账户地址移除本地账户,需要输入密码

  • 命令:remove <address>
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+Enter your password for account**********
+Success
+

修改账户密码

根据账户地址和账户密码重新设置新密码。

  • 命令:resetpwd <address>
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N
+Enter your old password:**********
+Enter new password**********
+Please confirm new password:**********
+Success
+

设置别名

给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示

  • 命令:setalias <address> <alias>
参数 说明
<address> 账户的地址,必填
<alias> 别名名称,必填

返回信息 交易hash

txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

示例

nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj
+Enter your account password**********
+txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582
+

导入账户keystore

导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。

  • 命令:importkeystore <path>
参数 说明
<path> 待导入的keystore文件地址,必填

注意:导入keystore文件生成账户时,需要原始密码

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+

导入账户私钥

导入账户私钥,生成本地账户,如果本地已有该账户将覆盖,导入时需要给账户设置密码。此功能可以用于忘记账户密码后,通过私钥重新找回账户。

  • 命令:import <privatekey>
参数 说明
<privatekey> 账户的私钥,必填
"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+

查询账户信息

根据账户地址查询账户信息

  • 命令:getaccount <address>
参数 说明
<address> 账户地址,必填

返回信息

{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //加密后的私钥
+  "alias" : "zlj",  //别名
+  "baglance" : {  
+    "freeze" : 0,   //冻结的资产数量
+    "total" : 997999999800000,     //总的资产数量
+    "available" : 997999999800000  //可用的资产数量
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //账户地址
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //公钥
+}
+

示例

nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //加密后的私钥
+  "alias" : "zlj",  //别名
+  "baglance" : {  
+    "freeze" : 0,   //冻结的资产数量
+    "total" : 997999999800000,     //总的资产数量
+    "available" : 997999999800000  //可用的资产数量
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //账户地址
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //加密后的公钥
+}
+

查询账户列表

根据分页参数查询账户列表,所有账户以创建时间倒序输出。

  • 命令:getaccounts <pageNumber> <pageSize>
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息,将输出账户集合

[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //地址
+  "alias" : null,  //别名
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //公钥
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //私钥
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

示例 获取账户列表

nuls>>> getaccounts
+[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //地址
+  "alias" : null,  //别名
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //加密后的公钥
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //加密后的私钥
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

查询账户私钥

根据账户地址个密码查询账户私钥

  • 命令:getprikey <address>
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户的私钥(未加密)

00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+

示例

nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9
+Enter your account password**********
+7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678
+

查询账户余额

根据账户地址查询账户余额

  • 命令:getbalance <address>
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

{
+  "total" : "9999998.99",//余额
+  "freeze" : "0",//已锁定余额
+  "available" : "9999998.99"//可用余额
+}
+

示例

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "total" : "9999998.99",
+  "freeze" : "0",
+  "available" : "9999998.99"
+}
+

转账

根据账户地址或别名将NULS转入另一账户地址或别名中

  • **命令:transfer <formAddress>|<formAlias> <toAddress>|<toAlias> <amount> [remark] **
参数 说明
<formAddress> 转出地址(与formAlias任选一项)
<formAlias> 转出地址别名(与formAddress任选一项)
<toAddress> 接收地址(与toAlias任选一项)
<toAlias> 接收地址别名(与toAddress任选一项)
<amount> 转账数量,必填
[remark] 备注信息,选填

返回信息 转账交易hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

示例

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

查询交易详情

根据交易hash查询交易详细信息

  • 命令:gettx <hash>
参数 说明
<hash> 交易hash,必填

返回信息 交易详细信息

{
+  "type" : 2,  //交易类型(枚举说明见下表【type 枚举类型说明】)
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //区块高度
+  "status" : "CONFIRMED",  //确认状态
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //手续费
+  "multiSignTx" : false
+}
+

示例 查询转账交易

nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f
+{
+  "type" : 2,  //交易类型(枚举说明见下表【type 枚举类型说明】)
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //区块高度
+  "status" : "CONFIRMED",  //确认状态
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //手续费
+  "multiSignTx" : false
+}
+

type 枚举类型说明

/** coinbase交易*/
+    int TX_TYPE_COINBASE = 1;
+    /** 转账交易*/
+    int TX_TYPE_TRANSFER = 2;
+    /** 设置别名*/
+    int TX_TYPE_ALIAS = 3;
+    /** 创建共识节点交易*/
+    int TX_TYPE_REGISTER_AGENT = 4;
+    /** 委托交易(加入共识)*/
+    int TX_TYPE_JOIN_CONSENSUS = 5;
+    /** 取消委托交易(退出共识)*/
+    int TX_TYPE_CANCEL_DEPOSIT = 6;
+    /** 黄牌惩罚*/
+    int TX_TYPE_YELLOW_PUNISH = 7;
+    /** 红牌惩罚*/
+    int TX_TYPE_RED_PUNISH = 8;
+    /** 停止节点(删除共识节点)*/
+    int TX_TYPE_STOP_AGENT = 9;
+    /** 跨链转账交易*/
+    int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;
+    /** 注册链交易*/
+    int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;
+    /** 销毁链*/
+    int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;
+    /** 为链新增一种资产*/
+    int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;
+    /** 删除链上资产*/
+    int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;
+    /** 创建智能合约交易*/
+    int TX_TYPE_CREATE_CONTRACT = 100;
+    /** 调用智能合约交易*/
+    int TX_TYPE_CALL_CONTRACT = 101;
+    /** 删除智能合约交易*/
+    int TX_TYPE_DELETE_CONTRACT = 102;
+

创建节点

根据账户地址创建节点,创建节点时需要提供两个地址,第一个地址为节点地址,需要输入节点地址账户密码,第二地址为打包地址,不需要输入密码。同时需要至少20000NULS的保证金。

  • 命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit>
参数 说明
<agentAddress> 创建节点的账户地址,必填
<packingAddress> 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)
<commissionRate> 代理佣金比例,范围:10~100,必填
<deposit> 创建节点的保证金,不能低于20000NULS,必填

返回信息 返回节点的agent hash

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

示例 创建一个节点,佣金比例为10%,押金20000NULS。

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

加入共识(委托节点)

根据账户地址和节点agentHash,加入共识,至少需要2000NULS

  • 命令:deposit <address> <agentHash> <deposit>
参数 说明
<address> 账户地址,必填
<agentHash> 节点的agentHash,必填
<deposit> 加入共识保证金,不能低于2000NULS,必填

返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

示例

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

退出共识(退出委托)

根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。

  • 命令:withdraw <address> <txHash>
参数 说明
<address> 账户地址,必填
<txHash> 委托时的交易hash,必填

返回信息 退出共识交易hash

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

示例

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

停止节点

停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。

  • 命令:stopagent <address>
参数 说明
<address> 账户地址,必填

返回信息 停止节点交易hash

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

示例

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

获取最新的区块头信息

获取最新的区块头信息

  • 命令:getbestblockheader

返回信息

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

示例

nuls>>> getbestblockheader
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",
+  "time" : "2019-03-19 18:26:20.020",
+  "height" : 1479,
+  "txCount" : 0,
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",
+  "size" : 0,
+  "packingAddress" : null,
+  "roundIndex" : 155299118,
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1,
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。

  • 命令:getblock <hash> | <height>
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

示例 根据高度获取区块

nuls>>> getblock 28115
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。

  • 命令:getblockheader <hash> | <height>
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块头

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

创建智能合约

调用此接口在链上创建一个智能合约

  • 命令:createcontract <sender> <gaslimt> <price> <contractCode> [remark]
参数 说明
<sender> 创建智能合约的账户地址
<gaslimt> 本次创建合约最大消耗的Gas
<price> 单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas
<contractCode> 合约代码的hex编码
[remark] 备注

返回信息 创建合约的交易hash和合约的地址

{
+  "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f",  //交易hash
+  "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //合约地址
+}
+

示例 创建一个合约(contractCode 省略中间部分)

nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo
+The arguments structure: 
+[ {
+  "type" : "String",
+  "name" : "name",
+  "required" : true
+}, {
+  "type" : "String",
+  "name" : "symbol",
+  "required" : true
+}, {
+  "type" : "BigInteger",
+  "name" : "initialAmount",
+  "required" : true
+}, {
+  "type" : "int",
+  "name" : "decimals",
+  "required" : true
+} ]
+Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'").
+Enter the arguments:"KQB","KQB",10000,2
+{
+  "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"
+}
+

获取合约基本信息

获取智能合约的描述信息以及构造函数、调用方法的参数列表

  • 命令:getcontractinfo <contract address>
参数 说明
<contract address> 合约地址

返回信息

略 ,见示例
+

示例


+nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+{
+  "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+  "createTime" : 1553563706022,
+  "blockHeight" : 46,
+  "isNrc20" : true,
+  "nrc20TokenName" : "QKB",
+  "nrc20TokenSymbol" : "QKB",
+  "decimals" : 2,
+  "totalSupply" : "200000000",
+  "status" : "normal",
+  "method" : [ {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },{
+    "name" : "transfer",
+    "desc" : "(Address to, BigInteger value) return boolean",
+    "args" : [ {
+      "type" : "Address",
+      "name" : "to",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "value",
+      "required" : true
+    } ],
+    "returnArg" : "boolean",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  }]
+}
+
+

调用智能合约

调用智能合约提供的函数

  • 命令:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]
参数 说明
<senderAddress> 调动合约的账户地址
<gasLimit> 本次合约执行最大消耗的Gas
<price> 单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas
<contractAddress 调用的合约地址
<methodName> 合约的方法名
<value> 如果要向合约转账,转账的数量
[-d methodDesc] 如果合约中有同名方法时,使用此方法来描述参数列表
[-r remark] 备注信息

返回信息 本次调用的交易hash

"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //交易hash
+

示例 调用一个指定合约的NRC20-Token转账函数, 示例中tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L为NRC20合约地址,输入的参数为 接收地址和转账数量

nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+Please Enter your account passwordzhoujun172
+**********
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2
+"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"
+

删除智能合约

停止一个可用的智能合约

  • 命令:deletecontract <senderAddress> <contractAddress>
参数 说明
<senderAddress> 调用合约的账户地址
<contractAddress> 调用的合约地址

返回值 交易hash

"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash
+

示例

nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+Please enter your account passwordzhoujun172
+**********
+"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"
+

调用合约视图方法

调用合约的视图方法,会立即返回结果,不会产生交易

  • 命令:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract
参数 说明
<contractAddress> 调用的合约地址
<methodName> 调用的方法
[-d methodDesc] 如果合约中有同名方法时,使用此方法来描述参数列表

返回值

根据具体调用函数返回值不同
+

示例 调用NRC20-Token合约的查询Token余额函数查询指定地址的Token余额

nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+{
+  "result" : "20000000"
+}
+

向合约地址转账

向指定的合约地址转入主网币

  • 命令:transfertocontract <senderAddress> <contractAddress> <amount> [remark]
参数 说明
<senderAddress> 转出账户地址
<contractAddress 转入的合约地址
<amount> 转入数量
[remark] 备注

返回值 交易hash

"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

示例 向指定合约转入2个NULS

nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark
+Please enter your account password
+**********
+"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

token转账

NRC20 token转账

  • 命令:tokentransfer <formAddress> <toAddress> <contractAddress> <amount> [remark]
参数 说明
<formAddress> 转出账户地址
<toAddress 转入的账户地址
<contractAddress> 合约地址
<amount> 转入数量
[remark] 备注

返回值 交易hash

"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

示例 token转账:

nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD  tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta  tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000
+Please enter your account password
+**********
+"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

获取合约交易

获取合约的交易信息, 包含交易详情,合约调用参数,合约执行结果

  • 命令:getcontracttx <hash>
参数 说明
<hash> 交易hash

返回值

略 见示例
+

示例

nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "type" : "100",
+  "time" : "2019-03-26 09:28:26",
+  "blockHeight" : 46,
+  "fee" : 0.0,
+  "value" : 0.0,
+  "remark" : null,
+  "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",
+  "status" : "confirm",
+  "confirmCount" : 0,
+  "size" : 6686,
+  "inputs" : [ {
+    "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "assetsChainId" : 2,
+    "assetsId" : 1,
+    "amount" : "5700000",
+    "nonce" : "ffffffff",
+    "locked" : 0,
+    "value" : 0.0
+  } ],
+  "outputs" : [ ],
+  "txData" : {
+    "data" : {
+      "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "value" : 0.0,
+      "hexCode" : "504b03040a0000080...........31600000000",
+      "gasLimit" : 200000,
+      "price" : "0.00000025",
+      "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]
+    }
+  },
+  "contractResult" : {
+    "success" : true,
+    "errorMessage" : null,
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "result" : null,
+    "gasLimit" : 200000,
+    "gasUsed" : 14029,
+    "price" : "0.00000025",
+    "totalFee" : 0.0,
+    "txSizeFee" : 0.0,
+    "actualContractFee" : 0.0,
+    "refundFee" : 0.0,
+    "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+    "value" : 0.0,
+    "stackTrace" : null,
+    "balance" : 0.0,
+    "transfers" : [ ],
+    "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+    "tokenTransfers" : [ {
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "from" : null,
+      "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "value" : "200000000",
+      "name" : "QKB",
+      "symbol" : "QKB",
+      "decimals" : 2
+    } ],
+    "remark" : "create"
+  }
+}
+
+
+

获取合约执行结果

获取一个合约的执行结果

  • 命令:getcontractresult <hash>
参数 说明
<hash> 交易hash

返回值

略 见示例
+

示例

nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "success" : true,
+  "errorMessage" : null,
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "result" : null,
+  "gasLimit" : 200000,
+  "gasUsed" : 14029,
+  "price" : "0.00000025",
+  "totalFee" : 0.0,
+  "txSizeFee" : 0.0,
+  "actualContractFee" : 0.0,
+  "refundFee" : 0.0,
+  "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+  "value" : 0.0,
+  "stackTrace" : null,
+  "balance" : 0.0,
+  "transfers" : [ ],
+  "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+  "tokenTransfers" : [ {
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "from" : null,
+    "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "value" : "200000000",
+    "name" : "QKB",
+    "symbol" : "QKB",
+    "decimals" : 2
+  } ],
+  "remark" : "create"
+}
+
+

获取合约构造函数

获取创建指定合约时需要传入的参数列表

  • 命令:getcontractcontructor <contractCode>
参数 说明
<contractCode> 合约代码的hex编码

返回值

略 见示例
+

示例

nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000
+{
+  "constructor" : {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },
+  "isNrc20" : true
+}
+
+

获取指定账户创建的合约列表

获取指定账户地址所创建的合约列表

  • 命令:getaccountcontracts <createAddress>
参数 说明
<createAddress> 账户地址

返回值

{
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}
+

示例

nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD
+[ {
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",
+  "createTime" : "2019-03-25 16:08:25.025",
+  "height" : 253,
+  "confirmCount" : 195,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",
+  "createTime" : "2019-03-25 15:33:54.054",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+} ]
+

查询网络信息

查询网络基本信息

  • **命令:network info **

返回信息

{
+  "localBestHeight" : 35317,//本地最新区块高度
+  "netBestHeight" : 35317,//网络最新区块高度
+  "timeOffset" : "0ms",//网络时间偏移值
+  "inCount" : 0,//被动连接节点数量
+  "outCount" : 1//主动连接节点数量
+}
+

示例

nuls>>> network info
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

查询网络节点IP

查询网络节点IP

  • **命令:network nodes **

返回信息

[ "192.168.1.223" ]
+

示例 根据高度获取区块

nuls>>> network nodes
+[ "192.168.1.223" ]
+

退出钱包命令程序

退出操作钱包的命令行程序,不会退出已启动的钱包节点。

  • 命令:exit

示例

nuls>>> exit
+
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/packageGeneration.html b/docs/.vuepress/dist/zh/NULS2.0/packageGeneration.html new file mode 100644 index 00000000..0f115a0d --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/packageGeneration.html @@ -0,0 +1,43 @@ + + + + + + 生成程序包 | NULS + + + + + + + +

生成程序包

必备知识

Nuls2基础模块使用java11开发,使用分布式多模块的微服务架构,模块间使用websocket进行通信。但模块间并无语言要求,能支持websocket协议进行网络编程的语言理论上都可以成为NULS2的模块,所以需要对websocket协议有一定的了解。

获取程序源代码

NULS2的源代码托管在github.com上,任何人可免费获取。项目地址nuls_2.0,获取方法参见git

调试程序

如果想要开发或者调试NULS2的源代码,需要先准备开发环境,依次安装JDK11.0.2、apache maven 3.3,以及一个趁手的开发工具,我们推荐IntelliJ IDEA。开发环境和源代码准备好后,在IDEA中用导入maven项目的方式导入程序模块。

modules

模块根目录存在module.ncf文件的模块定义为nuls2子模块,其中mykernel为核心调度模块,此模块负责其他子模块注册服务。每个模块的启动类的命名方式为XXXXBootstrap,运行启动类的main函数启动模块。

在开发环境中,首先需要启动mykernel模块,再启动其他模块,模块间的依赖关系由框架自动控制。在日志中打印"MYKELNEL STARTED. PORT:8887"时,mykernel模块启动成功。

启动其他模块(以ledger模块为例),找到LedgerBootstrap类,运行main函数。

日志打印"RMB:module state : Running"时,模块启动成功。

生成可执行程序包

获取到源代码后,可以自己通过源代码生成可使用的脚本程序。在nuls2.0根目录运行脚本package.sh执行自动打包程序(脚本需要依赖jdk11,maven3.3,git).

执行打包程序,将/usr/local/java/jdk11.0.2目录下的JDK作为运行环境复制到钱包目录中。钱包可运行程序输出到../NULS2这个相对目录中。

./package.sh -J /usr/local/java/jdk11.0.2 -o ../NULS2
+

日志输出XXXX PACKAGE FINISH时,打包程序生成成功。

更多的package.sh脚本参数可通过-h查看帮助。

lijunzhou:nuls_2.0 zhoulijun$ ./package.sh -h
+    Desc: 使用此脚本将生成符合NULSTAR规范的可执行子模块,
+    	  所有子模块按照module.ncf配置,使用mvn命令进行打包,并生成启动、停止脚本
+    Usage: ./package.sh 
+    		-b <branch> 打包前同步最新代码 参数为同步的远程分支名称
+    		-p 打包前同步最新代码 从master分支拉取
+    		-o <目录>  指定输出目录
+    		-h 查看帮助
+    		-j JAVA_HOME
+    		-J 输出的jvm虚拟机目录,脚本将会把这个目录复制到程序依赖中
+    		-i 跳过mvn打包
+    		-z 生成压缩包
+    Author: zlj
+

钱包使用方法请参见命令行使用手册

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/quickStart.html b/docs/.vuepress/dist/zh/NULS2.0/quickStart.html new file mode 100644 index 00000000..9d80f834 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/quickStart.html @@ -0,0 +1,53 @@ + + + + + + 快速开始 | NULS + + + + + + + +

快速开始

一、安装JDK11

下载JDK11到服务器并解压。

1、下载jdk11

jdk11下载地址:jdk11下载

2、上传至服务器并解压

tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz
+

20190327142342

3、配置环境

vi /ect/profile

将下面的代码复制写入文件

JAVA_HOME=/home/nuls2/jdk-11.0.2
+PATH=$PATH:$JAVA_HOME/bin
+CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
+export JAVA_HOME PATH CLASSPATH	
+

ps:/home/nuls2/jdk-11.0.2为jdk加压之后的路径,请根据自己的实际路径配置。

source /ect/profile 执行该命令配置生效。

通过java -version查看jdk版本:

20190327143435

二、下载、安装客户端

1、下载NULS钱包

进入GitHub下载最新版的NULS2.0 Alpha1钱包:下载地址

2、上传至服务器并解压

tar -zxvf NULS-Walltet-linux64-alpha1.tar.gz
+

20190327144549

三、进入CLI

1、启动钱包

钱包解压之后,进入start.sh文件目录:/home/nuls2/NULS-Walltet-linux64-alpha1/bin

20190327150757

执行命令:./start.sh -D

2、进入命令行

钱包启动之后,执行同目录下的cmd.sh(./cmd.sh)进入钱包命令行,将会提示NULS命令输入提示符:nuls&gt;&gt;&gt;,输入NULS钱包操作命令,进行操作。

20190327223858

四、部分操作命令说明

1、创建账户

命令:create [Number]

Number:创建账户地址的数量,默认为1,最大为100
+

2、备份keystore

命令:backup <address> [Path]

Address:待备份的账户地址(必填)
+Path:生成备份文件的目录,默认为当前目录(可选)
+

3、获取私钥

命令:getprikey <address>

Address:获取私钥的账户地址(必填)
+

4、移除账户

命令:remove <address>

Address:待移除地址(必填)
+

5、修改账户密码

命令:resetpwd <address>

Address:修改密码的账户地址(必填)
+

6、转账

命令:transfer <FormAddress/FormAlias> <ToAddress/ToAlias><amount> [Remark]

FormAddress/FormAlias:转出地址或转出别名,二者选一(必填)
+ToAddress/ToAlias:接收地址或接收别名,二选一(必填)
+

7、创建共识节点

命令:createagent <AgentAddress> <PackingAddress> <CommissionRate> <Deposit> [RewardAddress]

AgentAddress:共识节点创建地址(必填)
+PackingAddress:共识节点打包地址,密码必须与配置文件中一致,默认为:nuls123456(必填)
+CommissionRate:佣金比例,范围:10-100,最多小数位2位(必填)Deposit:保证金,范围:20000-200000,最多小数位8位(必填)RewardAddress:奖励地址,默认为节点创建地址(选填)
+

ps:保存好创建共识节点的hash(或者在浏览器中查询),加入共识和查询共识节点信息需要使用;必须保证共识节点创建地址与打包地址在一个钱包内,一个钱包不能同时创建两个共识节点。

8、加入共识

命令:deposit<Address><AgentHash><Deposit>

Address:加入共识的账户地址(必填)
+AgentHash:创建共识节点的hash(必填)
+Deposit:加入共识保证金,2000-500000,最多8位小数(必填)
+

ps:保存好加入共识的hash,退出共识需要使用

9、退出共识

命令:withdraw<Address><TxHash>

Address:退出共识地址(必填)
+TxHash:委托时的交易hash(必填)
+

10、停止共识节点

命令:stopagent<Address>

Address:共识节点创建地址(必填)
+

11、查询共识节点信息

命令:getagent<AgentHash>

AgentHash:共识节点创建hash(必填)
+
Last Updated: 2019-3-28 11:34:44
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/smartContractFee.html b/docs/.vuepress/dist/zh/NULS2.0/smartContractFee.html new file mode 100644 index 00000000..1e0aefcf --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/smartContractFee.html @@ -0,0 +1,44 @@ + + + + + + 手续费 | NULS + + + + + + + +

手续费

1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用?

背景:由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一

在主链上,多出三个类型的交易,创建智能合约, 调用智能合约, 删除智能合约

三个交易与其他交易如转账不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一

  • 智能合约收费计算方式
public static final int COMPARISON = 1;//比较字节码
+public static final int CONSTANT = 1;//简单数值类型字节码
+public static final int LDC = 1;//数值常量,字符串常量(长度 * LDC)
+public static final int CONTROL = 5;//控制字节码
+public static final int TABLESWITCH = 2;//switch字节码(大小 * TABLESWITCH)
+public static final int LOOKUPSWITCH = 2;//switch字节码(大小 * LOOKUPSWITCH)
+public static final int CONVERSION = 1;//数值转换
+public static final int EXTENDED = 1;//null判断
+public static final int MULTIANEWARRAY = 1;//多维数组(大小 * MULTIANEWARRAY)
+public static final int LOAD = 1;//把本地变量送到栈顶
+public static final int ARRAYLOAD = 5;//把数组的某项送到栈顶
+public static final int MATH = 1;//数学操作及移位操作
+public static final int REFERENCE = 10;//对象相关操作
+public static final int NEWARRAY = 1;//一维数组(大小 * NEWARRAY)
+public static final int STACK = 2;//栈操作
+public static final int STORE = 1;//把栈顶的值存入本地变量
+public static final int ARRAYSTORE = 5;//把栈项的值存到数组里
+public static final int TRANSFER = 1000;//转账交易
+
+
  • 一次智能合约总手续费

    一次合约交易的总手续费由三部分构成

    • 第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费

    • 第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na

    举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是20000 * 20 = 400000,既是0.004NULS

    • 第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还

    举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是10000 * 20 = 200000,既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方

  • 合约调用方付多少钱?

    在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方

  • 由谁收到了这些费用?

    前提:这部分费用都体现在区块的CoinBase交易(共识奖励)中

    区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULS2.0/startSmartContract.html b/docs/.vuepress/dist/zh/NULS2.0/startSmartContract.html new file mode 100644 index 00000000..25359e57 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULS2.0/startSmartContract.html @@ -0,0 +1,76 @@ + + + + + + 快速入门 | NULS + + + + + + + +

快速入门

一、运行公测环境,创建账户,领取测试币

为部署、调用智能合约做准备

二、安装JDK8、IntelliJ IDEA、NULS智能合约插件

为开发智能合约代码做准备

下载JDK8(安装略)

下载IntelliJ IDEA(安装略)

下载NULS智能合约插件

安装NULS智能合约插件

三、智能合约代码示例

用示例快速编译、部署一个智能合约

  • 简单示例

+import io.nuls.contract.sdk.Contract;
+import io.nuls.contract.sdk.Msg;
+import io.nuls.contract.sdk.annotation.Payable;
+import io.nuls.contract.sdk.annotation.Required;
+import io.nuls.contract.sdk.annotation.View;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+public class SimpleContract implements Contract {
+
+    private String sayContent;
+
+    @Override
+    @Payable
+    public void _payable() {
+        // 覆写这个方法并标记@Payable注解,这个智能合约可以接收全节点钱包NULS资产的直接转账
+        // you can do something else
+        // ...
+    }
+
+    public String sayContent(@Required String content) {
+        this.sayContent = content;
+        return "you want say " + content;
+    }
+
+    @Payable
+    public String transferToContract() {
+        // 标记@Payable注解,调用这个方法时,智能合约可接受NULS转入
+        BigInteger value = Msg.value();
+        BigDecimal nuls = new BigDecimal(value).movePointLeft(8);
+        // you can do something else
+        // ...
+
+        return "I received your transfer amount: " + nuls.toPlainString();
+    }
+
+    @View
+    public String sayWhat() {
+        if(sayContent != null) {
+            return "you want say " + sayContent;
+        }
+        return "you want say nothing.";
+    }
+}
+
+

四、智能合约代码仓库

NULS官方收集的智能合约代码仓库

社区成员Angelillou的智能合约-合作委托挖矿

社区成员Angelillou的智能合约-彩票

社区成员Naveen的智能合约-评论

五、智能合约部署与调用

全节点钱包智能合约部署与调用方式

六、智能合约代码规范与语法

智能合约代码规范与语法说明

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/NULS2.0Introduction.html b/docs/.vuepress/dist/zh/NULSInfrastructure/NULS2.0Introduction.html new file mode 100644 index 00000000..79cc9be2 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/NULS2.0Introduction.html @@ -0,0 +1,23 @@ + + + + + + NULS 2.0 介绍 | NULS + + + + + + + +

NULS 2.0 介绍

为什么要做NULS2.0

NULS创立的目的就是为了让区块链更简单,所以在2017年9月的时候,核心团队就定义了NULS 的基本架构为模块化,就是为了让更多开发者和用户能更容易的使用和编写模块。NULS目前完成了编码层的模块化,但存在模块之间耦合度较高的问题,开发者想使用某个模块或参与某个模块的开发,需要同时了解与其相关联的其他模块的设计,并且只能用特定的语言进行开发,这对NULS技术社区深度参与NULS架构的设计和开发,以及用户简单低成本的运用模块不够友好。

NULS在创立之初,就致力于成为一个由全球社区驱动的开源项目。我们认为,能不断催生创新思维的社区发展路线,才是区块链项目区别于其他商业项目的一大特点。不断的迭代与创新是开源项目发展过程中必然会产生的现象,也是区块链的魅力所在。为了让开源技术社区可以无任何障碍的融入NULS底层设计和开发中,以及为了革命性产品“链工厂”中的重要组成部分“模块仓库”的搭建和易用,有以下几个难点必须克服:

1、模块的耦合度降低,模块之间不在编写和使用上彼此依赖 ;

2、 模块可扩展、修改、替换,每一个模块都是简单的、纯粹的,不受到区块链程序整体复杂度的影响;

3、 彻底打破编程语言障碍。

核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。

在NULS2.0设计期间,NULS技术社区开发者还成立了NULS CCC(Code Craft Council),初步开始了技术社区的自治。无独有偶的是,CCC成员BERZECK也一直在思考用微服务的设计方式来重构NULS架构。核心团队阅览了BERZECK的设计方案后,大感欣慰,他提出了更完善的微服务设计思路,他的想法和我们想要达到的更加灵活的区块链底层设施不谋而合。Berzeck的设计方案分为三层系统架构设计:

第一层为微服务基础架构层;

第二层为区块链基础服务层;

第三层为DAPP应用层。

这个设计站在一个脱离区块链的角度来重构NULS,是一个更高层次的认知,它将把NULS带入NULS IS EVERYTHING的新时代。核心团队决定在这个架构基础上来进行NULS2.0的架构重构。可以预见,NULS成为一个真正的强大灵活平台之后的景象。 +

此构架使得我们可以在第二层上开发更高级的应用系统(比如交易所的分布式系统,数据服务系统,甚至类似于滴滴打车的整个系统都可以构建在第二层之上)。构建在NULS体系上的,不仅仅是多个链和多个DAPP,还可以是有意向往区块链发展的其他大中小型互联网、移动互联网、物联网、车联网等等商业系统。

这样的设计让NULS将不仅仅是区块链底层基础设施,还是与区块链系统无缝结合的分布式系统基础架构,它将成为一个不同系统间(区块链以及其他系统)可以进行无缝通信的平台,这将使围绕NULS构建的企业能够更快地蓬勃发展,同时大大降低开发成本。这种整体上的优化,使得NULS生态具备先天的竞争优势。 +

NULS2.0的设计思维

NULS2.0的微服务架构是逐渐演化而成,想深入了解其是如何形成的,可阅读文档NULS2.0设计思维,文档中详细阐述了NULS2.0的演化之路。

Last Updated: 2019-1-9 16:46:46
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/accountModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/accountModuleDesign.html new file mode 100644 index 00000000..e210374d --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/accountModuleDesign.html @@ -0,0 +1,920 @@ + + + + + + 账户模块设计 | NULS + + + + + + + +

账户模块设计

账户模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《账户》模块

  • 用于管理账户的生成、安全和保管、信息的获取
  • 用户保存账户的地址、公私钥对、以及验证数据签名

1.1.2 《账户》要做什么

账户模块是提供关于账户各项功能的基础性模块。主要对账户的生成、安全和保管、信息的获取等几个方面的功能提供支持,其他模块可以根据账户模块提供的接口来使用账户的各种功能以及获取账户信息,用户或者其他应用可以根据RPC接口对账户进行更加实用性和个性化的操作。账户是基础模块,也是用户数据的载体 。

  • 账户的生成

    创建账户、导入账户

  • 账户的安全和保管

    账户的备份、设置账户密码、修改账户密码、移除账户

  • 账户信息的获取

    查询单个账户信息、获取多个账户信息、获取账户地址、查询账户余额、查询账户别名

  • 其他实用性和个性化功能

    设置账户别名、设置账户备注、验证账户是否加密、签名、验证账户地址格式、验证账户密码是否正确等功能

1.1.3 《账户》在系统中的定位

账户是底层模块,与账本、共识、交易、内核、事件总线、社区治理模块有依赖关系。

1、账户模块依赖账本模块

ledger模块需要处理本地交易,依赖于账户信息。
+
+账户模块需要发起设置别名交易,需要ledger模块支付费用
+
+账户余额查询,需要依赖ledger模块
+

2、账户模块依赖内核模块

上报模块信息、共享数据操作
+

3、账户模块依赖网络模块

通过网络模块来接收和发送数据
+

4、账户模块依赖事件总线模块

创建账户、删除账户、修改密码事件通过事件总线模块发送消息
+账户模块并非强依赖事件总线模块,因为即使事件发送失败也不影响业务正常流程
+

5、共识模块依赖账户模块

共识需要账户信息进行打包出块
+

6、交易管理模块依赖账户模块

交易管理模块要对交易进行验证,依赖账户中address功能,验证地址是否合法
+

7、社区治理模块依赖账户模块

社区治理需要账户签名
+

1.2 架构图

1、API:对外提供接口层,提供账户的创建、备份、设置别名等操作;

2、业务逻辑层:定义账户、账户地址、别名的功能;

3、数据持久化层:保存账户、别名数据;

二、功能设计

2.1 功能架构图

2.2 模块服务

2.2.1 创建账户

  • 功能说明:

    创建用户的账户,包括账户的地址、公匙、私匙的创建,账户信息保存到数据库,并将创建账户通过事件通知其他节点

  • 流程描述

    创建地址:创建卫星链标准账户地址

    1、生成随机公私钥对
    +2、获取chainId和账户类型
    +3、根据公钥计算hash160
    +4、拼接字节数组组成地址:
    +4.1、如果是NULS体系地址:address=type+hash160
    +4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址
    +5、生成地址字符串:地址字节[]+校验位,然后执行Base58计算生成字符串
    +5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)
    +5.1、如果非NULS体系校验位:xor=XOR(length+address)
    +6、base58计算生成地址字符串:
    +   NULS体系地址:Base58(type+hash160+xor)+Hex(chainId)
    +   非NULS体系地址:Base58(length+address+xor)+Hex(chainId)
    +7、根据密码对私钥进行加密,并将私钥的明文删除
    +8、存储账户信息
    +9、将账户加入缓存
    +10、发送创建账户事件
    +
  • ac_createAccount接口

    • 接口说明

      该接口创建一个或多个账户。

    • 请求示例

    {
    +    "cmd":"ac_createAccount",
    +    "minVersion":1.0,
    +    "params":[
    +        1234,
    +        10,
    +        "123456"
    +    ]
    +}
    +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID,说明该账户属于哪个链
      1 count false Integer 要创建账户数量,约束条件:1-100.
      2 password false String 账户初始密码,可为空
    • 返回示例

    {
    +    "code": 0,
    +    "msg": "success",
    +    "version":1.0,
    +    "result": {
    +    	["address","",""]
    +    }
    +}
    +
    • 返回字段说明
    parameter type description
    code Integer 返回结果状态
    msg String 失败时的信息
    result jsonObj 业务数据
    list jsonArray 账户地址列表
  • 依赖服务

    事件总线:发送创建账户事件

2.2.2 创建离线账户

  • 功能说明:

    创建用户的离线账户,包括账户的地址、公匙、私匙的创建,账户信息并不会保存到数据库

  • 流程描述

    创建地址:创建卫星链标准账户地址

    1、生成随机公私钥对
    +2、获取chainId和账户类型
    +3、根据公钥计算hash160
    +4、拼接字节数组组成地址:
    +4.1、如果是NULS体系地址:address=type+hash160
    +4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址
    +5、生成地址字符串:地址字节[]+校验位,然后执行Base58计算生成字符串
    +5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)
    +5.1、如果非NULS体系校验位:xor=XOR(length+address)
    +6、base58计算生成地址字符串:
    +   NULS体系地址:Base58(type+hash160+xor)+Hex(chainId)
    +   非NULS体系地址:Base58(length+address+xor)+Hex(chainId)
    +7、根据密码对私钥进行加密,并将私钥的明文删除
    +8、返回账户信息,并不保存到数据库
    +
  • ac_createOfflineAccount接口

    • 接口说明

      该接口创建一个或多个离线账户。

    • 请求示例

      {
      +    "cmd":"ac_createOfflineAccount",
      +    "minVersion":1.0,
      +    "params":[
      +        1234,
      +        10,
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID,说明该账户属于哪个链
      1 count false Integer 要创建账户数量,约束条件:1-100.
      2 password false String 账户初始密码,可为空
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	[
      +    	{
      +    	"address":"LgkSxjwficqMwnMVXpdA3kntVjXDm3930",
      +    	"pubKey":"0253aa17b27482261cc9e91d5ff6f4820130055ad092629e6981bff78c545c6289",
      +    	"priKey":"0253aa17b27482261cc9e91d5ff6f4820130055ad092629e6981bff78c545c6111",	
      +   		"encryptedPriKey":"e447b8427ce96b49e0fcf167f31635b93c8e8acf15e48c01e6753e23a",
      +  		"extend":null,
      +  		"createTime":1542003713441,
      +  		"encrypted":true,
      +  		"remark":null
      +  		},{}
      +    	]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      list jsonArray 账户地址列表
      address String 账户地址
      pubKey String 公匙16进制编码
      priKey String 私匙16进制编码
      encryptedPriKey String 加密私匙16进制编码,与priKey不会同时为空
      extend String 扩展字段16进制编码
      createTime long 账户创建时间
      encrypted boolean 账户是否加密
      remark String 备注
  • 依赖服务

2.2.3 创建多签账户

  • 功能说明:

    创建多重签名账户,包括账户的地址、脚本的创建,多签账户信息保存到数据库

  • 流程描述

    1、验证签名公匙列表,最少验证签名数是否正确
    +2、创建多重签名脚本
    +3、根据多签脚本创建多重签名类型的账户地址
    +4、保存多重签名账户
    +5、返回多签账户信息
    +
  • ac_createMultiSigAccount接口

    • 接口说明

      该接口创建多重签名账户。

    • 请求示例

      {
      +  "cmd": "createMultiAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID,说明该账户属于哪个链
      1 pubKeys true jsonArray 需要签名的公钥列表
      2 minSigns true String 最少签名数,最少需要几个公钥验证通过
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "address":"",
      +        "minSigns":"",
      +        "pubKeys":[{
      +            "pubKey":"",
      +            "address":""
      +            },{}
      +        ]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 多签账户地址
      minSigns Integer 最小签名数
      pubKeys jsonObj 公钥列表
      --pubKey String 公钥
      --address String 地址
  • 依赖服务

2.2.4 移除账户

  • 功能说明:

    移除用户的本地账户,包括删除本地账户的地址,并将删除账户通过事件通知其他节点

  • 流程描述

    删除账户

    1、验证账户地址格式是否正确
    +2、验证账户存在
    +3、验证账户是否加密,如果加密,则需要验证密码
    +3.1、根据账户已加密私匙+密码得到未加密私匙
    +3.2、根据未加密私匙得到公匙
    +3.3、将解密出的公匙与查询出的账户公匙比较是否相等
    +4、删除数据
    +4.1、删除本地账户信息
    +4.2、删除账户缓存信息
    +5、发送删除账户事件
    +
  • ac_removeAccount接口

    • 接口说明

      该接口用于移除账户

    • 请求示例

      {
      +  "cmd": "ac_removeAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "AAax8wqxALqjyhrL8Wv1tQiqswAshAnX",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true Integer 要删除的账户地址
      2 password false String 账户密码,可为空
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 删除是否成功
  • 依赖服务

    事件总线模块:发送删除账户事件

2.2.5 导入账户-私匙

  • 功能说明:

    根据私匙导入账户,根据私匙生成账户,并导入账户账本数据

  • 流程描述

    根据私匙导入账户信息

    1、根据私钥生成公私钥对
    +2、获取chainId和账户类型
    +3、根据公钥计算hash160
    +4、拼接字节数组组成地址:
    +4.1、如果是NULS体系地址:address=type+hash160
    +4.2、如果非NULS体系地址(比特币):address=原始地址长度+原始地址
    +5.1、如果是NULS体系校验位:xor=XOR(addressType+pkh)
    +5.1、如果非NULS体系校验位:xor=XOR(length+address)
    +6、base58计算生成地址字符串:
    +   NULS体系地址:Base58(type+hash160+xor)+Base58(chainId)
    +   非NULS体系地址:Base58(length+address+xor)+Base58(chainId)
    +7、根据密码对私钥进行加密,并将私钥的明文删除
    +8、存储账户信息
    +9、将账户加入缓存
    +10、若发送导入账户事件:账户已存在的情况不发布新事件,只做覆盖更新
    +
  • ac_importAccountByPriKey接口

    • 接口说明

      该接口根据账户私匙导入账户

    • 请求示例

      {
      +  "cmd": "ac_importAccountByPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 priKey true String 账户私匙
      2 password false String 账户密码
      3 overwrite true Boolean 账户存在时是否覆盖
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 账户地址
  • 依赖服务

    事件总线模块:账户不存在时,发送导入账户事件

    账本模块:导入账户账本(已确认交易)

2.2.6 导入账户-keystore

  • 功能说明:

    根据keystore导入账户,根据keystore解析解密得到私匙并生成账户,并导入账户账本数据

  • 流程描述

    导入账户keystore

    1、验证keystore和密码是否匹配
    +2、根据密码解密keystore中的私钥,keyStore包括json格式(address,encryptedPrivateKey,pubKey,prikey)
    +3、根据私钥生成公私
    +4、获取chainId和账户类型
    +5、拼接字节数组组成地址
    +6、生成地址字符串
    +7、验证地址字符串和keystore中的地址是否一致
    +8、存储账户信息
    +9、发送导入账户事件:账户已存在的情况不发布新事件,只做覆盖更新
    +
  • ac_importAccountByKeystore接口

    • 接口说明

      该接口用于导入账户keystore

    • 请求示例

      {
      +  "cmd": "ac_importAccountByKeystore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "HEX",
      +        "123456",
      +        true
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 keyStore true String keyStore HEX编码
      2 password false String 账户密码
      3 overwrite true Boolean 账户存在时是否覆盖
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 账户地址
  • 依赖服务

    事件总线模块:账户不存在时,发送导入账户事件

    账本模块:导入账户账本(已确认交易)

2.2.7 导入多签账户

  • 功能说明:

    导入一个跟本地地址相关的多签账户,包括账户的地址、脚本的创建,多签账户信息保存到数据库

  • 流程描述

    1、验证多签地址、签名公匙列表、最少验证签名数是否正确
    +2、创建多重签名脚本
    +3、根据多签脚本创建多重签名类型的账户地址
    +4、判断导入的多签地址与脚本生成的地址是否相同,不相同则提示导入错误
    +5、保存多签账户信息,包括:地址、公匙列表、最少验证签名数
    +6、返回多签地址
    +
  • ac_importMultiSigAccount接口

    • 接口说明

      该接口用于导入多重签名账户。

    • 请求示例

      {
      +  "cmd": "ac_importMultiSigAccount",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        ["pubKey1","pubKey2"],
      +        2
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 多签账户地址
      2 pubkeys true jsonArray 需要签名的公钥列表
      3 minSigns true Integer 最小签名数,最少需要几个公钥验证通过
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 多签地址

2.2.8 导出账户私匙

  • 功能说明:

    导出账户私匙十六进制编码,与查询账户私钥功能重叠,作废

  • 流程描述

    导出账户私匙

    1、验证账户是否存在,验证密码是否正确
    +2、解密私钥,生成Hex字符串
    +
  • ac_exportAccountPriKey接口

    • 接口说明

      该接口用于导出账户私匙。

    • 请求示例

      {
      +  "cmd": "ac_exportAccountPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password true String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    	"priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 地址
      priKey String 私匙十六进制

2.2.9 导出账户KeyStore

  • 功能说明:

    导出账户keystore

  • 流程描述

    导出账户keystore

    1、验证账户是否存在,验证密码是否正确
    +2、生成keystore文件
    +
  • ac_exportAccountKeyStore接口

    • 接口说明

      该接口用于导出账户keystore。

    • 请求示例

      {
      +  "cmd": "ac_exportAccountKeyStore",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +        "backup"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password false String 账户密码
      3 path false String 文件备份地址
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"path":"backup/TTax8wqxALqjyhrL8Wv1tQiqswAshAnX.keystore"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      path String 文件备份地址

2.2.10 查询全部账户

  • 功能说明:

    查询全部账户

  • 流程描述

    查询账户信息

    1、查询全部账户信息
    +
  • ac_getAccountList接口

    • 接口说明

      接口说明:该接口用于查询全部账户。

    • 请求示例

      {
      +    "cmd":"ac_getAccountList",
      +    "minVersion":1.0,
      +    "params":[
      +        1234
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	[{
      +         	"address":"",
      +            "alias":"",
      +            "pubkeyHex":"",
      +            "encryptedPrikeyHex":""
      +            },{}]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      list List 账户列表集合
      address String 账户地址
      alias String 别名
      pubkeyHex String 公匙16进制编码
      encryptedPrikeyHex String 加密私匙16进制编码

2.2.11 根据地址获取账户

  • 功能说明:

    根据地址获取账户

  • 流程描述

    1、验证地址是否存在
    +2、根据地址获取账户
    +
  • ac_getAccountByAddress接口

    • 接口说明

      该接口用于根据地址获取账户。

    • 请求示例

      {
      +  "cmd": "ac_getAccountByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "ABCMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "address":"",
      +      "alias":"",
      +      "pubkeyHex":"",
      +      "encryptedPrikeyHex":""
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 账户地址
      alias String 别名
      pubkeyHex String 公匙16进制编码
      encryptedPrikeyHex String 加密私匙16进制编码

2.2.12 查询账户地址列表

  • 功能说明:

    查询账户地址列表

  • 流程描述

    1、校验分页参数是否合法,分页数、分页大小不能小于0,必须为整数;
    +2、查询所有账户;
    +3、过滤符合分页条件的账户;
    +4、只返回账户的地址列表;
    +
  • ac_getAddressList接口

    • 接口说明

      该接口用于查询账户地址列表。

    • 请求示例

      {
      +  "cmd": "ac_getAddressList",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        1,
      +        10
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 pageNumber true Integer 页码
      2 pageSize true Integer 每页显示数量
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	["","",""]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      list jsonArray 地址列表集合

2.2.13 根据别名获取地址

  • 功能说明:

    根据别名获取地址

  • 流程描述

    1、查询别名是否存在
    +2、返回设置别名时使用的账户地址,并使用Base58对账户地址进行编码
    +
  • ac_getAddressByAlias接口

    • 接口说明

      该接口用于根据别名获取地址。

    • 请求示例

      {
      +  "cmd": "ac_getAddressByAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 alias true String 别名
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      address String 地址,Base58编码

2.2.14 查询账户私匙

  • 功能说明:

    查询账户私匙

  • 流程描述

    1、校验地址是否正确,使用Base58解码,分别校验链ID、地址类型、校验位
    +2、验证账户是否存在
    +3、如果账户加过密(有密码), 就通过AES解密并验证密码是否正确,获得未加密私匙
    +4、如果账户未加密,则不返回私钥,账户如果存在则返回账户有效标识
    +5、使用十六进制编码,并返回账户私匙
    +
  • ac_getPriKeyByAddress接口

    • 接口说明

      该接口用于查询账户私匙。

    • 请求示例

      {
      +  "cmd": "ac_getPriKeyByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String address
      2 password false String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "priKey":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308",
      +       "valid":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      priKey String 私匙十六进制
      valid Boolean 账户是否存在

2.2.15 查询所有账户私匙

  • 功能说明:

    查询所有账户私匙

  • 流程描述

    1、验证密码格式是否正确,密码可为空
    +2、获取所有本地账户
    +3、本地账户的加密信息必须一致,如果参数密码不为空,所有账户的密码都必须与之相同,如果参数密码为空,所有账户都不能设置密码,否则提示错误
    +4、如果账户加密则通过密码反解出未加密私匙,否则未加密直接获得私匙
    +5、将所有私匙添加到集合并返回
    +
  • ac_getAllPriKey接口

    • 接口说明

      该接口用于查询所有账户私匙。

    • 请求示例

      {
      +  "cmd": "ac_getAllPriKey",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId false Short 链ID,默认为0查询所有链账户
      2 password false String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      ["",""]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      list String 私匙集合

2.2.16 设置密码

  • 功能说明:

    设置密码

  • 流程描述

    1、验证账户是否存在
    +2、验证密码是否已经设置
    +3、设置账户密码
    +
  • ac_setPassword接口定义

    • 接口说明

      该接口用于设置账户密码。

    • 请求示例

      {
      +  "cmd": "ac_setPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password true String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 业务数据,密码设置是否成功

2.2.17 设置离线账户密码

  • 功能说明:

    设置离线账户密码

  • 流程描述

    1、验证地址是否正确
    +2、验证私匙是否正确
    +3、根据私匙创建
    +4、设置离线账户密码
    +
  • ac_setOfflineAccountPassword接口

    • 接口说明

      该接口用于设置离线账户密码。

    • 请求示例

      {
      +  "cmd": "ac_setOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 priKey true String 账户私匙
      3 password true String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      encryptedPriKey String 加密私匙

2.2.18 修改密码

  • Request Body

  • 功能说明:

    修改密码

  • 流程描述

    1、验证旧密码正确性
    +2、更新私钥密文
    +3、发送修改密码事件
    +
  • ac_updatePassword接口

    • 接口说明

      该接口用于修改账户密码。

    • 请求示例

      {
      +  "cmd": "ac_updatePassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password true String 账户密码
      3 newPassword true String 账户新密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 密码修改是否成功

2.2.19 修改离线账户密码

  • 功能说明:

    修改离线账户密码

  • 流程描述

    1、验证地址是否正确
    +2、根据地址、私匙、新密码生成离线账户
    +
  • ac_updateOfflineAccountPassword接口

    • 接口说明

      该接口用于修改离线账户密码。

    • 请求示例

      {
      +  "cmd": "ac_updateOfflineAccountPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "00c22ad91a170fc49df53b79791f702879eb0604235787eee2c303463bf6e41111",
      +        "123456",
      +        "111111"
      +    ]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 priKey true String 私匙
      3 password true String 账户密码
      4 newPassword true String 账户新密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "encryptedPriKey":""
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      encryptedPriKey String 加密私匙

2.2.20 验证密码

  • 功能说明:

    验证密码

  • 流程描述

    1、验证密码是否正确
    +2、返回验证结果
    +
  • ac_validationPassword接口

    • 接口说明

      该接口用于验证密码。

    • 请求示例

      {
      +  "cmd": "ac_validationPassword",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password true String 账户密码
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 密码是否正确

2.2.21 验证账户是否加密

  • 功能说明:

    验证账户是否加密

  • 流程描述

    1、验证账户是否存在 +2、验证账户是否加密 +3、返回验证结果

  • ac_isEncrypted接口

    • 接口说明

      该接口用于验证账户是否加密。

    • 请求示例

      {
      +  "cmd": "ac_isEncrypted",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +    	"value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 账户是否加密

2.2.22 设置账户别名

  • 功能说明:

    设置账户别名

  • 流程描述

    1、验证别名是否合法
    +2、生成设置别名交易
    +3、调用ledger填充交易费用信息
    +4、广播交易
    +5、交易确认后,会保存别名到数据库,将address和alias分别作为key存储,也就是别名数据会存两条数据,主要是为了便于根据address和alias分别查询
    +
  • ac_setAlias接口定义

    • 接口说明

      该接口用于设置账户别名。

    • 请求示例

      {
      +  "cmd": "ac_setAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password false String 账户密码
      3 alias true String 别名
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +      "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      txHash String 别名交易hash
  • 依赖服务

    账本模块:设置别名需要花费手续费

2.2.23 获取设置别名手续费

  • 功能说明:

    获取设置别名手续费

  • 流程描述

    1、验证账户是否存在,验证别名是否正确
    +2、计算别名设置所需手续费
    +
  • ac_getAliasFee接口

    • 接口说明

      该接口用于获取设置别名手续费。

    • 请求示例

      {
      +  "cmd": "ac_getAliasFee",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "abc"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 alias true String 别名
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "fee":"100",
      +        "maxAmount":"10000"
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      fee String 别名交易手续费
      maxAmount String 交易最大手续费

2.3.24 根据地址查询别名

  • 功能说明:

    根据地址查询别名

  • 流程描述

    1、验证账户是否存在
    +2、从数据库中查询账户对应的别名
    +
  • ac_getAliasByAddress接口

    • 接口说明

      该接口用于根据地址查询别名。

    • 请求示例

      {
      +  "cmd": "ac_getAliasByAddress",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "alias":""
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      alias String 账户别名

2.2.25 验证别名是否可用

  • 功能说明:

    验证别名是否可用

  • 流程描述

    1、查询别名是否已存在,如果存在则不可用,反之则可用
    +
  • ac_isAliasUsable接口

    • 接口说明

      该接口用于验证别名是否可用。

    • 请求示例

      {
      +  "cmd": "ac_isAliasUsable",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "abc"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 alias true String 账户别名
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 别名是否可用

2.2.26 设置账户备注

  • 功能说明:

    设置账户备注

  • 流程描述

    1、验证账户是否存在
    +2、修改备注信息并保存
    +
  • ac_setRemark接口

    • 接口说明

      该接口用于设置账户备注。

    • 请求示例

      {
      +  "cmd": "ac_setRemark",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST"
      +        "remark1"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 remark true String 账户备注
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +        "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 设置是否成功

2.2.27 设置多签账户别名

  • 功能说明:

    设置多签账户别名

  • 流程描述

    1、验证账户地址、别名、账户密码、签名地址参数是否合法
    +2、查询账户地址、签名地址是否存在
    +3、生成设置多签账户别名交易
    +4、调用ledger填充交易费用信息
    +5、使用签名账户对交易进行签名
    +6、当已签名数等于最少签名数则保存未确认交易到本地账户
    +7、广播该交易
    +8、返回交易hash
    +
  • ac_setMultiSigAlias接口

    • 接口说明

      该接口用于设置多签账户别名。

    • 请求示例

      {
      +  "cmd": "ac_setMultiSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "123456",
      +        "abc"
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 多签账户地址
      2 signAddress true String 签名地址
      3 password false String 账户密码
      4 alias true String 别名
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "txHash":"1cb336b834494fb7eef070cf9c3e60a5a49e762ca1f81cb2592593047235f308"
      +    }
      +}
      +
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      txHash String 多签别名交易hash
  • 依赖服务

    账本模块:设置多签别名需要花费手续费

2.2.28 移除多签账户

  • 功能说明:

    移除多签账户

  • 流程描述

    1、验证账户地址是否正确
    +2、数据库中删除多签账户
    +3、返回删除是否成功
    +
  • ac_removeMultiSigAccount接口

    • 接口说明

      该接口用于移除多签账户。

    • 请求示例

      {
      +  "cmd": "ac_setMutilSigAlias",
      +  "minVersion":1.0,
      +  "params": [
      +        1234,
      +        "DCQMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +    ]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 多签账户地址
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 是否移除成功

2.2.29 交易统一验证

  • 功能说明:

    账户模块所有交易统一验证接口,目前只有别名交易

  • 流程描述

    1、交易列表是否为空
    +2、循环所有交易列表,针对别名交易进行处理
    +3、检测当前交易列表中,是否存在设置相同的别名
    +4、检测当前交易列表中,是否存在账户重复设置别名
    +5、如果交易列表中没有冲突,则验证通过
    +
  • ac_accountTxValidate接口

    • 接口说明

      该接口用于批量验证账户模块所有交易。

    • 请求示例

      {
      +  "cmd": "ac_accountTxValidate",
      +  "minVersion":1.0,
      +  "params": [chianId, ["txHex","txHex","txHex", ...]]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 txHex true array 别名交易序列化数据数组

      txHex说明

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"10000",
      +            "nonce":"123"
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"1"
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":12345,
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "list":["txHex", "txHex", "txHex", ...]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      list jsonArray 不合法交易序列化数据数组

2.2.30 别名交易验证

  • 功能说明:

    别名交易验证接口

  • 流程描述

    1、反序列化txHex别名交易数据
    +2、验证别名格式
    +3、验证别名是否已被占用
    +4、验证该账户是否已设置别名
    +5、验证coinData输入输出
    +6、验证脚本签名格式
    +7、验证签名中是否包含设置别名的地址,如果不包含则属于恶意犯规,否则验证通过
    +
  • ac_aliasTxValidate接口

    • 接口说明

      该接口用于单个别名交易。

    • 请求示例

      {
      +  "cmd": "ac_aliasTxValidate",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 txHex true String 别名交易序列化数据

      txHex说明

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"10000",
      +            "nonce":"123"
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"1"
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":12345,
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 是否验证成功

2.2.31 别名交易提交

  • 功能说明:

    别名交易提交,保存别名

  • 流程描述

    1、反序列化txHex别名交易数据
    +2、保存别名alias至数据库
    +3、将别名设置到account然后保存至数据库
    +4、将修改后的account重新进行缓存
    +5、返回别名保存是否成功
    +
  • ac_aliasTxCommit接口

    • 接口说明

      该接口用于保存别名。

    • 请求示例

      {
      +  "cmd": "ac_aliasTxCommit",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 txHex true String 别名交易序列化数据
      2 secondaryDataHex true String 区块头序列化数据

      txHex说明

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"10000",
      +            "nonce":"123"
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"1"
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":12345,
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex说明

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 别名交易保存是否成功

2.2.32 别名交易回滚

  • 功能说明:

    别名交易回滚接口

  • 流程描述

    1、反序列化txHex别名交易数据
    +2、从数据库删除别名对象数据
    +3、取出对应的account将别名清除,重新存入数据库
    +4、重新缓存account
    +5、返回别名回滚是否成功
    +
  • ac_aliasTxRollback接口

    • 接口说明

      该接口用于回滚别名。

    • 请求示例

      {
      +  "cmd": "ac_aliasTxRollback",
      +  "minVersion":1.0,
      +  "params": [chainId,"txHex","secondaryDataHex"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 txHex true String 别名交易序列化数据
      2 secondaryDataHex true String 区块头序列化数据

      txHex说明

      {
      +    "type":3,
      +    "time":"12546545596",
      +    "scriptSig":"",
      +    "hash":"",
      +    "coinData":
      +    {
      +        "froms":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"10000",
      +            "nonce":"123"
      +        }],
      +        "to":
      +        [{
      +            "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +            "amount":"1"
      +        }]
      +    },
      +    "txData":
      +    {
      +        "chainId":12345,
      +        "address":"Nse8m2Te1UNGPhD1tjZ3A4GDW3dCJxqE",
      +        "alias":"lucas"
      +    }
      +}
      +

      secondaryDataHex说明

      "txData":
      +    {
      +        "hash":"",
      +        "height":1,
      +        "time":13369748564
      +    }
      +
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "value":true
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      value boolean 别名交易回滚是否成功

2.2.33 数据签名

  • 功能说明:

    根据私钥将数据进行加密签名

  • 流程描述

    1、验证账户是否存在,验证密码是否正确
    +2、根据椭圆曲线算法对数据签名
    +3、返回十六进制签名后数据
    +
  • ac_signDigest接口

    • 接口说明

      该接口用于数据签名。

    • 请求示例

      {
      +  "cmd": "ac_signDigest",
      +  "minVersion":1.0,
      +  "params": 
      +    {
      +        "chainId":"12345",
      +        "address":"NseMUi1q9TefkXUcaysAuvFjj4NbTEST",
      +        "password":"",
      +        "dataHex":""
      +    }
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true Short 链ID
      1 address true String 账户地址
      2 password false String 账户密码
      3 dataHex true String 待签名数据HEX编码,如交易hash摘要
    • 返回示例

      {
      +    "code": 0,
      +    "msg": "success",
      +    "version":1.0,
      +    "result": {
      +       "signatureHex":""
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      code Integer 返回结果状态
      msg String 失败时的信息
      result jsonObj 业务数据
      signatureHex string 签名后的数据

2.3 模块内部功能

四、事件说明

4.1 发布的事件

  • 创建账户

    event_topic : "evt_ac_createAccount"

    data:{
    +    address:''
    +    isEncrypted:true   //是否设置了密码
    +}
    +
  • 删除账户

    event_topic : "evt_ac_removeAccount"

    data:{
    +	address:''
    +}
    +
  • 修改密码

    event_topic : "evt_ac_updatePassword"

    data:{
    +	address:''
    +}
    +

4.2 订阅的事件

五、协议

5.1 网络通讯协议

5.2 交易协议

  • 设置别名

    • 协议

      与通用交易相比,只有类型和txData有区别,具体区别如下

    type: n //设置别名交易的类型
    +txData:{
    +    address:  //VarByte 设置别名的地址
    +    alias:   //VarByte 别名字符串转成的字节数组,用UTF-8解码
    +}
    +
    • 别名交易参数
    Len Fields Data Type Remark
    24 address byte[] 设置别名的地址
    32 alias byte[] 别名字符串转成的字节数组,用UTF-8解码
    • 验证器
    1、别名格式合法性验证
    +2、地址必须是卫星链地址,且一个地址只能设置一个别名
    +3、烧毁一个token单位
    +4、交易手续费
    +5、签名:设置的地址、input、签名三者验证
    +
    • 处理器
    1、资产处理器
    +2、存储alias数据
    +3、更新本地账户信息
    +

六、模块配置项

server.ip:0.0.0.0   //本机ip,用于提供服务给其他模块
+server.port:8080    //提供服务的端口
+

七、Java特有的设计

  • Account对象设计

    该表存储时使用的key:

    NULS体系:chainId+type+hash160

    非NULS体系:chainId+length+address

字段名称 type 说明
chainId short 链ID
address String 账户地址(Base58(address)+Base58(chainId))
alias String 账户别名
status Integer 是否默认账户(不保存)
pubKey byte[] 公匙
priKey byte[] 私匙-未加密
encryptedPriKey byte[] 已加密私匙
extend byte[] 扩展数据
remark String 备注
createTime long 创建时间
  • Address对象设计(不持久化存储)
字段名称 type 说明
chainId short 链ID
addressType byte 地址类型
hash160 byte[] 公匙hash
addressBytes byte[] 地址字节数组
  • Alias对象设计

    该表存储时使用的key:

    address和alias分别作为key存储,别名数据存储两份

    需要按照不同的链分别创建不同的别名表

字段名称 type 说明
address byte[] 账户地址
alias String 账户别名
  • MultiSigAccount对象设计
字段名称 type 说明
address String 账户地址
pubKeyList List<byte[]> 需要签名的公钥列表
minSigns long 最少签名数

八、补充内容

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/blockModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/blockModuleDesign.html new file mode 100644 index 00000000..7d2835a4 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/blockModuleDesign.html @@ -0,0 +1,674 @@ + + + + + + 区块管理模块设计文档 | NULS + + + + + + + +

区块管理模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《区块管理》模块

​ 区块链上所有交易数据都保存在区块中,所以要有一个模块负责区块的存储与管理,以便其他模块对区块中数据进行验证、业务处理时可以获取到区块。

​ 区块链程序初次启动时,需要同步网络上的最新区块到本地,这个过程一般耗时较长,且同步未完成时不能发起交易,所以适合由单独模块来完成该工作。

​ 综上所述,为其他模块提供统一的区块数据服务是必要的,也能更好地把区块的管理与区块的具体业务进行分离,用到区块的模块不必关心区块的获取细节。

1.1.2 《区块管理》要做什么

​ 系统启动时,判断本地区块高度是否达到网络上大多数节点的最新高度,如果没有达到,要从网络上下载区块到本地,进行区块的验证,验证通过后,保存到本地数据库,这叫区块的同步。

​ 区块同步完成后,系统开始正常运行,分下面两种情况讨论

  • 如果是自身节点打包区块,共识模块会把打包好的区块交给区块管理模块,区块管理模块会负责进行区块验证、区块保存、区块广播,并且要响应网络上的其他节点发起的获取该区块的请求。
  • 如果是其他共识节点打包区块,本地节点会收到网络上发来的转发区块消息,此时要从其他节点获取区块信息,进行验证并保存,保存完成后再次转发该区块,让区块在全网传播。

异常情况下,区块验证不通过,新区块无法与主链上最后一个区块相连,则把该区块视为分叉区块或孤儿区块,放入分叉链集合维护。当发现有一条分叉链A比主链B高度更高时,进行链切换,以分叉链A为最新的链 +,原主链B回滚,并进入分叉链集合维护。

对外提供区块头、区块查询服务
+

1.1.3 《区块管理》在系统中的定位

区块管理是底层模块之一,以下分功能讨论模块依赖情况

依赖

  • 区块同步-依赖网络模块的通讯接口,依赖工具模块的序列化工具
  • 区块存储、回滚-依赖工具模块的数据库存储工具、共识模块、交易管理模块
  • 区块转发-依赖网络模块的广播消息接口

被依赖

  • 整个系统可以发起交易-区块同步
  • 共识模块:区块详细验证、打包-区块查询、区块保存、区块广播、区块回滚

1.2 架构图

二、功能设计

2.1 功能架构图

  1. 提供api,进行区块存储、查询、回滚的操作
  2. 从网络上同步最新区块,进行初步验证、分叉验证,如果没有分叉,调用共识模块进行共识验证,调用交易模块进行交易验证,全部验证通过后保存到本地。
  3. 区块同步、广播、转发消息的处理
  4. 分叉区块的判断、存储
  5. 孤儿区块的判断、存储
  6. 分叉链维护、切换
  7. 孤儿链维护、切换

2.2 模块服务

2.2.1 获取本地最新区块头

  • 接口说明
  1. 根据链ID、缓存的最新区块高度查询DB得到最新区块头HASH
  2. 根据HASH查询DB得到区块头byte数组
  3. 反序列化为区块头对象
  • 请求示例

    {
    +  "cmd": "bestBlockHeader",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • 返回字段说明

parameter type description
chainId Long 链ID
hash String 区块HASH
preHash String 上一区块HASH
merkleHash String 区块MerkleHash
height Long 区块高度
size Integer 区块大小
time Long 区块打包时间
txCount Integer 交易数
packingAddress String 打包地址
reward Long 共识奖励
fee Long 手续费
extend String 扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String 区块签名

2.2.2 获取本地最新区块

  • 接口说明:
  1. 根据链ID获取本地最新区块头
  2. 根据区块头高度查询DB得到交易HASH列表
  3. 根据HASH列表从交易管理模块获取交易数据
  4. 组装成block对象
  • 请求示例

    {
    +  "cmd": "bestBlock",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
  • 返回示例

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //区块头
    +    	"transactions": [
    +    	    {
    +                "chainId": "888", //链Id
    +                "height": "1", //区块高度
    +                "hash": "1", //交易HASH
    +                "remark": "1", //交易备注
    +                "size": "1", //交易大小
    +                "time": "1", //交易时间
    +                "type": "1", //交易类型
    +                "transactionSignature": "1", //交易签名
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            "fromAssetsChainId":""//资产发行链的id  
    +                            "fromAssetsId":""//资产id
    +                            "fromAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "nonce":""//交易顺序号,递增
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            "toAssetsChainId":""//资产发行链的id  
    +                            "toAssetsId":""//资产id
    +                            "toAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "locktime":""
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //交易数据 HEX
    +    	    },
    +    	    {...}
    +    	] //交易列表
    +    }
    +}
    +
  • 返回字段说明

2.2.3 根据高度获取区块头

  • 接口说明
  1. 根据链ID、高度查询DB得到最新区块头HASH
  2. 根据HASH查询DB得到区块头byte数组
  3. 反序列化为区块头对象
  • 请求示例

    {
    +  "cmd": "getBlockHeaderByHeight",
    +  "minVersion":"1.1",
    +  "params": ["111","888"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 height true Long 区块高度
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • 返回字段说明

parameter type description
chainId Long 链Id
hash String 区块HASH
preHash String 上一区块HASH
merkleHash String 区块MerkleHash
height Long 区块高度
size Integer 区块大小
time Long 区块打包时间
txCount Integer 交易数
packingAddress String 打包地址
reward Long 共识奖励
fee Long 手续费
extend String 扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String 区块签名

2.2.4 根据高度获取区块

  • 接口说明:
  1. 根据链ID、高度获取区块头
  2. 根据区块头高度查询DB得到交易HASH列表
  3. 根据HASH列表从交易管理模块获取交易数据
  4. 组装成block对象
  • 请求示例

    {
    +  "cmd": "bl_getBlockByHeight",
    +  "minVersion":"1.1",
    +  "params": ["111","888"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 height true Long 区块高度
  • 返回示例

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +            "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //区块头
    +    	"transactions": [
    +    	    {
    +                "chainId": "888",//链ID
    +                "height": "1", //区块高度
    +                "hash": "1", //交易HASH
    +                "remark": "1", //交易备注
    +                "size": "1", //交易大小
    +                "time": "1", //交易时间
    +                "type": "1", //交易类型
    +                "transactionSignature": "1", //交易签名
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            "fromAssetsChainId":""//资产发行链的id  
    +                            "fromAssetsId":""//资产id
    +                            "fromAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "nonce":""//交易顺序号,递增
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            "toAssetsChainId":""//资产发行链的id  
    +                            "toAssetsId":""//资产id
    +                            "toAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "nonce":""//交易顺序号,递增
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //交易数据 HEX
    +    	    },
    +    	    {...}
    +    	], //交易列表
    +    }
    +}
    +
  • 返回字段说明

2.2.5 根据HASH获取区块头

  • 接口说明
  1. 根据链ID、HASH查询DB得到区块头byte数组
  2. 反序列化为区块头对象
  • 请求示例

    {
    +  "cmd": "bl_getBlockHeaderByHash",
    +  "minVersion":"1.1",
    +  "params": ["888","aaa"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 hash true String 区块hash
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "chainId": "888",
    +        "hash": "xxxxxxx",
    +        "preHash": "xxxxxxx",
    +        "merkleHash": "1",
    +        "height": 1,
    +        "size": 1,
    +        "time": 1,
    +        "txCount": 1,
    +        "packingAddress": "1",
    +        "reward": 0,
    +        "fee": 0,
    +        "extend": xxxxxxx,HEX
    +        "scriptSig": "1"
    +    }
    +}
    +
  • 返回字段说明

parameter type description
chainId Long 链ID
hash String 区块HASH
preHash String 上一区块HASH
merkleHash String 区块MerkleHash
height Long 区块高度
size Integer 区块大小
time Long 区块打包时间
txCount Integer 交易数
packingAddress String 打包地址
reward Long 共识奖励
fee Long 手续费
extend String 扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String 区块签名

2.2.6 根据HASH获取区块

  • 接口说明:
  1. 根据链ID、hash获取区块头
  2. 根据区块头高度查询DB得到交易HASH列表
  3. 根据HASH列表从交易管理模块获取交易数据
  4. 组装成block对象
  • 请求示例

    {
    +  "cmd": "bl_getBlockByHash",
    +  "minVersion":"1.1",
    +  "params": ["888","aaa"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 hash true String 区块hash
  • 返回示例

    Failed

    ```
    +{
    +    "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +```
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +    	"blockHeader": {
    +    	    "chainId": "888",
    +            "hash": "xxxxxxx",
    +            "preHash": "xxxxxxx",
    +            "merkleHash": "1",
    +            "height": 1,
    +            "size": 1,
    +            "time": 1,
    +            "txCount": 1,
    +            "packingAddress": "1",
    +            "reward": 0,
    +            "fee": 0,
    +            "extend": xxxxxxx,HEX
    +            "scriptSig": "1"
    +    	}, //区块头
    +    	"transactions": [
    +    	    {
    +    	        "chainId": "888",
    +                "height": "1", //区块高度
    +                "hash": "1", //交易HASH
    +                "remark": "1", //交易备注
    +                "size": "1", //交易大小
    +                "time": "1", //交易时间
    +                "type": "1", //交易类型
    +                "transactionSignature": "1", //交易签名
    +                "coinData": {
    +                    "from" : [
    +                        {
    +                            "fromAssetsChainId":""//资产发行链的id  
    +                            "fromAssetsId":""//资产id
    +                            "fromAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "nonce":""//交易顺序号,递增
    +                        },{...}
    +                    ]
    +                    "to" : [
    +                        {
    +                            "toAssetsChainId":""//资产发行链的id  
    +                            "toAssetsId":""//资产id
    +                            "toAddress":""//转出账户地址
    +                            "amount":""//转出金额
    +                            "nonce":""//交易顺序号,递增
    +                        },{...}
    +                    ]
    +                }
    +                "txData": XXXX, //交易数据 HEX
    +    	    },
    +    	    {...}
    +    	], //交易列表
    +    }
    +}
    +
  • 返回字段说明

2.2.7 获取当前同步区块状态

  • 接口说明

某个ChainID上的区块同步完成时,更新缓存的同步状态标识。同步区块未完成时,禁止发起交易

  • 请求示例

    {
    +  "cmd": "bl_getSynchronizeInfo",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"chainId": "888", "sync": "true"}
    +}
    +
  • 返回字段说明

parameter type description
chainId String 链ID
sync String 区块同步是否完成

2.2.8 获取某高度区间内区块头

  • 接口说明
  1. 令queryHash=endHash
  2. 根据链ID、queryHash查询DB得到区块头byte数组
  3. 反序列化为区块头对象blockHeader,添加到List中作为返回值
  4. 如果blockHeader.hash!=startHash,令queryHash=blockHeader.preHash,重复第2步
  5. 返回List
  • 请求示例

    {
    +  "cmd": "bl_getBlockHeaderBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 startHeight true Long 起始高度
2 endHeight true Long 结束高度
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "list" : [
    +            {
    +           "chainId": "888",
    +           "hash": "xxxxxxx",
    +           "preHash": "xxxxxxx",
    +           "merkleHash": "1",
    +           "height": 1,
    +           "size": 1,
    +           "time": 1,
    +           "txCount": 1,
    +           "packingAddress": "1",
    +           "reward": 0,
    +           "fee": 0,
    +           "extend": xxxxxxx,HEX
    +           "scriptSig": "1"
    +           }
    +        ]
    +
    +    }
    +}
    +
  • 返回字段说明

parameter type description
chainId Long 链ID
hash String 区块HASH
preHash String 上一区块HASH
merkleHash String 区块MerkleHash
height Long 区块高度
size Integer 区块大小
time Long 区块打包时间
txCount Integer 交易数
packingAddress String 打包地址
reward Long 共识奖励
fee Long 手续费
extend String 扩展字段,HEX,包含roundIndex、roundStartTime、consensusMemberCount、packingIndexOfRound、stateRoot
scriptSig String 区块签名

2.2.9 获取某高度区间内区块

  • 接口说明
  1. 令queryHash=endHash
  2. 根据链ID、queryHash查询DB得到区块byte数组
  3. 反序列化为区块对象block,添加到List中作为返回值
  4. 如果block.hash!=startHash,令queryHash=block.preHash,startHash,重复第2步
  5. 返回List
  • 请求示例

    {
    +  "cmd": "bl_getBlockBetweenHeights",
    +  "minVersion":"1.1",
    +  "params": ["888",111","111"]
    +}
    +
  • 请求参数说明

index parameter required type description
0 chainId true Long 链ID
1 startHeight true Long 起始高度
2 endHeight true Long 结束高度
  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {
    +        "list" : [
    +            {
    +                "blockHeader": {
    +                    "chainId": "888",
    +                    "hash": "xxxxxxx",
    +                    "preHash": "xxxxxxx",
    +                    "merkleHash": "1",
    +                    "height": 1,
    +                    "size": 1,
    +                    "time": 1,
    +                    "txCount": 1,
    +                    "packingAddress": "1",
    +                    "reward": 0,
    +                    "fee": 0,
    +                    "extend": xxxxxxx,HEX
    +                    "scriptSig": "1"
    +                }, //区块头
    +                "transactions": [
    +                    {
    +                        "chainId": "888",
    +                        "height": "1", //区块高度
    +                        "hash": "1", //交易HASH
    +                        "remark": "1", //交易备注
    +                        "size": "1", //交易大小
    +                        "time": "1", //交易时间
    +                        "type": "1", //交易类型
    +                        "transactionSignature": "1", //交易签名
    +                        "coinData": {
    +                            "from" : [
    +                                {
    +                                    "fromAssetsChainId":""//资产发行链的id  
    +                                    "fromAssetsId":""//资产id
    +                                    "fromAddress":""//转出账户地址
    +                                    "amount":""//转出金额
    +                                    "nonce":""//交易顺序号,递增
    +                                },{...}
    +                            ]
    +                            "to" : [
    +                                {
    +                                    "toAssetsChainId":""//资产发行链的id  
    +                                    "toAssetsId":""//资产id
    +                                    "toAddress":""//转出账户地址
    +                                    "amount":""//转出金额
    +                                    "nonce":""//交易顺序号,递增
    +                                },{...}
    +                            ]
    +                        }
    +                        "txData": XXXX, //交易数据 HEX
    +                    },
    +                    {...}
    +                ], //交易列表
    +           }
    +        ]
    +
    +    }
    +}
    +
  • 返回字段说明

2.2.10 接收最新打包区块

  • 接口说明

本地节点共识模块打包后,调用此接口保存区块数据

  • 请求示例

    {
    +  "cmd": "receivePackingBlock",
    +  "minVersion":"1.1",
    +  "params": [
    +  	blockhex//能用hex就用hex
    +  ]
    +}
    +
  • 请求参数说明

  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"sync": "true"}
    +}
    +
  • 返回字段说明

parameter type description
sync String 区块是否保存成功

2.2.11 运行一条链

  • 接口说明

在链工厂发布一条链后,核心模块会调用区块管理模块的该接口,根据chainID初始化区块、分叉链数据库,开启chainID对应的一系列工作线程,并为运行新链做准备。

  • 请求示例

    {
    +  "cmd": "bl_startChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • 请求参数说明

  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • 返回字段说明

parameter type description
result String 新链是否启动成功

2.2.12 停止一条链

  • 接口说明

在链工厂停止一条链后,核心模块会调用区块管理模块的该接口,删除该链的缓存区块、分叉链数据,停止chainID对应的一系列工作线程。

  • 请求示例

    {
    +  "cmd": "bl_stopChain",
    +  "minVersion":"1.1",
    +  "params": ["888"]
    +}
    +
  • 请求参数说明

  • 返回示例

    Failed

    {
    +    "version": 1.2,
    +    "code": 1,
    +    "msg": "error message",
    +    "result": {}
    +}
    +

    Success

    {
    +    "version": 1.2,
    +    "code": 0,
    +    "result": {"result": "true"}
    +}
    +
  • 返回字段说明

parameter type description
result String 新链是否停止成功

2.3 模块内部功能

2.3.1 模块启动

  • 功能说明:

  • 流程描述

  • 1.加载区块模块配置信息
  • 2.加载区块模块消息、消息处理器
  • 3.注册区块模块服务接口(向核心模块注册)
  • 4.注册区块模块事件(向事件总线模块注册)
  • 5.启动同步区块线程、区块监控线程、分叉链处理线程
  • 依赖服务

    工具模块、内核模块

2.3.2 区块存储

  • 功能说明:

    说明存储表划分

    • 主链存储
         不同的链存到不同的表,表名加chainID后缀
    +     一个完整的区块由区块头和交易组成,区块头与交易分别进行存储。
    +       区块头:(放在区块管理模块)
    +           key(区块高度)-value(区块头hash)              block-header-index
    +           key(区块头hash)-value(完整的区块头)           block-header
    +       交易:(放在交易管理模块)
    +
    • 分叉链存储
         内存中缓存每一个分叉链的(起始高度、起始hash、结束高度、结束hash),在硬盘中缓存全量分叉链数据
    +     不同链的分叉链集合存在不同的表,表名加chainID后缀,每一个分叉链对象如下:
    +         key(start区块高度+start区块hash)-value(完整的chains)          fork chains
    +     private Chain chain;
    +             private String id;
    +             private String preChainId;
    +             private BlockHeader startBlockHeader;
    +             private BlockHeader endBlockHeader;
    +             private List<BlockHeader> blockHeaderList;
    +             private List<Block> blockList;
    +
  • 流程描述

  • 依赖服务

    工具模块的数据库存储工具

2.3.2 区块同步

  • 功能说明:

  • 流程描述

    • 区块同步主流程

    • 获取网络上可用节点列表
        1. 遍历节点,统计两个MAP,假定每个节点的(最新HASH+最新高度)是key
    +    2. 一个以key为主键统计次数
    +    3. 一个以key为主键记录持有该key的节点列表
    +    4. 最终统计出出现频率最大的key,就获取到当前可信的最新高度与最新hash,以及可信的节点列表
    +    
    +    举个栗子:
    +    现在同时连接到10个节点。其中4个节点(A,B,C,D)的最新区块高度是100,最新区块hash是aaa,其中6个节点(E,F,G,H,I,J)的最新区块高度是101,最新区块hash是bbb。
    +    最终返回(101,bbb,[E,F,G,H,I,J])。
    +
    • 下载区块逻辑

        在正式下载区块前,要判断本地与网络是否发生分叉,是否需要回滚。以便找到准确的区块下载高度。
    +    以下分情况讨论:
    +    取上一步的结果(101,bbb,[E,F,G,H,I,J]),同时LH(N)代表本地第N块的hash,RH(N)代表网络上第N块的hash。
    +    1.本地高度100<网络高度101,LH(100)==RH(100),正常,比远程节点落后,下载区块
    +    2.本地高度100<网络高度101,LH(100)!=RH(100),认为本地分叉,回滚本地区块,如果LH(99)==RH(99)
    +    回滚结束,从99块开始下载,如果LH(99)!=RH(99),继续回滚,重复上述逻辑。但最多回滚10个块就停止,等待下次同步,这样可以避免被恶意节点攻击,大量回滚正常区块。
    +    3.本地高度102>网络高度101,LH(101)==RH(101),正常,比远程节点领先,无需下载区块
    +    4.本地高度102>网络高度101,LH(101)!=RH(101),认为本地分叉,先一次性回滚到高度与远程一致,重复场景2
    +    5.本地高度101=网络高度101,LH(101)==RH(101),正常,与远程节点一致,无需下载区块
    +    6.本地高度101=网络高度101,LH(101)!=RH(101),认为本地分叉,重复场景2
    +    
    +    场景1、2需要额外从节点下载与本地高度一致的区块,进行hash判断
    +    上述需要回滚的场景,要满足可用节点数(10个)>配置,一致可用节点数(6个)占比超80%两个条件,避免节点太少导致频繁回滚。以上两个条件都不满足,清空已连接节点,重新获取可用节点。
    +
    +    真正下载区块时,举个栗子:
    +    当前高度100,网络高度500,可用节点12个,一致可用节点10个,每个节点每次下载区块2个
    +    那么计算得出需要下载区块400个,400/(2*10)=20轮下载完毕,同时可以计算出每轮每个节点下载区块的高度范围
    +    伪代码表示
    +        For(20轮){
    +            for(10个节点){
    +                每个节点下载对应区块,并放到共享队列给区块验证线程处理
    +            }
    +        }
    +    考虑下载过程中,节点掉线的情况。可能20轮不能下载完,所以外层加循环。
    +        while(没有下载完){
    +            重新计算轮次、各节点下载区块高度区间
    +            For(20轮){
    +                for(10个节点){
    +                    每个节点下载对应区块,并放到共享队列给区块验证线程处理
    +                }
    +            }
    +        }
    +
    • 从节点下载某高度区间内的区块

  • 依赖服务

    工具模块的数据库存储工具、RPC工具

2.3.3 区块基础验证

  • 功能说明:

    验证区块自身数据正确性,下载过程中验证,验证通过说明区块数据本身没有问题,验证失败则丢弃该区块

  • 流程描述

    • 区块基本验证

    • 区块头验证

  • 依赖服务

    工具模块的数据库存储工具

2.3.4 分叉块验证

  • 功能说明:

    验证区块上下文正确性,下载完成后验证,验证通过说明该区块与主链相连,验证失败说明该区块分叉,进入分叉链处理逻辑

  • 流程描述

    • 定义一条主链(MasterChain),一个分叉链集合(forkChains)

    • 定义待验证区块为Block

    • 定义主链高度MG,待验证区块高度BG

    • 定义主链最新区块HASH为MH,待验证区块HASH为BH,待验证区块PREHASH为BPH

    • 分六种情况讨论

    • 1.MG==BG,MH==BH,说明重复收到最新主链区块,丢弃

    • 2.MG==BG,MH!=BH,说明网络分叉

      • 遍历已有分叉链集合,判断是否已存在此区块 +
        • 如果已存在,丢弃该区块
        • 如果不存在,新建一条分叉链 +
          • 判断是否能连接上其他的分叉链(若能连上,则连接到其他分叉链则视为一条链)
          • 递归判断
    • 3.MG==BG-1,MH==BPH,说明区块连续,保存到主链

    • 4.MG==BG-1,MH!=BPH,说明网络分叉,处理同第2步

    • 5.MG<BG-1,说明网络分叉,处理同第2步

    • 6.MG>BG,说明网络分叉,处理同第2步

    高度差1000以内缓存到磁盘,磁盘空间做大小限制,超出高度则丢弃,缓存空间满则按加入缓存时间顺序清理分叉链。 +如果是正常运行时,收到其他节点转发的区块,发现分叉了要通知共识模块给生成这个区块的节点红牌惩罚,系统启动后的同步过程中不做这个判断

  • 依赖服务

    工具模块的数据库存储工具

2.3.5 分叉链管理

  • 功能说明:

    判断分叉链与主链是否需要进行切换

  • 流程描述 +​

    • 检查是否有分叉链能链接上主链,如果有则链接
    • 取出最长的一条分叉链与主链长度对比判断是否需要切换主链 +
      • 如果分叉链长度比主链长度长3(配置)个区块以上则需要切换主链
      • 找到主链与最长分叉链的分叉点
      • 验证分叉链中的区块,如果验证通过继续往下执行
      • 回滚主链区块
      • 切换分叉链为主链

  • 依赖服务

    工具模块的数据库存储工具

2.3.5 孤儿链管理

2.3.6 转发区块

  • 功能说明:

    详细说明

  • 流程描述

  1. 使用blockHash组装ForwardSmallBlockMessage,发送给目标节点
  2. 目标节点收到ForwardSmallBlockMessage后,取出hash判断是否重复,如果不重复,使用hash组装GetSmallBlockMessage发给源节点
  3. 源节点收到GetSmallBlockMessage后,取出hash,查询SmallBlock并组装SmallBlockMessage,发给目标节点
  4. 后续交互流程参考广播区块
  • 依赖服务

    工具模块的数据库存储工具

2.3.7 广播区块

  • 功能说明:

  • 流程描述

  1. 根据HASH获取BlockHeader,TxList,组装成SmallBlock,
  2. 将一个<SmallBlock.hash,SmallBlock>放入缓存中,若不主动删除,则在缓存存满或者存在时间超过1000秒时,自动清理
  3. 组装SmallBlockMessage,调用RPC模块发送消息给目标节点
  4. 目标节点收到消息后根据txHashList判断哪些交易本地没有,再组装GetTxGroupRequest发给源节点
  5. 源节点收到信息后按照hashlist组装TxGroupMessage,返回给目标节点
  6. 至此所有区块数据已经发送给目标节点。
  • 依赖服务

    工具模块的数据库存储工具

2.3.8 区块监控

  • 功能说明:

  • 流程描述

    • 启动监控定时任务,每分钟执行一次
    • 取本地最新区块头
    • 验证网络模块是否需要重启(如果本地最新区块3分钟都没有更新过则需要网络模块断开并随机重连),这里区分chainID
  • 依赖服务

    工具模块的数据库存储工具

三、事件说明

3.1 发布的事件

3.1.1 同步完成

说明:同步完成,本地区块高度与网络高度一致时,发布该事件

event_topic : "bl_blockSyncComplete",

data:{
+    chainId
+    height
+    hash
+}
+

3.1.2 保存区块

说明:每保存一个区块,发布该事件,初次同步时不发该事件

event_topic : "bl_saveBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.1.3 回滚区块

说明:每回滚一个区块,发布该事件

event_topic : "bl_rollbackBlock",

data:{
+    chainId
+    height
+    hash
+}
+

3.2 订阅的事件

3.2.1 网络稳定

说明:网络稳定时,发布该事件

event_topic : "nt_networkDone",

data:{
+    chainId
+}
+

四、协议

4.1 网络通讯协议

参见网络模块
+

4.2 消息协议

4.2.1 单个摘要消息HashMessage

  • 消息说明:用于"转发区块","孤儿链维护"功能

  • 消息类型(cmd)

    forward,getBlock,getsBlock

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
  • 消息的验证

  • 消息的处理逻辑

  1. 目标节点收到消息后,先根据chainID判断缓存中hash是否重复
  2. 如果重复,说明已经收到别的节点转发的SmallBlock,丢弃消息
  3. 如果没有重复,用hash组装GetSmallBlockMessage,并发送给源节点

4.2.2 摘要列表消息HashListMessage

  • 消息说明:用于"转发区块"功能

  • 消息类型(cmd)

    GetSmallBlock

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? blockHash byte[] hash
? hashLength VarInt 数组长度
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
  • 消息的验证

  • 消息的处理逻辑

  1. 根据chainID、hash获取SmallBlock对象
  2. 组装SmallBlockMessage,并发送给源节点

4.2.3 区块广播消息SmallBlockMessage

  • 消息说明:用于"转发区块"、"广播区块"功能

  • 消息类型(short)

    SmallBlock

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? preHashLength VarInt preHash数组长度
? preHash byte[] preHash
1 digestAlgType byte 摘要算法标识
? merkleHashLength VarInt merkleHash数组长度
? merkleHash byte[] merkleHash
48 time Uint48 时间
32 height Uint32 区块高度
32 txCount Uint32 交易数
? extendLength VarInt extend数组长度
? extend byte[] extend
32 publicKeyLength Uint32 公钥数组长度
? publicKey byte[] 公钥
1 signAlgType byte 签名算法类型
? signBytesLength VarInt 签名数组长度
? signBytes byte[] 签名
? txHashListLength VarInt 交易hash列表数组长度
1 digestAlgType byte 摘要算法标识
? txHashLength VarInt 交易hash数组长度
? txHash byte[] 交易hash
  • 消息的验证

  • 消息的处理逻辑

  1. 判断区块时间戳是否大于(当前时间+10s),如果大于这个时间,则判定为恶意提前出块,忽略该消息
  2. 根据chainID、区块hash判断消息是否重复,如果重复,则忽略该消息(这里要求维护一个集合,按照chainID分类储存收到的区块hash)
  3. 根据chainID、区块hash在DB中查询本地是否已经有该区块,如果已经有了,则忽略该消息
  4. 验证区块头,验证失败,则忽略该消息
  5. 取txHashList,判断那些tx本地没有,组装HashListMessage,发给源节点,获取没有的那些交易信息
  6. 如果交易都有,组放入缓存队列,等待验证线程验证后存储

4.2.4 高度区间消息HeightRangeMessage

  • 消息说明:用于"同步区块"功能

  • 消息类型(cmd)

    GetBlocksByHeight

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
32 startHeight uint32 起始高度
32 endHeight uint32 结束高度
  • 消息的验证

  • 消息的处理逻辑

  1. chainID、高度参数验证
  2. 返回响应消息ReactMessage
  3. 从endHeight开始查找Block,组装BlockMessage,发给目标节点
  4. 查找到startHeight为止,组装CompleteMessage,发给目标节点

4.2.5 完整的区块消息BlockMessage

  • 消息说明:用于"区块同步"

  • 消息类型(cmd)

    Block

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? preHashLength VarInt preHash数组长度
? preHash byte[] preHash
1 digestAlgType byte 摘要算法标识
? merkleHashLength VarInt merkleHash数组长度
? merkleHash byte[] merkleHash
48 time Uint48 时间
32 height Uint32 区块高度
32 txCount Uint32 交易数
? extendLength VarInt extend数组长度
? extend byte[] extend
32 publicKeyLength Uint32 公钥数组长度
? publicKey byte[] 公钥
1 signAlgType byte 签名算法类型
? signBytesLength VarInt 签名数组长度
? signBytes byte[] 区块签名
16 type uint16 交易类型
48 time uint48 交易时间
? remarkLength VarInt 备注数组长度
? remark byte[] 备注
32 fromCount Uint32 转出记录数
32 fromAssetsChainId Uint32 资产发行链的id
32 fromAssetsId Uint32 资产id
? fromAddress VarChar 转出账户地址
48 amount Uint48 转出金额
32 nonce Uint32 交易顺序号,递增
32 toCount Uint32 转入记录数
32 toAssetsChainId Uint32 资产发行链的id
32 toAssetsId Uint32 资产id
? toAddress VarChar 转入账户地址
48 amount Uint48 转入金额
32 lockTIme Uint32 锁定时间
? txData T 交易数据
? txSignLength VarInt 交易签名数组长度
? txSign byte[] 交易签名
  • 消息的验证

  • 消息的处理逻辑

  1. 放入缓存队列
  2. 等待其他区块同步中

4.2.6 请求完成消息CompleteMessage

  • 消息说明:通用消息,用于异步请求,标志异步请求处理结束。

  • 消息类型(cmd)

    Complete

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? HashLength VarInt Hash数组长度
? Hash byte[] Hash
1 success byte 成功标志
  • 消息的验证

  • 消息的处理逻辑

  1. 根据chainID、hash查找源节点缓存的异步请求,把处理结果标志设置为完成。

4.2.7 交易列表的消息TxGroupMessage

  • 消息说明:用于"转发区块"

  • 消息类型(cmd)

    TxGroup

  • 消息的格式(messageBody)

Length Fields Type Remark
32 chainID uint32 链ID
1 digestAlgType byte 摘要算法标识
? requestHashLength VarInt requestHash数组长度
? requestHash byte[] requestHash
? txCount VarInt 交易数
16 type uint16 交易类型
48 time uint48 交易时间
? remarkLength VarInt 备注数组长度
? remark byte[] 备注
32 fromCount Uint32 转出记录数
32 fromAssetsChainId Uint32 资产发行链的id
32 fromAssetsId Uint32 资产id
? fromAddress VarChar 转出账户地址
48 amount Uint48 转出金额
32 nonce Uint32 交易顺序号,递增
32 toCount Uint32 转入记录数
32 toAssetsChainId Uint32 资产发行链的id
32 toAssetsId Uint32 资产id
? toAddress VarChar 转入账户地址
48 amount Uint48 转入金额
32 lockTIme Uint32 锁定时间
? txData T 交易数据
? txSignLength VarInt 交易签名数组长度
? txSign byte[] 交易签名
  • 消息的验证

  • 消息的处理逻辑

五、模块配置

{
+    {
+        "name": "validBlockInterval",
+        "remark": "为阻止恶意节点提前出块,设置此参数,区块时间戳大于当前时间多少就丢弃该区块",
+        "readOnly": "true",
+        "value": "1000"
+    },
+    {
+        "name": "blockCache",
+        "remark": "同步区块时最多缓存多少个区块",
+        "readOnly": "true",
+        "value": "1000"
+    },
+    {
+        "name": "smallBlockCache",
+        "remark": "系统正常运行时最多缓存多少个从别的节点接收到的小区块",
+        "readOnly": "true",
+        "value": "100"
+    },
+    {
+        "name": "chainSwtichThreshold",
+        "remark": "分叉链切换为主链的高度差阈值",
+        "readOnly": "true",
+        "value": "1"
+    },
+    {
+        "name": "chainName",
+        "remark": "链名称",
+        "readOnly": "true",
+        "value": "nuls"
+    },
+    {
+        "name": "serverIp",
+        "remark": "服务ip",
+        "readOnly": "true",
+        "value": "127.0.0.1"
+    },
+    {
+        "name": "serverPort",
+        "remark": "服务端口",
+        "readOnly": "true",
+        "value": ""
+    },
+    {
+        "name": "blockMaxSize",
+        "remark": "区块大小最大值",
+        "readOnly": "false",
+        "value": "3145728"
+    },
+    {
+        "name": "resetTime",
+        "remark": "持续多长时间区块高度没有更新时,就重新获取可用节点",
+        "readOnly": "true",
+        "value": "180"
+    },
+    {
+        "name": "cacheSize",
+        "remark": "分叉链、孤儿链缓存区块最大数量",
+        "readOnly": "true",
+        "value": "10000"
+    },
+    {
+        "name": "heightRange",
+        "remark": "缓存到分叉链的高度区间",
+        "readOnly": "false",
+        "value": "1000"
+    },
+    {
+        "name": "maxRollback",
+        "remark": "每次最多回滚多少区块",
+        "readOnly": "true",
+        "value": "20"
+    },
+    {
+        "name": "consistencyNodePercent",
+        "remark": "一致可用节点最低比例,低于此数不同步区块",
+        "readOnly": "false",
+        "value": "80"
+    },
+    {
+        "name": "minNodeAmount",
+        "remark": "最小可用节点个数,低于此数不同步区块",
+        "readOnly": "false",
+        "value": "1"
+    },
+    {
+        "name": "downloadNumber",
+        "remark": "同步时,每次从一个节点下载多少区块",
+        "readOnly": "true",
+        "value": "20"
+    },
+    {
+        "name": "orphanChainMaxAge",
+        "remark": "孤儿链最大年龄",
+        "readOnly": "true",
+        "value": "10"
+    },
+    {
+        "name": "extendMaxSize",
+        "remark": "区块头扩展字段最大值",
+        "readOnly": "false",
+        "value": "1024"
+    }
+}
+
+

六、Java特有的设计

  • Block对象设计
字段名称 字段类型 说明
blockHeader BlockHeader 区块头
transactions List 交易列表
  • SmallBlock对象设计
字段名称 字段类型 说明
blockHeader BlockHeader 区块头
transactions List 所有交易HASH列表
subTxList List 其他节点一定没有的交易(如共识奖励交易、红黄牌交易等)
  • BlockHeader对象设计
字段名称 字段类型 说明
hash String 区块HASH
preHash String 上一区块HASH
merkleHash String 区块MerkleHash
height int 区块高度
time long 区块打包时间
txCount short 交易数
packingAddress String 打包地址
extend byte[] 扩展字段
blockSignature BlockSignature 区块签名
  • BlockSignature对象设计
字段名称 字段类型 说明
signData String 区块签名
publicKey byte[] 公钥

七、补充内容

Last Updated: 2019-1-10 20:03:04
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/chainModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/chainModuleDesign.html new file mode 100644 index 00000000..b86e2ad1 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/chainModuleDesign.html @@ -0,0 +1,159 @@ + + + + + + 链管理模块设计文档 | NULS + + + + + + + +

链管理模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《链管理》模块

在NULS 1.0中,只有一条链(NULS主网),因此不需要链管理模块。

在NULS 2.0中,NULS主网上可以注册其他友链信息,包括:

  • NULS生态圈中的链:与NULS主网使用同一套代码衍生出来。
  • 其他链:比特币、以太坊等

《链管理》模块用来管理所有加入NULS主网的友链的信息

名词解释:

  • NULS主网:不同于NULS 1.0,是独立运行的另一条链,也称之为NULS 2.0。 +《链管理》是NULS主网的其中一个模块
  • 友链:在NULS主网上注册的其他链

假设1:友链A,其拥有资产A

假设2:友链B,其拥有资产B

  • 跨链交易: +
    • 友链A把资产A转到友链B
    • 友链B内部转移资产A
    • 友链B把资产A转回到友链A
    • 友链B把资产A转到其他友链(C,D等)
  • 非跨链交易: +
    • 友链A内部转移资产A
    • 友链B内部转移资产B

备注:不论链内资产,还是链外资产,只要资产跨链进行交易,就需要主网进行确认。

1.1.2 《链管理》要做什么

《链管理》模块用来管理加入NULS主网的链的基本信息,包括:

  • 注册一条新的友链
  • 销毁已经存在的友链
  • 查询友链信息
  • 特定友链增加资产类型
  • 特定友链销毁资产类型
  • 跨链资产校验

1.1.3 《链管理》在系统中的定位

《链管理》强依赖的模块:

  • 核心模块
  • 网络模块
  • 交易管理模块
  • 账本模块

《链管理》弱依赖的模块:

  • 事件总线模块

1.2 模块内部架构图

二、功能设计

2.1 功能架构图

2.2 模块服务

2.2.1 注册一条新的友链

  • 功能说明:

    NULS主网会提供一个入口(网页),可以通过这个入口注册新的友链到NULS主网。

    注册一条友链必须含一个注册资产。

  • 流程描述

步骤描述:

1.用户通过终端注册登记链信息以及随链初始化的资产信息。

2.链管理模块进行链交易的封装发送给交易模块。期间需要通过账本模块获取账户余额及交易nonce值。

​ 并且通过网络模块获取跨链的种子节点信息 返回给用户。

3.交易模块会在交易处理过程中进行数据校验的回调。

4.链管理模块通过 交易模块回调 “提交链注册交易”的接口 来进行注册数据提交。

5.链管理模块存储数据并将注册信息下发给网络模块。

6.注册链需要1000NULS,其中20%直接销毁,80%用于抵押,删除资产时退回。

  • 接口定义

    • 接口说明

    ​ 向链管理模块注册友链信息。

    ​ method : cm_chainReg

    • 请求示例
    {
    +        "chainId": 152,
    +        "chainName": "nuls chain",
    +        "addressType": "1",
    +        "magicNumber":454546,
    +        "supportInflowAsset":"1",
    +        "minAvailableNodeNum":5,
    +        "singleNodeMinConnectionNum":5,
    +        "txConfirmedBlockNum":30,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"纳斯",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    chainName true string 链名称
    addressType true int 链上创建的账户的地址类型:1生态内 2非生态内
    magicNumber true string 网络魔法参数
    minAvailableNodeNum true int 最小可用节点数量
    singleNodeConMinNodeNum true int 单节点连接最小数量
    txConfirmBlockNum true int 交易确认块数
    symbol true string 资产符号
    assetName true string 资产名称
    initNumber true string 资产初始值
    decimalPlaces true int 最小资产可分割位数
    address true string 创建链的主网地址
    password true string 私钥对应的密码
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      {
      +"seeds":"xxx.xxx.xxx.xxx:8001,xxx.xxx.xxx.xxx:8002"
      +}
      +
      +
    • 返回字段说明

    parameter type description
    seeds String 种子节点
  • 依赖服务

    • 网络管理模块
    • 交易管理模块,发送交易
    • 账本模块,获取账本信息

2.2.2 注销已经存在的友链

  • 功能说明:

    NULS主网会提供一个入口(网页),可以通过这个入口注销已经存在的友链。

  • 流程描述

  1. 链是随资产而创建,所以注销链必须进行资产校验,只有删除最后一条资产,链才会随着一起注销。

2.判断是否允许注销的条件:

​ 资产与链存在。

​ 随链只有最后一个资产。

​ 链资产有n%资产在自有主链上。

3.链管理模块进行链交易的封装发送给交易模块。

​ 期间需要通过账本模块获取账户余额及交易nonce值。

4.交易模块会在交易处理过程中进行数据校验的回调。

5.链管理模块通过 交易模块回调 “提交链注销交易”的接口 来进行注销数据提交。

6.链管理模块存储数据并将注册信息下发给网络模块。

7.删除链随注销的资产,将退回抵押押金的80%。

  • 接口定义

    • 接口说明

    ​ 向链管理模块注销友链信息(调用的是资产注销接口,因为链随最后资产一起注销)。

    ​ method : cm_assetDisable

    • 请求示例
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    assetId true int 资产id
    address true string 创建链的主网账户地址
    password true string 私钥对应的密码
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      统一RPC标准格式
      +
      +
    • 返回字段说明

    parameter type description
  • 依赖服务

    • 网络管理模块
    • 交易管理模块,发送交易
    • 账本模块,校验账本信息

2.2.3 增加资产信息

  • 功能说明:

    NULS主网会提供一个入口(网页),可以通过这个入口选择链及登记注册资产。

  • 流程描述

步骤描述:

1.用户通过终端选择链 及随链录入资产信息:判断资产是否重叠。

2.链管理模块进行链交易的封装发送给交易模块。

期间需要通过账本模块获取账户余额及交易nonce值。

3.交易模块会在交易处理过程中进行数据校验的回调。

4.链管理模块通过 交易模块回调 “提交资产注册交易”的接口 来进行注册数据提交。

5.注册资产收1000NULS,其中20%直接销毁,80%用于抵押,删除资产时退回。

  • 接口定义

    • 接口说明

    ​ 向链管理模块注册资产信息。

    ​ method : cm_assetReg

    • 请求示例
    {
    +        "chainId": 152,
    +        "assetId":85,
    +        "symbol":"NULS",
    +        "assetName":"纳斯",
    +        "initNumber":"1000000000",
    +        "decimalPlaces":8,
    +         "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    symbol true string 资产符号
    assetName true string 资产名称
    initNumber true string 资产初始值
    decimalPlaces true int 最小资产可分割位数
    address true string 创建链的主网地址
    password true string 私钥对应的密码
    • 返回示例

      Failed

      统一RPC标准格式
      +

      Success

      统一RPC标准格式
      +
    • 返回字段说明

    parameter type description
  • 依赖服务

    • 交易管理模块,发送交易
    • 账本模块,获取账本信息

2.2.4 特定友链删除资产类型

  • 功能说明:

    NULS主网会提供一个入口(网页),可以通过这个入口对指定友链销毁资产。

  • 流程描述

    1. 连下注册有多个资产时,单资产允许注销,如果只有一个资产,则资产随链一起注销。

      2.判断是否允许注销的条件:

    ​ 连下存在多个资产。

    ​ 链资产有n%资产在自有主链上。

    3.链管理模块进行链交易的封装发送给交易模块。

    ​ 期间需要通过账本模块获取账户余额及交易nonce值。

    4.交易模块会在交易处理过程中进行数据校验的回调。

    5.链管理模块通过 交易模块回调 “提交链注销交易”的接口 来进行注销数据提交。

    6.注销资产将退回抵押押金的80%。

  • 接口定义

    • 接口说明

    ​ 向链管理模块注销资产信息。

    ​ method : cm_assetDisable

    • 请求示例
    {
    +        "chainId": 152,
    +        "assetId": 45,
    +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
    +        "password":"xxxxxxxxxxxxx"
    +        
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    assetId true int 资产id
    address true string 创建链的主网账户地址
    password true string 私钥对应的密码
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      统一RPC标准格式
      +
      +
    • 返回字段说明

    parameter type description
    • 依赖服务

      • 交易管理模块,发送交易
      • 账本模块,校验账本信息

2.2.5 跨链交易的链资产校验

  • 功能说明:

    交易模块在产生一笔跨链交易时,调用该接口进行跨链资产的校验。

  • 流程描述

    1. 校验链及资产是否在跨链模块正常注册
    2. 校验链上资产金额是否透支。
    3. 校验资产状态是否正常。
  • 接口定义

    • 接口说明

    ​ 跨链资产流通时,向链管理提交校验

    ​ method : cm_assetCirculateValidator

    • 请求示例
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • 请求参数说明
    parameter required type description
    coinDatas true String 交易coindata的HEX值
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      统一RPC标准格式
      +
      +
    • 返回字段说明

    parameter type description
  • 依赖服务

    • 交易管理模块,跨链交易校验调用

2.2.6 跨链交易的链资产提交

  • 功能说明:

    交易模块在产生一笔跨链交易,并校验通过时,调用该接口进行跨链资产的提交。

    用于变更链资产,并用于链资产的管理。

  • 流程描述

    1. 直接调用cm_assetCirculateCommit 接口
  • 接口定义

    • 接口说明

    ​ 跨链资产流通时,校验通过并且确认可提交时,可向链管理提交该笔交易

    ​ method : cm_assetCirculateCommit

    • 请求示例
    {
    +        "coinDatas": "FFAABB214324"       
    +}
    +
    • 请求参数说明
    parameter required type description
    coinDatas true String 交易coindata的HEX值
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      统一RPC标准格式
      +
      +
    • 返回字段说明

    parameter type description
  • 依赖服务

    • 交易管理模块,跨链交易调用

2.2.7 链管理交易处理函数的注册

  • 功能说明:

    在模块启动时,需要进行交易回调函数的注册,以便交易模块在进行相关类型交易处理时,进行回调处理。

    注册函数分为4类:1>交易校验 2>交易提交 3>交易回滚 4>一个区块内的模块批量交易校验

  • 流程描述

    1. 链管理模块启动
    2. 判断交易模块RPC调用状态是否可访问
    3. 提交回调接口
  • 接口定义

    参看 交易模块 设计文档中的 “注册交易” 部分

  • 依赖服务

    • 交易管理模块

2.2.8 查询链信息

  • 功能说明:

    查询注册链信息

  • 流程描述

​ 无

  • 接口定义

    • 接口说明

    ​ 查询注册友链信息。

    ​ method : cm_chain

    • 请求示例
    {
    +   "chainId":4545 
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "chainName": "nuls chain",
      +        "addressType": 1,
      +        "magicNumber":454546,
      +        "supportInflowAsset":"1",
      +        "minAvailableNodeNum":5,
      +        "singleNodeMinConnectionNum":5,
      +        "txConfirmedBlockNum":30,
      +        "regAddress":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "regTxHash":"FFFFF", 
      +        "selfAssetKeyList":["1232_32","528_8"],
      +        "totalAssetKeyList":["1232_32","528_8"],
      +        "createTime":1212131
      +}
      +
    • 返回字段说明

    parameter type description
    chainId int 链标识
    chainName string 链名称
    addressType int 链上创建的账户的地址类型:1生态内 2非生态内
    magicNumber string 网络魔法参数
    minAvailableNodeNum int 最小可用节点数量
    singleNodeConMinNodeNum int 单节点连接最小数量
    txConfirmBlockNum int 交易确认块数
    regTxHash string 交易hash
    regAddress string 创建链的主网地址
    selfAssetKeyList list 链下注册的资产列表,由chainId_assetId 组合的资产key值
    totalAssetKeyList list 链下流通的资产列表,由chainId_assetId 组合的资产key值
    createTime long 创建时间
  • 依赖服务

2.2.9 查询链下资产信息

  • 功能说明:

    查询某链资产信息。

  • 流程描述

​ 无

  • 接口定义

    • 接口说明

    ​ 向链管理模块查询某资产信息。

    ​ method : cm_asset

    • 请求示例
    {
    +   "chainId":4545, 
    +   "assetId":45
    +}
    +
    • 请求参数说明
    parameter required type description
    chainId true int 链标识
    assetId true int 资产id
    • 返回示例

      Failed

      统一RPC标准格式
      +
      +

      Success

      {
      +        "chainId": 152,
      +        "assetId":85,
      +        "symbol":"NULS",
      +        "assetName":"纳斯",
      +        "initNumber":"1000000000",
      +        "decimalPlaces":8,
      +        "address":"NsdxSexqXF4eVXkcGLPpZCPKo92A8xpp",
      +        "txHash":"xxxxxxxxxxxxx",
      +        "createTime":125848
      +        }
      +
    • 返回字段说明

    parameter type description
    chainId int 链标识
    symbol string 资产符号
    assetName string 资产名称
    initNumber string 资产初始值
    decimalPlaces int 最小资产可分割位数
    address string 创建链的主网地址
    txHash string 交易hash
    createTime long 创建时间
  • 依赖服务

3、事件说明

  • 链注册事件
  • 链注销事件
  • 新增资产事件
  • 注销资产事件

4、协议

4.1 网络通讯协议

4.1.1 向友链请求获取发行的资产总量

  • 消息说明:定期链管理向友链发起发行资产总量数据请求消息。
  • cmd:requestAssetAmount
Length Fields Type Remark
2 chainId uint16 链Id
2 assetId uint16 资产id
4 randomCode uint32 随机数

4.1.1 接收友链回复的资产总量

  • 消息说明:接收到友链对资产的回复。
  • cmd:responseAssetAmount
Length Fields Type Remark
2 chainId uint16 链Id
2 assetId uint16 资产id
48 amount biginteger 资产总量
4 randomCode uint32 随机数

4.2 交易协议

4.2.1 注册一条新的友链

与通用交易相比,只有类型和txData有区别,具体区别如下

交易类型定义:10101

txData定义

Length Fields Type Remark
2 chainId uint16 链Id
name byte[] 链名称
1 addressType uint8 地址类型
4 magicNumber uint32 魔法参数
1 supportInflowAsset uint8 是否支出资产流入
2 minAvailableNodeNum uint16 最小可用节点数
2 singleNodeMinConnectionNum uint16 单节点最小连接数
address byte[] 账户地址
2 assetId uint16 资产id
symbol byte[] 单位
assetName byte[] 资产名称
2 depositNuls uint16 抵押NULS数量
48 initNumber Biginteger 资产初始数量
1 decimalPlaces uint8 资产最小分割位数
4.2.2 注销已经存在的友链

与通用交易相比,只有类型和txData有区别,具体区别如下

交易类型定义:10102

txData定义:同4.2.1 链注册交易

4.2.3 新增友链资产

与通用交易相比,只有类型和txData有区别,具体区别如下

交易类型定义:10103

txData定义:

Length Fields Type Remark
2 chainId uint16 链Id
2 assetId uint16 资产id
symbol byte[] 单位
assetName byte[] 资产名称
2 depositNuls uint16 抵押NULS数量
48 initNumber Biginteger 资产初始数量
1 decimalPlaces uint8 资产最小分割位数
address byte[] 账户地址
4.2.2 注销已经存在的资产

与通用交易相比,只有类型和txData有区别,具体区别如下

交易类型定义:10104

txData定义:同4.2.3 资产新增交易

六、模块配置

[system]
+language = en
+encoding = UTF-8
+
+[db]
+rocksdb.datapath = ../data
+
+[param]
+asset_symbol_max = 5
+asset_name_max = 20
+asset_depositNuls = 200000
+asset_depositNuls_destroy_rate = 0.2
+asset_depositNuls_lock_rate = 0.8
+asset_initNumber_min = 10000
+asset_initNumber_max = 100000000
+asset_decimalPlaces_min = 4
+asset_decimalPlaces_max = 8
+asset_recovery_rate = 0.9
+
+[defaultAsset]
+nuls_chain_id = 8964
+nuls_chain_name = nuls chain
+nuls_asset_id = 1
+nuls_asset_initNumber_max = 100000000
+nuls_asset_symbol = NULS
+

七、Java特有的设计

八、补充内容

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/consensusModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/consensusModuleDesign.html new file mode 100644 index 00000000..177f49e9 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/consensusModuleDesign.html @@ -0,0 +1,1110 @@ + + + + + + 共识模块设计文档 | NULS + + + + + + + +

共识模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有共识模块

​ 众所周知,区块链的核心是共识机制。和传统互联网的cliet-server架构不同,区块链的节点是对等的,没有中心,大家权利一样;所以为了使数据达到一致性,让一个没有中心的网络维护一套大家都认同的账本,这就是共识机制的作用。

​ 从广义上来说,共识机制就是区块链每个节点共同遵守的规则或算法,是实现互信的基础,如此才能实现去中心化的无监管,维持整个平台的正常运转。

​ 从狭义来说,共识机制决定了每个节点对区块链上交易的验证和确认的机制。

1.1.2 共识模块要做什么

​ 区块链的每次交易,都必须获得每个节点的认可,只有全网都达成共识后,交易才算完成。就好像民主选举中,投票方式或规则必须被全民认可,基于此才能完成选举。而在区块链中,共识机制的主要表现就是激励制度,也就是给矿工的奖励。在共识机制的保障下,每个矿工都能获得奖励,整个区块链才能有序的运转,提供公平、透明及互信的环境。因此共识模块就需要提供特定的算法来维持,即共识算法。

​ 公链共识机制有多种,主流的有POW、POS、DPOS。NULS主网采用自主原创的POC(Proof Of Credit)共识机制,一种继承了Dpos共识机制的安全性和高效率,同时在协作方面进行了非常大的改进,可以看成是一种升级版的Dpos。

​ POC共识模块职责:

  • 区块同步后的合法性验证

  • 创建共识节点、委托参与共识、取消委托、注销共识节点★

  • 共识节点打包出块

  • 网络维护激励的发放

  • 作恶节点惩罚★

    PS:不同的共识机制其共识算法不尽相同,以上有标记★的为POC共识特有

1.1.3 《共识模块》在系统中的定位

​ 共识模块在系统中是比较核心的一块,主要负责打包交易出块,验证区块头,管理系统中的共识节点信息,委托信息,处罚信息等。

1.2 架构图

(注意:区块下载属于区块管理模块,重新画图)

说明:

  • Services 层: +
    • tx service : 交易的增删改查
    • consensus service : 共识活动及状态管理二、功能设计
  • Validator +
    • tx Validator: 共识相关交易的验证器,用于验证共识相关交易
  • Processor +
    • Tx Processor:共识模块相关交易处理器,用于提交回滚检测交易
  • Task/Thread层:定时任务 +
    • consensus Task: 共识打包
    • Reward Task : 数据统计
  • Storage层:存储共识模块相关交易数据

2.0 功能架构图

2.1共识模块功能需求分析

2.1.1 支持多链并行

NULS2.0设计理念是提供模块化的服务,并且每个模块都应该支持多条链的数据同时运行,因此共识模块需要实现不同共识机制的算法。当共识模块启动运行后,可同时支持多条链同时运行。

2.1.2 POC的共识机制

NULS的主网采用自主的POC共识机制,要实现POC,首先需要知道POC的设计理念和业务规则,以下内容摘自NULS白皮书POC共识介绍部分,如果熟悉可直接跳过。

共识机制——POC
+	NULS主链默认采用信用共识机制 POC(Proof-Of-Credit)。节点信用达标的情况下,锁定一定保证金即可加入共识,共识节点重新排序后每轮轮流出块,退出共识时保证金解锁。
+1、共识进入与退出机制
+	任何人都可以随时加入NULS的共识之中,只要满足条件,遵守规则,即可持续获得NULS代币奖励。POC的加入分为硬性指标和软性指标。硬性指标指的是信用分值必须达到一定标准线,排除掉一部分曾经作恶的节点。软性指标指的是必须冻结一定量的NULS代币作为保证金,为杜绝节点的泛滥,同时让整个系统更加公平,保证金的数量除了有一个最低值的限制外,任何人可自由选择保证金的数量,保证金的数量会和最终的奖励挂钩。
+1.1黄牌警告
+	由于节点硬件配置或者网络原因,造成的共识期间掉线、死机等无法出块的,不属于违规情况,但对整个系统会造成一定影响,所以对这类情况,系统有一个轻度的警告机制:降低节点信用值,
+1.2红牌警告
+	对于一些双花、重复出块、尝试分叉系统、不遵守系统规则的恶意人为破坏情况,NULS系统坚决抵制,所有节点都可以检测到这类情况的发生;一旦有恶意节点确实试图挑战系统,那么对应的保证金将会被锁定2个月,且再次信用评级,将永远达不到共识门槛。
+2、信用评级
+	在 NULS 系统里,信用是账户在系统中的诚信系数,所有账户的信用会在区间[-1,1]内,通过信用评级算法公式自动计算。
+	信用评估公式:信用基数=能力系数+责任系数
+	能力系数:根据历史出块数量计算
+	责任系数:根据违规情况和出块正确性计算
+3、共识奖励
+	为了整个 NULS 系统的平衡与公平,共识奖励根据所有共识节点所提交保证金与共识节点信用综合计算。共识奖励计算公式:见(图p1)
+4、子链共识机制
+	接入 NULS 的子链分为两种类型,第一种是通过 NULS 系统的标准接口协议接入,第二种是通过 NULS 的程序部署接入。
+	NULS 是一套通用的区块链底层基础设施,在其主链上不运行任何应用业务,所有应用业务由子链运行。通过 NULS 的系统,能快速的部署基于 NULS 的子链,且可灵活定制子链的各种运行参数,包括是否支持基础代币、加密算法、共识机制、存储机制等。
+	NULS 定义了标准共识模块,以提供接口兼容不同的共识机制。NULS 社区会陆续开发 POW、DPOS、POS、PBFT、POOL 验证池等共识机制,以供用户自由选择。
+
+

图p1:共识奖励计算公式:

在POC系统中,有代理人、委托人、打包人、奖励人这四个角色。
  • 代理人————即共识节点创建人。NULS持有人发起一笔创建共识节点的交易,记录到链中,告诉所有人我要做共识节点。节点创建的基本条件是需要锁定20,000—200,000个NULS,且没有红牌惩罚记录,设立这个基本条件的目的是证明你是真心实意的想维护好NULS的基础网络。
  • 打包人————代理人在创建共识节点时,可指定一个打包人,这个打包人可以是自己的其他账户,也可以是懂技术的朋友,最重要的是打包人可以不持有任何NULS,即使参与共识的服务器被黑客攻破,用户也不会有巨大损失,损失的仅仅是被攻击后的收益影响。需要注意的是打包人是真正出块的账户,每次打包区块后都需要对区块签名,因此打包账户一定不要设置密码。
  • 奖励人————代理人在创建共识节点时,不仅仅可以指定一个打包人,还可以指定一个受益人,指定谁可以获得共识所产出的奖励
  • 委托人————NULS持有人,可根据代理人的信用值情况,以及代理人的影响力等等因素,把自己所持有的NULS委托给该代理人进行共识,同时享受相应的共识收益,若发现代理人节点质量或者诚信有所下降,委托人可随时撤掉其委托改投他人。
在POC系统中,有创建代理(创建共识节点)、停止代理节点(退出共识)、委托共识、取消委托四种业务逻辑。
  • 创建代理(创建共识节点):锁定20,000—200,000个NULS,发起一笔注册代理交易,打包之后全网可见,其它人可锁定NULS委托到该代理人节点之上。
  • 停止代理节点(退出共识):代理人可随时停止其代理资格,发起交易删除代理节点,交易被打包确认之后,很快就会退出共识,不再参与新区块的生产。注册代理时锁定的2万个NULS会72小时之后解锁,其余委托人委托到该节点的NULS立即解锁。
  • 委托共识:持有2000及以上NULS的用户,可以选择一个代理节点进行委托,获得相应的出块收益。在退出之前,相应委托的NULS将被锁定不可用。一个代理节点最高可接受500,000NULS的委托。
  • 取消委托:用户可对之前进行的委托进行撤销,撤销之后锁定的NULS马上解释,不再享受相应的共识收益。
POC系统的两种处罚机制
  • 黄牌处罚:当出块节点因断网,卡机等各种不确定原因,导致该出块时没有出块,或者出的块没有被采用,那么将在下一轮获得黄牌处罚。黄牌处罚会影响节点的收益;当连续获得100个黄牌处罚时,会被进行红牌处罚。
  • 红牌处罚:当出块节点作出恶意分叉、双花等严重危害网络稳定的行为时,或者连续获得100个黄牌处罚时,系统会给予红牌处罚。获得红牌处罚的节点会被强制停止共识,创建代理时的押金被冻结3个月,且永远不可再次创建节点;获得红牌处罚的节点对应的委托立即解锁。
POC内部系统的隐藏功能需求
  • 维护一张共识节点信息表,并根据实时接收到的以上四种交易进行更新。
  • 维护一个轮次信息表,让每个轮次符合出块条件的代理人随机排队出块。
  • 符合出块条件的代理节点,对内存池的交易进行验证打包,组装成新区块并广播到全网。

以上是对共识模块POC共识机制实现的功能分析,在下一章节会介绍每个功能实现的细节。

2.2 模块服务

共识模块为区块链的核心模块,由于共识机制的不同,导致对外提供的服务也不尽相同。模块服务会对共识模块共有的服务和POC机制特有的服务做详细描述。

2.2.1 创建节点

  • 功能说明:

    创建一个指定打包区块的地址(当共识节点满足可打包条件后的处快地址),佣金比例(其他账户参与该节点共识的佣金比例),共识奖励结算地址(该共识节点出块的奖励金归属地址)的共识节点,等待其他节点委托共识,当委托共识金额达到标准金额时,该节点可以打包出块赚取奖励金
    +
  • 流程描述

    - 验证参数正确性
    +- 创建交易
    +- 判断账户余额是否足够
    +- 验证交易
    +- 保存交易
    +- 广播交易
    +
  • 接口定义

    • 接口说明

      通过创建节点接口,NULS用户可以发起创建节点交易,交易被确认打包后,即可成功创建共识节点。
      +
    • 请求示例

      {
      +    "method":"cs_createAgent",
      +    "version:"1.0",
      +    "params":["agentAddress","packingAddress","rewardAddress",10,20000,"password","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 agentAddress true String 申请创建节点账户的地址
      1 packingAddress true String 打包区块地址
      2 rewardAddress false String 奖励结算地址(默认与节点地址一致)
      3 commissionRate true double 佣金比例
      4 deposit true long 创建节点的保证金
      5 password false String 密码
      6 chainId true String 链ID
    • 返回示例

      成功

      {
      + 	"version": 1.0,
      +    "code":0,
      +    "msg" :"成功提示信息",
      +    "result":{
      +        "value":"tx.getHash().getDigestHex()"   //生成的交易hash值
      +    }
      +}
      +

      失败

      {
      +	"version": 1.0,
      +   	 "code":1,
      +   	 "msg" :"错误提示信息",
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      value String 生成的交易hash值的十六进制字符串

2.2.2 创建节点交易验证

  • 功能说明:

    创建节点交易的验证器
    +
  • 流程描述

    - 验证交易中是否包含节点信息
    +- 验证交易创建者是否正确
    +- 节点地址与打包地址不能相同验证
    +- 节点奖励地址与打包地址不能相同验证
    +- 佣金比例有效性验证
    +- 创建节点的保证金有效性验证
    +- 签名正确性验证
    +- CoinData验证(锁定时间验证)
    +
  • 接口定义

    • 接口说明

      这个接口主要是验证区块轮次信息,打包人,区块中的交易以及CoinBase是否正确,并验证是否有红黄牌惩罚。
      +
    • 请求示例

      {
      +    "method":"cs_createAgentValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 创建节点交易的序列化数据
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.3 创建节点交易提交

  • 功能说明:

    保存创建的共识节点信息
    +
  • 流程描述

    - 保存节点信息到数据库
    +
  • 接口定义

    • 接口说明

      保存共识节点信息到数据库
      +
    • 请求示例

      {
      +    "method":"cs_createAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 创建节点交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.4 创建节点交易回滚

  • 功能说明:

    删除共识节点信息
    +
  • 流程描述

    - 删除共识节点信息
    +
  • 接口定义

    • 接口说明

      从数据中删除共识节点信息
      +
    • 请求示例

      {
      +    "method":"cs_createAgentRollBack",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 创建节点交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.5 注销共识节点

  • 功能说明:

    注销一个自己创建的共识节点,注销节点后参与共识的节点的共识金额及共识奖金会在一定时间后解冻
    +
  • 流程描述

    - 验证参数正确性
    +- 创建交易
    +- 判断账户余额是否足够
    +- 验证交易
    +- 保存交易
    +- 广播交易
    +
  • 接口定义

    • 接口说明

      通过注销节点接口,NULS用户可以发起注销自己创建的节点的交易,交易被确认打包后,即可成功注销共识节点。
      +
    • 请求示例

      {
      +    "method":"cs_stopAgent",
      +    "version:"1.0",
      +    "params":["address","password",chainId]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 address true String 创建注销节点交易账户的地址
      1 password false String 密码
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		"value":"tx.getHash().getDigestHex()"   //生成的交易hash值
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      value String 生成的交易hash值的十六进制字符串

2.2.6 注销节点交易验证

  • 功能说明:

    验证注销节点交易的正确性
    +
  • 流程描述

    - 验证删除的共识节点是否存在和该共识节点是否已经被注销
    +- 验证交易创建者是否正确
    +- CoinData验证(输出地址必须存在)
    +- 查询出所有参与该共识节点的共识信息和该节点总的共识金额
    +- 检查注销节点交易中花费的UTXO总额与数据库查询出的共识节点委托金额是否相等,如果不等则验证失败
    +- 验证注销节点交易中解锁的每笔UTXO是否正确
    +
  • 接口定义

    • 接口说明

      验证注销节点交易是否正确。
      +
    • 请求示例

      {
      +    "method":"cs_stopAgentValid",
      +    "version:"1.0",
      +    "params":["tx",chainId]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 注销节点交易的序列化数据
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.7 注销节点交易提交

  • 功能说明:

    提交注销节点数据交易
    +
  • 流程描述

    - 把该共识节点下所有的委托数据设为已删除
    +- 把该共识节点数据设为已删除
    +
  • 接口定义

    • 接口说明

      注销共识节点,把该共识节点下的所有委托数据设和共识节点设为已删除状态
      +
    • 请求示例

      {
      +    "method":"cs_stopAgentCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 创建节点交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.8 注销节点交易回滚

  • 功能说明:

    注销节点交易数据回滚
    +
  • 流程描述

    - 把该共识节点下所有的委托数据设为未删除
    +- 把该共识节点数据设为未删除
    +
  • 接口定义

    • 接口说明

      回滚注销节点交易数据
      +
    • 请求示例

      {
      +    "method":"cs_stopAgentRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 注销节点交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.9 申请加入共识

  • 功能说明:

    委托指定金额到共识节点参与共识赚取共识奖励,加入共识期间委托金额和共识奖励会被冻结
    +
  • 流程描述

    - 验证参数正确性
    +- 创建交易
    +- 判断账户余额是否足够
    +- 验证交易
    +- 保存交易
    +- 广播交易
    +
  • 接口定义

    • 接口说明

      通过该接口,用户可以委托指定节点地址加入共识,赚取奖金。
      +
    • 请求示例

      {
      +    "method":"cs_depositToAgent",
      +    "version:"1.0",
      +    "params":["address","agentHash",20000,"password","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 address true String 申请参与共识账户地址
      1 agentHash true String 共识节点id
      2 deposit true long 参与共识的金额
      3 password false String 申请参与共识账户的密码
      4 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		"value":"tx.getHash().getDigestHex()"   //生成的交易hash值
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      value String 交易hash值的十六进制字符串

2.2.10 委托共识交易验证

  • 功能说明:

    委托共识交易正确性验证
    +
  • 流程描述

    - 验证申请加入的共识节点是否有效
    +- 验证申请加入的共识节点是否已经达到允许加入共识的最大数量
    +- 验证委托金额是否有效
    +- 验证交易是否为申请委托的账户自己创建
    +- 验证委托金额与输出的UTXO金额是否相等,输出的UTXO锁定时间是否正确
    +
  • 接口定义

    • 接口说明

      验证委托交易中委托节点有效性的验证,委托金额正确性验证,委托交易创建者是否正确,委托交易输出的UTXO是否正确等。验证注销节点交易是否正确。
      +
    • 请求示例

      {
      +    "method":"cs_depositValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 委托共识交易的序列化数据
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.11 委托共识交易提交

  • 功能说明:

    委托交易提交
    +
  • 流程描述

    - 保存委托交易信息
    +
  • 接口定义

    • 接口说明

      保存委托交易数据
      +
    • 请求示例

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 交易的序列化数据
      1 height true long 委托交易被打包的区块高度
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.12 委托共识交易回滚

  • 功能说明:

    委托共识交易回滚,删除委托共识交易数据
    +
  • 流程描述

    - 删除委托共识交易信息
    +
  • 接口定义

    • 接口说明

      当委托共识交易提交出错时,需要掉此接口来删除委托共识交易数据
      +
    • 请求示例

      {
      +    "method":"cs_depositRollback",
      +    "version:"1.0",
      +    "params":["tx",1000000,"chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 委托共识交易的序列化数据
      1 height true long 委托共识交易被打包区块的高度
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.13 撤销委托

  • 功能说明:

    申请退出共识,交易验证通过后在指定时间之后加入共识的押金和奖励会解冻
    +
  • 流程描述

    - 验证参数正确性
    +- 创建交易
    +- 判断账户余额是否足够
    +- 验证交易
    +- 保存交易
    +- 广播交易
    +
  • 接口定义

    • 接口说明

      申请退出共识,交易验证通过后在指定时间之后加入共识的押金和奖励会解冻
      +
    • 请求示例

      {
      +    "method":"cs_withdraw",
      +    "version:"1.0",
      +    "params":["address","txHash","password","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 address true String 申请退出共识账户地址
      1 txHash true String 加入共识时的交易hash
      2 password false String 密码
      3 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		"value":"tx.getHash().getDigestHex()"   //生成的交易hash值
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      value String 交易hash值的十六进制字符串

2.2.14 退出共识交易验证

  • 功能说明:

    验证退出共识交易是否正确
    +
  • 流程描述

    - 验证要退出的共识之前是否已经委托且没有退出
    +- 验证创建该交易的账户是否正确
    +
  • 接口定义

    • 接口说明

      在退出之前要验证该账户是否参与过该委托且现在还是在委托中。还要验证交易创建者是否为委托人本人。
      +
    • 请求示例

      {
      +    "method":"cs_withdrawValid",
      +    "version:"1.0",
      +    "params":["tx","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 退出委托交易的序列化数据
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.15 退出共识交易提交

  • 功能说明:

    退出共识交易提交,保存退出共识交易相关数据
    +
  • 流程描述

    - 保存退出共识交易相关数据
    +
  • 接口定义

    • 接口说明

      当退出共识交易验证成功之后通过调用该接口来保存交易相关数据
      +
    • 请求示例

      {
      +    "method":"cs_depositCommit",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.16 退出共识交易回滚

  • 功能说明:

    退出共识交易数据回滚
    +
  • 流程描述

    - 回滚退出共识交易数据
    +
  • 接口定义

    • 接口说明

      当退出共识交易提交出错时,需要调用此接口来回滚数据,保证数据的正确性。
      +
    • 请求示例

      {
      +    "method":"cs_withdrawRollback",
      +    "version:"1.0",
      +    "params":["tx","blockHeader","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx true String 退出委托交易的序列化数据
      1 blockHeader true String 区块头的十六进制字符串
      2 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.17 查询共识节点列表

  • 功能说明:

    获取自己加入的或全网所有的共识节点列表,支持关键字查询,排序,分页查询
    +
  • 流程描述

    - 验证参数正确性
    +- 获取本地主链上共识节点列表
    +- 过滤共识节点列表,得到满足条件的共识节点列表
    +- 共识节点列表排序
    +- 分页
    +- 返回共识节点列表
    +
  • 接口定义

    • 接口说明

      获取自己加入的或全网所有的共识节点列表,支持关键字查询,排序,分页查询
      +
    • 请求示例

      {
      +    "method":"cs_getAgentList",
      +    "version:"1.0",
      +    "params":[1,10,"address","keyword","sortType","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 pageNumber true int 页码
      1 pageSize true int 每页数据量
      2 keyword false String 关键字(节点地址,打包地址,节点别名,节点ID)
      3 sortType false String 排序类型(deposit创建共识节点的锁定金额,commissionRate佣金比 例,creditVal奖励金额,totalDeposit参与共识的总金额,comprehensive综合排序)
      4 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"pageNumber":1,                         //页码         
      +    	"pageSize":10,                          //每页数据量
      +    	"total":100,                            //总数据量
      +    	"pages",10,                             //总页数
      +    	"data":[
      +            {
      +                "agentHash":"",                  //节点hash
      +                "agentAddress";"",              //创建节点的地址
      +                "packingAddress";"",            //打包地址
      +                "rewardAddress";"",             //奖励地址
      +                "deposit";,                     //保证金
      +                "commissionRate";,              //佣金比例
      +                "agentName";"",                 //节点名称
      +                "agentId";"",                   //节点ID
      +                "introduction";"",              //简介
      +                "time";,                        //创建时间
      +                "blockHeight";,                 //所在区块高度
      +                "delHeight":,                   //共识节点被删除的区块高度
      +                "status":,                      //状态                    
      +                "creditVal":,                   //信誉值
      +                "totalDeposit":,                //参与共识总金额
      +                "txHash":"",                    //交易hash
      +                "memberCount":,                 //加入该节点共识的人数
      +                "version":                       //版本
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      data:

      parameter type description
      pageNumber int 页码
      pageSize int 每页数据量
      total int 总数据量
      pages int 总页数
      data List 共识节点列表

      Agent:

      parameter type description
      agentHash String 节点hash
      agentAddress String 创建节点的地址
      packingAddress String 打包地址
      rewardAddress String 奖励地址
      deposit long 保证金
      commissionRate double 佣金比例
      agentName String 节点名称
      agentId String 节点ID
      introduction String 简介
      time long 创建时间
      blockHeight long 创建该节点的交易所在区块高度
      delHeight long 注销交易所在区块高度
      status int 状态
      creditVal double 信誉值
      totalDeposit long 总委托金额
      txHash String 交易hash
      memberCount int 委托数量
      version String 协议版本

2.2.18 查询节点明细(基本信息、信用值、节点状态)

  • 功能说明:

    查询指定共识节点详细信息,包括共识节点的创建时间,保证金,佣金比例,节点地址,打包地址,共识状态,信用值,委托金额,共识人数等信息
    +
  • 流程描述

    - 验证参数正确性
    +- 获取本地主链上共识节点列表
    +- 从列表中找出对应的节点信息
    +
  • 接口定义

    • 接口说明

      通过节点hash查询该节点的详细信息
      +
    • 请求示例

      {
      +    "method":"cs_getAgent",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 agentHash true String 共识节点id
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"data":{
      +                "agentHash":"",                  //节点hash
      +                "agentAddress";"",              //创建节点的地址
      +                "packingAddress";"",            //打包地址
      +                "rewardAddress";"",             //奖励地址
      +                "deposit";,                     //保证经
      +                "commissionRate";,              //佣金比例
      +                "agentName";"",                 //节点名称
      +                "agentId";"",                   //节点ID
      +                "introduction";"",              //简介
      +                "time";,                        //创建时间
      +                "blockHeight";,                 //所在区块高度
      +                "delHeight":,                   //共识节点被删除的区块高度
      +                "status":,                      //状态                    
      +                "creditVal":,                   //信用值
      +                "totalDeposit":,                //参与共识总金额
      +                "txHash":"",                    //交易hash
      +                "memberCount":,                 //加入该节点共识的人数
      +                "version":                       //版本
      +         }
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      agentHash String 节点hash
      agentAddress String 创建节点的地址
      packingAddress String 打包地址
      rewardAddress String 奖励地址
      deposit long 保证金
      commissionRate double 佣金比例
      agentName String 节点名称
      agentId String 节点ID
      introduction String 简介
      time long 创建时间
      blockHeight long 创建该节点的交易所在区块高度
      delHeight long 注销交易所在区块高度
      status int 状态
      creditVal double 信誉值
      totalDeposit long 总委托金额
      txHash String 交易hash
      memberCount int 委托数量
      version String 协议版本

2.2.19 查询节点惩罚列表(全部、红牌、黄牌)

  • 功能说明:

    获取共识节点以前获得的惩罚记录(红牌和黄牌惩罚),用户可自定义查询全部惩罚记录还是只获取红牌或则黄牌惩罚信息
    +
  • 流程描述

    - 验证参数正确性
    +- 根据查询类型获取相应惩罚
    +
  • 接口定义

    • 接口说明

      查询指定出块地址的惩罚记录
      +
    • 请求示例

      {
      +    "method":"cs_getPunishList",
      +    "version:"1.0",
      +    "params":["address",0,"chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 address true String 出块地址
      1 type true int 惩罚类型 1黄牌,2红牌,0全部
      2 chainId true String 链ID
  • 返回示例

    成功

    {
    +    "code": 0,                                  //错误码
    +    "msg": "success",                           //错误提示信息
    +    "version":"1.0",                            
    +    "result": {                                 //返回的业务数据集  
    +    	"pageNumber":1,                         //页码         
    +    	"pageSize":10,                          //每页数据量
    +    	"total":100,                            //总数据量
    +    	"pages",10,                             //总页数
    +    	"data":[
    +            {
    +                "type",,                        //惩罚类型
    +                "address","",                   //出块地址
    +                "time","",                      //惩罚时间
    +                "height",,                      //区块高度
    +                "roundIndex",,                  //轮次               
    +                "reasonCode",""                  //惩罚原因
    +            },{
    +               ......
    +            }
    +    	]
    +    }
    +}
    +

    失败

    {
    +     "version": 1.0,
    +   	 "code":1,                         //错误码
    +   	 "msg" :"错误提示信息",             //提示信息
    +     "result":{
    +        
    +  	  }
    +}
    +
  • 返回参数说明

    data:

    parameter type description
    pageNumber int 页码
    pageSize int 每页数据量
    total int 数据总量
    pages int 数据总页数
    data List 惩罚列表数据

    Punish:

    parameter type description
    type byte 惩罚类型
    address String 地址
    time String 惩罚时间
    height long 惩罚所在区块高度
    roundIndex long 轮次
    reasonCode String 惩罚原因

2.2.20 查询委托列表(根据委托人、根据节点)

  • 功能说明:

    1.查询指定地址参与的所有委托信息列表
    +2.查询指定账户参与的指定共识节点的委托信息
    +3.查询指定共识节点受托列表信息
    +
  • 流程描述

    - 验证参数正确性
    +- 获取本地主链上参与共识信息列表
    +- 过滤共识列表,获取指定账户参与的共识列表或指定节点受委托的共识列表信息
    +
  • 接口定义

    • 接口说明

      获取指定账户参与的或指定共识节点接受的共识列表信息,当查询指定账户参与的所有共识列表时agentHash字段传"",当需要查询指定节点的所有受委托列表时address字段传""
      +
    • 请求示例

      {
      +    "method":"cs_getDepositList",
      +    "version:"1.0",
      +    "params":[1,10,"address","agentHash","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 pageNumber true int 页码
      1 pageSize true int 每页数据量
      2 address false String 参与委托的账户地址(查询节点受委托信息是该指定传"")
      3 agentHash false String 指定代理节点标识(当查询账户所有委托信息时该字段传"")
      4 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"pageNumber":1,                         //页码         
      +    	"pageSize":10,                          //每页数据量
      +    	"total":100,                            //总数据量
      +    	"pages",10,                             //总页数
      +    	"data":[
      +            {
      +                "agentHash":"",                  //节点hash
      +                "address";"",                   //申请加入共识账户地址
      +                "deposit";,                     //委托金额
      +                "time";,                        //委托时间
      +                "blockHeight";,                 //委托所在区块高度
      +                "delHeight":,                   //共识节点被删除的区块高度         
      +                "txHash":"",                    //交易hash
      +                "status":,                       //共识节点状态(待共识,共识中)
      +                "agentName":"",                  //共识节点名称
      +                "agentAddress":""                //共识节点地址
      +            },{
      +                
      +            }
      +    	]
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      data:

      parameter type description
      pageNumber int 页码
      pageSize int 每页数据量
      total int 数据总量
      pages int 总页码
      data List 共识数据列表的json字符串

      Deposit:

      parameter type description
      agentHash String 共识节点hash
      address String 申请加入共识账户地址
      deposit long 委托金额
      time long 委托时间
      blockHeight long 委托交易所在区块高度
      delHeight long 退出委托交易所在高度
      txHash String 交易hash
      status int 共识节点状态(待共识,共识中)
      agentName String 共识节点名称
      agentAddress String 共识节点地址

2.2.21 查询全网共识状态

  • 功能说明:

    查询全网共识总体信息,包括节点数量,总抵押,参与共识账户总数量等信息
    +
  • 流程描述

    - 获取全网共识节点列表
    +- 过滤共识节点列表,等到合法的共识节点列表
    +- 获取当前打包轮次信息
    +- 根据当前打包轮次信息获取,当前网络参与共识的账户总量及委托金额总量
    +
  • 接口定义

    • 接口说明

      查询全网节点数量,总委托金额,参与共识的账户两及满足打包条件的共识节点数量
      +
    • 请求示例

      {
      +    "method":"cs_getWholeInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"data":{
      +            "agentCount":,                      //节点数量
      +            "totalDeposit":,                    //委托金额总量
      +            "rewardOfDay":,                     //24小时内的奖励金额
      +            "consensusAccountNumber":,          //参与共识的账户数量
      +            "packingAgentCount":                //当前轮次打包共识节点数量
      +    	}
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      agentCount int 节点数量
      totalDeposit long 委托金额总量
      rewardOfDay long 24小时内的奖励金额
      consensusAccountNumber int 参与共识的账户数量
      packingAgentCount int 当前轮次打包共识节点数量

2.2.22 查询单个账户共识状态

  • 功能说明:

    查询指定账户共识信息,包括该账户自己创建的共识节点个数及节点hash,参与共识的总金额,该账户参与的共识节点个数,可用余额,共识奖金,24小时内获取的共识奖金
    +
  • 流程描述

    - 获取全网网络共识节点列表
    +- 查看共识节点列表中是否有该账户创建的共识节点
    +- 获取当前网络委托列表
    +- 从委托列表中获取该账户参与的委托列表
    +- 从该账户的委托列表获取该账户的委托信息
    +
  • 接口定义

    • 接口说明

      查询指定账户共识信息,包括该账户自己创建的共识节点个数及节点hash,参与共识的总金额,该账户参与的共识节点个数,可用余额,共识奖金,24小时内获取的共识奖金
      +
    • 请求示例

      {
      +    "method":"cs_getInfo",
      +    "version:"1.0",
      +    "params":["address","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 address true String 账户地址
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"data":{
      +            "agentCount":,                      //该账户创建的节点个数
      +            "totalDeposit":,                    //该账户总的委托金额
      +            "joinAgentCount":,                  //该账户参与的共识节点个数
      +            "usableBalance":,                   //账户可用余额
      +            "reward":,                          //账户参与共识的所有奖励
      +            "rewardOfDay":,                     //账户24小时内获取的共识奖励
      +            "agentHash":""                      //账户创建的节点的hash
      +    	}
      +    }
      +}
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      parameter type description
      data Object 共识信息
      agentCount int 该账户创建的节点个数
      totalDeposit long 该账户总的委托金额
      joinAgentCount int 该账户参与的共识节点个数
      usableBalance long 可用余额
      reward long 账户参与共识的所有奖励
      rewardOfDay long 账户24小时内获取的共识奖励
      agentHash String 账户创建的节点的hash

2.2.23 验证区块正确性

  • 功能说明:

    验证区块轮次信息,打包人,区块中交易信息,CoinBase是否正确,并验证是否有红黄牌交易生成
    +
  • 流程描述

    - 验证分叉(调用区块管理模块接口),有分叉则生成红牌交易
    +- 验证双花(调用交易模块接口),有双花则生成红牌交易并直接返回验证失败
    +- 生成红牌交易,将红牌交易放入待打包交易池
    +- 验证区块轮次信息及打包人是否正确
    +- 验证区块中交易正确性(调用交易模块接口)
    +- 验证CoinBase交易
    +
  • 接口定义

    • 接口说明

      这个接口主要是验证区块轮次信息,打包人,区块中的交易以及CoinBase是否正确,并验证是否有红黄牌惩罚
      +
    • 请求示例

      {
      +    "method":"cs_validSmallBlock",
      +    "version:"1.0",
      +    "params":["SmallBlock","chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 smallBlock true String SmallBlock的序列化数据
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
    • 返回参数说明

      无
      +

2.2.24 共识模块批量验证

  • 功能说明:

    共识模块交易批量验证,验证每笔交易正确性,验证交易冲突
    +
  • 流程描述

    - 循环验证每笔交易是否正确
    +- 验证交易列表的是否存在冲突交易
    +
  • 接口定义

    • 接口说明

      循环验证传入的交易列表中的每笔交易是否正确,并验证交易列表中是否存在冲突交易
      +
    • 请求示例

      {
      +    "method":"cs_batchValid",
      +    "version:"1.0",
      +    "params":[["tx1","tx2","tx3"],"chainId"]
      +}
      +
    • 请求参数说明

      index parameter required type description
      0 tx1,tx2,tx3...... true String 交易的序列化数据
      1 chainId true String 链id
    • 返回示例

      {
      +    "version":"1.0",  
      +    "code": 0,                                  //错误码
      +    "msg": "提示信息",                           //提示信息                          
      +    "result": {                                 //返回的业务数据集  
      +  		"data":[							 //验证不通过的交易列表
      +  				"tx1_hash",
      +  				"tx2_hash",
      +  				"tx3_hash"
      +  			  ]
      +    }
      +}
      +
    • 返回参数说明

      parameter type description
      data String 验证不通过的交易列表
      tx1_hash,tx2_hash,tx3_hash..... String 验证没通过的交易的hash

2.2.25 获取当前轮次信息

  • 功能说明:

    查询当前网络共识节点的打包轮次信息,包括当前网络有多少处于打包状态的共识节点,本轮次打包的开始结束时间,本轮次所有打包节点的基本信息
    +
  • 流程描述

    无
    +
  • 接口定义

    • 接口说明

      查询当前网络共识节点打包轮次信息
      +
    • 请求示例

      {
      +    "method":"cs_getRoundInfo",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"data":{
      +            "totalWeight":,                      
      +            "index":,                    
      +            "startTime":,                     
      +            "endTime":,          
      +            "memberCount":,
      +            "memberList":[
      +                {
      +                    "agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"Weight":
      +                },{
      +                    
      +                }
      +            ],
      +            "myMember":{
      +                	"agentAddress":"",
      +                    "packingAddress":"",
      +                    "agentHash":"",
      +                    "packingIndexOfRound":,
      +                    "creditVal":,
      +                    "packStartTime":,
      +                    "packEndTime":,
      +					"weight":
      +            }
      +    	}
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • 返回参数说明

      data

      parameter type description
      totalWeight double 总权重(用于计算共识奖励)
      index long 当前轮次下标
      startTime long 当前轮次开始打包时间
      endTime long 当前伦次打包结束时间
      memberCount int 当前打包轮次打包节点数量
      memberList List 当前轮次打包节点打包信息
      myMember MeetingMember 当前节点打包信息

      MeetingMember

      parameter type description
      agentAddress String 节点地址
      packingAddress String 打包地址
      agentHash String 节点ID
      packingIndexOfRound int 共识节点在当前轮次中打包下标
      creditVal double 信用值
      packStartTime long 共识节点打包开始时间
      packEndTime long 共识节点打包结束时间
      weight double 当前共识节点权重(总委托金额*信用值)

2.2.26 指定共识节点状态查询

  • 功能说明:

    查询指定共识节点当前状态(共识中,打包中)
    +
  • 流程描述

    - 查询节点是否存在
    +- 查询节点状态
    +
  • 接口定义

    • 接口说明

      查询指定共识节点当前状态
      +
    • 请求示例

      {
      +    "method":"cs_getAgentStatus",
      +    "version:"1.0",
      +    "params":["agentHash","chainId"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 agentHash true String 节点ID
      1 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	"data":{
      +            "status":1                          //节点状态       
      +    	}
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • 返回参数说明

      parameter type description
      status int 节点状态(0共识中,1打包中)

2.2.27 修改节点打包状态

  • 功能说明:

    本地节点启动时当区块管理模块同步完区块之后通知共识模块打包
    +
  • 流程描述

    - 修改节点打包状态
    +
  • 接口定义

    • 接口说明

      修改节点打包状态
      +
    • 请求示例

      {
      +    "method":"cs_updatePackStatus",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • 返回参数说明

      无
      +

2.2.28 停止链

  • 功能说明:

    暂停某条正在运行的链
    +
  • 流程描述

    无
    +
  • 接口定义

    • 接口说明

      暂停某条正在运行的链
      +
    • 请求示例

      {
      +    "method":"cs_stopChain",
      +    "version:"1.0",
      +    "params":["chainId"]
      +}
      +
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true String 链ID
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	
      +    }
      +}
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
    • 返回参数说明

      无
      +

2.2.29 运行链

  • 功能说明:

    在本地运行一条新的子链
    +
  • 流程描述

    无
    +
  • 接口定义

    • 接口说明

      在本地运行一条新的子链
      +
    • 请求示例

      {
      +    "method":"cs_runChain",
      +    "version:"1.0",
      +    "params":["chainId",1999,8000,12131,24274727,54646,12.5,80.5,200000,700000,2000,500000]
      +}
      +
    • 请求参数说明(待完善)

      index parameter required type description
      0 chainId true String 链ID
      1 packing_interval true long 打包间隔时间(单位:s)
      2 packing_amount true long 出块最小金额
      3 coinbase_lockHeight true long 奖励金锁定块数
      4 redPublish_lockTime true long 获得红牌保证金锁定时间(单位:s)
      5 stopAgent_lockTime true long 注销节点保证金锁定时间(单位:s)
      6 commissionRate_min true double 佣金比列最小值
      7 commissionRate_max true double 佣金比列最大值
      8 deposit_min true int 创建节点保证金最小金额
      9 deposit_max true int 创建节点保证金最大金额
      10 commission_min true int 委托共识最小金额
      11 Commission_max true int 委托共识最大金额
    • 返回示例

      成功

      {
      +    "code": 0,                                  //错误码
      +    "msg": "success",                           //错误提示信息
      +    "version":"1.0",                            
      +    "result": {                                 //返回的业务数据集  
      +    	
      +    }
      +}
      +
      +
      +

      失败

      {
      +     "version": 1.0,
      +   	 "code":1,                         //错误码
      +   	 "msg" :"错误提示信息",             //提示信息
      +     "result":{
      +        
      +  	  }
      +}
      +
      +
      +
    • 返回参数说明

2.3 模块内部功能

​ POC共识机制是由参与共识出块的节点轮流出块,达成共识,共同维护一套账本。但由于网络原因或者是有的共识节点作恶(向不同的节点发送不同的打包块),会出现分叉的情况,对于这种恶意节点系统会根据恶劣程度给与不同的处罚,当轮到某节点出块时未按规定时间出块时系统会给与节点黄牌处罚,该处罚会降低节点的信用值,当节点信用值降到-1时,该节点会被处以红牌惩罚;对于作恶程度恶劣的节点会直接处以红牌惩罚,获得红牌惩罚的节点将会停止打包且该节点永久不能再创建共识节点,且保证金会被冻结一定时间,其他委托该节点的委托金额会返还给委托人;当节点正常出块时,节点会获得出块奖励,委托该节点的账户也会根据委托金额的多少获取相应比例的奖励金。

​ 共识模块除了提供打包出块外,还会做奖励金的统计工作,统计24小时内发放的总的奖励金额,24小时内本地账户累计的奖励金额,24小时内的奖励明细等

  • 共识模块启动流程

    初始化:

    • 1.加载共识模块配置信息(出块间隔时间,奖励金锁定块数)
    • 2.注册共识模块交易、交易验证器、交易处理器(向交易模块注册)
    • 3.注册共识模块服务接口(向核心模块注册)
    • 4.注册共识模块事件(向事件总线模块注册)

    启动:

    • 获取数据库最新一轮区块信息,计算轮次信息
    • 获取当前协议版本信息并缓存
    • 启动各个相关线程
  • 打包出块流程

    • 判断节点是否满足成为打包节点要求
    • 计算打包轮次信息
    • 等待打包出块
    • 接收最新区块,如果等待5秒还没有收到最新的区块,则默认上一个出块节点没有出块,当前节点继续执行打包操作
    • 校验需打包的交易,剔除重复打包交易后打包新区块
    • 校验打包的新区块,并保存相关数据到数据库
    • 广播区块

  • 共识奖励统计

    • 获取本地账户列表
    • 获取24小时内的区块列表
    • 遍历区块列表获取CoinBase交易
    • 根据CoinBase交易,更新24小时内总的奖励金额,24小时内本地账户累计的奖励金额,24小时内的奖励明细

四、事件说明

4.1 发布的事件

4.1.1 区块打包成功事件

说明:当一个新区快打包成功之后发布该事件
+
 event_topic : "evt_cs_packing"
+
data:{
+    "chainId":88,
+    "smallBlock":"smallBlock对象序列化成十六进制字符串"
+}
+

4.1.2 创建节点

说明:当创建节点交易被确认并打包进块之后发布该事件
+
 event_topic : "evt_cs_createAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //打包区块中创建的共识节点列表
+        "agent1",    //Agent对象的序列化为十六进制字符串
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.3 注销节点

说明:当注销节点交易被确认并打包进块之后发布该事件
+
 event_topic : "evt_cs_stopAgent"
+
data:{
+    "chainId":88,
+    "agentList":{    //打包区块中注销的共识节点列表
+        "agent1",    //Agent对象的序列化为十六进制字符串
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.4 共识节点状态改变(共识中,出块中)

说明:当共识节点状态改变时发布该事件
+
 event_topic : "evt_cs_agentStatusChage"
+
data:{
+    "chainId":88,
+    "agentList":{    //打包区块中状态该表的共识节点列表
+        "agent1",    //Agent对象的序列化为十六进制字符串
+        "agent2",
+        "agent3"
+    }
+}
+

4.1.5 委托共识

说明:当委托共识交易被确认并打包进块之后发布该事件
+
 event_topic : "evt_cs_deposit"
+
data:{
+    "chainId":88,
+    "depositList":{     //打包区块中委托列表
+        "deposit1",     //Deposit对象序列化为十六进制字符串
+        "deposit2"
+    }
+}
+

4.1.6 退出共识

说明:当退出共识交易被确认并打包进块之后发布该事件
+
 event_topic : "evt_cs_withdraw"
+
data:{
+    "chainId":88,
+    "depositList":{     //打包区块中退出委托列表
+        "deposit1",     //Deposit对象序列化为十六进制字符串
+        "deposit2"
+    }
+}
+

4.1.7 黄牌惩罚

说明:当有共识节点获得黄牌惩罚是发布该事件
+
 event_topic : "evt_cs_yellowPublish"
+
data:{
+    "chainId":88,
+    "yellowPublishList":{    //打包区块中黄牌列表
+        "yellowPublish1",    //YellowPublish对象序列化为十六进制字符串
+        "yellowPublish2"
+    }
+}
+

4.1.8 红牌惩罚

说明:当有共识节点获得红牌交易时获得该事件
+
 event_topic : "evt_cs_redPublish"
+
data:{
+    "chainId":88,
+    "redPublishList":{    //打包区块中红牌列表
+        "redPublish1",    //RedPublish对象序列化为十六进制字符串
+        "redPublish2"
+    }
+}
+

4.2 订阅的事件

无
+

五、协议

5.1 网络通讯协议

broadBlock

  • 发送新区块(SmallBlock)
  • 根据hash获取区块
  • 发送完整区块
  • 根据高度获取多个区块
  • 根据交易hash列表获取交易列表
  • 发送交易列表
  • 根据hash获取SmallBlock
  • 根据高度区间获取区块hash列表
  • 根据高度区间获取SmallBlock列表

用于广播打包的新区快

Length Fields Type Remark
4 chainId int 链ID
?? smallBlock String SmallBlock对象序列化的十六进制字符串

六、模块配置

{
+    {
+        "name": "packing_interval",
+        "remark": "打包间隔时间",
+        "changable": "true",
+        "default": "10秒"
+    },
+    {
+    	"name": "packing_amount",
+        "remark": "出块最小金额",
+        "changable": "true",
+        "default": "200000"
+    },
+    {
+    	"name": "coinbase_unlock_height",
+        "remark": "奖励金锁定块数",
+        "changable": "true",
+        "default": "100"
+    },
+    {
+    	"name": "redPublish_lockTime",
+        "remark": "获得红牌保证金锁定时间",
+        "changable": "true",
+        "default": "3个月"
+    },
+    {
+    	"name": "stopAgent_lockTime",
+        "remark": "注销节点保证金锁定时间",
+        "changable": "true",
+        "default": "3天"
+    },
+    {
+    	"name": "commissionRate_min",
+        "remark": "佣金比例的最小值",
+        "changable": "true",
+        "default": "10"
+    },
+    {
+    	"name": "commissionRate_max",
+        "remark": "佣金比例的最大值",
+        "changable": "true",
+        "default": "80"
+    },
+    {
+    	"name": "deposit_min",
+        "remark": "创建节点的保证金最小值",
+        "changable": "true",
+        "default": "20000"
+    },
+    {
+    	"name": "deposit_max",
+        "remark": "创建节点的保证金最大值",
+        "changable": "true",
+        "default": "700000"
+    },
+    {
+    	"name": "commission_min",
+        "remark": "委托最小值",
+        "changable": "true",
+        "default": "2000"
+    },
+    {
+    	"name": "commission_max",
+        "remark": "委托最大值",
+        "changable": "true",
+        "default": "680000"
+    }
+}
+

七、Java特有的设计

八、补充内容

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/eventBusModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/eventBusModuleDesign.html new file mode 100644 index 00000000..cab9276c --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/eventBusModuleDesign.html @@ -0,0 +1,115 @@ + + + + + + 事件总线模块设计 | NULS + + + + + + + +

事件总线模块设计

事件总线模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《事件总线》模块

事件总线模块是专门用来接收及通知处理模块事件的功能性模块,管理着所有模块事件。

1.1.2 《事件总线》要做什么

提供事件的订阅、接收、发送等功能,是模块间的事件中转站

1.1.3 《事件总线》在系统中的定位

事件模块是一个边缘系统,提供主要一些异步的消息发送,也就说,即使没有事件总线,系统一样可以正常运行,比较轻量级,而且不依赖其他模块系统。

1.2 架构图

event-bus-module

  • 事件总线模块主要含2部分交互逻辑: +
    • 与系统核心模块的微服务注册与服务信息获取。
    • 与其他基础模块间的事件消息创建、订阅、转发管理。

二、功能设计

2.1 功能架构图

event-bus-content

2.2 模块服务

event-bus-model

该模块提供事件的订阅,事件的转发

2.2.1 修改系统运行参数

只依赖核心系统,核心系统可以对事件模块系统的启动,停止,参数修改等,

2.3 模块内部功能

event-bus-function

模块内部工能主要包含,订阅管理器,事件管理器,转发管理器。

  • 微服务接口信息同步管理 +
    • 用于与kernel服务治理模块之间的服务接口同步
  • 事件储存管理(eventBus) +
    • 用于进行事件信息的创建,订阅等储存,并且在模块重启是进行信息的初始化。
  • 事件订阅管理(subscribe) +
    • 维护订阅事件的“配置表”:包括所有各个模块订阅的重要参数
  • 事件转发管理(dispatcher) +
    • 开放接口用于事件的接收,对接收事件按订阅进行转发,转发调用接口通过服务信息管理接口获得
  • 功能接口管理(rpc) +
    • 开放查询接口供外部查询

2.4 事件总线流程

  • 事件处理时序

event-bus-seq-flow

  • 事件处理基本流程

event-bus-main-flow

2.5 业务逻辑

在事件转发失败(比如网络原因)情况下进行的异常逻辑处理 ,按以下2种逻辑处理:

  • 1、保留事件调用 按队列重复调用,直到转发成功。
  • 2、尝试多次后直接丢弃,(暂定5次)每10秒后重试一次。

三、接口设计

3.1 模块接口

3.1.1 事件主题订阅

cmd: subscribe

参数说明 (request body)
{
+  "cmd": "subscribe",
+  "min_version": "1.0",
+  "params":[
+    "app.nuls.network.bandwidth",//topic 事件主题
+    "moduleId" //moduleId订阅者模块id
+  ]
+}
+
返回值说明 (response content)
{
+  "version": "1.0",
+  "code": 0,//操作码
+  "msg": "reponse message.",//失败时的信息
+  "result": {
+    "app_secret": "xxxxxxxxxxxx" // app_secret,暂时不需要,后期如果需要不是本机调用可能需要验证
+  }
+}
+

3.1.2 事件取消订阅

cmd: unsubscribe

参数说明 (request body)
{
+"cmd": "unsubscribe",
+"min_version": "1.0",
+"params":[
+  "app.nuls.network.bandwidth", //topic 事件主题
+  "moduleId" //moduleId订阅者模块id
+  ]
+}
+
返回值说明:(response content)
{
+  "version": "1.0",
+  "code": 0, //操作码
+  "msg": "reponse message.",//失败时的信息
+  "result": {
+  }
+}
+

3.1.3 事件发送【自动创建topic】

在没人订阅情况下是否保留一定时间?

cmd: send

参数说明(request body)
{
+ "cmd": "send",
+ "min_version": "1.0",
+ "params":[
+   "app.nuls.network.bandwidth",//topic 事件主题
+   "moduleId", //moduleId订阅者模块id
+   {"key" : "data value"} // 需要发送的事件,jsonObj
+ ]
+}
+
返回值说明(response content)
{
+  "version": "1.0",
+  "code": 0, //操作码
+  "msg": "reponse message.",//失败时的信息
+  "result": {
+  }
+}
+

3.1.4 事件广播(推送push or dispatcher)

需要每个接口在订阅事件时提供接口,我在广播时调用即可,我这里是多线程去掉你们接口,你们需要返回正确的code,否则会有走重试机制

参数说明(request body)
{
+ "cmd": "dispatcher",
+ "min_version": "1.0",
+ "params":[
+   {} //data 需要发送的事件,payload
+ ]
+}
+
返回值说明(response content)
{
+  "version": "1.0",
+  "code": 0, //一定要正确返回,不要需要告诉你业务逻辑是否出错,你只要接收到了就告诉我你成功接收到了即可。
+  "msg": "reponse message.",//失败时的信息
+  "result": {
+  }
+}
+

3.2 功能接口

功能接口是提供给界面和命令行工具使用的接口

获取事件主题信息

cmd: topics

参数说明(request body)
{
+ "cmd": "topics",
+ "min_version": "1.0",
+ "params":[]
+}
+
返回值说明(response content)
{
+  "version": "1.0",
+  "code": 0, //一定要正确返回,不要需要告诉你业务逻辑是否出错,你只要接收到了就告诉我你成功接收到了即可。
+  "msg": "reponse message.",//失败时的信息
+  "result": {
+    "topics":[{
+        "topic": "",  //主题id
+        "createTime":"",	//创建时间
+        "moduleId":"",   //主题创建者(模块)Id
+        "subscribes":[//订阅者信息
+            {
+                "moduleId":"", //订阅者
+                "subscribeTime":"" //订阅时间
+            }
+        ]}
+    ]
+  }
+}
+

获取事件主题信息(包含该主题上所有事件信息?) 每个事件其实我不关心的。

cmd : get_topic

四、事件说明

不依赖任何事件

五、协议

5.1 网络通讯协议

5.2 交易协议

六、模块配置

6.1 配置说明

一般支持性配置,端口,重试次数,重试时间,默认执行器的线程池大小,网络调用超时配置等。

server:
+  ip: 127.0.0.1   //本机ip,用于提供服务给其他模块,可以不填,默认自动获取
+  port: 8080    //提供服务的端口,可以不填,默认自动获取
+

6.2 模块依赖关系

  • 内核模块 +
    • 模块注册
    • 模块注销
    • 模块状态上报(心跳)
    • 服务接口数据获取及定时更新

七、Java特有的设计

核心对象类定义,存储数据结构,......

八、补充内容

上面未涉及的必须的内容

Last Updated: 2019-1-11 13:47:19
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocol.html b/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocol.html new file mode 100644 index 00000000..10d16d63 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocol.html @@ -0,0 +1,66 @@ + + + + + + 通用协议设计 | NULS + + + + + + + +

通用协议设计

Protocol design

[TOC]

Common standards

Hashes

Usually, when a hash is computed within Satellite-chain, it is computed twice. Most of the time SHA-256 hashes are used, however RIPEMD-160 is also used when a shorter hash is desirable (for example when creating a NULS address).

Example of double-SHA-256 encoding of string "nuls":

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round of sha-256)
+7e0590c37ab91aacabdac1bedec9ff6acd609215d019e489cc0a5dcf38b7b055(second round of sha-256)
+
+

For NULS addresses (RIPEMD-160) this would give:

nuls
+96cc377699e3289875d6d40da436110d692e823eb8900ae13a7107cb36c7310c (first round is sha-256)
+f8e8d1c6f1511c356effad8b986b0aa439a88c44(with ripemd-160)
+

Merkle Trees

Merkle trees are binary trees of hashes. Merkle trees in NULS use a double SHA-256, the SHA-256 hash of the SHA-256 hash of something.

If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.

First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.

Then the row above it consists of half that number of hashes. Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.

This procedure repeats recursively until we reach a row consisting of just a single double-hash. This is the Merkle root of the tree.

For example, imagine a block with three transactions a, b and c. The Merkle tree is:

d1 = dhash(a)
+d2 = dhash(b)
+d3 = dhash(c)
+d4 = dhash(c)            # a, b, c are 3. that's an odd number, so we take the c twice
+
+d5 = dhash(d1 concat d2)
+d6 = dhash(d3 concat d4)
+
+d7 = dhash(d5 concat d6)
+
+

where

dhash(a) = sha256(sha256(a))
+
+

d7 is the Merkle root of the 3 transactions in this block.

Addresses

A NULS address is in fact the hash of a ECDSA public key, computed this way:

ChainId = 2 byte,The ID of the chain in which the account belongs.
+addressType = 1 byte,The type of the account,Example: 1 general account, 2 contract account……
+pkh = 20 byte , RIPEMD-160(SHA-256(public key))
+xor = 1 byte, XOR(chainId+addressType+pkh)
+address = Base58Encode(chainId+addressType+pkh+xor)
+

非nuls体系的地址格式如下:

例如:比特币地址,在地址之前追加两个字节的chainId,之后跟随比特币的原始地址,地址解析方式根据链配置决定

address = Base58Encode(chainId+原始地址长度+原始地址+xor)
+

Message Structre

Satellite-chain uses custom messaging for communication over the TCP protocol.

  • Digital binary stream using little endian。
  • Floating point numbers convert to integers and transfer by little endian

Message

The message consists of a 24-byte header and payload.

*---------------------------------------------------------------*
+|       Header(24 Byte)         |            Payload            |
+*---------------------------------------------------------------*
+

message header

The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets.

Len Fields Data Type Remark
4 MagicNumber uint32 Packet valid flag
12 command char[12] ASCII string identifying the packet content, NULL padded
4 PayloadLength uint32 Length of payload in number of bytes
4 checksum uint32 First 4 bytes of sha256(sha256(payload))

[^MagicNumber]: MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test.

Common Structre

VarInt

Variable-length integers that can be encoded based on the values expressed to save space.

Value Len Structure
< 0xfd 1 uint8
<= 0xffff 3 0xfd + uint16
<= 0xffffffff 5 0xfe + uint32
> 0xffffffff 9 0xff + uint64

VarString

A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8.

Len Fields Data Type Remark
? length VarInt Length of the string
length value uint8[length] The string itself

VarByte

Variable-length buffer, consistent with the VarString implementation.

Len Fields Data Type Remark
? length VarInt Length of payload in number of bytes
length data byte[length] payload

Int48

6-byte number.

Network address

When a network address is needed somewhere, this structure is used.

Len Fields Data type Remark
16 IPv6/4 char[16] IPv6/4 address. Network byte order. The IPv4 address is written into the message as a 16 byte
2 port1 uint16 port number, network byte order
2 port2 uint16 port number,for cross-chain module

Block_headers

Len Fields Data Type Remark
4 version uint32 version bumber
32 preHash byte[32]
32 merkleRoot byte[32]
stateRoot VarByte
4 time uint32 second
2 txCount uint16
extends VarByte 本字段内容不同的链可设置不同的约束
? signature Varbyte

Transactions

Len Fields Data Type Remark
2 type uint16 交易类型
4 time uint32 时间,精确到秒
txData VarByte 业务数据
coinData VarByte 资产数据
remark VarString 备注
sig VarByte 只包含签名,不包含pubkey

交易特性

多账户转出
+多账户转入
+多资产转账
+

coinData结构

froms://List<CoinForm>格式,
+tos://List<CoinTo>格式
+

CoinForm结构[40]

address:  //byte[24] 账户地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount:  //uint128,转出数量
+nonce  : //byte[8] 交易顺序号,前一笔交易的hash的前8个字节
+locked : //byte 是否是锁定状态(locktime:-1),1代表锁定,0代表非锁定
+

CoinTo结构[44]

address:  //byte[24],目标地址
+assetsChainId://uint16 资产发行链的id
+assetsId: //uint16 资产id
+amount :  //uint128,转账金额
+lockTime://uint32,解锁高度或解锁时间,-1为永久锁定
+

手续费

forms-tos剩余的部分就是手续费(模型中支持多种资产缴纳手续费,约束条件由经济模型设计决定)
+

Message Types

参考各个模块

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocolDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocolDesign.html new file mode 100644 index 00000000..aface390 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/generalProtocolDesign.html @@ -0,0 +1,21 @@ + + + + + + 总体设计 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/howToUseNulsBuildChain.html b/docs/.vuepress/dist/zh/NULSInfrastructure/howToUseNulsBuildChain.html new file mode 100644 index 00000000..036acbb5 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/howToUseNulsBuildChain.html @@ -0,0 +1,96 @@ + + + + + + [Alpha]如何使用NULS搭建区块链 | NULS + + + + + + + +

[Alpha]如何使用NULS搭建区块链

NULS2.0 开发环境搭建

NULS2.0是一个开放的不限制语言的区块链底层平台,本文只参考区块链核心业务模块的情况,编写Java环境搭建流程。

1 环境准备

  • 安装JDK
  • 安装Maven
  • 安装IntelliJ IDEA开发工具
  • 安装git

2 clone源代码

git clone git@github.com:nuls-io/nuls_2.0.git

3 IDEA导入nuls_2.0中所有maven项目

4 建立自己的maven项目

5 运行所有需要启动的模块

使用NULS2.0核心模块搭建基础链

NULS是一个全球开源的区块链底层基础设施,让区块链更简单是NULS的使命,本文将描述如何使用NULS核心模块,快速搭建一条基础区块链。

NULS并不限制区块链的属性,使用NULS底层可以搭建私链、联盟链、公有链,可以搭建有币区块链,也可以搭建无币区块链。

1 理解NULS 2.0的微服务架构

img

NULS 2.0基于微服务架构搭建,内置了区块链核心业务模块,包括账户、交易、区块、共识等,当我们要基于NULS 2.0搭建基础区块链时,我们将基于NULS 2.0区块链通用基础功能层进行扩展。

因为NULS2.0中已经包含了区块链的基础功能,在开发自己的区块链时,只需要整理自己独有的业务功能,抽象出对应的协议,将功能开发为一个模块插入到NULS2.0中即可。举个例子:假设我们要实现一条“记事本链”,在NULS的基础上我们需要设计“记事本”的业务交易,比如记事交易、删除记事交易,我们的业务模块需要做的是,在本模块中添加业务逻辑代码,并实现两个交易的验证、处理、回滚功能,然后将交易信息上报给交易管理模块,处理交易相关逻辑。

理解了如何进行区块链功能拓展,就可以根据下面的步骤,详细设计自己的功能模块了。

2 修改基础配置信息

一条区块链要运行起来,需要非常多的基础配置,每条区块链都要有自己的配置参数,在搭建一条新的区块链时,第一件事就是配置自己的运行参数。

NULS2.0的启动脚本支持传入配置文件的方式启动区块链,使用方式如下:sh start.sh -c modules.ncf

modules.ncf内可以配置各个模块的参数,开发者可以根据自己的链的情况自行修改运行参数,具体运行参数预设如下:

section param name remark
common chain.id 本链id Uint16,NULS主网为1,测试网为2
common address.prefix 地址前缀 大小字母+数字,2-5个字符
common data.root.dir 数据存储路径 为了所有模块都存储在同一个目录,如有需要可以在任意模块内配置特殊的路径
common encoding 编码方式 默认UTF-8,不建议修改
common asset.id 本来主资产编码 NULS为1
common log.root.dir 日志根目录 用于存放各个模块的日志文件
common log.level 日志级别 日志打印级别debug/info/warn/error.
block data.folder data子文件夹 用于存储block模块数据,该文件夹放在#{data.root.dir}下
block block.max.size 区块最大size 区块大小限制,避免太大区块太高参与门槛
block block.interval 出块间隔
block max.rollback 最大回滚数量 当超过这个数量后,系统将停止回滚,避免出现重大问题
block header.extend.max.size 扩展最大size 区块头中的扩展字段的大小限制
block genesis.block.json.path 创世块描述文件 创世块的描述文件
consensus data.folder data子文件夹 用于存储共识模块数据,该文件夹放在#{data.root.dir}下
consensus packing.interval 出块间隔
consensus inflation.token.count 每年增发数量 增发数量用于通过coinbase交易奖励给节点
consensus block.max.size 区块最大size
consensus seed.addresses 共识种子地址 多个地址用","分隔
consensus packing.address.pwd 地址密码 用于打包的地址的密码
consensus agent.deposit.min 创建节点时最小保证金数量
consensus agent.deposit.max 创建节点时最大保证金数量
consensus commission.rate.max 佣金比例最大值,不能大于100
consensus commission.rate.min 佣金比例最小值
consensus deposit.min 单笔委托最小金额
consensus agent.total.deposit.max 节点接受委托的最大金额
consensus packing.token.min 当节点的委托达到该值则开始出块
consensus red.punish.lock.time 红牌锁定时间
consensus agent.stop.lock.time 停止节点锁定时间
network data.folder data子文件夹
network seeds 种子节点,多个之间用","隔开
network magic.number 魔法数字,用于隔离其他网络
network port 端口
network nuls.seed 需要进行跨链时,配置NULS2.0种子节点
network cross.listener.port
network nuls.magic.number
contract nrc20.file.path NRC20协议描述json文件路径
tx data.folder data子文件夹
Ledger data.folder data子文件夹
api mongodb.ip mongodb地址
api mongodb.port mongodb端口
api rpc.listener.ips rpc监听ip 可以配置多个
api rpc.port rpc监听端口
api req.allow.per.s 并发限制

表格中列出的是可能比较常用的配置项,并不是全部,在经过alpha版本和beta版本后,团队会整理所有NULS2.0的可用配置清单,用于广大区块链开发者配置自己的区块链。

3 打包和启动

链的配置项修改完成后,则可直接参考本文档的第4部分:打包和启动

搭建包含业务模块的区块链

在使用NULS2.0的模块化基础设施搭建了自己的区块链之后,想要实现自己的独特业务,就需要自己开发一个业务模块,整合到基础链中。下面的内容可以对如何开发一个自己的业务模块做一些指导。

1 业务模块说明

1.1 何为业务模块

基于区块链底层进行扩展的带有自定义业务的功能模块,该模块可以是遵循NULS2.0模块协议、可以与其他模块通信的微服务模块,也可以是一个独立的、只通过RPC接口与基础模块通信的外部应用。

业务模块不进行协议的增加和修改,只对基础协议进行扩展,通过协议的扩展,实现自身业务。

1.2 如何扩展协议

NULS提供了两种方式可以对协议进行扩展,两种方式比较类似,具体方式如下:

  • 通过转账交易的remark字段进行扩展

将想要上链的数据,序列化为字节数组,放入转账交易的remark字段。在字节数组的最前面放置自己的魔法数字,用于区别其他的转账交易。在自己的应用中监听所有区块中的转账交易,当发现以自己的魔法数字开头的remark时,进行解析和业务处理。

  • 通过制定的业务扩展交易进行扩展

NULS为业务扩展提供了特定的交易类型,该交易可以自由填写txData,将想要上链的数据,序列化为字节数组,放入转账交易的txData中。在字节数组的最前面放置自己的魔法数字,用于区别不关心的交易。在自己的应用中监听所有区块中的业务扩展交易,当发现以自己的模块数字开头的txData,进行解析和业务处理。

示例:

假设现在要实现一个应用,该应用的业务是:私密记事本,核心业务就是每个地址可以将加密后的记事文本存储到区块链上,在任意时候可以解密查看。

1 功能设计

1. 新增记事:对记事内容进行加密,将加密后的数据发送到链上;
+
+2. 解析区块数据提取记事数据:从区块链上获取本应用的数据,并将数据存储到本地数据库;
+
+3. 解密查看:从数据库中获取记录,解密,展示解密结果
+
+4. 删除记事:app本地删除,不删除区块链中数据
+

2 区块链交互

以上功能设计需要和区块链进行交互的就是1新增记事和2解析区块数据提取记事数据。

  • 第一个功能的实现思路如下:
首先设计数据格式,如下
+
+{
+
+  address:"",//记事所属人
+
+  time:"",//记事时间点
+
+  content:""//加密后的记事内容
+
+}
+
+根据数据格式,组装上链数据:address+time+content;
+
+确定应用的魔法数字,假设为12345678.
+
+则组装DataTransaction(业务扩展交易),将txData的值设置为12345678、address、time、content的拼接字节数组,支付足够的手续费后,对交易进行签名,将交易广播到网络中。
+
  • 第二个功能的实现思路如下:
监听所有的区块,发现'业务扩展交易'则进行解析,首先解析到txData时,先判断是否是已12345678开始的,
+如果不是则丢弃该交易,如果是则继续解析,判断是否成功获取了address+time+content(避免魔法数字重复导致数据混乱)
+如果成功解析了数据,则将数据存储到本地数据库中
+

3 其他业务实现

所有不需要与区块链交互的业务,就可以通过常规的应用方式进行设计了,这样一个简单的区块链应用就完成了。

使用业务扩展的方式开发应用,是一个简单快捷高效的方式,NULS对业务扩展的支持是充分而友好的,希望越来越多的人加入到NULS生态建设中来。

2 需求分析

在动手开发模块之前,首先要确定几个问题:

  • 自己需要的是什么样的功能?
  • 是否一定需要添加模块来实现业务需求?是否可以通过已有的功能用更简单的方式实现?
  • 用哪种方式实现这个模块? +
    • 扩展基础协议的方式:不再新增协议,在基础协议的基础上拓展自己的业务就能满足自己的需要。
    • 增加新协议方式:需要新增协议、新增协议对应的业务逻辑,才能满足自己的需要
    • 修改基础链:以上两种都不能实现自己的业务,需要对基础模块进行修改才能满足自己的需求。

3 模块设计

在确定了自己的需求后,需要对自己的模块进行设计。模块设计依存于NULS2.0的整体设计,在设计自己的模块时,可以着重设计自己的业务,其他部分依照基础模块实现。

那么如何设计自己的业务?举例说明:

3.1 扩展基础协议的方式:

第Ⅰ种情况:我们的需求只是需要将一些关键信息存储上链,没有复杂的逻辑处理。
+比如我们只是想存储一份合同的相关信息在链上,且能够在链上随时查询到。这个时候实际上我们是没有必要去开发任何模块的。nuls2.0提供了一种专门用于存储数据的交易(DataTransaction),用户只需要将数据转换成字节数组存放在交易的txData字段或者remark字段中,广播交易到全网后,数据即可成功上链。再通过nuls2.0提供的查询交易接口,就能随时查询到交易和交易的相关数据。这样其他的业务功能可以以通用软件的方式进行设计和开发。
+
+第Ⅱ种情况:我们的需求需要将一些关键信息存储上链,并且需要有简单逻辑处理。
+一般这种情况,我们会推荐用户考虑使用智能合约做DAPP的开发,例如做简单的竞猜类游戏等。
+

3.2 新增协议的方式

如果我们的需求比较复杂,且有相关的逻辑流程处理,必须要通过添加新的协议来完成。
+这里我们就用nuls的poc共识机制来举例
+功能设计:先根据需求整理要提供的功能,根据功能设计新的协议。
+nuls的poc共识机制的业务功能有:
+1. 用户可以通过发送申请共识节点的交易,锁定2-20万的nuls来新建共识节点,待节点满足出块条件后,可参与打包出块,获得出块奖励。
+2. 用户可以通过发送加入委托共识的交易,至少锁定2000个nuls来参与共识,获得出块奖励。
+3. 用户可以通过发送取消委托共识的交易解锁委托共识时锁定的nuls,取消委托后,不再继续得到奖励。
+4. 用户可以通过发送交易让节点退出共识,退出后委托在节点上的所有nuls都会解锁,节点不再参与出块。
+
+协议设计:包括协议的序列化和反序列化、交易验证器、交易确认处理器、交易回滚处理器,需要注意和基础协议避免冲突。
+poc共识机制的4个协议:创建共识节点交易、委托交易、取消委托交易、节点退出共识交易
+交易验证器:每个协议都会有相关的业务验证器,在节点收到新的交易或者在收到新的区块时,便会执行验证器,验证失败的交易直接拒绝。
+例如创建共识节点:
+	1)创建节点的账户不能重复多次创建共识节点;
+	2)保证金在2-20万nuls之间;
+	3)账户是否有过红牌记录;
+存储设计:将协议中的业务数据,存储为格式化数据,用于提供用户功能。
+例如创建共识节点后,底层会存储创建节点的交易数据,还会存储节点的相关信息,例如共识节点名称,共识节点当前的委托总量,共识节点的信用值等
+
+接口设计:需要对外提供的RPC接口
+例如:查询共识节点信息,查询共识委托信息等
+
+其他:其他的内部处理机制则根据不同的业务需求,在模块自己内部实现,例如poc共识的核心处理都在ConsensusProcess里
+

3.3 修改基础链的方式

本方式与方式二区别只在于涉及对基础链的修改,在修改时需要先对基础链的业务进行充分的理解,对自己的业务进行适配后需要进行充分的测试。
+修改的方法可以是替换模块的方式:获取基础链模块的源代码,对其进行修改,然后发布自己的模块替换原始的基础模块。
+

4 模块实现

首先模块由下面两部分组成,对于第一部分,目前官方只提供了Java版本的lib,后续会陆续提供C++,Go等其他语言版本。

1、nuls-service-base-lib(baselib):

通用的、所有模块中功能都一样的依赖包,提供基础的通信、接口格式、通用代码等内容,如果开发者使用未提供baselib的语言,则需要自己开发baselib。

2、module-self:

模块本身,在一下几方面需要做出自己的实现:

  • 模块管理

    1、启动、停止脚本:在自己的模块中,提供模块的启动和停止脚本,并且保证任何时机执行启动和停止脚本不会对业务和数据造成重大影响。

    2、启动后进行状态管理,首先通过启动参数连接到Nulstar(微服务管理器),上报自己模块的信息,同时获取到依赖模块的信息,尝试与依赖模块通信,在此期间完成自己模块的初始化,并变更自己模块的状态。在依赖的所有模块都ready后,开始运行自己模块的业务。

    3、当依赖的模块状态变更后,本模块要根据变更的状态进行处理

  • 协议相关

    当模块中创建了新的交易后,需要在每次模块启动时向交易管理模块注册自己的协议信息,同时上报交易的验证器、确认处理器、回滚处理器信息。

  • 网络消息

    当新模块增加了网络协议后,需要向网络模块订阅自己需要的网络的消息,让网络模块接到消息后可以把消息发送到模块的消息处理器中。

  • 数据存储

    NULS2.0不对数据存储做任何限制,可以根据自己的业务需要自由的设计、实现自己的数据存储功能。

  • 功能实现

    如果有其他功能需要实现,可以按照自己的习惯或者行业的标准规范进行开发,NULS2.0不做任何限制。

  • 功能接口

    根据产品设计进行功能接口的实现,NULS2.0底层会提供统一的接口调用方式,会支持JSONRPC2.0/restFul/CMD/WebSocket等访问方式。

  • 日志记录

    NULS2.0原则上不对扩展模块的日志记录方式进行限制,但建议参考基础链的方式将所有日志归集到一个根目录中,便于备份和查看。

总结:业务模块的扩展可以参考底层基础链,所有的模块在NULS2.0的架构中都是平等的,遇到不清楚的地方可以通过查看基础模块代码的方式借鉴或者复制基础模块的解决方式,后续会陆续开源一些项目的扩展模块,让广大开发者借鉴,使开发模块变得越来越简单。

5 定义自己的协议

  • 设计协议的原则:数据精简,不要再协议中增加冗余数据,尽可能减小数据大小。

  • 网络消息: 消息格式,序列化方法、反序列化方法,计算数据大小方法、订阅接口和逻辑处理器。

  • 交易:交易格式,序列化方法、反序列化方法,计算数据大小方法、验证器、处理器、回滚处理器等。

6 调试

完成了设计和开发工作后,不可避免的要进行测试,本部分内容不包含开发过程中的单元测试部分,这里只讲解集成测试的方法和注意事项。

1、首先通过NULSTAR启动所有模块,查看自己的新增模块是否可以正常启动和停止;
+
+2、测试新增模块的交易是否可以发送,各种接口是否可以正常调用;
+
+3、主网测试,是否可以正常打包区块,新增交易是否可以被确认、回滚;
+
+4、检查交易验证逻辑是否严谨,不要出现安全漏洞;
+
+5、测试自身模块的业务是否正确、完整。
+

全部测试都完成后,便可进入打包和启动阶段了

打包和启动

1 打包

NULS2.0有自己的代码打包机制,因为涉及不同语言和不同开发环境,我们制定了一套独有的打包规范,请确保新开发模块遵循打包规范,已经提供了规范中要求的依赖、脚本等组件,并对打包流程进行测试

cd /home/nuls2/nuls_2.0
+./package.sh -m
+

确认没有问题后,完成区块链的开发工作,可以将打包后的程序包交给相关方进行公开测试,在测试一段时间后没有发现问题,就可以正式组件区块链网络,开始自己的业务。

2 启动

  • 编译成功 会生成如下路径文件
/home/nuls2/nuls_2.0/RELEASE/bin
+
  • 执行如下命令,即可一键批量启动所有模块
cd /home/nuls2/nuls_2.0/RELEASE/bin
+./start.sh -c ./moudle.json(指定moudle.json配置文件启动)
+
  • linux指令 jps 查看所有模块进程:
 ./start.sh  --jre $JAVA_HOME --managerurl 192.168.1.124:8887/ws
+
  • 查看模块启动状态
./checkstatus.sh  
+
  • 停止 工程模块:
kill  进程号(进程号对应jps显示出来的 mykernel 模块的进程)
+
Last Updated: 2019-3-26 18:13:19
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/interfaceStandard.html b/docs/.vuepress/dist/zh/NULSInfrastructure/interfaceStandard.html new file mode 100644 index 00000000..2f3ab3f4 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/interfaceStandard.html @@ -0,0 +1,35 @@ + + + + + + 接口交互格式与规范 | NULS + + + + + + + +

接口交互格式与规范

接口交互格式与规范 JSON-RPC

Request Body

{
+  "cmd": "nuls_accounts",
+  "params": ["param1", "param2"],
+  "min_version": 1.0,
+}
+
  • 请求参数
参数 必选 类型 说明
cmd true string 执行的 Command
params true array 命令参数表
min_version false float 兼容的最低版本

Response Body

  • success
{
+  "code":0,
+  "msg": "Success",
+  "result": {}
+}
+
  • 响应参数
参数 必选 类型 说明
code ture int 请求想要状态,成功返回0。否则返回错误码
msg true string 用户友好的请求执行结果描述
result true object 方法返回值

Error Code

JSON RPC Standard errors

Code Possible Return message Description
0 Success Operation success
1 Parse error Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
2 Invalid Request The JSON sent is not a valid Request object.
3 Method not found The method does not exist / is not available.
4 Invalid params Invalid method parameter(s).
5 Internal error Internal JSON-RPC error.
6 Unauthorized Should be used when some action is not authorized, e.g. sending from a locked account.
7 Action not allowed Should be used when some action is not allowed, e.g. preventing an action, while another depending action is processing on, like sending again when a confirmation popup is shown to the user (?).
8 Timeout Should be used when an action timedout.
9 Conflict Should be used when an action conflicts with another (ongoing?) action.
10 Execution error Will contain a subset of custom errors in the data field. See below.
11 to 100 Server error Reserved for implementation-defined server-errors.

Custom error fields

Custom error 10 can contain custom error(s) to further explain what went wrong.

{
+    code: 10,
+    msg: 'Execution error',
+}
+
Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/ledgerModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/ledgerModuleDesign.html new file mode 100644 index 00000000..d6db6a3a --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/ledgerModuleDesign.html @@ -0,0 +1,111 @@ + + + + + + 账本模块设计文档 | NULS + + + + + + + +

账本模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《账本模块》

账本模块是区块链的数据中枢,所有账户的余额、交易都保存在账本模块中, +每一个全网节点上都会保存一个全网账本,保证了数据的完整、公开、透明,同时保证了数据不可篡改、可追溯

1.1.2 《账本模块》要做什么

为组装交易提供数据支撑,主要就是记账和查账,验证交易的合法性,如:是否有充足的余额,是否重复支付(双花)

1.1.3 《账本模块》在系统中的定位

账本模块是数据中枢,保存系统所有存在交易的结果数据,它不依赖任何业务模块,其他模块按需依赖它。

1.1.4 《账本模块》中名词解释

  • 交易的随机数(nonce,一个32位hash值) +
    • nonce:与此地址发送的交易数量相等的标量值,用户发起的每一笔交易中都会包含该nonce。
    • 在该账户每笔交易都需要保存前一笔交易的nonce(hash)
    • 严格地说,nonce是始发地址的一个属性(它只在发送地址的上下文中有意义)。但是,该nonce并未作为账户状态的一部分显式存储在区块链中。
    • nonce值也用于防止帐户余额的错误计算。例如,假设一个账户有10个NULS的余额,并且签署了两个交易,都花费6个NULS,分别具有nonce 1和nonce 2。这两笔交易中哪一笔有效?在区块链分布式系统中,节点可能无序地接收交易。nonce强制任何地址的交易按顺序处理,不管间隔时间如何,无论节点接收到的顺序如何。这样,所有节点都会计算相同的余额。支付6以太币的交易将被成功处理,账户余额减少到4 ether。无论什么时候收到,所有节点都认为与带有nonce 2的交易无效。如果一个节点先收到nonce 2的交易,会持有它,但在收到并处理完nonce 1的交易之前不会验证它。
    • 使用nonce确保所有节点计算相同的余额,并正确地对交易进行排序,相当于比特币中用于防止“双重支付”的机制。但是,因为以太坊跟踪账户余额并且不会单独跟踪独立的币(在比特币中称为UTXO),所以只有在账户余额计算错误时才会发生“双重支付”。nonce机制可以防止这种情况发生。

1.2 架构图

账本的核心还是资产管理和记账管理。

ledger-arch.png

二、功能设计

2.1 功能架构图

ledger-functions.png

2.2 模块服务

2.2.1 账本模块的系统服务

ledger-service.png

账本模块提供的RPC的接口调用,详细接口请参照接口设计部分。

2.2.2 修改系统运行参数

只依赖核心系统,核心系统可以对事件模块系统的启动,停止,参数修改等,

2.3 模块内部功能

2.3.1 热(在线)交易处理

模块内部工能主要包含,资产管理,获取账户地址余额和nonce,验证交易coinData。

  • 资产管理 +
    • 账户的总资产
    • 可用资产
    • 冻结资产,对于有锁定的资产,需要单独记录以及锁定的资产信息,包含链ID,资产ID,资产金额,锁定时间,锁定高度等
    • 资产解锁流程,当用户的锁定资产时间或者高度达到解锁条件,账本会把该资产信息解锁,累计到可用余额,并删除本地数据的资产锁定记录。
    • 多资产情况,需要加入chainId.
  • 获取账户地址余额和nonce +
    • 获取账户地址余额
    • 获取账户地址nonce(该nonce是一个hash值,意味着第一个交易的nonce是0.以后该账户的每一笔交易都会包含前一笔交易的nonce值 )
  • 验证交易 +
    • 双花验证(nonce机制阻止双重支付)
    • 交易创建者验证,验证交易发出者是否拥有足够的余额,验证交易创建者的nonce是否合法
    • 连续交易验证
  • 功能接口管理(rpc) +
    • 提供给其他模块使用的rpc接口

2.3.2 冷(离线)交易处理

冷钱包就是不连网的钱包,也叫离线钱包。热钱包就是保持联网上线的钱包,也就是在线钱包。冷钱包不联网会比热钱包更安全。

由于冷钱包只对交易信息进行签名,在通过热钱包传输签名后的hex字符串到服务端, 然后服务端再进行统一的交易处理, 所以客户端就需要做到离线签名的功能, +离线交易系统中维护nonce的存储信息,使用一个nonce之后,在业务系统中对nonce进行保存处理。

离线交易大部分都是有交易所自己处理,我们需要存储全网账户的账本数据

2.4 账本流程

2.4.1 转账交易流程

  • 用户输入转账的地址和转入的地址和转出的金额
  • 系统通过转出的地址的私钥对转账信息进行签名(用于证明这笔交易确实有本人发起)
  • 系统对交易信息进行验证 +
    • 余额验证
    • 手续费验证
    • nonce连续性验证
    • 签名与input账户验证
  • 把这笔交易入到本地的TxPool中(就是账本未确认交易池)
  • 把交易信息广播给其它节点
  • 打包区块,验证区块
  • 确认交易 +
    • 更新相关(转入或者转出)的所有账户的余额
    • 更新账户资产对应的nonce

2.4.2 普通交易流程(参考实例)

eth-transaction-flow.png

2.4.3 交易验证流程

trx-validate-flow.png

三、接口设计

3.1 模块核心交互接口

3.1.1 获取账户余额

cmd: getBalance

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链id
address Y String 要查询余额的地址
assetChainId Y int 资产发起的链ID
assetId Y int 资产ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
返回值说明 (response)
{ 
+       "available": "10000000000",
+       "freeze": "200000000",
+       "total": "12000000000"
+}
+

说明: 1NULS=10^8Na

字段 数据类型 描述信息
available BigInteger 可用余额
freeze BigInteger 冻结余额
total BigInteger 总资产余额 total = available+freeze

3.1.2 获取当前账户nonce值

cmd: getNonce

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链id
address Y String 要查询余额的地址
assetChainId Y String 资产发起的链ID
assetId Y int 资产ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":34,
+    "assetId":5,
+}
+
返回值说明 (response)
{
+   "nonce":"xxxxxxxxxxx",
+   "nonceType":1
+}
+
字段 数据类型 描述信息
nonce String 上笔支出交易hash
nonceType int 1上笔交易已确认,0上笔交易未确认

3.1.3 获取余额与nonce值

cmd: getBalanceNonce

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链id
address Y String 要查询余额的地址
assetChainId Y String 资产发起的链ID
assetId Y String 资产ID
{
+   
+    "chainId":5,
+    "address":"0x407d73d8a49eeb85d32cf465507dd71d507100c1",
+    "assetChainId":"34",
+    "assetId":"5",
+}
+
返回值说明:(response)
{
+    "available": "10000000000",
+    "nonce": "xxxxx"
+}
+
字段 数据类型 描述信息
available BigInteger 用户可用余额
nonce String 账户的随机值,保存用户上一笔交易的hash。

3.1.4 验证coinData

cmd: validateCoinData

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链id
txHex Y String 交易16进制流
isBatchValidate Y boolean true 交易的批量校验,false 单笔的未确认校验
{
+    "chainId": 458,
+    "txHex": "xxxxxxxx",
+    "isBatchValidate": "false"
+}
+
返回值说明:(response)
{
+    "validateCode":1,
+    "validateDesc":"success" 
+}
+
字段 数据类型 描述信息
validateCode int 1校验通过,2孤儿交易 3双花 4 其他异常
validateDesc String 校验返回描述

3.1.5 批量校验通知

cmd: bathValidateBegin

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链Id
{
+     "chainId": 21
+}
+
返回值说明:(response)
{
+    "value":1
+}
+
字段 数据类型 描述信息
value int 1成功,0失败

3.1.6 提交交易

cmd: commitTx

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链Id
txHex Y String 交易16进制流
isConfirmTx Y boolean true 已确认交易 false 为确认交易回滚
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx",
+     "isConfirmTx": "false"
+}
+
返回值说明:(response)
{
+    "value":1
+}
+
字段 数据类型 描述信息
value int 1成功,0失败

3.1.7 回滚交易

cmd: rollBackTx

参数说明 (request)
字段 是否必填 数据类型 描述信息
chainId Y int 接口调用链的链Id
txHex Y String 交易16进制流
isConfirmTx Y boolean true 已确认交易 false 为确认交易回滚
{
+     "chainId": 21,
+     "txHex": "xxxxxxxx",
+     "isConfirmTx": "true"
+}
+
返回值说明:(response)
{
+    "value":1
+}
+
字段 数据类型 描述信息
value int 1成功,0失败

3.2 其他接口

3.2.1 根据资产id获取资产信息

cmd: getAsset

参数说明 (request)
字段 是否可选 数据类型 描述信息
chainId Y int 接口调用所在链链Id
assetChainId Y int 资产发起链的链ID
assetId Y int 资产ID
{
+  "chainId": 5,
+  "assetChainId": 12,
+  "assetId": 41
+}
+
返回值说明 (response)
{
+    "chainId": 5,
+    "assetChainId": 12,
+    "assetId": 41,
+    "balance" : {
+      "available": "10000000000",
+      "freeze": "200000000",
+      "total": "12000000000"
+    }
+}
+
字段 数据类型 描述信息
chainId int 发起调用的链ID
assetChainId int 资产发起的链链id
assetId int 资产ID
balance.available BigInteger 可用余额
balance.freeze BigInteger 冻结余额
balance.total BigInteger 总资产余额 total = available+freeze

四、事件说明

不依赖任何事件

五、协议

5.1 网络通讯协议

5.2 交易协议

六、模块配置

6.1 配置说明

6.2 模块依赖关系

  • 内核模块 +
    • 模块注册
    • 模块注销
    • 模块状态上报(心跳)
    • 服务接口数据获取及定时更新

七、Java特有的设计

核心对象类定义,存储数据结构,......

八、补充内容

参考资料文献资料

Last Updated: 2019-1-11 16:02:50
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/linuxTutorial.html b/docs/.vuepress/dist/zh/NULSInfrastructure/linuxTutorial.html new file mode 100644 index 00000000..159d54ea --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/linuxTutorial.html @@ -0,0 +1,704 @@ + + + + + + [Alpha]NULS2.0 CLI 使用指南 | NULS + + + + + + + +

[Alpha]NULS2.0 CLI 使用指南

介绍

本文档为NULS2.0 alpha版本测试网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。

版本更新记录

版本 更新日期 内容
V1.0.0 2018-03-18 alpha版功能

准备

服务器硬件配置

建立NULS节点的服务器不低于如下配置:

CPU 内存 硬盘 宽带
四核 3.0GHz 16G 128G硬盘 20M上行

推荐配置:

CPU 内存 硬盘 宽带
八核 3.0GHz 32G 256G硬盘 100M上行

系统及内核版本

Linux系统

  • CentOS 6,7

Linux内核版本推荐使用 2.6.32及以上

开始

下载

  • 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release

  • 进入NULS官网钱包下载界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。

    Linux系统中下载v2.0.0-alpha-1版的钱包可以使用如下命令:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    注:如果后续有其他版本,下载地址可能会不同。

安装

  • 在Linux中解压已下载的文件

    $ tar -zxf NULS-Wallet-linux64-2.0.0-alpha-1.tar.gz
    +

运行

  • 进入解压后的目录,并运行启动脚本,启动全节点钱包

    $ cd NULS-Wallet-linux64-2.0.0-alpha-1
    +$ ./start.sh
    +

使用钱包

快速入门

  • 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。

    进入cmdclient/1.0.0目录,执行如下命令:

    $ cd cmdclient/1.0.0
    +$ ./cmd.sh
    +

    将会出现NULS命名输入提示符nuls>>> ,然后可直接输入NULS钱包操作命令,来进行操作。

    例如,创建账户的示例如下:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    执行create命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。

约定

  • 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。
  • 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。

钱包命令

帮助命令

输出打印所有的命令,

  • 命令: help [-a]|[group]|[command]
参数 说明
-a 格式化打印命令,选填
command 查看指定命令使用说明
group 查看指定命令组的所有命令使用说明

返回信息 help

getaccount <address> --get account information
+

返回信息 help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

示例

nuls>>> help
+nuls>>> help -a
+nuls>>> help account
+nuls>>> help create
+

创建账户

创建账户,返回账户地址集合

  • 命令: create [number]
参数 说明
[number] 创建账户的数量,选填

创建账户时,将会提示输入密码,为了保证资产安全,必须给账户设置密码;

返回账户集合

[ "5MR_2CkDZtZRHGLD43JreUc8LsFBertsc9r", "5MR_2CXCCU89fj9RyQj9MgZVE7Pq3Mmk77p" ]
+

示例

创建1个账户

nuls>>> create 
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW" ]
+

一次创建多个账户

nuls>>> create 3
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+[ "5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N", "5MR_2CcYq7fqrvKagReBmzG3qEz8qGkifCr", "5MR_2Cd6E2vAGZQxkqeXbeqThRxDGTFiLei" ]
+

备份账户

备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件

  • 命令:backup <address> [path]
参数 说明
<address> 账户地址,必填
[path] 文件生成备份文件的目标文件夹,默认为当前文件夹,选填

返回信息

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

示例 备份一个有密码的账户

nuls>>> backup 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW /Users/zlj
+Enter account password
+***************
+The path to the backup file is /Users/zlj/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+

移除账户

根据账户地址移除本地账户,需要输入密码

  • 命令:remove <address>
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> remove 5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+Enter your password for account**********
+Success
+

修改账户密码

根据账户地址和账户密码重新设置新密码。

  • 命令:resetpwd <address>
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> resetpwd 5MR_2CWdfU2VDERgQbWS1quGYAGD1iDDM4N
+Enter your old password:**********
+Enter new password**********
+Please confirm new password:**********
+Success
+

设置别名

给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示

  • 命令:setalias <address> <alias>
参数 说明
<address> 账户的地址,必填
<alias> 别名名称,必填

返回信息 交易hash

txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

示例

nuls>>> setalias 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 zlj
+Enter your account password**********
+txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582
+

导入账户keystore

导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。

  • 命令:importkeystore <path>
参数 说明
<path> 待导入的keystore文件地址,必填

注意:导入keystore文件生成账户时,需要原始密码

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> importkeystore /Users/zhoulijun/5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW
+

导入账户私钥

导入账户私钥,生成本地账户,如果本地已有该账户将覆盖,导入时需要给账户设置密码。此功能可以用于忘记账户密码后,通过私钥重新找回账户。

  • 命令:import <privatekey>
参数 说明
<privatekey> 账户的私钥,必填
"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 1c2b9fd4417c1aad8ae9f24c982ff294eb50a6462b873b79a879e805a9990346
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+

查询账户信息

根据账户地址查询账户信息

  • 命令:getaccount <address>
参数 说明
<address> 账户地址,必填

返回信息

{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //加密后的私钥
+  "alias" : "zlj",  //别名
+  "baglance" : {  
+    "freeze" : 0,   //冻结的资产数量
+    "total" : 997999999800000,     //总的资产数量
+    "available" : 997999999800000  //可用的资产数量
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //账户地址
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //公钥
+}
+

示例

nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu
+{
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d",  //加密后的私钥
+  "alias" : "zlj",  //别名
+  "baglance" : {  
+    "freeze" : 0,   //冻结的资产数量
+    "total" : 997999999800000,     //总的资产数量
+    "available" : 997999999800000  //可用的资产数量
+  },
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //账户地址
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //加密后的公钥
+}
+

查询账户列表

根据分页参数查询账户列表,所有账户以创建时间倒序输出。

  • 命令:getaccounts <pageNumber> <pageSize>
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息,将输出账户集合

[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //地址
+  "alias" : null,  //别名
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //公钥
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //私钥
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

示例 获取账户列表

nuls>>> getaccounts
+[ {
+  "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu",  //地址
+  "alias" : null,  //别名
+  "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486",  //加密后的公钥
+  "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d"  //加密后的私钥
+}, {
+  "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW",
+  "alias" : null,
+  "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1",
+  "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57"
+}, {
+  "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9",
+  "alias" : "zlj",
+  "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb",
+  "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77"
+} ]
+

查询账户私钥

根据账户地址个密码查询账户私钥

  • 命令:getprikey <address>
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户的私钥(未加密)

00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+

示例

nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9
+Enter your account password**********
+7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678
+

查询账户余额

根据账户地址查询账户余额

  • 命令:getbalance <address>
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

{
+  "total" : "9999998.99",//余额
+  "freeze" : "0",//已锁定余额
+  "available" : "9999998.99"//可用余额
+}
+

示例

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "total" : "9999998.99",
+  "freeze" : "0",
+  "available" : "9999998.99"
+}
+

转账

根据账户地址或别名将NULS转入另一账户地址或别名中

  • **命令:transfer <formAddress>|<formAlias> <toAddress>|<toAlias> <amount> [remark] **
参数 说明
<formAddress> 转出地址(与formAlias任选一项)
<formAlias> 转出地址别名(与formAddress任选一项)
<toAddress> 接收地址(与toAlias任选一项)
<toAlias> 接收地址别名(与toAddress任选一项)
<amount> 转账数量,必填
[remark] 备注信息,选填

返回信息 转账交易hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

示例

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

查询交易详情

根据交易hash查询交易详细信息

  • 命令:gettx <hash>
参数 说明
<hash> 交易hash,必填

返回信息 交易详细信息

{
+  "type" : 2,  //交易类型(枚举说明见下表【type 枚举类型说明】)
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //区块高度
+  "status" : "CONFIRMED",  //确认状态
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //手续费
+  "multiSignTx" : false
+}
+

示例 查询转账交易

nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f
+{
+  "type" : 2,  //交易类型(枚举说明见下表【type 枚举类型说明】)
+  "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=",
+  "txData" : null,
+  "time" : 1552979783918,
+  "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==",
+  "remark" : "6L2s6LSm",
+  "hash" : {
+    "digestAlgType" : 0,
+    "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", 
+    "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" 
+  },
+  "blockHeight" : 341,   //区块高度
+  "status" : "CONFIRMED",  //确认状态
+  "size" : 225,
+  "inBlockIndex" : 0,
+  "coinDataInstance" : {  
+    "from" : [ {
+      "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100100000,
+      "nonce" : "79acNPim+aw=",
+      "locked" : 0
+    } ],
+    "to" : [ {
+      "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=",
+      "assetsChainId" : 12345,
+      "assetsId" : 1,
+      "amount" : 100000000,
+      "lockTime" : 0
+    } ]
+  },
+  "fee" : 100000,  //手续费
+  "multiSignTx" : false
+}
+

type 枚举类型说明

/** coinbase交易*/
+    int TX_TYPE_COINBASE = 1;
+    /** 转账交易*/
+    int TX_TYPE_TRANSFER = 2;
+    /** 设置别名*/
+    int TX_TYPE_ALIAS = 3;
+    /** 创建共识节点交易*/
+    int TX_TYPE_REGISTER_AGENT = 4;
+    /** 委托交易(加入共识)*/
+    int TX_TYPE_JOIN_CONSENSUS = 5;
+    /** 取消委托交易(退出共识)*/
+    int TX_TYPE_CANCEL_DEPOSIT = 6;
+    /** 黄牌惩罚*/
+    int TX_TYPE_YELLOW_PUNISH = 7;
+    /** 红牌惩罚*/
+    int TX_TYPE_RED_PUNISH = 8;
+    /** 停止节点(删除共识节点)*/
+    int TX_TYPE_STOP_AGENT = 9;
+    /** 跨链转账交易*/
+    int TX_TYPE_CROSS_CHAIN_TRANSFER = 10;
+    /** 注册链交易*/
+    int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11;
+    /** 销毁链*/
+    int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12;
+    /** 为链新增一种资产*/
+    int TX_TYPE_ADD_ASSET_TO_CHAIN = 13;
+    /** 删除链上资产*/
+    int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14;
+    /** 创建智能合约交易*/
+    int TX_TYPE_CREATE_CONTRACT = 100;
+    /** 调用智能合约交易*/
+    int TX_TYPE_CALL_CONTRACT = 101;
+    /** 删除智能合约交易*/
+    int TX_TYPE_DELETE_CONTRACT = 102;
+

创建节点

根据账户地址创建节点,创建节点时需要提供两个地址,第一个地址为节点地址,需要输入节点地址账户密码,第二地址为打包地址,不需要输入密码。同时需要至少20000NULS的保证金。

  • 命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit>
参数 说明
<agentAddress> 创建节点的账户地址,必填
<packingAddress> 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)
<commissionRate> 代理佣金比例,范围:10~100,必填
<deposit> 创建节点的保证金,不能低于20000NULS,必填

返回信息 返回节点的agent hash

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

示例 创建一个节点,佣金比例为10%,押金20000NULS。

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

加入共识(委托节点)

根据账户地址和节点agentHash,加入共识,至少需要2000NULS

  • 命令:deposit <address> <agentHash> <deposit>
参数 说明
<address> 账户地址,必填
<agentHash> 节点的agentHash,必填
<deposit> 加入共识保证金,不能低于2000NULS,必填

返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

示例

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

退出共识(退出委托)

根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。

  • 命令:withdraw <address> <txHash>
参数 说明
<address> 账户地址,必填
<txHash> 委托时的交易hash,必填

返回信息 退出共识交易hash

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

示例

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

停止节点

停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。

  • 命令:stopagent <address>
参数 说明
<address> 账户地址,必填

返回信息 停止节点交易hash

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

示例

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

获取最新的区块头信息

获取最新的区块头信息

  • 命令:getbestblockheader

返回信息

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

示例

nuls>>> getbestblockheader
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",
+  "time" : "2019-03-19 18:26:20.020",
+  "height" : 1479,
+  "txCount" : 0,
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365",
+  "size" : 0,
+  "packingAddress" : null,
+  "roundIndex" : 155299118,
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1,
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。

  • 命令:getblock <hash> | <height>
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

示例 根据高度获取区块

nuls>>> getblock 28115
+{
+  "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57",  //区块hash
+  "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc",  //上一个区块hash
+  "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e",  //merkle hash
+  "time" : "2019-03-19 18:26:20.020",  //打包时间
+  "height" : 1479, //区块高度
+  "txCount" : 1,   //包含的交易数
+  "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //区块签名
+  "size" : 0, //区块大小
+  "packingAddress" : null,  //打包地址
+  "roundIndex" : 155299118, 
+  "consensusMemberCount" : 100,
+  "roundStartTime" : "2019-03-19 18:26:10.010",
+  "packingIndexOfRound" : 1, 
+  "mainVersion" : 1,
+  "blockVersion" : 0,
+  "stateRoot" : null
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。

  • 命令:getblockheader <hash> | <height>
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块头

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

创建智能合约

调用此接口在链上创建一个智能合约

  • 命令:createcontract <sender> <gaslimt> <price> <contractCode> [remark]
参数 说明
<sender> 创建智能合约的账户地址
<gaslimt> 本次创建合约最大消耗的Gas
<price> 单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas
<contractCode> 合约代码的hex编码
[remark] 备注

返回信息 创建合约的交易hash和合约的地址

{
+  "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f",  //交易hash
+  "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //合约地址
+}
+

示例 创建一个合约(contractCode 省略中间部分)

nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo
+The arguments structure: 
+[ {
+  "type" : "String",
+  "name" : "name",
+  "required" : true
+}, {
+  "type" : "String",
+  "name" : "symbol",
+  "required" : true
+}, {
+  "type" : "BigInteger",
+  "name" : "initialAmount",
+  "required" : true
+}, {
+  "type" : "int",
+  "name" : "decimals",
+  "required" : true
+} ]
+Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'").
+Enter the arguments:"KQB","KQB",10000,2
+{
+  "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587",
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK"
+}
+

获取合约基本信息

获取智能合约的描述信息以及构造函数、调用方法的参数列表

  • 命令:getcontractinfo <contract address>
参数 说明
<contract address> 合约地址

返回信息

略 ,见示例
+

示例


+nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+{
+  "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+  "createTime" : 1553563706022,
+  "blockHeight" : 46,
+  "isNrc20" : true,
+  "nrc20TokenName" : "QKB",
+  "nrc20TokenSymbol" : "QKB",
+  "decimals" : 2,
+  "totalSupply" : "200000000",
+  "status" : "normal",
+  "method" : [ {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },{
+    "name" : "transfer",
+    "desc" : "(Address to, BigInteger value) return boolean",
+    "args" : [ {
+      "type" : "Address",
+      "name" : "to",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "value",
+      "required" : true
+    } ],
+    "returnArg" : "boolean",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  }]
+}
+
+

调用智能合约

调用智能合约提供的函数

  • 命令:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]
参数 说明
<senderAddress> 调动合约的账户地址
<gasLimit> 本次合约执行最大消耗的Gas
<price> 单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas
<contractAddress 调用的合约地址
<methodName> 合约的方法名
<value> 如果要向合约转账,转账的数量
[-d methodDesc] 如果合约中有同名方法时,使用此方法来描述参数列表
[-r remark] 备注信息

返回信息 本次调用的交易hash

"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //交易hash
+

示例 调用一个指定合约的NRC20-Token转账函数, 示例中tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L为NRC20合约地址,输入的参数为 接收地址和转账数量

nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call
+Please Enter your account passwordzhoujun172
+**********
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2
+"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad"
+

删除智能合约

停止一个可用的智能合约

  • 命令:deletecontract <senderAddress> <contractAddress>
参数 说明
<senderAddress> 调用合约的账户地址
<contractAddress> 调用的合约地址

返回值 交易hash

"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash
+

示例

nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L
+Please enter your account passwordzhoujun172
+**********
+"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6"
+

调用合约视图方法

调用合约的视图方法,会立即返回结果,不会产生交易

  • 命令:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract
参数 说明
<contractAddress> 调用的合约地址
<methodName> 调用的方法
[-d methodDesc] 如果合约中有同名方法时,使用此方法来描述参数列表

返回值

根据具体调用函数返回值不同
+

示例 调用NRC20-Token合约的查询Token余额函数查询指定地址的Token余额

nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf
+Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"),
+If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly.
+Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD"
+{
+  "result" : "20000000"
+}
+

向合约地址转账

向指定的合约地址转入主网币

  • 命令:transfertocontract <senderAddress> <contractAddress> <amount> [remark]
参数 说明
<senderAddress> 转出账户地址
<contractAddress 转入的合约地址
<amount> 转入数量
[remark] 备注

返回值 交易hash

"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

示例 向指定合约转入2个NULS

nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark
+Please enter your account password
+**********
+"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979"
+

token转账

NRC20 token转账

  • 命令:tokentransfer <formAddress> <toAddress> <contractAddress> <amount> [remark]
参数 说明
<formAddress> 转出账户地址
<toAddress 转入的账户地址
<contractAddress> 合约地址
<amount> 转入数量
[remark] 备注

返回值 交易hash

"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

示例 token转账:

nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD  tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta  tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000
+Please enter your account password
+**********
+"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8"
+

获取合约交易

获取合约的交易信息, 包含交易详情,合约调用参数,合约执行结果

  • 命令:getcontracttx <hash>
参数 说明
<hash> 交易hash

返回值

略 见示例
+

示例

nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f",
+  "type" : "100",
+  "time" : "2019-03-26 09:28:26",
+  "blockHeight" : 46,
+  "fee" : 0.0,
+  "value" : 0.0,
+  "remark" : null,
+  "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505",
+  "status" : "confirm",
+  "confirmCount" : 0,
+  "size" : 6686,
+  "inputs" : [ {
+    "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "assetsChainId" : 2,
+    "assetsId" : 1,
+    "amount" : "5700000",
+    "nonce" : "ffffffff",
+    "locked" : 0,
+    "value" : 0.0
+  } ],
+  "outputs" : [ ],
+  "txData" : {
+    "data" : {
+      "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "value" : 0.0,
+      "hexCode" : "504b03040a0000080...........31600000000",
+      "gasLimit" : 200000,
+      "price" : "0.00000025",
+      "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ]
+    }
+  },
+  "contractResult" : {
+    "success" : true,
+    "errorMessage" : null,
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "result" : null,
+    "gasLimit" : 200000,
+    "gasUsed" : 14029,
+    "price" : "0.00000025",
+    "totalFee" : 0.0,
+    "txSizeFee" : 0.0,
+    "actualContractFee" : 0.0,
+    "refundFee" : 0.0,
+    "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+    "value" : 0.0,
+    "stackTrace" : null,
+    "balance" : 0.0,
+    "transfers" : [ ],
+    "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+    "tokenTransfers" : [ {
+      "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+      "from" : null,
+      "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+      "value" : "200000000",
+      "name" : "QKB",
+      "symbol" : "QKB",
+      "decimals" : 2
+    } ],
+    "remark" : "create"
+  }
+}
+
+
+

获取合约执行结果

获取一个合约的执行结果

  • 命令:getcontractresult <hash>
参数 说明
<hash> 交易hash

返回值

略 见示例
+

示例

nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f
+{
+  "success" : true,
+  "errorMessage" : null,
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "result" : null,
+  "gasLimit" : 200000,
+  "gasUsed" : 14029,
+  "price" : "0.00000025",
+  "totalFee" : 0.0,
+  "txSizeFee" : 0.0,
+  "actualContractFee" : 0.0,
+  "refundFee" : 0.0,
+  "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba",
+  "value" : 0.0,
+  "stackTrace" : null,
+  "balance" : 0.0,
+  "transfers" : [ ],
+  "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ],
+  "tokenTransfers" : [ {
+    "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+    "from" : null,
+    "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD",
+    "value" : "200000000",
+    "name" : "QKB",
+    "symbol" : "QKB",
+    "decimals" : 2
+  } ],
+  "remark" : "create"
+}
+
+

获取合约构造函数

获取创建指定合约时需要传入的参数列表

  • 命令:getcontractcontructor <contractCode>
参数 说明
<contractCode> 合约代码的hex编码

返回值

略 见示例
+

示例

nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000
+{
+  "constructor" : {
+    "name" : "<init>",
+    "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void",
+    "args" : [ {
+      "type" : "String",
+      "name" : "name",
+      "required" : true
+    }, {
+      "type" : "String",
+      "name" : "symbol",
+      "required" : true
+    }, {
+      "type" : "BigInteger",
+      "name" : "initialAmount",
+      "required" : true
+    }, {
+      "type" : "int",
+      "name" : "decimals",
+      "required" : true
+    } ],
+    "returnArg" : "void",
+    "view" : false,
+    "event" : false,
+    "payable" : false
+  },
+  "isNrc20" : true
+}
+
+

获取指定账户创建的合约列表

获取指定账户地址所创建的合约列表

  • 命令:getaccountcontracts <createAddress>
参数 说明
<createAddress> 账户地址

返回值

{
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}
+

示例

nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD
+[ {
+  "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L",
+  "createTime" : "2019-03-26 09:28:26.026",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 2,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg",
+  "createTime" : "2019-03-25 16:08:25.025",
+  "height" : 253,
+  "confirmCount" : 195,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+}, {
+  "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK",
+  "createTime" : "2019-03-25 15:33:54.054",
+  "height" : 46,
+  "confirmCount" : 402,
+  "remarkName" : null,
+  "status" : 0,
+  "msg" : null,
+  "create" : true
+} ]
+

查询网络信息

查询网络基本信息

  • **命令:network info **

返回信息

{
+  "localBestHeight" : 35317,//本地最新区块高度
+  "netBestHeight" : 35317,//网络最新区块高度
+  "timeOffset" : "0ms",//网络时间偏移值
+  "inCount" : 0,//被动连接节点数量
+  "outCount" : 1//主动连接节点数量
+}
+

示例

nuls>>> network info
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

查询网络节点IP

查询网络节点IP

  • **命令:network nodes **

返回信息

[ "192.168.1.223" ]
+

示例 根据高度获取区块

nuls>>> network nodes
+[ "192.168.1.223" ]
+

退出钱包命令程序

退出操作钱包的命令行程序,不会退出已启动的钱包节点。

  • 命令:exit

示例

nuls>>> exit
+
Last Updated: 2019-3-26 18:13:19
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/networkModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/networkModuleDesign.html new file mode 100644 index 00000000..8bb5af6b --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/networkModuleDesign.html @@ -0,0 +1,354 @@ + + + + + + 网络模块设计文档 | NULS + + + + + + + +

网络模块设计文档

[TOC]

一、总体描述

1.1 模块概述

1.1.1 为什么要有《网络模块》

网络模块保障了去中心化节点间的通讯,为NULS基础模块之一,提供最底层的网络通信、节点发现等服务。区块链的网络基础就是Peer to Peer,即P2P。P2P网络中的所有参与者,可以是提供服务(server),也可以是资源使用者(client)。P2P网络的特点:去中心化、可扩展性、健壮性、高性价比、隐私保护、负载均衡。

1.1.2 《网络模块》要做什么

网络模块是整个系统的基础模块,用来管理节点、节点间的连接及连接的状态、数据的发送与接收。网络模块不涉及复杂的业务逻辑。

  • 接收到的网络消息,根据内核模块中的指令服务映射关系,推送消息相应的处理模块中。

  • 开放接口供其他模块封装好的消息调用推送到指定的peer节点以及广播到指定的网络组中。

1.1.3 《网络模块》在系统中的定位

  • 网络模块是底层应用模块,任何需要网络通讯的模块都要通过网络模块来进行消息的收发。
  • 网络模块依赖核心模块进行服务接口的治理。
  • 网络模块按网络id(魔法参数) 来进行不同网络的构建。
  • 网络模块在卫星链中的节点在进行跨链网络组建时,需要链管理模块提供跨链配置信息。
  • 网络模块在子链中的节点在进行跨链网络组建时,需要跨链模块提供跨链配置信息。

1.2 架构图

二、功能设计

2.1 功能架构图

网络模块在业务上功能有:节点管理,节点组管理,p2p网络连接管理,消息的收发管理。

在内部基础功能含有:模块的状态管理(包含启动与关闭管理),对外的接口提供管理,

线程任务管理,数据存储管理等。

  • 节点管理 Node management

    管理所有可连接的、已连接的节点信息、状态,提供节点操作接口

    • 节点发现
    • 节点存储
  • 节点组管理 Node Group management

    管理不同的网络节点,将节点分为不同的集合,每个集合分别管理。每个集合内的节点连接的魔法参数都是相同的,并且和其他集合的魔法参数不同。

    每个NodeGroup都根据链登记的信息或者自身配置的网络信息进行初始化(魔法参数、节点数量限制等)

    每初始化一个NodeGroup,网络服务都多监听一个MagicNumber。

  • 连接器管理 Connection management

    • 初始化连接 +
      • 卫星链节点:随机连接
      • 跨链节点:已固定的算法连接,目标是将跨链节点分散并全部连接
    • 连接管理:心跳维护
    • 连接断开
  • 消息收发管理

    1>消息接收 Message receiver

    接收网络节点发送过来的消息,对消息进行简单的判断(判断cmd),根据消息cmd字段,将消息发送到关心的模块服务中。

​ 2> 消息发送 Message sender

​ a> 对NodeGroup广播消息

​ b> 对一个节点发送消息

  • 模块状态管理

    ​ a>启动,关闭逻辑处理

​ b>对自身模块状态的维护与管理:管理模块的运行状态,内部功能状态等

  • 接口管理

    a>注册自身接口到kernel模块中

    b>同步模块信息与状态到kernel模块中

    c>获取服务列表到本地模块

    d>开放对外接口调用

  • 线程任务管理

    a>管理 心跳线程

    b>管理 节点发现/淘汰机制线程

    c>管理 接口信息同步线程

2.2 模块服务

2.2.1 网络消息接收

  • 功能说明:

    接收(外部)网络节点发送过来的消息,对消息进行简单的判断(判断魔法参数),根据消息头含有的command字段,将消息发送到关心的模块服务中。

  • 流程描述

  • 消息校验部分:

​ payload校验

​ magicNumber校验

  • 外部模块提供的接口参数约束

    • method : *** //同消息头中的CMD指令,约束12字节

    • params

    0:chainId //链id
+    1:nodeId //节点Id
+    2:message //16进制网络序消息体
+    ......
+
  • 依赖服务

​ 解析消息头中的command参数,在调用远程接口处理时,依赖内核模块提供的远程的服务接口数据。

2.2.2网络消息发送

转发 其他或自身模块封装的消息,含广播消息以及指定节点发送消息。

2.2.2.1、广播网络消息

功能说明:

转发 其他或自身模块封装的消息,对外部模块提供转发调用的接口有以下2种情况:

a> 对NodeGroup(指定某个网络)广播消息。

b> 对NodeGroup(指定某个网络)广播消息,并排除某些节点。

  • 流程描述

  • 接口定义

    • 接口说明

      method : nw_broadcast

      外部模块可以通过该接口去广播消息

    • 请求示例

      {
      +   "chainId":1234,
      +   "excludeNodes": "10.13.25.36:5003,20.30.25.65:8009",
      +   "params":     "03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3"
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
      1 excludeNodes true String 排除节点,逗号分割
      2 message true String 对象16进制字符
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
  • 依赖服务

2.2.2.2、指定节点发送网络消息

功能说明:

转发 其他或自身模块封装的消息,可以指定某些节点(可以为1个节点)发送消息。

  • 流程描述

  • 接口定义

    • 接口说明

      外部模块可以通过该接口去广播消息

      method : nw_sendPeersMsg

    • 请求示例

      {
      +      "chainId":  1234,
      +      "nodes":  "10.13.25.36:5003,20.30.25.65:8009",
      +   "message":"03847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF303847ABDFF3"
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
      1 nodes true String 发送节点,逗号分割
      2 message true String 对象16进制字符
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

2.2.3 创建节点组

卫星链除了自身卫星网络,还存在n个跨链网络,友链上除了自身网络,还可以注册跨链网络。

节点组就是用来管理不同网络信息的。网络模块通过节点组去隔离维护不同网络。

节点组类型:1>自身网络 2>跨链网络 (卫星链跨链网络&友链跨链网络)

网络模块是接收外部模块的调用,来创建节点组。跨链的基本网络配置信息主要通过2种途径获得:

1>自身的配置文件加载创建自身网络组。

2>跨链网络:

​ 作为卫星链节点,由链管理模块进行注册登记后,系统产生交易验证确认后调用,产生跨链网络组,之后存储配置,后续模块启动自动加载。

​ 作为友链节点,由跨链协议模块启动时,跨链协议模块从模块配置中获取跨链配置信息,通知网络模块,

网络模块触发跨链 连接。

2.2.3.1 自有网络创建节点组
  • 功能说明:

    自有网络对应自有chainId,以及一个魔法参数,通过配置初始化创建节点组

  • 流程描述

    通过配置文件加载创建节点组

  • 接口定义

​ 内部创建,无外部接口。

  • 依赖服务

​ 无

2.2.3.2 创建跨链节点组
  • 功能说明:

    卫星链上的跨链节点组由友链在卫星链进行跨链注册触发。友链则获得跨链配置信息,由跨链协议来更新自有网络组的跨链状态。

  • 流程描述

    1>卫星链通过 链管理模块调用来触发跨链节点组的创建。

    2>友链通过跨链协议模块来 更新自有网络组的跨链状态。

  • 接口定义

    • 接口说明

      接收外部模块的调用,创建节点组

      method : nw_createNodeGroup

    • 请求示例

      {
      +      "chainId":  1234,
      +      "magicNumber": 232342,
      +      "maxOut":  10,
      +      "maxIn":  100,
      +      "minAvailableCount":  20,
      +      "seedIps":  "10.20.30.10:8002,48.25.32.12:8003,52.23.25.32:9003",
      +      "isMoonNode":  0
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
      1 magicNumber true long 魔法参数
      2 maxOut true int 最大主动连接数
      3 maxIn true int 最大被动连接数
      4 minAvailableCount true int 友链最小连接数
      5 seedIps true String 种子节点,逗号分割
      6 isMoonNode true int 是否卫星链节点,默认0
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

​ 依赖内核模块提供的远程的服务接口数据。

2.2.4 注销节点组

  • 功能说明:

    接收外部模块的调用,注销跨链节点组。

    作为卫星链节点,由链管理模块进行注销登记,系统产生交易验证确认后调用。

  • 流程描述

  • 接口定义

    • 接口说明

      接收外部模块的调用,删除节点组

      method : nw_delNodeGroup

    • 请求示例

      {
      +    "chainId": 1234
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

    依赖内核模块提供的远程的服务接口数据。

2.2.5 跨链种子节点提供

  • 功能说明:

    种子节点是在网络初始化时候,用于提供peer连接信息的节点。链管理模块在进行链注册时,需要获取卫星链上种子节点信息用于初始化连接。

  • 流程描述

  • 接口定义

    • 接口说明

      获取卫星链种子节点

      method : nw_getSeeds

    • 请求示例

      {
      +    "chainId": 1234
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +      seedsIps:"101.132.33.140:8003,116.62.135.185:8003,47.90.243.131:8003" 
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      seedsIps String 种子节点信息逗号分割
  • 依赖服务

    依赖内核模块提供的远程的服务接口数据。

2.2.6 添加连接节点

  • 功能说明:

    cmd指令下,对某个网络添加peer连接信息。

  • 流程描述

    添加的节点会触发网络连接 流程。

  • 接口定义

    • 接口说明

      添加网络peer节点

      method : nw_addNodes

    • 请求示例

      {
      +    "chainId":455,
      +    "isCross":0,
      +    "nodes":"10.20.23.02:5006,53.26.65.58:8003"
      +       }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
      1 isCross true int 是否跨链:0 非跨链,1跨链
      2 nodes true String 节点组
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

    ​ 无

2.2.7 删除连接节点

  • 功能说明:

    cmd指令下,删除某个网络下的peers连接信息。

  • 流程描述

    删除节点会触发 网络节点的断开。

  • 接口定义

    • 接口说明

      删除网络peer节点

      method : nw_delNodes

    • 请求示例

      {
      +    "chainId":234,
      +    "nodes": "10.20.23.02:5006,53.26.65.58:8003"
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
      1 nodes true String 节点组
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

2.2.8重连指定网络

  • 功能说明:

    cmd指令下,对指定的nodeGroup进行网络重新连接

  • 流程描述

    接收指令后,对指定的nodeGroup下的所有peer进行断连接后,重新连接网络。

    重新刷新nodegroup下peer 连接地址 ,并重启网络连接。

    如果peer连接 为多个 网络业务所有,则只需要取消关联关系,如果只有自身业务使用,则可以断开连接。

  • 接口定义

    • 接口说明

      重新刷新并连接网络节点

      method : nw_reconnect

    • 请求示例

      {
      +    "chainId":1234
      +    }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链标识
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +       
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
  • 依赖服务

2.2.9 获取nodeGroup列表

  • 功能说明:

    获取节点管理的所有网络列表。

  • 流程描述

  • 接口定义

    • 接口说明

      获取节点组信息

      method : nw_getGroups

    • 请求示例

      {
      +    "startPage":1,
      +    "pageSize":10
      + }
      +
    • 请求参数说明

      index parameter required type description
      0 startPage true int 开始页数
      1 pageSize true int 每页记录数
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +        list:[{
      +            chainId:1212, //链id
      +            magicNumber:324234,//魔法参数
      +            totalCount:2323, //总连接数
      +            inCount:22,   //被动连接数
      +            outCount:33,  //主动连接数
      +            isActive:1,//0未激活,1 已激活
      +            isCrossChain:1 //0不是跨链网络,1跨链网络
      +            },{}
      +            ]
      +    }
      +}
      +
    • 返回字段说明

      parameter type description
      chainId int 链id
      magicNumber int 魔法参数
      totalCount int 总连接数
      inCount int 被动连接数
      outCount int 主动连接数
      isActive int 0未激活,1 已激活
      isCrossChain int 0不是跨链网络,1跨链网络
  • 依赖服务

​ 无

2.2.10 获取指定nodeGroup下的连接信息

  • 功能说明:

    获取指定的网络id下所有节点的信息

  • 流程描述

  • 接口定义

    • 接口说明

      获取节点信息

      method : nw_getNodes

    • 请求示例

    {
    +    "chainId":125,
    +    "state":1,
    +    "isCross":1,
    +    "startPage":1,
    +    "pageSize":5
    +}
    +
    • 请求参数说明
    index parameter required type description
    0 chainId true int 网络id
    1 state true int 0所有链接,1已连接,2 未 连接
    2 isCross true int 0普通连接 1跨链连接
    3 startPage true int 开始页数
    4 pageSize true int 每页记录数
    • 返回示例

    Failed

    {
    +   "minVersion": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +

    Success

    {
    + "minVersion": 1.2,
    + "code":0,
    + "msg" :"xxxxxxxxxxxxxxxxxx",
    + "result":{
    +       list:[{
    +                chainId:122,//链id
    +                nodeId:"20.20.30.10:9902"
    +                magicNumber:134124,//魔法参数
    +                version:2,//协议版本号
    +                blockHeight:6000,   //区块高度
    +                blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
    +                     ea1a960f207778150ffb9f2c173ff",  //区块Hash值
    +                ip:"200.25.36.41",//ip地址
    +                port:54,//
    +                state:"已连接",
    +                isOut:"1", //0被动连接,1主动连接
    +                time:"6449878789", //最近连接时间
    +	     },{}
    +	     ]
    +    }
    +}
    +
    +
    • 返回字段说明
parameter type description
chainId int 链id
nodeId String 节点id
magicNumber int 魔法参数
version int 协议版本号
blockHeight long 最新区块高度
blockHash String 最新区块hash
ip String ip地址
port int 端口号
state int 连接状态 1 连接 0 未连接
isOut int 0被动连接,1主动连接
time long 最近连接时间
  • 依赖服务

2.2.11 获取指定链网络概要信息

  • 功能说明:

    获取指定chainId的网络信息。

  • 流程描述

  • 接口定义

    • 接口说明

      获取链网络信息

      method : nw_getGroupByChainId

    • 请求示例

      {
      +    "chainId":142
      + }
      +
    • 请求参数说明

      index parameter required type description
      0 chainId true int 链Id
    • 返回示例

      Failed

      {
      +   "version": 1.2,
      +    "code":1,
      +    "msg" :"xxxxxxxxxxxxxxxxxx",
      +    "result":{}
      +}
      +

      Success

      {
      + "version": 1.2,
      +    "code":0,
      +    "result":{
      +            chainId:1212, //链id
      +            magicNumber:324234,//魔法参数
      +            totalCount:2323, //总连接数
      +            inCount:22,   //被动连接数
      +            outCount:33,  //主动连接数
      +            blockHeight:6000,   //网络最高区块高度
      +            blockHash:"0020ba3f3f637ef53d025d3a8972462c00e84d9
      +                     ea1a960f207778150ffb9f2c173ff",  //最大高度区块Hash值
      +            isActive:1,//0未激活,1 已激活
      +            isCrossActive:1, //0跨链网络未激活,1跨链激活
      +            isMoonNet:0 //0友链 ,1卫星链
      +            }
      +}
      +
    • 返回字段说明

      parameter type description
      chainId int 链id
      magicNumber int 魔法参数
      totalCount int 总连接数
      inCount int 被动连接数
      outCount int 主动连接数
      blockHeight long 网络最高区块高度
      blockHash String 最大高度区块Hash值
      isActive int 0未激活,1 已激活
      isCrossActive int 0跨链网络未激活,1跨链激活
      isMoonNet int 0友链 ,1卫星链
  • 依赖服务

​ 无

2.2.12 更新peer连接节点的信息(高度&Hash)

  • 功能说明:

    网络连接,在进行握手连接时带有peer节点的高度与Hash值,后续的peer连接节点的高度与Hash值由外部模块(区块管理模块)进行调用更新。

  • 流程描述

    1>节点启动时等待 区块管理接口 初始化完成,然后调用区块管理接口获取最新区块高度及hash值。

    2>握手时将节点相关信息放入Verion信息中发送到peer端。

    3>建立连接后,区块管理模块会调用该接口进行最新区块高度与hash值的更新。

  • 接口定义

    • 接口说明

      区块管理模块 调用进行节点的高度与Hash值的更新。

      method : nw_updateNodeInfo

    • 请求示例

      {
      +    "method":"nw_reconnect",
      +    "minVersion":1.1,
      +    "params":[
      +        1598,
      +        "10.20.30.20:8856",
      +        10,
      +        "0020ba3f3f637ef53d025d3a8972462c00e84d9ea1a960f207778150ffb9f2c173ff"
      +    ]
      +}
      +
    • 请求参数说明

    index parameter required type description
    0 chainId true int 网络id
    1 nodeId true String 网络节点id
    2 blockHeight true long 开始页数
    3 blockHash true String 区块最新hash
    • 返回示例

    Failed

    {
    +   "version": 1.2,
    +    "code":1,
    +    "msg" :"xxxxxxxxxxxxxxxxxx",
    +    "result":{}
    +}
    +
    +

    Success

    {
    + "version": 1.2,
    + "code":0,
    + "msg" :"xxxxxxxxxxxxxxxxxx",
    + "result":{
    +   
    +    }
    +}
    +
    +
    • 返回字段说明
parameter type description
  • 依赖服务

​ 无

2.2.13 注册网络协议处理器

  • 功能说明:

    网络模块在接收到对端发送过来的消息后,需要根据 消息协议头中的 cmd 来调用对应模块处理。

    cmd与模块的映射关系,需要各个模块在启动时候进行提交注册。

  • 流程描述

  • 接口定义

    • 接口说明

      区块管理模块 调用进行节点的高度与Hash值的更新。

      method : nw_protocolRegister

    • 请求示例

      {
      +  "role": "bl",
      +  "protocolCmds": [
      +    {
      +    "protocolCmd":"getBlock",
      +    "handler":"getBlockRequest"
      +    },
      +    {
      +    "protocolCmd":"sendBlock",
      +    "handler":"downLoadBlock"
      +    }
      +  ]
      +}
      +
      +
    • 请求参数说明

    index parameter required type description
    0 role true String 模块角色
    1 protocolCmds true array 协议指令数组
    2 protocolCmd true String 协议指令,12字节
    3 handler true String 对应模块处理器
    • 返回示例

    Failed

    {
    +   "registerStatus":"0"
    +}
    +
    +
    +

    Success

    {
    +   "registerStatus":"1" 
    +}
    +
    +
    • 返回字段说明
parameter type description
registerStatus String 注册状态"0"为失败,"1" 为成功
  • 依赖服务

​ 无

2.2.14 网络时间获取

  • 功能说明:

    获取网络时间进行本地时间偏差同步。

  • 流程描述

    网络模块获取网络上若干服务器的时间,进行偏差计算调整。如果网络时间获取失败,则向10个对等节点发出“时间获取协议”获取对等节点时间 进行偏差计算,如果还无法获取,则直接返回本地时间。

    说明:定时进行偏差修正。

  • 接口定义

    • 接口说明

      获取网络时间

      method : nw_currentTimeMillis

    • 请求示例

      RPC 统一格式
      +
    • 请求参数说明

    index parameter required type description
    • 返回示例

    Failed

    RPC 统一格式
    +
    +

    Success

    {
    +   "currentTimeMillis":11544545466 
    +}
    +
    +
    +
    • 返回字段说明
parameter type description
currentTimeMillis long 1970-01-01至今的差值,单位毫秒
  • 依赖服务

​ 无

2.3 模块内部功能

2.3.1 模块启动

  • 功能说明:

    模块启动时,进行配置信息的初始化,注册服务初始化,各个内部功能管理数据库信息的初始化等。

  • 流程描述

​ 1>本地进行配置数据加载,数据库节点组及节点信息数据加载。

​ 2>监听区块管理模块的状态进入初始化完成,接口可调用,则调用获取最新本地节点的区块高度与Hash值。

​ 3>初始化完成,进入peer节点连接。

​ 4>网络模块在启动连接稳定后,通知区块管理模块 网络 最大区块高度与hash值。区块管理模块提供接口供 网络模块调用。

网络模块启动连接稳定的判定条件:x秒内 无新的握手连接产生,x秒内无高度的增长。x=10

​ 5>网络稳定后代表该网络处于可工作状态,各个chain的业务状态以事件方式发布给其他模块。

  • 依赖服务

    依赖 核心模块,区块管理模块

2.3.2 模块关闭

  • 功能说明:

    模块关闭时,进行连接的关闭,线程管理的关闭,各个资源的释放,并通知状态给核心接口。

  • 流程描述

  • 依赖服务

2.3.3 peer节点发现

  • 功能说明:

    在网络模块启动后,进行peer节点的获取管理。

    节点获取的途径有:

    1>连接向种子节点,并请求地址获取。

    2>接收广播过来的节点消息。

    2>跨链网络的连接,比如作为卫星链上的节点与子链的连接,或者子链上的节点与卫星链的连接。

  • 流程描述

  • 依赖服务

​ 无

2.3.4 网络连接

  • 功能说明:

    一个节点即作为client端,主动连接已知的peer节点,同时也是server端,等待peer节点的连接。

    一个连接能够正常工作,需要通过握手协议,即互相发送version协议消息,协议具体定义参看下面的

    “协议-网络通讯协议部分”。

  • 流程描述

​ client在与server完成tcp连接后,需要通过业务version协议握手,只有握手成功的连接才能进行业务转发工作。连接中状态在持续X分钟后无法跃迁到已连接,则主动断开连接。

流程中发送version协议(参看协议的version结构体):

1>协议携带了节点的信息,包含:协议的版本信息,本端口的最高区块高度,区块hash值,

​ 对方节点的外网IP,端口,及跨链服务端口,以及本节点的外网IP,端口,及跨链服务端口。

2>只有通过version协议,才能建立业务连接,否则等待X=1分钟后将断开连接。

PS:为了满足一个进程同时承载多链业务需求,一个node peer 连接建立后,应该满足多个NodeGroup业务。

​ 即 node peer connection 与 nodeGroup 对象间是 多对多,n:n 关系。

  • 依赖服务

2.3.5 心跳检测

  • 功能说明:

    检测连接是否还保持连接。通过client与server的ping-pong消息来进行维持保活。涉及的ping-pong协议定义参看“协议-网络通讯协议部分”

  • 流程描述

  • 依赖服务

2.3.6 连接数量验证

  • 功能说明:

    在建立节点连接时,会进行连接数量,如果达到最大值,则主动断开连接。

    流程描述

  • 依赖服务

2.3.7 节点的外网IP存储

  • 功能说明:

​ 一个节点可能存在多个网卡,也可能是在某个局域网内,所以在建立连接时,并不知道自己的外网IP地址。

而节点要广播自己的地址供外网peers节点连接,则需要知道自身的外网IP地址。我们的设计中,节点的外网是通过version协议消息进行携带发出的。

  • 流程描述

    在client接收到version消息时,可以知道自己的IP地址信息。

  • 依赖服务

2.3.8 节点的外网可连接检测

  • 功能说明:

​ 一个节点在建立连接时,可以广播自身的外网IP+port,给其他节点。但若一个节点是在某局域网内,则其外网的IP地址是是无法直接去连接通的。因此为了检测节点的外网IP是否可用,可以通过自己的client连接自己的server来,如果连接成功,则IP可以用于广播,如果不成功则节点外网IP不能广播给其他节点。

  • 流程描述

    自我连接可能成功,也可能失败,如果成功则说明外网IP是可达的,便可以在建立连接时广播传递给网络中其他节点,如果不可达,则连接无法建立不用处理。

  • 依赖服务

2.3.9 peer节点的广播

  • 功能说明:

    将自身节点广播给网络中其他节点,在设计中,我们将通过上面建立的自我连接,成功时,便可进行广播。

  • 流程描述

    约束:跨链网络peer间不进行地址的广播,即 卫星链中节点发现不会广播给子链,同样子链中的节点发现,不会广播给卫星链。卫星链与子链需要建立连接可以通过初始peer节点发getAdrr消息来请求连接地址。

  • 依赖服务

2.3.10 请求/回复 getaddr协议消息

  • 功能说明:

    请求地址协议消息,获取更多的网络连接

  • 流程描述

    请求getaddr:

​ 1>一个nodeGroup里连接未达到网络业务需要阈值minAvailableCount时,向种子节点请求地址列表。

​ 2>卫星链节点中的跨链nodeGroup可以直接向已连接的peer节点请求获取地址。

​ 回复 getaddr

​ 1>peer跨链连接,节点则回复地址列表( IP+跨链端口)

​ 2>peer自有网络连接,节点则回复地址列表(IP+自有链端口)

  • 依赖服务

2.3.11 发送/接收地址逻辑

  • 功能说明:

    接收 网络传送的 addr协议消息处理逻辑

  • 流程描述

    发送addr:

​ 1>在新节点接入时会向同一nodegroup的其他连接peer广播 addr 消息。

​ 2> 在请求getaddr消息时,会得到addr消息回复。

​ 接收addr:

​ 1>判断地址是否本地已经拥有,如果拥有不转发,获取新增的addr。

​ 2>PEER是跨链网络不转发

​ 3>自有网络,新增addr>0, 存储并广播转发(接收peer除外)

  • 依赖服务

2.3.12 跨链server端口的传递

  • 功能说明:

    一个node可以存在2个角色,一个是维护自有的内部链网络。另一个是作为跨链角色维护跨链网络。

    因此在server定义中我们将这2个网络的端口监听进行区分,以便各自相对独立。自有链定义一个serverPort1,跨链部分定义一个serverPort2.

  • 流程描述

    如下图,我们卫星链网络与友链网络产生一个跨链连接,当卫星链中有个节点2连接上节点1时,是通过内部服务Port1来建立的连接,而节点1是可以将节点2 发送给 友链的节点A与节点B来进行连接,则此时发送给友链的信息中 应该是serverPort2,因此serverPort2需要再卫星链的内部交互中进行传递。我们将该部分数据定义在version协议中进行传递。

  • 依赖服务

三、事件说明

3.1 发布的事件

3.1.1 NodeGroup达到节点数量下限

说明:NodeGroup达到节点数量下限,发布该事件

event_topic : "evt_nw_inNodeLimit",

data:{
+    chainId
+    magicNumber
+    nodeCount
+    nodeLimit
+    time
+}
+

3.1.2 NodeGroup少于节点数量下限

说明:NodeGroup少于节点数量下限,发布该事件

event_topic : "evt_nw_lessNodeLimit",

data:{
+    chainId
+    magicNumber
+    nodeCount
+    nodeLimit
+    time
+}
+

3.1.3 节点握手成功

说明:节点握手成功,发布该事件

event_topic : "evt_nw_connectSuccess",

data:{
+    chainId
+    magicNumber
+    nodeId
+    time
+    version
+}
+

3.1.4 节点断开连接

说明:节点断开连接,发布该事件

event_topic : "evt_nw_nodeDisconnect",

data:{
+    chainId
+    magicNumber
+    nodeId
+    time
+    version
+}
+

3.2 订阅的事件

​ 暂无

四、协议

4.1 网络通讯协议

version

用于建立连接(握手)

Length Fields Type Remark
4 version uint32 节点使用的协议版本标识
20 addr_you byte[20] 对方网络地址【IP+PORT1+PORT2】PORT2为跨链server端口 如:[10.32.12.25 8003 9003] 16byte+2byte+2byte
20 addr_me byte[20] 本节点网络地址【IP+PORT1+PORT2】PORT2为跨链server端口 如:[20.32.12.25 7003 6003] 16byte+2byte+2byte
4 block_height uint32 节点高度
block_hash varInt 区块hash
6 network_time uint48 网络时间
?? extend VarByte 扩展字段,不超过10个字节?

verack

用于应答version

Length Fields Type Remark
1 ack_code uint8 返回码,1代表正常,2代表连接已满

ping

用于维护连接,当一段时间未收到某个节点任何信息后,发送该消息,若能得到pong消息的回馈,则节点依然保持连接,否则关闭连接并删除节点

Length Fields Type Remark
4 randomCode uint32 随机数

pong

用于回应ping

Length Fields Type Remark
4 randomCode uint32 随机数

getaddr

用于获取网络中可用节点的连接信息,无消息体

addr

用于应答getaddr,或向网络中宣告自身的存在,节点接收到该消息后,判断节点是否已知,如果是未知节点,则向网络中传播该消息

Length Fields Type Remark
?? addr_list network address 每个节点18字节(16字节IP+2字节port)

bye

用于对等连接主动断开连接,拒绝服务对端消息业务

Length Fields Type Remark
1 byeCode uint8 预留字段

getTime

用于向对等节点获取时间

Length Fields Type Remark
4 messageId uint32 请求id

responseTime

回复对等节点时间

Length Fields Type Remark
4 messageId uint32 请求id
4 time uint32 时间值

4.2 交易协议

​ 暂无

五、模块配置

[network]
+network.self.server.port=8003
+network.self.chainId=9861
+network.self.magic=68866996
+network.self.max.in=100
+network.self.max.out=10
+network.self.seed.ip=127.0.0.1:8003
+#卫星链配置信息
+network.moon.node=true
+network.moon.server.port=8004
+network.moon.max.in=100
+network.moon.max.out=10
+network.moon.seed.ip=215.159.216.58:8003,215.159.69.140:8003,223.206.200.74:8003
+

六、Java特有的设计

七、补充内容

Last Updated: 2019-1-10 20:03:04
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/randomRPC.html b/docs/.vuepress/dist/zh/NULSInfrastructure/randomRPC.html new file mode 100644 index 00000000..d5f58e33 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/randomRPC.html @@ -0,0 +1,193 @@ + + + + + + 钱包增加随机种子 | NULS + + + + + + + +

钱包增加随机种子

一 、钱包增加随机种子RPC接口

获取的随机种子是大数字,注意,它可能是负数

根据高度区间获取随机种子列表:

URL:/random/seeds/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True 区间起始高度
endHeight Long True 区间截止高度,不能超过startHeight+1000

Returns:

field type Remark
success boolean 是否成功
data array 种子数组

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

根据高度区间获取随机种子列表:

URL:/random/seeds/count

Method:GET

Prams:

parameter type Required remark
height Long True 获取种子列表的最高高度
count Long True 随机种子数量,不能超过128

Returns:

field type Remark
success boolean 是否成功
data array 种子数组

Example:

Request:

curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": [
+    "8486473738212806059384942122915964966516544811115122625378589706648696927875",
+    "5763677830362183770819418466587054532227472729077319516033962399030101482330",
+    "-21576822359476915572374120992682286995340746526938743512234391635989859550499",
+    "21657748356022199241379814087980601843534504184851063250908405386419429001546",
+    "-31320197741848993348465901825403870475226356831977749494101003161293910010564",
+    "16054257794265746474880657765642725318937086559191102027715411501558318980478",
+    "39222628335763902261547055653161137231901517785016195993008289217415793052023",
+    "28759812140738813907858073405869390691919557824743093132519210315994120629868",
+    "26779511442264535228335930919961858598639368721086477781863239801135250744386",
+    "-23481782415506504277094909296039579696138464413290902597168011374639343982630"
+  ]
+}
+

根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回:

URL:/random/seed/height

Method:GET

Prams:

parameter type Required remark
startHeight Long True 区间起始高度
endHeight Long True 区间截止高度,endHeight-startHeight<=1000
algorithm String false 默认为sha3算法,支持sha3、KECCAK、merkle算法

Returns:

field type Remark
success boolean 是否成功
data Object 结果对象
seed String 计算的随机种子结果
algorithm String 计算的 算法
count int 原始随机种子个数

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "sha3",
+    "count": 10
+  }
+}
+

根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回:

URL:/random/seed/count

Method:GET

Prams:

parameter type Required remark
height Long True 获取种子列表的最高高度
count Long True 随机种子数量,不能超过128
algorithm String false 默认为sha3算法,支持sha3、KECCAK、merkle算法

Returns:

field type Remark
success boolean 是否成功
data Object 结果对象
seed String 计算的随机种子结果
algorithm String 计算的 算法
count int 原始随机种子个数

Example:

Request:

curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json"
+

Response:

{
+  "success": true,
+  "data": {
+    "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457",
+    "algorithm": "merkle",
+    "count": 10
+  }
+}
+

二、智能合约支持底层链随机数

与以上RPC接口相同,在智能合约SDK中支持了相同的方法来获取底层区块链提供的随机数种子,如以下代码。 +后面将以其中一个方法Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)为例,展示如何使用随机数种子产生随机数。

1) io.nuls.contract.sdk.Utils

/**
+ * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @param algorithm hash算法标识
+ * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm);
+
+/**
+ * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long endHeight, int seedCount) {
+    return getRandomSeed(endHeight, seedCount, "SHA3");
+}
+
+/**
+ * [Testnet]根据高度范围,用特定的算法生成一个随机种子
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @param algorithm   hash算法标识
+ * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm);
+
+/**
+ * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes))
+ */
+public static BigInteger getRandomSeed(long startHeight, long endHeight){
+    return getRandomSeed(startHeight, endHeight, "SHA3");
+}
+
+/**
+ * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合
+ *
+ * @param endHeight 截止高度
+ * @param seedCount 原始种子数量
+ * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long endHeight, int seedCount);
+
+/**
+ * [Testnet]根据高度范围,获取原始种子的集合
+ *
+ * @param startHeight 起始高度
+ * @param endHeight   截止高度
+ * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes))
+ */
+public static native List<BigInteger> getRandomSeedList(long startHeight, long endHeight);
+

2) 例子同时摇N一个骰子

2.1) 计算方式一

  • 获取原始种子Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • 根据骰子范围求模得到第一个随机数
  • 下一个随机数的计算方式 +
    • 原始种子乘以投掷次数,得到的结果转换成字节数组
    • 把字节数组进行SHA3-256得到32位字节数组的Hash
    • 把此Hash的字节数组转换为BigInteger大数字
    • 将此BigInteger大数字根据骰子范围求模得到下一个随机数
    • 以此类推

参考以下代码

public List<Integer> dice(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    for (int i = 0; i < times; i++) {
+        if(i == 0) {
+            BigInteger mod = orginSeed.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        } else {
+            BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1));
+            String s = sha3(multiply.toByteArray());
+            byte[] decode = decode(s);
+            BigInteger bigInteger = new BigInteger(decode);
+            BigInteger mod = bigInteger.mod(wrapperRange);
+            resultList.add(mod.intValue());
+        }
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+

2.2) 计算方式二

  • 获取原始种子Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)
  • 根据骰子范围求模得到第一个随机数
  • 下一个随机数的计算方式 +
    • 获取原始种子大数字的末位数字(根据投掷次数获取倒数第几位),将此末位数字乘以原始种子,得到的结果转换成字节数组
    • 把字节数组进行SHA3-256得到32位字节数组的Hash
    • 把此Hash的字节数组转换为BigInteger大数字
    • 将此BigInteger大数字根据骰子范围求模得到下一个随机数
    • 以此类推

参考以下代码

public List<Integer> diceAnother(long endHeight, int count, int range, int times) {
+    BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3");
+    if (orginSeed.equals(BigInteger.ZERO)) {
+        return null;
+    }
+    BigInteger wrapperRange = BigInteger.valueOf((long) range);
+    List<Integer> resultList = new ArrayList<Integer>(times);
+    BigInteger mod = orginSeed.mod(wrapperRange);
+    resultList.add(mod.intValue());
+    String orginStr = orginSeed.toString();
+    int length = orginStr.length();
+    for (int i = 1; i < times; i++) {
+        int c = orginStr.charAt(length - i);
+        BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c));
+        String s = sha3(multiply.toByteArray());
+        byte[] decode = decode(s);
+        BigInteger bigInteger = new BigInteger(decode);
+        mod = bigInteger.mod(wrapperRange);
+        resultList.add(mod.intValue());
+    }
+    return resultList;
+}
+
+public byte[] decode(String hexString) {
+    byte[] bts = new byte[hexString.length() / 2];
+    for (int i = 0; i < bts.length; i++) {
+        bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16);
+    }
+    return bts;
+}
+
Last Updated: 2019-2-19 14:26:14
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/rpcToolWebsocketDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/rpcToolWebsocketDesign.html new file mode 100644 index 00000000..12d75854 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/rpcToolWebsocketDesign.html @@ -0,0 +1,331 @@ + + + + + + RPC-Tool-WebSocket设计 | NULS + + + + + + + +

RPC-Tool-WebSocket设计

Websocket-Tool设计文档——第四版

[TOC]

写在最前的话

如果想知道websocket的具体设计,请逐步阅读本文档
+
+如果只想知道如何使用,请跳转到章节《7.1 如何使用》
+

一、总体描述

1.1 概述

1.1.1 为什么要有《Websocket-Tool》

  • NULS 2.0根据功能划分模块,所有模块隔离,可以独立运行。
  • 模块间通过《Websocket-Tool》调用接口
  • 模块只要实现了规定接口,可以用任何语言实现
  • 模块可以分布式部署
  • 《Websocket-Tool》会打包成jar包,供各模块引用

1.1.2 《Websocket-Tool》要做什么

所有模块间的接口调用都通过《Websocket-Tool》进行

  • 启动Websocket Server
  • 注册当前模块的所有cmd命令
  • 把当前模块信息汇报给kernel
  • 接收从kernel推送的所有模块信息
  • 启动Websocket Client
  • 维护调用过程产生的数据
  • 封装所有数据中间处理过程,各模块只需要关心 +
    • 输入
    • 输出
  • 各模块通过尽可能简单的方式调用cmd命令

1.1.3 《Websocket-Tool》在系统中的定位

《Websocket-Tool》是底层框架,任何模块都会依赖

《Websocket-Tool》维护各模块基础信息,但是不涉及具体业务

二、功能设计

2.1 架构图

三、接口设计

四、事件说明

五、协议

5.1 通信协议 – Json/WebSockets

微服务的行为不像标准的客户端 - 服务器基础设施,因为每个微服务同时是客户端和服务器,因此需要全双工通信协议,这允许实现特殊类型的发布 - 订阅模式; 在这个实现中,方法只能被调用一次,然后调用者可以通过两种不同的方式接收不断的更新:

  • 基于事件:当方法在预定义数量的事件之后发送通知时
  • 基于时间:当方法在预定义的秒数后发送通知时

WebSocket是一种成熟的选项,可以本机提供全双工连接,其他选项如标准Json-RPC不提供双向通道。 +消息将使用JSon格式进行编码,因为它是最广泛用于消息交换的,并且易于调试。

5.2 消息结构

所有消息都有一个由5个字段组成的公共基础结构:

  • MessageID:这是一个标识请求的字符串。 它的长度不应超过256个字符
  • Timestamp:自纪元以来的秒数(1970年1月1日格林威治标准时间00:00:00)
  • TimeZone:发起请求的时区,它应为介于-12和12之间的数字
  • MessageType:消息类型,这些在第3节中指定
  • MessageData:保存消息有效负载的Json对象

示例:

{  
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"NegotiateConnection",
+    "MessageData":{
+        "CompressionRate":"3",
+        "CompressionAlgorithm":"zlib"
+    }
+}
+

5.3 Message Types

目前只定义了9种类型的消息:NegotiateConnection, NegotiateConnectionResponse, Request, Unsubscribe, Response, Ack, Notificatioin, RegisterCompoundMethod, UnregisterCompoundMethod

5.3.1 NegotiateConnection

这应该是在与微服务建立连接时应该发送的第一个对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。

它由两个字段组成:

  • CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。
  • CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩

示例:

{
+    "messageId":"1",
+    "timestamp":"1543133816985",
+    "timezone":"9",
+    "messageType":"NegotiateConnection",
+    "messageData":{
+        "protocolVersion":"1.0",
+        "compressionAlgorithm":"zlib",
+        "compressionRate":"0"
+    }
+}
+

5.3.2 NegotiateConnectionResponse

仅在响应先前传入的NegotiateConnection消息时发送此类消息。 它由两个字段组成:

  • NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1
  • NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"NegotiateConnectionReponse",
+    "MessageData":{
+        "NegotiationStatus":"0",
+        "NegotiationComment":"Incompatible protocol version"
+    }
+}
+

5.3.3 Request

调用者服务必须发送一个Request对象来执行Nulstar网络内某些服务提供的方法。

如果在单个请求对象中包含两个或更多方法,则应按顺序执行方法,然后发送一个response包喊所有回执信息,如果其中一个请求失败,则整个操作被视为失败。

它由六个字段组成:

  • RequestAck(默认值:0):这是一个布尔值

    • 0:发出的请求只需要一条Response消息,如果它订阅了该函数,那么它可能会有很多响应消息
    • 1:发出的请求需要Ack和Response(译者注:有的请求可能需要一段时间处理,不会立刻返回Response,但是我要确保对方接收到了我的请求),如果它订阅了该函数,那么它可能会有很多响应消息
  • SubscriptionEventCounter(默认值:0):这是一个无符号整数,指定目标方法发送Response的值的改变次数。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每改变两次就发送。以此类推。

  • SubscriptionPeriod(默认值:0):这是一个无符号整数,指定目标方法发送Response的时间间隔。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每2秒都会检测是否发送。以此类推。

  • SubscriptionRange:如果请求的事件返回的是一个数字,则定义何时返回这个数字。 +这是一个字符串,表示将触发响应的条件。 字符串是一对带符号的十进制数,第一个是下限,第二个是上限,如果不可用则为空。 如果该对分别以“(”或“)”开始或结束,则表示该数字不包括在内,如果该对分别以“[”或“]”开始或结束,则表示该数字包括在内。

    示例:假设我们只希望仅在余额等于或大于1000时收到通知。然后,getbalance请求应以“[1000,)”字符串作为SubscriptionRange参数发送

  • ResponseMaxSize(默认值:0):无符号整数,指定方法应返回的最大对象数,值为零(默认值)表示无限制。只针对返回结果为List有效,指定的是返回的记录个数。

  • RequestMethods:一个数组,包含所请求的所有方法及其各自的参数

示例:

{
+    "messageId":"3",
+    "timestamp":"1543133968578",
+    "timezone":"9",
+    "messageType":"Request",
+    "messageData":{
+        "requestAck":"0",
+        "subscriptionEventCounter":"0",
+        "subscriptionPeriod":"5",
+        "subscriptionRange":"0",
+        "responseMaxSize":"0",
+        "requestMethods":{
+            "getHeight":{
+                "paramName":"value",
+                "version":"1.0"
+            }
+        }
+    }
+}
+

5.3.4 Unsubscribe

当服务不再希望从其订阅的方法接收响应时,它必须向目标服务发送Unsubscribe消息。

它由一个字段组成:

  • UnsubscribeMethods:一个数组,包含调用者想要取消订阅的所有方法

示例:

{
+    "messageId":"4",
+    "timestamp":"1543134296019",
+    "timezone":"9",
+    "messageType":"Unsubscribe",
+    "messageData":{
+        "unsubscribeMethods":[
+            "getHeight"
+        ]
+    }
+}
+

5.3.5 Response

当目标服务完成处理请求时,应该发送响应以及操作结果。

它由六个字段组成:

  • RequestID:这是引用的原始Request消息请求ID
  • ResponseProcessingTime:目标服务处理请求所用的时间(以毫秒为单位)
  • ResponseStatus:响应状态,如果成功则为1,否则为0
  • ResponseComment:一个字符串,可以提供有关该过程结果的更多说明
  • ResponseMaxSize:响应包含每个请求的最大对象数
  • ResponseData:一个对象数组,包含已处理方法的结果,每个请求一个对象

示例:

{
+    "messageId":"9",
+    "timestamp":"1543134299030",
+    "timezone":"9",
+    "messageType":"Response",
+    "messageData":{
+        "requestId":"5",
+        "responseProcessingTime":"1",
+        "responseStatus":"1",
+        "responseComment":"Congratulations! Processing completed!",
+        "responseMaxSize":"0",
+        "responseData":{
+            "getHeight":"getHeight->1.3"
+        }
+    }
+}
+

3.5.6 Ack

其唯一目的是通知呼叫者已成功接收请求。

它由一个字段组成:

  • RequestID:这是引用的原始Request消息请求ID

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"Ack",
+    "MessageData":{
+        "RequestID":"sdj8jcf8899ekffEFefee"
+    }
+}
+

3.5.7 Notification

当需要将某些事件通知给连接的组件而不期望响应消息时(例如,即将对服务执行升级时),将发送此消息类型。 通知将信息推送到其他组件,因此通知只应由Manager,Controller和Connector模块使用

它由四个字段组成:

  • NotificationAck :(默认值:0):这是一个布尔值 +
    • 0:发出的通知不期望任何类型的消息作为回执
    • 1:发出的通知需要一条Ack消息
  • NotificationType:通知的类别,每个服务都可以定义自己的类型,因此不需要接收方处理此字段
  • NotificationComment:字符串注释,提供有关通知原因的更多信息
  • NotificationData:与通知相关的数据,接收方不需要处理此字段

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"Notification",
+    "MessageData":{
+        "NotificationAck":"1",
+        "NotificationType":"SystemUpgrade",
+        "NotificationComment":"A system upgrade is about to be performed!",
+        "NotificationData":{
+            "Date":"2018-11-11",
+            "Time":"23:00:00",
+            "NewVersion":"1.1.6"
+        }
+    }
+}
+

3.5.8 RegisterCompoundMethod

请求可以由多个方法组成,使用此消息类型,我们注册一个虚拟方法,该方法将按顺序执行其各个实际方法,如果其子方法之一失败,则虚方法返回失败。

某些子方法可能共享相同的参数名称,因此可以创建别名,如示例中所示。

它由三个字段组成:

  • CompoundMethodName:这是标识虚方法的字符串
  • CompoundMethodDescription:描述方法功能,在查询API以获取帮助时将提供描述
  • CompoundMethods:这是一个数组,包含构成虚方法的各自参数别名的方法

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"RegisterCompoundMethod",
+    "MessageData":{
+        "CompoundMethodName":"GetMyInfo",
+        "CompoundMethodDescription":"Get useful information.",
+        "CompoundMethods":{
+            "GetBalance":{
+                "Address":"GetBalanceAddress"
+            },
+            "GetHeight":{
+
+            }
+        }
+    }
+}
+

在该示例中,正在注册一个名为GetMyInfo的虚方法,它由GetBalance和GetHeight方法组成,还为Address参数创建了一个名为GetBalanceAddress的别名。 +GetMyInfo的请求可以作为标准方法发送。

(我确实没看懂这个的意义在哪,感觉就是单纯为了多这么个功能,有疑问请直接找Berzeck或者坚哥,哈哈)

3.5.9 UnregisterCompoundMethod

此消息类型用于取消注册复合(虚拟)方法。

它由一个字段组成:

  • UnregisterCompoundMethodName:这是标识虚方法的字符串。 如果它为空,则应取消注册调用者注册的所有虚拟方法

示例:

{
+    "MessageID":"45sdj8jcf8899ekffEFefee",
+    "Timestamp":"1542102459",
+    "TimeZone":"-4",
+    "MessageType":"UnregisterCompoundMethod",
+    "MessageData":{
+        "UnregisterCompoundMethodName":"GetMyInfo"
+    }
+}
+

5.4 具体细节

  • 传输过程的所有属性都是string类型

  • 如果是boolean类型,"1"代表true,"0"代表false

  • 当调用一个方法的时候,调用者需要知道:提供方法的角色,以及方法的使用方式

  • 注册的时候,Role1有method1,Role2有method2,如何定义? +答:不需要定义,这是写在文档中的。 +apiMethods = Role1Methods + Role2Methods。因此注册的时候不需要知道每个Role都包含什么方法,这些应该在文档中体现。

  • 注册接口的字符串格式

    {
    +    "messageId":"2",
    +    "timestamp":"1543204508986",
    +    "timezone":"9",
    +    "messageType":"Request",
    +    "messageData":{
    +        "requestAck":"0",
    +        "subscriptionEventCounter":"0",
    +        "subscriptionPeriod":"0",
    +        "subscriptionRange":"0",
    +        "responseMaxSize":"0",
    +        "requestMethods":{
    +            "registerAPI":{
    +                "apiMethods":[
    +                    {
    +                        "methodName":"getHeight",
    +                        "methodDescription":"test getHeight 1.1",
    +                        "methodMinEvent":"0",
    +                        "methodMinPeriod":"0",
    +                        "methodScope":"private",
    +                        "parameters":[
    +                            {
    +                                "parameterName":"aaa",
    +                                "parameterType":"int",
    +                                "parameterValidRange":"(1,100]",
    +                                "parameterValidRegExp":""
    +                            },
    +                            {
    +                                "parameterName":"bbb",
    +                                "parameterType":"string",
    +                                "parameterValidRange":"",
    +                                "parameterValidRegExp":"^[A-Za-z0-9\\-]+$"
    +                            }
    +                        ]
    +                    },
    +                    {
    +                        "methodName":"getHeight",
    +                        "methodDescription":"test getHeight 2.0",
    +                        "methodMinEvent":"0",
    +                        "methodMinPeriod":"0",
    +                        "methodScope":"private",
    +                        "parameters":[
    +
    +                        ]
    +                    }
    +                ],
    +                "dependencies":{
    +                    "Role_Ledger":"1.1"
    +                },
    +                "connectionInformation":{
    +                    "IP":"192.168.1.65",
    +                    "Port":"17733"
    +                },
    +                "moduleDomain":"nuls.io",
    +                "moduleRoles":{
    +                    "cm":[
    +                        "1.1",
    +                        "1.2"
    +                    ]
    +                },
    +                "moduleVersion":"1.2",
    +                "moduleAbbreviation":"cm",
    +                "moduleName":"Chain Manager"
    +            }
    +        }
    +    }
    +}
    +
  • Manager返回各模块连接信息的字符串格式

    {
    +    "messageId":"8",
    +    "timestamp":"1543204714006",
    +    "timezone":"9",
    +    "messageType":"Response",
    +    "messageData":{
    +        "requestId":"2",
    +        "responseProcessingTime":"1",
    +        "responseStatus":"1",
    +        "responseComment":"Congratulations! Processing completed!",
    +        "responseMaxSize":"0",
    +        "responseData":{
    +            "registerAPI":{
    +                "Dependencies":{
    +                    "test":{
    +                        "APIVersion":[
    +                            "1.0"
    +                        ],
    +                        "IP":"192.168.1.65",
    +                        "Port":"14694"
    +                    },
    +                    "ke":{
    +                        "APIVersion":null,
    +                        "IP":"192.168.1.65",
    +                        "Port":"8887"
    +                    },
    +                    "cm":{
    +                        "APIVersion":[
    +                            "1.1",
    +                            "1.2"
    +                        ],
    +                        "IP":"192.168.1.65",
    +                        "Port":"17733"
    +                    }
    +                }
    +            }
    +        }
    +    }
    +}
    +

六、配置

七、Java特有的设计

7.1 设计

io.nuls.rpc

client

WsClient:与其他模块建立连接的对象,完全封装,不需要开发人员关注

ClientRuntime:客户端运行时需要的数据,方法

CmdDispatcher:开发人员应该只使用它来调用接口

cmd

cmd_package_1

cmd_package_2

BaseCmd:所有对外提供方法的类的父类,提供success, failed方法返回Response对象

info

Constants:常量

HostInfo:获取IP地址,随机获得端口

model

message

Message:所有消息都应该用该对象进行传输

MessageType:消息类型(包含以下9种)

Ack:确认收到消息

NegotiateConnection:握手

NegotiateConnectionResponse:回复握手

Notification:通知

Request:请求调用远程方法

Response:回复Request

Unsubscribe:取消订阅的远程方法

RegisterCompoundMethod:订阅多个远程方法

UnregisterCompoundMethod:取消订阅多个远程方法

CmdAnnotation:注解类,有该注解的方法可以对外提供接口

Parameter:注解类,用以描述对外提供接口的参数信息

Parameters:注解类,Parameter的集合

CmdDetail:对外提供的方法的具体信息

CmdParameter:对外提供的方法的参数信息

ModuleE:枚举类型,NULS2.0基础架构下的模块信息

RegisterApi:一个模块对外提供的所有方法的合集

server

CmdHandler:根据Request消息,调用正确的方法

ServerRuntime:服务器运行时需要的参数,方法

WsProcessor:处理收到的消息队列

WsServer:服务器对象,负责接收消息,然后放入消息队列

7.2 如何使用

Websocket-Tool会做成JAR包供各模块引用

7.2.1 测试专用:模拟kernel

非常重要!

各模块接口是在kernel中进行维护,但是kernel由社区成员开发,因此这一部分是内部测试的模拟代码,可以直接复制使用,无需额外操作。

(test/java/io.nuls.test.WsKernel)

@Test
+public void kernel() throws Exception {
+    // url: "ws://127.0.0.1:8887"
+    WsServer.mockKernel();
+}
+

7.2.2 自定义cmd

scope的值:public,private,admin

  • public:暴露出去,第三方应用/平台也能调用的公开接口
  • private:只有模块间内部才能调用的接口
  • admin:专门为管理员设计的特定接口(管理员定义在在Berzeck的connector中,我们并不需要关心)
/*
+ * 该类所在的包需要通过7.1.3中的方法进行扫描
+ */
+public class MyCmd extends BaseCmd {
+
+    @CmdAnnotation(cmd = "getHeight", version = 1.0, scope = "private", minEvent = 0, minPeriod = 0,
+            description = "test getHeight 1.0")
+    @Parameter(parameterName = "aaa", parameterType = "int", parameterValidRange = "(1,100]", parameterValidRegExp = "")
+    @Parameter(parameterName = "bbb", parameterType = "string")
+    public Object getHeight1(Map map) {
+        Log.info("getHeight version 1");
+        // success
+        return success("Here is your real return value");
+        // 预定义错误
+        return failed(ErrorCode);
+        // 非预定义错误
+        return failed(String)
+    }
+}
+

7.2.3 启动Server

// Start server instance
+WsServer.getInstance(ModuleE.CM)
+    .moduleRoles(new String[]{"1.0", "2.4"})
+    .moduleVersion("1.2")
+    .dependencies(ModuleE.LG.abbr, "1.1")
+    .dependencies(ModuleE.BL.abbr, "2.1")
+    .scanPackage("io.nuls.rpc.cmd.test")
+    .connect("ws://127.0.0.1:8887");
+
+// Get information from kernel
+CmdDispatcher.syncKernel();
+

7.2.4 为kernel提供的接口

现阶段忽略!


+

7.2.5 调用cmd

/*
+  单元测试专用:单元测试时需要告知内核地址,以及同步接口列表
+  如果不是单元测试,在模块中进行连调测试,下面两句话是不需要的
+  */
+WsServer.mockModule();
+/*
+  单元测试专用结束
+  */
+
+
+// Build params map
+Map<String, Object> params = new HashMap<>();
+// Version information ("1.1" or 1.1 is both available)
+params.put(Constants.VERSION_KEY_STR, "1.0");
+params.put("paramName", "value");
+
+// 可以看成是一个同步方法,发送Request,获得Response
+Response response = CmdDispatcher.requestAndResponse(ModuleE.CM.abbr, "getHeight", params);
+
+// 发送Request,当有Response的时候会自动调用预设的方法,返回的messageId是为了取消订阅
+String messageId = CmdDispatcher.requestAndInvoke(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2");
+
+// 与requestAndInvoke一样,但是必须在收到Ack之后才会返回messageId
+String messageId = CmdDispatcher.requestAndInvokeWithAck(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2");
+
+// 取消订阅
+CmdDispatcher.unsubscribe(messageId);
+System.out.println("我已经取消了订阅");
+
+

八、补充内容

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/NULSInfrastructure/transactionModuleDesign.html b/docs/.vuepress/dist/zh/NULSInfrastructure/transactionModuleDesign.html new file mode 100644 index 00000000..97a06be5 --- /dev/null +++ b/docs/.vuepress/dist/zh/NULSInfrastructure/transactionModuleDesign.html @@ -0,0 +1,429 @@ + + + + + + 交易管理模块设计文档 | NULS + + + + + + + +

交易管理模块设计文档

[TOC]

一、总体概览

1.1 模块概述

1.1.1 为什么要有《交易管理》模块

​ 在NULS2.0的生态体系中,交易会在链中或者链与链之间流转,各条链的节点不仅要处理链内的交易,可能还会处理跨链的交易,于是每个节点需要处理的交易会越来越多,并且更复杂,因此我们需要一个但单独的模块来统一处理各种交易。而从NULS2.0的架构设计来看,我们需要一个独立的模块来处理交易的收集、验证、存储以及转发等功能,对于所有交易来说,这些功能具有共用性、统一性,因此我们把交易管理作为一个独立的模块来运行。

1.1.2《交易管理》模块要做什么

交易管理最核心的工作主要从两个方面来看:

一、对本地交易进行处理

  • 收集交易
  • 本地验证
  • 提取可打包的交易
  • 提交、回滚交易
  • 保存未确认的、可打包的以及已确认的交易
  • 提供交易的数据查询

二、对跨链交易的处理

交易管理模块需要对跨链交易进行跨链验证,而跨链验证涉及到不同链不同节点之间的交互,主要有以下三种跨链交易需要处理:

  1. 友链向NULS主网发送交易

​ 首先友链节点发起一笔新的跨链交易,在友链内部进行确认,当在该友链达到一定确认块数后,友链节点将向NULS主网节点发送这笔跨链交易。 例如友链节点A向NULS主网节点S发送了这笔跨链交易,NULS主网节点S会向友链中除节点A以外的节点发送该笔交易进行验证。 NULS主网节点S将会收到多个友链节点的验证结果,然后进行计算得出节点S自己的跨链验证结果,然后广播给NULS主网其他节点,因此NULS主网的每个节点都会收到其他所有节点的验证结果,最后计算出NULS主网最终的验证结果。

  • 在这个过程中NULS主网的交易管理模块将会接收来自友链的新的跨链交易
  • 交易管理模块在对新的跨链交易做基础验证后向友链其他节点进行验证,计算出结果后广播结果到NULS主网
  • NULS主网各个节点会在交易管理模块中统计各个节点的验证结果,并计算NULS主网最终结果
  1. NULS主网向友链发送交易

​ 当NULS主网节点发起一笔新的跨链交易时,首先要在交易管理模块中对跨链交易进行本地验证,然后发送共识模块打包确认,当在NULS主网中达到一定的确认块数时,交易管理模块将取出该跨链交易发送到目标链。 例如NULS主网节点S向目标链节点A发送了该笔交易,目标链节点A将会向NULS主网除S节点以外的节点发送该交易进行验证。 A节点得到多个NULS主网节点的结果后进行计算,得到A节点的最终跨链验证结果并广播到目标链。目标链的节点都会收到其他所有节点的结果,然后再计算出目标链最终验证结果。

  • 交易管理模块从已确认的块中取出跨链交易,发送跨链交易给目标链
  • 交易管理模块接收目标链节点的验证请求,提取对应的交易发送回去
  1. 友链向友链发送交易

由于友链之间的协议可能是不兼容的,所以他们之间的交易需要由NULS主网来中转,友链向友链发送交易的流程,其实就是先后完成了友链向NULS主网发送交易,NULS主网向友链发送交易这两个流程,其中交易管理模块起到的作用是基本相同的。

1.1.3 《交易管理》在系统中的定位

在整个系统中,交易管理控制着所有交易的验证和流转

正常运行时需要依赖

  • 核心模块
  • 网络模块
  • 链管理模块
  • 账本模块

1.2 架构图

整个模块大致分为3个部分: 接口、实现层、本地存储

实现层中含有4个部分

  • 接口的功能实现逻辑
  • 验证器管理器,根据需要来调用交易验证器
  • 各种队列,用于交易接收、异步验证处理以及推送共识等操作
  • 缓存,维护节点组,链数据等基础数据

二、功能设计

2.1 功能架构图

2.2 核心流程

2.2.1 交易管理缓存其他模块的数据

模块启动时需要获得其他模块的基础数据

  • 维护链管理模块中所有链的基础数据

    获取数据的方式:

    1. 链管理后启动完成后,调用链管理模块接口
    2. 有新的链完成注册时,定时获取,事件通知
  • 维护一个以交易类型为key的交易与其验证器、处理器提交接口、回滚接口的对应关系。

    获取数据的方式:各模块启动后自行调用交易管理模块注册交易接口进行注册

2.2.2 收集新交易

  • 由本节点各模块新创建的交易

    各模块新创建的交易(包含跨链交易),通过交易管理模块提供的接口newTx进行收集,模块收到一个新交易后将会进行基本的验证,然后放到待验证本地交易队列中,等待进行验证流程。

    注意:待验证本地交易队列中也会存在跨链交易,这是所有交易的本地验证流程。

  • 由其他节点广播的跨链交易

    其他节点广播的跨链交易(前提是该跨链交易在创建该交易的链中已打包确认一定的高度),将会通过网络消息的方式进行发送,首先发送的是交易的hash,交易管理模块收到后再发送索取完整交易的消息,之后才会接收到完整的跨链交易。收到后同样会进行基础的验证,然后放入待验证跨链交易队列中,等待进行验证流程。

2.2.3 跨链交易详细流程

例如:从A链的a地址发起一笔交易atx,转移aCoin到B链b地址中 (A -->NULS主网 --> B)

  • A链中a地址以A链链id(ChainId)起始的NULS体系格式的地址
  • B链中b地址是以B链链id起始的NULS体系格式的地址
  • 当资产转移到b地址后,b地址不允许在A链中发起交易

即:其他链地址不能在本链发起交易。

(1) 跨链交易在A链中的本地流程

  1. 账本模块生成转账交易atx,如果生成的是跨链交易,需要同时调用跨链模块生成NULS主网协议的atx_trans并签名。

    • 根据NULS主网协议,从atx提取type、time、remark、txData放入新生成的atx_trans中。

    • 提取CoinData数据,如果是UTXO模型,则需要根据资产、input、output以及手续费,计算出实际的支付金额,生成NULS主网协议(账户余额模型)的from。

      from总额 = input_utxo总额 - output_utxo(非找零部分) - 手续费

      再计算NULS主网协议的to

      to = output_utxo(非找零部分)

      注意:考虑多地址转账,计算from要以input中UTXO的所有者为单位,如果是多个地址的utxo,要以utxo的所有者为单位,计算出多个input,output也是如此。

      例如:input有3个地址的utxo,转出给2个不同的地址(非找零地址),将计算出3个账户余额模型的from

      from_1 = input_utxo1

      from_2 = input_utxo2

      from_3 = from总额 - input_utxo1 - input_utxo2

      to_1 =output中(非找零部分)_addr_1

      to_2 =output中(非找零部分)_addr_2

      最终结果必须满足:from总额 <= input_utxo总额、to总额 = output_utxo(非找零部分之和)。

    • 如果是账户余额模型,则提取对应的from和to,生成NULS主网协议的CoinData

    • atx_trans 交易的txData中包含atx交易的hash

    • 最后对 atx_trans 交易进行签名,设置scriptSig

  2. atx_trans跨链交易通过接口newCrossTx发送到交易管理模块等待广播; atx转账交易在A链中生成后,发送到交易管理模块中,通过newTx接口对交易数据的基本格式以及合法性进行基础验证,然后存放到待验证本地交易队列中。

    • 接收交易对交易数据反序列化成Transaction

    • 对Transaction 数据的基本格式,合法性,和完整性进行校验

    • 对coinData中链和资产的基本格式,合法性,和完整性进行校验

  3. 验证交易的定时任务Task将会从该队列中取出交易,首先通过账本模块验证coinData,验证通过之后跟交易类型从缓存中找到对应的交易验证器,再调用验证接口进行验证,验证通过的交易通过newHash广播给链内其他节点,同时通过newCrossHash广播主网协议的交易atx_trans,并将放入交易管理模块待打包交易内存池,等待共识打包。

    • 定时取出待确认交易

    • 通过调用账本模块接口对CoinData进行验证

    • 通过调用交易的验证器接口对交易进行验证

    • 验证通过的交易放入待打包交易内存池

  4. 当共识需要打包的时候会根据链id、规定的结束打包时间、交易数据最大容量值来调用tx_packableTxs接口获取可打包交易集合,这时交易管理模块将从待打包交易内存池中获取交易,再进行验证。

    • 首先从待打包交易内存池中拿出一个交易,再进行单独的验证流程(与步骤2基本一致),然后按模块放对应的集合。

    • 重复这个过程直到达到规定结束打包时间或交易最大容量值。

  5. 根据账本模块的统一验证器一次性验证所有交易的CoinData,得到未通过验证的交易,过滤掉未通过验证的交易;再根据各模块统一交易验证器来验证各自模块的交易集合,得到未通过验证的交易再汇总结果,然后返回可打包的交易集合给共识模块。

  6. 当打包的区块在验证通过后,区块管理模块将调用交易对应的tx_commit提交接口,调用账本模块接口更新余额等账本数据,最后再调用保存交易接口tx_save,完成后则意味着交易被区块链确认。

    PS:如果一个交易为非跨链交易,到这一步时正常交易流程已完成。

(2) 跨链交易进入跨链流程

  1. A链节点的交易管理模块将会一直扫描区块链中的跨链交易,当发现atx交易被区块链确认n个高度后,A链节点交易管理模块发送消息将atx_trans交易发送给连接的NULS主网节点(多个)

    发送跨链交易流程

    1. A链节点Anode1先通过消息接口newCrossHash广播atx_trans交易的hash给连接的NULS主网节点。
    2. 交易管理模块获得的交易hash后,再通过askCrossTx发送获取完整跨链交易的消息到A链节点Anode1。
    3. A链节点Anode1收到该请求,再将完整的atx_trans跨链交易通过newMnTx发送给主网节点Mn,主网节点交易管理模块解析处理atx_trans交易。
  2. NULS主网节点交易管理模块先反序列化atx_trans交易,然后进行校验。

    • 对交易数据的基本格式,合法性,和完整性进行校验;
    • 对coinData里链和资产的基本格式,合法性,和完整性进行校验。
  3. 进行跨链验证,NULS主网节点Mn将通过消息接口verifyFc发送atx_hash(协议转换前的交易hash)、atx_trans_hash(NULS主网收到的协议转换后的完整交易hash)给与A链连接的节点中除Anode1之外的节点验证atx_trans交易。

    A链中执行验证的节点Anode2的验证逻辑

    1. 网络模块接收消息后,通过接口verifyFc将消息发送给交易管理,交易管理模块先通过atx_hash从数据库中查询对应的atx交易,并且验证该交易所在的区块已经被确认n个区块高度。
    2. 将atx交易进行协议转换生成新的Anode2_atx_trans,再验证接收到的atx_trans_hash与Anode2_atx_trans_hash一致。

    通过以上两个验证之后,节点Anode2将通过verifyResult将atx_trans_hash和确认高度发送给NULS主网节点Mn。

    注意:NULS主网节点通过网络模块向A链节点组发送跨链验证消息verifyFc时,交易管理将会缓存发送成功和失败的节点信息,如果成功发送的节点数小于S(Mn与A链连接的节点数的51%),则重新发送给失败的节点,直到S不小于51%。

  4. NULS主网节点Mn(共识节点)收到A链节点Anode2对交易atx_trans的验证结果的消息,通过交易管理verifyResult接口发送到交易管理中,交易管理会将验证结果与发送的成功的节点对应着缓存起来。Mn收到所有自己发出的求证的回应结果后,计算出验证通过的百分比,如果超过全部链接节点51%的节点验证通过(发送失败的节点视为不通过),则节点Mn判定交易atx_trans的验证通过。

    小结:节点Mn收到的验证结果数量不能小于S,如果小于S则重新发送verifyFc给未回应结果的节点,NULS主网的普通节点询问A链任意个节点,主网共识节点询问A链全部节点,普通节点在任意3个节点确认的情况下就视为该交易验证通过并转发该交易。

  5. 共识节点Mn对跨链交易atx_trans_hash签名,并将hash和签名数据通过crossNodeRs广播到NULS主网网络中。

  6. NULS主网共识节点互相收到所有其他共识节点发出的消息,由交易管理模块接口crossNodeRs进行收集汇总,当一个交易的签名者超过共识节点总数的80%,判定该跨链交易通过NULS主网的验证,放入待打包交易内存池,等待打包确认。

  7. NULS主网节点共识模块打包的时,交易模块先取出交易(与 步骤 4 类似),再次验证跨链交易atx_trans的签名数量(PS:由于提取出来的交易集合包含NULS主网创建的交易,这类交易没有验证签名数量步骤),然后通过账本模块验证CoinData(转出资产总余额等),符合要求则将交易发送共识模块打包进区块。

    区块确认逻辑:验证区块中包含的跨链交易时,验证签名数量和转出链的资产余额,符合要求就确认该交易。

(3) 跨链交易进入B链中的流程

  1. NULS主网节点的交易管理模块将会一直扫描区块链中的跨链交易,当发现atx_trans交易被区块链确认n个高度后,取出atx_trans交易发送给连接的B链节点(多个)

    发送跨链交易流程(与 步骤 7 类似):

    1. NULS主网节点Mn先通过消息newCrossHash广播atx_trans交易的hash给连接的B链节点。
    2. 交易管理模块获得的交易hash,再通过askCrossTx发送获取完整跨链交易的消息到NULS主网节点Mn。
    3. Mn的网络模块收到该消息后,再将完整的atx_trans跨链交易通过newMnTx发送给Bnode1,Bnode1收到该消息后,需要借助 跨链模块 来处理 atx_trans 交易。
  2. B链节点Bnode1交易管理模块通过verifyMn发送 atx_trans的交易hash( 步骤14-2 已获得)给与NULS主网连接的节点中除Mn之外的节点验证atx_trans交易。

    NULS主网中执行验证的节点Mn2的验证逻辑

    1. 网络模块接收到消息后,通过接口verifyMn将消息发送给交易管理,交易管理模块先通过atx_hash从数据库中查询对应的atx交易,并且验证该交易所在的区块已经被确认n个区块高度。

    通过验证之后,节点Mn2将通过verifyResult将atx_trans_hash和确认高度发送给B链节点Bnode1。

  3. B链节点通过网络模块向NULS主网节点组发送跨链验证消息verifyMn时,交易管理将会缓存发送成功和失败的节点信息,如果成功发送的节点数小于S(节点Bnode1与NULS主网连接的节点数的51%),则重新发送给失败的节点,直到S不小于51%。

  4. (与 步骤10 类似)B链节点Bnode1收到主网节点Mn对交易atx_trans的验证结果的消息,通过交易管理verifyResult接口发送到交易管理中,交易管理会将验证结果与发送的成功的节点对应着缓存起来。Bnode1收到所有自己发出的求证的回应结果后,计算出验证通过的百分比,如果超过51%的节点验证通过(发送失败的节点视为不通过),则节点Bnode1判定交易atx_trans的验证通过。

  5. 验证通过后,交易管理模块调用跨链模块atx_trans交易通过协议转换生成B链协议的交易btx并通过crossNodeRs广播到B链网络中,如果Bnode1节点是B链最近x块的出块者(POW需要适配),则需要对该交易进行签名,通过crossNodeRs广播到B链网络中。

  6. B链节点收到其他节点发出的消息,由交易管理模块接口crossNodeRs进行收集汇总,统计该交易的签名,当签名者达到了最近20块的出块者的80%时,该交易可以被打包(打包者也要确认该交易且打包的交易中包含所有签名),放入待打包交易内存池,等待打包确认。

  7. (与 步骤 13 类似)B链节点共识模块打包的时,交易模块先取出交易一致,再次验证交易 btx 的签名数量,然后通过账本模块验证CoinData,符合要求则将交易发送共识模块打包进区块。

  8. 当新区块验证通过得到最终确认后,整个跨链交易流程结束。

2.3 模块服务

2.3.1 注册交易

  • 功能说明:

    将各个模块的交易类型、对应的交易验证器和处理器接口缓存起来。

  • 流程描述

    NULS主网启动时,各个模块需要向交易管理模块注册自己的交易类型,验证器等信息。交易管理模块将缓存各个交易以及对应的验证器、处理器接口,当有新交易需要用验证器验证时,交易管理模块将取出对应的验证器接口名称,并调用验证器接口进行验证。

  • 接口定义

    • method: tx_register

      接口说明:注册交易需要传交易类型、验证器名称、处理器名称,返回是否注册成功。

    • 请求示例

      {
      +    "cmd": "tx_register",
      +    "minVersion": "1.0",
      +    "params":[
      +        "moduleCode", 
      +        "moduleValidateCmd",
      +        [
      +            [
      +                "txType",
      +                "validateCmd",
      +                "commitCmd",
      +                "rollbackCmd",
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ],
      +             [
      +                "txType",
      +                "validateDeposit",
      +                "depositCommit",
      +                "depositRollback"
      +                "systemTx",
      +                "unlockTx",
      +                "verifySignature"
      +            ]
      +         ]
      +    ]
      +}
      +
    • 请求参数说明

      index type description
      0 String 模块Code
      1 String Module validate 模块统一验证器 接口名称
      2 Array 模块交易注册信息集合
    • 模块交易集合元素

      index type description
      0 int Type 交易类型
      1 String Transaction validator 单个交易验证器接口名称
      2 String Transaction processor commit 交易处理器提交接口名称
      3 String Transaction processor rollback 交易处理器回滚接口名称
      4 boolean 是否是系统产生的交易(打包节点产生,用于出块奖励结算、红黄牌惩罚)
      5 boolean 是否是解锁交易
      6 boolean 该交易是否需要在账本中验证签名,所有系统产生的交易和一些特殊交易,不需要按照普通交易的方式验证签名,会提供额外的逻辑进行验证。
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +	"value":true
      +  }
      +

} +```

  • 返回结果说明

    parameter type description
    value boolean 成功
2.3.1.1 交易验证器、处理器接口规范
  • 模块统一交易验证器接口规范 Module validate

    • 请求示例

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chianId", ["txHex","txHex","txHex"]]
      +}
      +
    • 请求参数说明

      index type description
      0 chianId 链id
      1 array 交易序列化数据数组
    • 返回结果

      • result说明:返回不合法的交易hash列表
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "list":["txHash", "txHash", "txHash"]
      +	}
      +}
      +
      parameter type description
      list jsonArray 不合法交易序列化数据数组
  • **交易验证器接口统一规范 Transaction validate **

    • 请求示例

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int chainId
      1 String 交易序列化数据
    • 返回结果

      • result说明:返回不合法的交易列表
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean 验证成功返回true
  • **交易处理器commit接口参数统一规范 Transaction processor commit **

    • 请求示例

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex","secondaryDataHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int Chain Id
      1 String 交易序列化数据
      2 String 区块头的hash,高度,时间的序列化数据
    • 返回结果

      • result说明:提交成功返回true,失败返回错误信息
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean 提交成功返回true
  • 交易处理器rollback接口参数统一规范 Transaction processor rollback

    • 请求示例

      {
      +    "cmd": "",
      +    "minVersion": "1.0",
      +    "params":["chainId","txHex","secondaryDataHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int Chain Id
      1 String 交易序列化数据
      2 String secondaryData 区块头的hash,高度,时间的序列化数据
    • 返回结果

      • result说明:回滚成功返回true,失败返回错误信息
      {
      +	"version": 1.0,
      +	"code":0,
      +    "result":{
      +        "value":true
      +	}
      +}
      +
      parameter type description
      value boolean 回滚成功返回true

2.3.2 接收本地新交易

  • 功能说明:

    收集本节点其他模块新产生的交易

  • 流程描述

    当一个节点中其他模块有新交易产生时,需要调用交易管理模块的新交易接口进行统一的收集和处理;交易管理模块将会把新的交易放到未确认队列中等待,处理交易的线程来处理。

    1. 对交易进行基本验证、去重等,不合法直接丢弃

    2. 待验证本地交易队列中

  • 接口定义

    • method: newTx

      接口说明:接收一个新的交易

    • 请求示例

      {
      +    "cmd": "newTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true  
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.3 获取可打包交易集合

  • 功能说明:

    根据打包结束时间和交易容量最大值提取可打包的交易集合(给共识打包)

  • 流程描述

    当节点需要打包时,要根据链id、规定的结束打包时间和交易数据最大容量值,来获取可打包的交易。交易管理模块将会从待打包交易内存池取出对应的交易集合,然后一次性从账本模块验证集合中所有交易的coinData,过滤掉未通过验证的交易,得到验证通过的集合,然后通过各模块统一交易验证器来验证各自模块的交易集合,再汇总结果返回可打包的交易集合。

  • 接口定义

    • method: tx_packableTxs

      接口说明:返回可打包的交易集合

    • 请求示例

      {
      +    "cmd": "tx_packableTxs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "endtimestamp", "maxTxDataSize"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 long endtimestamp 结束打包的时间
      2 int maxTxDataSize 交易数据最大容量值
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"list":[]
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      List Transaction 返回交易集合

2.3.4 交易确认提交

  • 功能说明:

    执行交易处理器commit

  • 流程描述

    当交易被打包到区块中,并且区块验证通过后,将调用交易commit接口

  • 接口定义

    • method: tx_commit

      接口说明:调用交易处理器提交接口

    • 请求示例

      {
      +    "cmd": "tx_commit",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易序列化数据
      2 String 区块头的hash,高度,时间的序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.5 交易回滚

  • 功能说明:

    执行交易处理器rollback

  • 流程描述

    当交易被打包到区块中,并且区块验证不通过,或者区块回滚且交易不为跨链交易时,将调用交易rollback接口。

  • 接口定义

    • method: tx_rollback

      接口说明:调用交易处理器回滚接口

    • 请求示例

      {
      +    "cmd": "tx_rollback",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex", "secondaryData"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易序列化数据
      2 String !!!(区块头的hash,高度,时间)
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.6 保存交易

  • 功能说明:

    将验证通过的新区块中的交易保存到数据库

  • 流程描述

    区块管理保存区块时将交易发送到交易管理模块进行保存

  • 接口定义

    • method: tx_save

    • 请求示例

      {
      +    "cmd": "tx_save",
      +    "minVersion": "1.0",
      +    "params": ["chainId", ["txHex", "txHex"]]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 array 交易序列化数据数组
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.7 获取已保存的交易

  • 功能说明:

    从数据库中获取已经打包到区块中的交易

  • 接口定义

    • method: tx_getTx

      接口说明:返回交易序列化数据

    • 请求示例

      {
      +    "cmd": "tx_getTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易hash
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"tx":"txHex"
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      tx String 交易序列化数据

2.3.8 删除已保存的交易

  • 功能说明:

    从数据库中删除已经打包到区块中的交易,区块回滚等

  • 接口定义

    • method:tx_delete

      接口说明:返回交易序列化数据

    • 请求示例

      {
      +    "cmd": "tx_delete",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易hash
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	value:true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.9 验证交易

  • 功能说明:

    对交易(包含跨链交易)进行本地验证,包括调用验证器,验证coinData等,不包括对跨链交易进行跨链验证。

  • 接口定义

    • method:tx_verify

      接口说明:返回验证结果

    • 请求示例

      {
      +    "cmd": "tx_verify",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.10 接收新交易hash

  • 功能说明:

    接收链内其他节点广播的新交易hash的消息

  • 接口定义

    • method:newHash Receive new transaction hash message

      接口说明:接收交易hash序列化数据

    • 请求示例

      {
      +    "cmd": "newHash",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHashHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链id
      1 String 交易hash序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +    	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.11 接收新的跨链交易hash

  • 功能说明:

    接收由其他链发送的新跨链交易hash的message

  • 流程描述

    当一个跨链交易在该链内部已确认一定高度以后,将由交易模块发送到目标链(NULS主网或者普通链)中,目标链将接收该交易进行验证。在发送该交易前首先发送该交易的hash,本接口将接收该hash。

  • 接口定义

    • method: newCrossHash Receive new cross transaction hash

      接口说明:接收一个新的交易hash

    • 请求示例

      {
      +    "cmd": "newCrossHash", 
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 int chainId 链id
      1 int nodeId 节点id
      2 String txHash 交易hash
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      	"value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.12 接收友链新的完整跨链交易 (废弃)

  • 功能说明:

    处理由其他链发送到NULS主网的新跨链交易的message

  • 流程描述

    当其NULS主网节点收到其他链广播的跨链交易hash时,会向发送的hash节点索取完整的交易,这时该节点会发送完整的交易和原始hash到NULS主网节点,NULS主网再进行处理

  • 接口定义

    • method: newFcTx Receive new cross transaction

      接口说明:接收一个新的完整跨链交易,和该交易原始hash(友链协议转换前该交易的hash值)

    • 请求示例

      {
      +    "cmd": "newFcTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String txHex 原始交易hash,协议转换后NULS主网协议的交易序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.13 接收主网新的完整跨链交易

  • 功能说明:

    处理由NULS主网发送到友链的新跨链交易的message

  • 流程描述

    当其友链节点收到NULS主网广播的跨链交易hash时,会向发送的hash节点索取完整的交易,这时该节点会发送完整的交易友链节点。

  • 接口定义

    • method: newMnTx Receive new mainnet cross transaction

      接口说明:接收一个主网发送的新的完整跨链交易

    • 请求示例

      {
      +    "cmd": "newMnTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String txHex NULS主网协议的交易序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.14 索取完整跨链交易

  • 功能说明:

    根据交易hash取出已确认一定高度的完整跨链交易,然后通过消息发送回去

  • 流程描述

    NULS主网有新的跨链交易发送给目标链时(或者是普通链有跨链交易发送给NULS主网),先发送hash给目标链,目标链节点会根据hash向NULS主网索取完整交易,本接口处理该消息。

  • 接口定义

    • method: askCrossTx send cross transaction

      接口说明:接收网络节点发送的交易hash,通过网络消息发送完整交易回去

    • 请求示例

      {
      +    "cmd": "askCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String txhash 交易hash
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.15 根据原始交易和跨链交易hash向友链节点验证该交易是否被确认

  • 功能说明:

    友链节点接收NULS主网节点的跨链验证请求的消息

  • 流程描述

    NULS主网节点新收到跨链交易,将会向发送该交易的友链(除发送者以外的节点)求证该交易,求证时将发送的消息由本接口处理。

  • 接口定义

    • method: verifyFc

    • 接口说明:接收跨链交易hash和该交易原始hash,通过网络消息返回确认结果

    • 请求示例

      {
      +    "cmd": "verifyFc",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String txOriginalHash 原始交易的hash(协议转换前)、txCrossHash跨链交易hash(协议转换后)
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.16 根据跨链交易hash向主网验证该交易是否被确认

  • 功能说明:

    NULS主网节点接收友链节点的跨链验证请求的消息

  • 流程描述

    友链节点新收到跨链交易,将会向发送该交易的NULS主网节点(除发送者以外的节点)求证该交易,求证时将发送的消息由本接口处理。

  • 接口定义

    • method: verifyMn

    • 接口说明:接收跨链交易hash,通过网络消息返回确认结果

    • 请求示例

      {
      +    "cmd": "verifyMn",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "txHash"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String txHash 跨链交易hash
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.17 接收跨链验证结果

  • 功能说明:

    处理接收跨链交易验证结果的消息

  • 流程描述

    NULS主网向其他链节点验证跨链交易,该节点发送的验证结果

  • 接口定义

    • method: verifyResult cross result

    • 接口说明:接收跨链交易验证结果

    • 请求示例

      {
      +    "cmd": "verifyResult",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "rsHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String 交易hash和确认高度的序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.18 接收跨链交易的链内节点验证结果

  • 功能说明:

    接收跨链交易的链内节点验证结果,进行统计。

  • 流程描述

    节点对某个跨链交易进行跨链验证,得到这个节点对于该交易的跨链验证结果,该节点将此结果广播给本链的其他节点,其他节点收到该消息后会调用本接口

  • 接口定义

    • method: crossNodeRs cross tx node result

    • 接口说明:接收发出者的签名、跨链交易的hash、节点验证结果

    • 请求示例

      {
      +    "cmd": "crossNodeRs",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "nodeId", "nodeRsHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
      1 int nodeId 节点id
      2 String 接收发出者的签名、跨链交易的hash、节点验证结果 序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  	}
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.19 查看交易池信息

  • 功能说明:

    查看交易内存池的数据

  • 接口定义

    • method: tx_getTxsInfo

    • 接口说明:统计交易内存池的数据

    • 请求示例

      {
      +    "cmd": "tx_getTxsInfo",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • 请求参数说明

      index type description
      0 Int chainId 链id
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "localTxCount":111,	//本地交易数量
      +      "crossChainTxCount":111,//跨链交易数量
      +      "pushingCount":111	//已确认待打包交易数量
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      localTxCount int 本地交易数量
      crossChainTxCount int 跨链交易数量
      pushingCount int 已确认待打包交易数量

2.3.20 获取所有交易与其对应的处理器的关系列表

  • 功能说明:

    返回所有交易与其对应的commit处理器、rollback处理器的关系列表

  • 接口定义

    • method: tx_getTxProcessors

    • 接口说明:返回Map<List<String>> 结构jsonObject

    • 请求示例

      {
      +    "cmd": "tx_getTxProcessors",
      +    "minVersion": "1.0",
      +    "params": ["txType"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 交易类型(不填返回全部)
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "2":["commitCmd","rollbackCmd"],
      +      "3":["commitCmd","rollbackCmd"],
      +      "4":["commitCmd","rollbackCmd"]
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      0 String commit处理器接口
      1 String rollback处理器接口

2.3.21 根据账户地址查询交易记录

  • 功能说明:

    根据账户、链、资产、分页信息等条件查询交易列表

  • 接口定义

    • method: tx_getTxs

    • 接口说明:返回 Page<Transaction>

    • 请求示例

      {
      +    "cmd": "tx_getTxs",
      +    "minVersion": "1.0",
      +    "params": [
      +    	"ChainId",
      +    	"assetId",
      +    	"type",
      +    	"Nse7PfBkqtByKJ6AuxY151n1CM2xxxx",
      +    	"pageSize",
      +    	"pageNumber"
      +    ]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链Id
      1 int 资产Id标识
      2 int 交易类型(不填返回全部)
      3 String 账户地址
      4 int 每一页数据条数
      5 int 页码
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +     "pageNumber": 1,
      +     "pageSize": 10,
      +     "total": 31,
      +     "pages": 4,
      +     "list": []
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      pageNumber int 页码
      pageSize int 每页显示条数
      total int 数据总数
      pages int 总页数
      list Page 交易记录数据集合

2.3.22 接收本地新的主网协议的跨链交易

  • 功能说明:

    收集新的NULS主网协议的完整交易用于广播

  • 接口定义

    • method: newCrossTx

    • 请求示例

      {
      +    "cmd": "newCrossTx",
      +    "minVersion": "1.0",
      +    "params": ["chainId", "txHex"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链Id
      1 String 交易序列化数据
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  	"value":true
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.23 运行链

  • 功能说明:

    运行一条链

  • 接口定义

    • method: tx_runChain

    • 接口说明:运行一条注册的链

    • 请求示例

      {
      +    "cmd": "tx_runChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • 请求参数说明

      index type description
      0 int chainId
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

2.3.24 停止链

  • 功能说明:

    停止一条运行中的链

  • 接口定义

    • method: tx_stopChain

    • 接口说明:停止运行一条链

    • 请求示例

      {
      +    "cmd": "tx_stopChain",
      +    "minVersion": "1.0",
      +    "params": ["chainId"]
      +}
      +
    • 请求参数说明

      index type description
      0 int 链Id
    • 返回示例

      Success

      {
      +  "code":0,
      +  "version": 1.0,
      +  "msg": "Success",
      +  "result": {
      +      "value":true
      +  }
      +}
      +
    • 返回结果说明

      parameter type description
      value boolean 成功

四、事件说明

4.1 发布的事件

4.2 订阅的事件

  • 链注册事件

    用于发送验证tx coinData的链信息接口

  • 链注销事件

    用于终止该链交易的确认

五、网络消息体协议

5.1 BroadcastCrossTxHashMessage

  • 广播新的跨链交易hash

  • 消息说明:用于跨链交易在本链确认后需要广播给其他节点或其他链的节点时发送的消息

  • cmd:newCrossHash

Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
  • 消息处理

    • 收到该消息后newCrossHash将会发送askCrossTxMessage来获取完整的跨链交易

5.2 ReceiveCrossTxMessage

  • 消息说明:请求获取完整的跨链交易的消息,例如NULS主网收到友链新的跨链交易hash,主网节点将向友链节点获取完整的交易。
  • cmd:askCrossTx
Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
  • 消息处理 +
    • 该消息由askCrossTx处理将会发送SendcrossTxMessage/SendHashcrossTxMessage消息来传送完整的交易

5.3 SendHashCrossTxMessage(废弃)

  • 消息说明:友链向NULS主网发送经过协议转换的完整跨链交易,和原始交易hash
  • cmd:newFcTx
Length Fields Type Remark
2 chainId uint16 链Id
2 type uint16 交易类型
4 time uint32 交易时间
txData VarByte 交易数据
coinData VarByte 交易输入和输出
remark VarString 备注
scriptSig VarByte 数字脚本与交易签名
1 originalHashDigestAlgType byte 摘要算法标识
? originalHashLength VarInt 数组长度
? originalHash byte[] originalHash友链原始交易hash
  • 消息处理 +
    • newFcTx接收消息后将会处理该交易,然后通过消息进行跨链验证

5.4 VerifyCrossWithFCMessage

  • 消息说明:发送协议转换前的交易hash、协议转换后的交易hash,向友链节点验证跨链交易
  • cmd:verifyFc
Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] 转换NULS主网协议后交易hash
1 originalHashDigestAlgType byte 摘要算法标识
? originalHashLength VarInt 数组长度
? originalHash byte[] 友链原始交易hash
  • 消息处理 +
    • verifyFc处理该消息,验证后将结果通过VerifyCrossResultMessage发送回去

5.5 VerifyCrossResultMessage

  • 消息说明:节点收到跨链验证请求后,将验证结果发送回去
  • cmd:verifyResult
Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
32 hight uint32 确认高度
? signature varByte 签名?
  • 消息处理 +
    • verifyResult接收到跨链验证结果后会计算出自己节点的结果

5.6 SendCrossTxMessage

  • 消息说明:发送完整的跨链交易的消息
  • cmd:newMnTx
Length Fields Data Type Remark
2 type uint16 交易类型
4 time uint32 交易时间
txData VarByte 交易数据
coinData VarByte 交易输入和输出
remark VarString 备注
scriptSig VarByte 数字脚本与交易签名
  • 消息处理 +
    • newMnTx接收交易后将会进行一系列的验证,如果不是交易原产地链的节点收到该交易后会进行跨链验证

5.7 VerifyCrossWithMainMessage

  • 消息说明:友链节点发送协议转换后的跨链交易hash,向主网节点验证跨链交易
  • cmd:verifyMn
Length Fields Type Remark
32 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] 转换后的跨链交易hash
  • 消息处理 +
    • verifyMn处理该消息验证NULS主网中该交易是否被确认,将结果通过VerifyCrossResultMessage消息发送回去。

5.8 BroadcastCrossNodeRsMessage

  • 消息说明:向链内其他节点广播本节点对于某个跨链交易的验证结果
  • cmd:crossNodeRs
Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
Signature VarByte 对验证的节点对交易的签名
2 result boolean 验证结果
  • 消息处理 +
    • crossNodeRs接收该消息,同时统计其他所有节点的结果,最后计算本链对该交易的验证结果。

5.9 BroadcastTxMessage

  • 消息说明:本节点创建的交易完成本地验证后广播hash给其他节点
  • cmd:newHash
Length Fields Type Remark
2 chainId uint16 链Id
1 digestAlgType byte 摘要算法标识
? hashLength VarInt 数组长度
? hash byte[] hash
  • 消息处理 +
    • newHash接口处理该消息,发送完整交易回去

5.10 SendTxMessage

  • 消息说明:向链内其他节点发送的完整交易
  • cmd:newTx
Length Fields Data Type Remark
2 type uint16 交易类型
4 time uint32 交易时间
txData VarByte 交易数据
coinData VarByte 交易输入和输出
remark VarString 备注
scriptSig VarByte 数字脚本与交易签名
  • 消息处理 +
    • 进入新的交易流程

六、模块配置项

[tx-manager]
+bootstrap=io.module.TxManagerModuleBootstrap
+
Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/community/ambassadorRules.html b/docs/.vuepress/dist/zh/community/ambassadorRules.html new file mode 100644 index 00000000..650d33f9 --- /dev/null +++ b/docs/.vuepress/dist/zh/community/ambassadorRules.html @@ -0,0 +1,21 @@ + + + + + + NULS大使竞选参与规则 | NULS + + + + + + + +

NULS大使竞选参与规则

一、NULS大使介绍

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

二、NULS大使职责和权益

1、参与NULS大使的选举需要具有创建NULS节点的基本条件。

2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员。

3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。

4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。

5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。

6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。

7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。

8、NULS大使可以向NULS基金会提报预算,申请重大事项发展的经费,该预算面向全体社区公开,发起预算投票,投票期为15天,投票量超过1000W NULS且支持率达到70%以上,基金会可以向该预算发放资金。

三、如何参与竞选

  • 第一步:

发布上月的工作情况报告和下月的工作计划:

请发布到论坛https://community.nuls.world/t/elections

  • 第二步:

NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。

  • 第三步:

如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;

NULS基金会将会委托200000NULS在您的节点上。

最后祝愿:

  • 恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。
  • 开始社区建设和拓展工作。
  • 帮助NULS对接更多的DApp接入。
  • 请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。

所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections

欢迎大家加入NULS社区,共同创造NULS美好未来!

如果您能够奉献更多,对您的期望:

1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。

3、分享NULS的故事给社区。

3、分享NULS的故事给社区;

4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。

大使指导手册

前言

欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。

作为NULS的大使,你将获得

1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;

2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;

3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;

4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。

作为NULS的大使,你可以从这些方面来开展工作

1、社区拓展

(1)通过互联网或者线下交流的方式让其他人了解NULS。

(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。

(3)将NULS社区其他地区的发展情况分享到当地社区。

(4)持续分享NULS项目的进展、规划、新闻等到当地社区。

(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。

(6)分享NULS的故事给社区。

(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。

(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。

2、社区活动

(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。

(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。

(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。

了解NULS可以从这里开始

1、NULS大使工作看板(点击进入),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。

2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。

3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。

4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。

5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。

6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。

7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注Githubdev.nuls.io

7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛nuls.community上面发帖。

招募志愿者组织当地的社群

1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。

2、组织开展一些线下见面会活动。

3、让更多的区块链投资人了解NULS,引导他们对NULS投资。

4、帮助NULS寻找更多的区块链技术爱好者加入。

发展当地的NULS生态

1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;

2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。

3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。

将NULS的理念和技术传播到当地

1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。

2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。

3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。

NULStar指南和职责

成为NULStar的要求

1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。

2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。

3、必须住在人口超过35万的城市。

NULStar的职责

1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。

2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。

NULStars的奖励

1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。

2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。

指导手册会不断更新,希望大使们和NULS一起成长!

Last Updated: 2019-1-2 17:31:35
+ + + diff --git a/docs/.vuepress/dist/zh/community/communityConstitution.html b/docs/.vuepress/dist/zh/community/communityConstitution.html new file mode 100644 index 00000000..7cd97f85 --- /dev/null +++ b/docs/.vuepress/dist/zh/community/communityConstitution.html @@ -0,0 +1,21 @@ + + + + + + NULS社区章程 | NULS + + + + + + + +

NULS社区章程

一、NULS社区简介

NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。

**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

二、NULS基金会

NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。

(一)NULS基金会宗旨

以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:

1、代码贡献

2、应用开发

3、运营推广

4、其他有利于NULS社区生态发展的具体事项

(二)NULS社区基金的来源

NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。

(三)NULS社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

三、理事会

(一)理事会介绍

NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。

(二)理事会成员产生

社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员),由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。

1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。

2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。

3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。

4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。

(三) 理事会成员权责

1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。

(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。

  • 竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。

  • 固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。

(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。

  • 节点下限代理手续费佣金调整。

  • 转账手续费调整。

  • 合约调用手续费调整。

  • 理事会发起提案的手续费调整。

  • 其他系统可调整的系统参数调整。

(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。

  • 委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。

  • 转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。

  • 创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。

  • 调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。

2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。

3、理事会成员的责任。

  • 理事会成员需要能够及时与社区进行沟通。

  • 严格遵照社区章程。

  • 与NULS的愿景和目标一致。

  • 以全体社区成员利益为己任。

注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。

四、CODE CRAFT COUNCIL(CCC)

(一)CCC介绍

CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。

(二)CCC理念

在技术社区里我们坚持以下的理念:

1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。

2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。

3、共享 (Sharing):

  • 社区共享NULS技术成果。

  • 社区共享NULS发展红利。

  • 社区共享NULS的影响力和名誉。

  • 行业共享NULS带来的技术革新。

  • 行业共享NULS推动行业发展的标准制定。

4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。

5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

(三)CCC成员产生

每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。

加入流程如下:

1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。

2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。

3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。

(四)CCC成员权责

1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。

2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。

3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。

4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。

5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。

五、贡献者角色

(一)竞选贡献者角色

竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示nuls.community

(二)固定贡献者角色

固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。

六、项目预算

(一)对于贡献者角色

对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。

(二)对于其他事务资金

理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。

七、其他投票

(一)发起投票

1、理事会成员发起投票。只收取交易手续费。

2、普通成员投票。押金(目前设定是100NULS)+交易手续费。

(二)代理投票

  • 任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。

  • 任何的NULS用户都可以成为代理人。

  • 代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。

  • 代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。

八、建议反馈

如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。

NULS社区网站:https://nuls.community

建议反馈帖:https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 2019-1-2 17:31:35
+ + + diff --git a/docs/.vuepress/dist/zh/community/communityFund.html b/docs/.vuepress/dist/zh/community/communityFund.html new file mode 100644 index 00000000..2e20528a --- /dev/null +++ b/docs/.vuepress/dist/zh/community/communityFund.html @@ -0,0 +1,21 @@ + + + + + + NULS社区基金管理和使用流程 | NULS + + + + + + + +

NULS社区基金管理和使用流程

img

一、社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

社区基金账户地址:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

根据社区章程指导思想,提案执行基金会账户操作。

该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。

注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。

暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei

二、发起申请的成员

1、普通成员

包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。

注:理事会发起的该部分成员的申请提案投票期为15天。

2、贡献者角色

通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。

三、申请类型

1、提案支付资金

申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。

2、预算项目提案

申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。

3、提案创建节点

申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。

4、提案委托资金

申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。

四、申请流程

1、方案公开讨论

(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;

(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;

(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;

(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;

(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;

(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;

(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;

(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;

2、理事会成员提案

(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;

(2)理事会和申请人都需要引导社区正确地进行投票;

(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;

(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。

3、基金会执行提案

(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;

(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。

五、流程解释

所有的社区讨论建议在nuls.community进行。

本流程根据社区章程思想进行管理,流程将会对全体社区公开。

流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。

具体节点产生收益参考NULS POC共识机制。

附:当前贡献者角色的委托和节点

大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC 成员:

Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 2019-1-2 17:31:35
+ + + diff --git a/docs/.vuepress/dist/zh/community/joinCCC.html b/docs/.vuepress/dist/zh/community/joinCCC.html new file mode 100644 index 00000000..52acf089 --- /dev/null +++ b/docs/.vuepress/dist/zh/community/joinCCC.html @@ -0,0 +1,35 @@ + + + + + + 如何成为社区开发者 | NULS + + + + + + + +

如何成为社区开发者

一、NULS简介

NULS 是一个区块链公链项目,其致力于打造由社区驱动的一个真正开源、自我革新的区块链平台。NULS期望通过构建灵活易用的区块链基础设施,最大限度降低企业/个人使用区块链底层技术的难度。 +NULS技术社区,是由来自NULS社区的一批对NULS充满激情与梦想的技术开发人员构建而成。技术社区将和NULS核心开发团队共同搭建NULS底层,通过实现模块化、多链并行、跨链等机制,让企业/个人都可以通过简单配置定制自己的区块链。

在社区里我们坚持以下的理念:

  • 平等 (Equal):技术社区与核心团队是平等关系,一起合作开发;
  • 共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态;
  • 共享 (Sharing): +
    • 社区共享NULS技术成果
    • 社区共享NULS发展红利
    • 社区共享NULS的影响力和名誉
    • 行业共享NULS带来的技术革新
    • 行业共享NULS推动行业发展的标准制定
  • 公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正;
  • 创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

二、你是我们在寻找的TA吗?

NULS技术社区向所有开发者开放。 +如果你: +对区块链世界充满期待,希望用代码创造出新的世界。

请加入我们的技术社区电报群:https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ +注意:我们不是寻求任务外包。任何你认为值得改进的地方,都是你可以发挥的空间。

三、我们能提供什么?

NULS团队会为技术社区的每一个为NULS项目作出贡献的开发者提供奖励,奖励的大小基于贡献的大小。 +目前,如果你能通过前期表现,加入技术社区核心开发团队(Code Craft Council),我们会为你创建一个节点,并委托20万NULS Token,节点奖励的50%部分将用于支持开发者(目前大约1500NULS/月),剩下50%会注入社区基金池。注:50%是初始值,后续调整由社区决定,我们会在社区进行公示。

四、我们的计划

让造链变得容易! +首先,我们希望建立一个涵盖80%区块链底层技术的模块仓库。 +通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更加融入到日常生活中。 +我们正和技术社区一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。 +其次,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),极大的缩短了目前公链开发少则半年多则1年的耗时。 +以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。 +现在NULS技术社区有中西方开发者200余人,我们欢迎更多的开发者加入。你们将协助核心团队进行NULS底层的开发工作。

五、技术社区的现状:

(1)我们一直认为NULS属于社区,NULS技术的长远发展离不开极具创造力的社区技术力量,在过去一年时间里我们很高兴能看到社区开发者自愿为NULS贡献自己的力量。其中来自英国的Josh为NULS开发了官网(nuls.io),来自法国的Moshe为NULS开发了区块链浏览器(nuls.world/)和轻钱包(nuls.world/wallet),来自玻利维亚的Berzeck正在参与NULS的底层开发工作。

(2)尽管如此,我们还有很多的工作尚待完成。我们会在本帖下方持续更新一个任务清单,该清单会包含NULS的设计、开发、改进等方面的工作。所有开发者都可以根据自己的能力和兴趣进行选择。

六、如何加入开发团队

(1)为方便沟通,请先加入技术社区的Telegram群(见上),并阅读群置顶消息;

(2)跟社区开发者Moshe进行初步沟通,简要介绍自己的经历、擅长的编程语言等,社区开发者会跟你交流一些技术相关信息,并了解你希望做些什么,这将决定你接下来的工作内容。 +同时我们强烈建议你通过下面的链接,去了解更多关于NULS的内容:

(3)你可以选择感兴趣并胜任的任务。届时,我们会让你加入各个开发小组,同其他开发人员一起工作。在这里,我们强烈建议你下载微信作为沟通交流工具: +https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh

(4)在小组中,各小组leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

技术社区和核心团队经过仔细审核后,如果申请被批准,我们将为你创建一个节点(这将是你获得奖励的基础)。

七、查看任务清单

任务清单持续更新中

Last Updated: 2019-1-15 14:00:51
+ + + diff --git a/docs/.vuepress/dist/zh/community/toolsGuide.html b/docs/.vuepress/dist/zh/community/toolsGuide.html new file mode 100644 index 00000000..cc5a4542 --- /dev/null +++ b/docs/.vuepress/dist/zh/community/toolsGuide.html @@ -0,0 +1,21 @@ + + + + + + 社区投票指南 | NULS + + + + + + + +

社区投票指南

1 投票

如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。

img

点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。

img

若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。

系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。

投票详情的各个选项,可以点击展开详情,查看票数分布情况。

2 更新投票

如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。

img

同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。

img

3 查看我的投票

在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。

img

点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。

4创建投票

在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。

为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。

img

创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。

Last Updated: 2019-1-2 17:31:35
+ + + diff --git a/docs/.vuepress/dist/zh/developerTools/APIManual.html b/docs/.vuepress/dist/zh/developerTools/APIManual.html new file mode 100644 index 00000000..bdf6f8f2 --- /dev/null +++ b/docs/.vuepress/dist/zh/developerTools/APIManual.html @@ -0,0 +1,21 @@ + + + + + + API手册 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/developerTools/clientCLI.html b/docs/.vuepress/dist/zh/developerTools/clientCLI.html new file mode 100644 index 00000000..8d0f1415 --- /dev/null +++ b/docs/.vuepress/dist/zh/developerTools/clientCLI.html @@ -0,0 +1,706 @@ + + + + + + CLI 使用指南 | NULS + + + + + + + +

CLI 使用指南


介绍

​ 本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。

版本更新记录

版本 更新日期 内容
V1.0.0 2018-07-12 主网正式版全部功能

准备

服务器硬件配置

建立NULS节点的服务器不低于如下配置:

CPU 内存 硬盘 宽带
四核 3.0GHz 16G 128G硬盘 20M上行

推荐配置:

CPU 内存 硬盘 宽带
八核 3.0GHz 32G 256G硬盘 100M上行

系统及内核版本

Linux系统

  • CentOS (推荐)

Linux内核版本推荐使用 2.6.32及以上

开始

下载

  • 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release

  • 进入NULS官网钱包下载界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。

    Linux系统中下载v1.0.0版的钱包可以使用如下命令:

    $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz
    +

    注:如果后续有其他版本,下载地址可能会不同。

安装

  • 在Linux中解压已下载的文件

    $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz
    +

运行

  • 进入解压后的bin目录,并运行启动脚本,启动全节点钱包

    $ cd bin
    +$ ./start.sh
    +

使用钱包

快速入门

  • 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。

    进入bin目录,执行如下命令:

    $ ./cmd.sh
    +

    将会出现NULS命名输入提示符nuls>>> ,然后可直接输入NULS钱包操作命令,来进行操作。

    例如,创建账户的示例如下:

    nuls>>> create
    +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
    +Enter your password:*********
    +Please confirm new password:*********
    +[ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ]
    +nuls>>>
    +

    执行create命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。

约定

  • 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。
  • 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。

钱包命令

帮助命令

输出打印所有的命令,

  • **命令: help [-a] **
参数 说明
-a 格式化打印命令,选填

返回信息 help

getaccount <address> --get account information
+

返回信息 help -a

getaccount <address> --get account information
+	OPTIONS:
+	<address> the account address - Required
+

示例

nuls>>> help
+nuls>>> help -a
+

创建账户

创建账户,返回账户地址集合

  • **命令: create [number] **
参数 说明
[number] 创建账户的数量,选填

创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter;

返回账户集合

[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

示例 创建2个没有密码的账户

nuls>>> create 2
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:
+[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ]
+

备份账户

备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件

  • 命令:backup <address> [path]
参数 说明
<address> 账户地址,必填
[path] 文件生成备份文件的目标文件夹,默认为当前文件夹,选填

注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。

返回信息

The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

示例 备份一个有密码的账户

nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+

移除账户

根据账户地址移除本地账户,如果账户已加密,则需要输入密码

  • **命令:remove <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+Success
+

设置账户密码

根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。

  • **命令:setpwd <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

修改账户密码

根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。

  • **命令:resetpwd <address> **
参数 说明
<address> 账户的地址,必填

返回信息

Success
+

示例

nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Enter your old password:**********
+Please enter the new password(8-20 characters, the combination of letters and numbers).
+Enter your new password:**********
+Please confirm new password:**********
+Success
+

设置别名

给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示

  • 命令:setalias <address> <alias>
参数 说明
<address> 账户的地址,必填
<alias> 别名名称,必填

返回信息 交易hash

"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

示例

nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias
+"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d"
+

导入账户keystore

导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。

  • **命令:importkeystore <path> **
参数 说明
<path> 待导入的keystore文件地址,必填

注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

导入账户私钥

导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。

  • **命令:import <privatekey> **
参数 说明
<privatekey> 账户的私钥,必填

注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

导入账户私钥(覆盖导入)

导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。

  • **命令:import <privatekey> **
参数 说明
<privatekey> 账户的私钥,必填

注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。

覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。

返回信息 导入的账户地址

"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

示例

nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655
+Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly.
+Enter your password:**********
+Please confirm new password:**********
+"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy"
+

查询账户信息

根据账户地址查询账户信息

  • 命令:getaccount <address>
参数 说明
<address> 账户地址,必填

返回信息

{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址
+  "alias" : null,//别名
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥
+  "priKey" : "",//私钥(如果账户设置了密码,该项为空)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//创建时间
+  "encrypted" : true//是否加密(是否设置了密码)
+}
+

示例

nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+{
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}
+

查询账户列表

根据分页参数查询账户列表,所有账户以创建时间倒序输出。

  • 命令:getaccounts <pageNumber> <pageSize>
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息,将输出账户集合

[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址
+  "alias" : null,//别名
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥
+  "priKey" : "",//私钥(如果账户设置了密码,该项为空)
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空)
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",//创建时间
+  "encrypted" : true//是否加密(是否设置了密码)
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

示例 获取账户列表 显示第一页,每页显示2条

nuls>>> getaccounts 1 2
+[ {
+  "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",
+  "alias" : null,
+  "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",
+  "priKey" : "",
+  "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:39:14",
+  "encrypted" : true
+}, {
+  "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2",
+  "alias" : null,
+  "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa",
+  "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb",
+  "encryptedPriKey" : "",
+  "extend" : null,
+  "createTime" : "2018-07-13 11:02:23",
+  "encrypted" : false
+} ]
+

查询账户私钥

根据账户地址查询账户私钥,如果账户已加密,则需要输入密码

  • **命令:getprikey <address> **
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

示例

nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy
+Please enter the password.
+Enter your password:**********
+"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655"
+

查询账户余额

根据账户地址查询账户余额

  • **命令:getbalance <address> **
参数 说明
<address> 账户的地址,必填

返回信息 导入的账户地址

{
+  "balance" : "9999998.99",//余额
+  "locked" : "0",//已锁定余额
+  "usable" : "9999998.99"//可用余额
+}
+

示例

nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "balance" : "9999998.99",
+  "locked" : "0",
+  "usable" : "9999998.99"
+}
+

转账

根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。

  • **命令:transfer <address> <toAddress> <amount> [remark] **
参数 说明
<address> 转出地址,必填
<toAddress> 接收地址,必填
<amount> 转账数量,最多可以有8位小数(单位:NULS),必填
[remark] 备注信息,选填

返回信息 转账交易hash

"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

示例

nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账
+Please enter the password.
+Enter your password:**********
+"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596"
+

查询交易详情

根据交易hash查询交易详细信息

  • 命令:gettx <hash>
参数 说明
<hash> 交易hash,必填

返回信息 交易详细信息

{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash
+  "type" : "transfer",//交易类型(此示例为转账交易)
+  "time" : "2018-07-16 11:21:46",//交易时间
+  "blockHeight" : 26269,//打包交易的区块高度
+  "fee" : "0.001",//交易手续费
+  "value" : "100",//(转账)交易数量
+  "remark" : "转账",//备注
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//签名
+  "status" : "confirm",//交易确认状态(已确认或者未确认)
+  "confirmCount" : 46,//确认次数
+  "size" : 254,//交易大小
+  "inputs" : [ {//交易的输入
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {//交易的输出
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"//交易输出的目标地址(此数据相当于转出100给目标地址)
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//交易输出的目标地址(此数据相当于找零给自己)
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

示例 查询转账交易

nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596
+{
+  "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "type" : "transfer",
+  "time" : "2018-07-16 11:21:46",
+  "blockHeight" : 26269,
+  "fee" : "0.001",
+  "value" : "100",
+  "remark" : "转账",
+  "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",
+  "status" : "confirm",
+  "confirmCount" : 46,
+  "size" : 254,
+  "inputs" : [ {
+    "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e",
+    "fromIndex" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979998.98",
+    "lockTime" : 0
+  } ],
+  "outputs" : [ {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 0,
+    "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T",
+    "value" : "100",
+    "lockTime" : 0,
+    "status" : "usable"
+  }, {
+    "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+    "index" : 1,
+    "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+    "value" : "9979898.979",
+    "lockTime" : 0,
+    "status" : "usable"
+  } ]
+}
+

查询交易列表

根据账户地址,查询该账户的交易列表

  • 命令:gettxlist <address> <pageNumber> <pageSize>
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息 交易详细信息

[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//交易hash
+  "blockHeight" : 26473,//交易的区块高度
+  "time" : "2018-07-16 11:55:43",//交易时间
+  "txType" : "transfer",//交易类型
+  "status" : 1,//确认状态
+  "info" : "+100"//信息
+},{
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

示例

nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10
+[ {
+  "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",
+  "blockHeight" : 26473,
+  "time" : "2018-07-16 11:55:43",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+}, {
+  "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",
+  "blockHeight" : 26269,
+  "time" : "2018-07-16 11:21:46",
+  "txType" : "transfer",
+  "status" : 1,
+  "info" : "+100"
+} ]
+

创建节点

根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。

  • **命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> **
参数 说明
<agentAddress> 创建节点的账户地址,必填
<packingAddress> 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块)
<commissionRate> 代理佣金比例,范围:10~100,必填
<deposit> 创建节点的保证金,不能低于20000NULS,必填

返回信息 返回节点的agent hash

"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

示例 创建一个节点,佣金比例为10%,押金20000NULS。

nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000
+Please enter the password.
+Enter your password:**********
+"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e"
+

加入共识(委托节点)

根据账户地址和节点agentHash,加入共识,至少需要2000NULS

  • **命令:deposit <address> <agentHash> <deposit> **
参数 说明
<address> 账户地址,必填
<agentHash> 节点的agentHash,必填
<deposit> 加入共识保证金,不能低于2000NULS,必填

返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。

"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

示例

nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000
+"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0"
+

退出共识(退出委托)

根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。

  • **命令:withdraw <address> <txHash> **
参数 说明
<address> 账户地址,必填
<txHash> 委托时的交易hash,必填

返回信息 退出共识交易hash

"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

示例

nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0
+"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf"
+

停止节点

停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。

  • **命令:stopagent <address> **
参数 说明
<address> 账户地址,必填

返回信息 停止节点交易hash

"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

示例

nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+Please enter the password.
+Enter your password:**********
+"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f"
+

获取节点详情

根据节点agentHash获取节点详情

  • **命令:getagent <agentHash> **
参数 说明
<agentHash> 节点agentHash值,必填

返回信息

{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 60.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "35024DE6",//节点ID
+  "time" : "2018-07-16 16:33:38",//创建节点时间
+  "blockHeight" : 28141,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : 0.05,//信用值
+  "totalDeposit" : "208000",//节点当前委托总额
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//参与数
+}
+

示例

nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6
+{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.05,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}
+

获取节点列表

根据共识节点列表

  • **命令:getagents <pageNumber> <pageSize> **
参数 说明
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息

[{
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 60.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "35024DE6",//节点ID
+  "time" : "2018-07-16 16:33:38",//创建节点时间
+  "blockHeight" : 28141,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : 0.05,//信用值
+  "totalDeposit" : "208000",//节点当前委托总额
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5//参与数
+}]
+

示例

nuls>>> getagents 1 2
+[ {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.18,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+}, {
+  "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7",
+  "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN",
+  "deposit" : "20000",
+  "commissionRate" : 10.0,
+  "agentName" : null,
+  "agentId" : "5CE291D8",
+  "time" : "2018-07-16 16:31:12",
+  "blockHeight" : 28126,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.16,
+  "totalDeposit" : "208000",
+  "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8",
+  "memberCount" : 5
+} ]
+

获取全网共识总体信息

查询全网共识总体信息

  • **命令:getconsensus **

返回信息

{
+  "agentCount" : 6,//节点数
+  "totalDeposit" : "1758000",//总委托数
+  "rewardOfDay" : "0",//奖励
+  "consensusAccountNumber" : 6,//共识账户数量
+  "packingAgentCount" : 6//打包地址数量
+}
+

示例

nuls>>> getconsensus
+{
+  "agentCount" : 6,
+  "totalDeposit" : "1758000",
+  "rewardOfDay" : "0",
+  "consensusAccountNumber" : 6,
+  "packingAgentCount" : 6
+}
+

获取单个账户的委托总览

根据账户地址获取该账户参与的所有委托(共识)信息的总览

  • **命令:getdepositedinfo <address> **
参数 说明
<address> 账户地址,必填

返回信息

{
+  "agentCount" : 1,//创建的节点数
+  "totalDeposit" : "1600000",//总共委托的数量
+  "joinAgentCount" : 6,//加入委托的节点数
+  "usableBalance" : "8048998.869",//可用余额
+  "reward" : "219.65910271",//得到的奖励总数
+  "rewardOfDay" : "219.65910271",//一天得到的奖励数
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//节点hash
+}
+

示例

nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT
+{
+  "agentCount" : 1,
+  "totalDeposit" : "1600000",
+  "joinAgentCount" : 6,
+  "usableBalance" : "8048998.869",
+  "reward" : "219.65910271",
+  "rewardOfDay" : "219.65910271",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"
+}
+

获取单个账户的委托信息列表

根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表

  • **命令:getdepositeds <address> <pageNumber> <pageSize> [agentHash] **
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填
[agentHash] 节点Hash,选填

返回信息

[{
+  "deposit" : "2000",//委托金额
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//委托者地址
+  "time" : "2018-07-16 16:38:25",//时间
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//委托交易hash
+  "blockHeight" : 28148,//交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//节点状态
+  "agentName" : "35024DE6",//节点名
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//节点地址
+}]
+

示例

nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "deposit" : "2000",
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:25",
+  "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",
+  "blockHeight" : 28148,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "35024DE6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"
+}, {
+  "deposit" : "2000",
+  "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd",
+  "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "time" : "2018-07-16 16:38:43",
+  "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234",
+  "blockHeight" : 28149,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "agentName" : "E09EB7FD",
+  "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT"
+} ]
+

获取单个账户的委托节点列表

根据地址查询该账户委托的节点列表(返回节点信息列表)

  • **命令:getdepositedagents <address> <pageNumber> <pageSize> **
参数 说明
<address> 账户地址,必填
<pageNumber> 页数,需要获取第几页的数据,必填
<pageSize> 每一页显示的数据条数,必填

返回信息

[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//节点hash
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//创建节点的账户地址
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//节点打包(出块)地址
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//奖励地址(默认为创建节点地址)
+  "deposit" : "20000",//创建节点的保证金
+  "commissionRate" : 40.0,//代理佣金比例
+  "agentName" : null,//节点名称(来源)
+  "agentId" : "0198ACAF",//节点ID
+  "time" : "2018-07-16 16:32:52",//创建节点时间
+  "blockHeight" : 28136,//创建节点交易的块高度
+  "delHeight" : -1,
+  "status" : "consensus",//状态
+  "creditVal" : -0.91,//信用值
+  "totalDeposit" : "204000",//节点当前委托总额
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3//参与数
+}]
+

示例 获取第一页,每页显示两条

nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2
+[ {
+  "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",
+  "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",
+  "deposit" : "20000",
+  "commissionRate" : 40.0,
+  "agentName" : null,
+  "agentId" : "0198ACAF",
+  "time" : "2018-07-16 16:32:52",
+  "blockHeight" : 28136,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : -0.91,
+  "totalDeposit" : "204000",
+  "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",
+  "memberCount" : 3
+}, {
+  "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",
+  "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",
+  "deposit" : "20000",
+  "commissionRate" : 60.0,
+  "agentName" : null,
+  "agentId" : "35024DE6",
+  "time" : "2018-07-16 16:33:38",
+  "blockHeight" : 28141,
+  "delHeight" : -1,
+  "status" : "consensus",
+  "creditVal" : 0.91,
+  "totalDeposit" : "208000",
+  "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6",
+  "memberCount" : 5
+} ]
+

获取最新的区块头信息

获取最新的区块头信息

  • 命令:getbestblockheader

返回信息

{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//区块hash
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//前一区块hash
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//梅克尔hash
+  "time" : "2018-07-17 10:25:40",//区块生成时间
+  "height" : 33950,//区块高度
+  "txCount" : 1,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 668413,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-17 10:25:30",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0",//共识奖励
+  "fee" : "0",//区块的打包手续费
+  "confirmCount" : 0,//确认次数
+  "size" : 204,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"//签名
+}
+

示例

nuls>>> getbestblockheader
+{
+  "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",
+  "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",
+  "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",
+  "time" : "2018-07-17 10:25:40",
+  "height" : 33950,
+  "txCount" : 1,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 668413,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-17 10:25:30",
+  "packingIndexOfRound" : 1,
+  "reward" : "0",
+  "fee" : "0",
+  "confirmCount" : 0,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"
+}
+

查询区块信息

根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。

  • **命令:getblock <hash> | <height> **
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "txList" : [ {//交易集合
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//交易hash
+    "type" : "coinbase",//交易类型
+    "time" : "2018-07-16 16:29:30",//交易时间
+    "blockHeight" : 28115,//交易所在区块高度
+    "fee" : "0",//交易手续费
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],//交易的输入
+    "outputs" : [ //交易的输出
+        {
+          "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+          "value" : 100000,
+          "lockTime" : 29115
+        }
+    ]
+  }],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块

nuls>>> getblock 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6174,
+  "size" : 507,
+  "txList" : [ {
+    "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",
+    "type" : "coinbase",
+    "time" : "2018-07-16 16:29:30",
+    "blockHeight" : 28115,
+    "fee" : "0",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : null,
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 54,
+    "inputs" : [ ],
+    "outputs" : [ {
+      "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+      "value" : 100000,
+      "lockTime" : 29115
+    } ]
+  }, {
+    "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b",
+    "type" : "transfer",
+    "time" : "2018-07-16 16:29:27",
+    "blockHeight" : 28115,
+    "fee" : "0.001",
+    "value" : null,
+    "remark" : null,
+    "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663",
+    "status" : "confirm",
+    "confirmCount" : 6174,
+    "size" : 249,
+    "inputs" : [ {
+      "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459",
+      "fromIndex" : 1,
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 972899896100000
+    } ],
+    "outputs" : [ {
+      "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne",
+      "value" : 3000000000000,
+      "lockTime" : 0
+    }, {
+      "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",
+      "value" : 969899896000000,
+      "lockTime" : 0
+    } ]
+  } ],
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

查询区块头信息

根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。

  • **命令:getblockheader <hash> | <height> **
参数 说明
<hash> 区块的hash值
<height> 区块的高度

返回信息

{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash
+  "time" : "2018-07-16 16:29:30",//区块生成时间
+  "height" : 28115,//区块高度
+  "txCount" : 2,//区块打包交易数量
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址
+  "roundIndex" : 662578,//共识轮次
+  "consensusMemberCount" : 1,//参与共识成员数量
+  "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间
+  "packingIndexOfRound" : 1,//当前轮次打包出块的名次
+  "reward" : "0.001",//共识奖励
+  "fee" : "0.001",//区块的打包手续费
+  "confirmCount" : 6174,//确认次数
+  "size" : 507,//区块大小
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名
+}
+

示例 根据高度获取区块头

nuls>>> getblockheader 28115
+{
+  "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",
+  "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",
+  "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",
+  "time" : "2018-07-16 16:29:30",
+  "height" : 28115,
+  "txCount" : 2,
+  "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",
+  "roundIndex" : 662578,
+  "consensusMemberCount" : 1,
+  "roundStartTime" : "2018-07-16 16:29:20",
+  "packingIndexOfRound" : 1,
+  "reward" : "0.001",
+  "fee" : "0.001",
+  "confirmCount" : 6280,
+  "size" : 204,
+  "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"
+}
+

查询网络信息

查询网络基本信息

  • **命令:getnetinfo **

返回信息

{
+  "localBestHeight" : 35317,//本地最新区块高度
+  "netBestHeight" : 35317,//网络最新区块高度
+  "timeOffset" : "0ms",//网络时间偏移值
+  "inCount" : 0,//被动连接节点数量
+  "outCount" : 1//主动连接节点数量
+}
+

示例

nuls>>> getnetinfo
+{
+  "localBestHeight" : 35317,
+  "netBestHeight" : 35317,
+  "timeOffset" : "0ms",
+  "inCount" : 0,
+  "outCount" : 1
+}
+

查询网络节点IP

查询网络节点IP

  • **命令:getnetnodes **

返回信息

[ "192.168.1.223" ]
+

示例 根据高度获取区块

nuls>>> getnetnodes
+[ "192.168.1.223" ]
+

查询当前版本信息

查询当前版本号

  • **命令:version **

返回信息

[ "192.168.1.223" ]
+

示例

nuls>>> version
+{
+  "myVersion" : "1.0.0",
+  "newestVersion" : "0.9.11",
+  "upgradable" : false,
+  "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization"
+}
+

版本更新

查询当前版本号

  • **命令:upgrade <version> **

示例

nuls>>> version 1.0.0
+

退出钱包命令程序

退出操作钱包的命令行程序,不会退出已启动的钱包节点。

  • 命令:exit

示例

nuls>>> exit
+
Last Updated: 2019-1-14 18:17:19
+ + + diff --git a/docs/.vuepress/dist/zh/developerTools/sdk.html b/docs/.vuepress/dist/zh/developerTools/sdk.html new file mode 100644 index 00000000..86f64a33 --- /dev/null +++ b/docs/.vuepress/dist/zh/developerTools/sdk.html @@ -0,0 +1,987 @@ + + + + + + SDK | NULS + + + + + + + +

SDK

介绍

本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。

约定

  • 所有SDK接口统一返回Result(说明见文末附件数据解释)
  • 每个接口描述的返回对象是指Result中data属性的内容
  • 除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na
  • 运行SDK前,需要确认NULS节点服务已经启动并工作正常
  • 推荐使用JDK1.8+

版本更新记录

版本 更新日期 更新内容
v0.9.11.0 2018-06-19 对接NULS服务各项基础功能的接口
v0.9.11.1 2018-06-22 新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1
v0.9.14 2018-07-04 修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等)
v0.9.15 2018-07-07 新增4个共识接口,4.1——4.4
v0.9.16 2018-07-11 新增接口4.5
v1.0.1 2018-07-13 新增错误码
v1.1.0 2018-09-28 新增多账户转账接口

快速入门

1.引入文件

使用构建工具导入jar包

  • maven方式
<dependency>
+   <groupId>io.nuls.sdk</groupId>
+   <artifactId>sdk-all</artifactId>
+   <version>1.0.1</version>
+</dependency>
+

2.创建SDK实例

首先添加SDK命名空间

//SDK启动类命名空间
+import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+//引入SDK调用工具的命名空间
+import io.nuls.sdk.tool.NulsSDKTool;
+

引入后 使用下列代码生成一个实例client

  • 初始化SDK
  • 初始化方法不传参数时,默认PRC ip和端口分别为127.0.0.18001
//默认 
+SDKBootstrap.init();
+//传入NULS服务的ip,port
+SDKBootstrap.init("192.168.1.88", "8001");
+
  • 使用工具类调用接口方法
Result result = NulsSDKTool.createAccount("nuls123456");
+

e.g 创建一个带密码的账户的完整示例

import io.nuls.sdk.SDKBootstrap;
+import io.nuls.sdk.model.Result;
+//根据需求引入对应模块的命名空间
+import io.nuls.sdk.tool.NulsSDKTool;
+
+public static void main(String[] args) {
+	SDKBootstrap.init();
+	Result result = NulsSDKTool.createAccount("nuls123456");
+}
+

--

账户 AccountService

1.1 创建账户

接口

Result createAccount(int count, String password);

说明

创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户; +成功创建的账户信息将被持久化至NULS服务本地数据库中。

返回成功创建的账户地址集合

参数 类型 是否必填 说明
count int 非必填 创建账户的数量(默认1)
password String 非必填 设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data":{
+	    "list": [ //返回创建账户的地址集合
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv",
+	        "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv"
+	    ]
+    }
+}
+

e.g 示例代码

//创建一个没有密码的账户
+createAccount();
+//创建一个有密码的账户
+createAccount("nuls123456");
+//创建3个没有密码的账户
+createAccount(3);
+//创建3个有密码的账户
+createAccount(3, "nuls123456");
+

1.2 创建离线账户

接口

Result createOfflineAccount(int count, String password)

说明

直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作 +Create encrypted off-line accounts (Not saved to the database)

Result.data List<AccountInfo>

参数 类型 是否必填 说明
count int 非必填 创建账户的数量(默认1)
password String 非必填 设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"list":[
+			{
+				"address": String, 账户地址
+				"alias": String, 账户别名
+				"pubKey": String, 公钥
+				"extend": String, 扩展
+				"createTime": Long, 创建时间
+				"encrypted": boolean, 是否加密
+				"priKey": String, 私钥(创建无密码离线账户时才会有值)
+				"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+			},
+			{
+				"address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD",
+				"alias": null,
+				"pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb",
+				"extend": null,
+				"createTime": 1529314943624,
+				"encrypted": true,
+				"priKey": "",
+				"encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0"
+			}
+		]
+	}
+}
+

e.g 示例代码

//创建一个没有密码的离线账户
+createOfflineAccount();
+//创建一个有密码的离线账户
+createOfflineAccount("nuls123456");
+//创建3个没有密码的离线账户
+createOfflineAccount(3);
+//创建3个有密码的离线账户
+createOfflineAccount(3, "nuls123456");
+

1.3 获取账户

接口

Result getAccount(String address)

说明

根据账户地址获取一个账户的信息

Result.data AccountInfo

参数 类型 是否必填 说明
address String 必填 账户的地址

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"address": String, 账户地址
+		"alias": String, 账户别名
+		"pubKey": String, 公钥
+		"extend": String, 扩展
+		"createTime": Long, 创建时间
+		"encrypted": boolean, 是否加密
+		"priKey": String, 私钥(创建无密码离线账户时才会有值)
+		"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+	}
+}
+

e.g 示例代码

getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.4 获取设置别名的手续费

接口

Result getAliasFee(String address, String alias)

说明

根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费)

Result.data double, unit is NULS

注意! 此接口返回的手续费单位为NULS

参数 类型 是否必填 说明
address String 必填 账户的地址
alias String 必填 待设置的别名名称

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data":{
+		"value": 0.01 //(单位为NULS)
+	} 
+}
+

e.g 示例代码

getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666");
+

1.5 获取账户列表

接口

Result getAccountList(int pageNumber, int pageSize)

说明

根据分页参数获取账户列表

Result.data Page List<AccountInfo>

参数 类型 是否必填 说明
pageNumber int 必填 页码,必须大于0
pageSize int 必填 每页返回数据记录数量, 取值范围1~100

返回结果

  • 返回结果为Result对象,格式如下:
{
+	"success": true,
+	"data": {
+		"pageNumber": 1,
+    	"pageSize": 10,
+    	"total": 100,
+     	"pages": 10,
+		"list": [
+			{
+				"address": String, 账户地址
+				"alias": String, 账户别名
+				"pubKey": String, 公钥
+				"extend": String, 扩展
+				"createTime": Long, 创建时间
+				"encrypted": boolean, 是否加密
+				"priKey": String, 私钥(创建无密码离线账户时才会有值)
+				"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+			},
+			{
+				"address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP",
+				"alias": null,
+				"pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184",
+				"extend": null,
+				"createTime": 1529311250627,
+				"encrypted": true,
+				"priKey": null,
+				"encryptedPriKey": null
+			}
+			...
+			
+		]
+	}
+}
+

e.g 示例代码

getAccountList(1, 10);
+

1.6 根据账户别名获取账户地址

接口

Result getAddressByAlias(String alias)

说明

根据账户别名获取账户地址字符串

Result.data String

参数 类型 是否必填 说明
alias String 必填 账户别名

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g 示例代码

 getAddressByAlias("factory666");
+

1.7 获取账户私钥

接口

Result getPrikey(String address, String password)

说明

根据账户地址和密码获取账户私钥,返回私钥字符串

Result.data String

参数 类型 是否必填 说明
address String 必填 账户地址
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+		"value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"
+    }
+}
+

e.g 示例代码

//有密码的账户调用方式
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+//无密码的账户调用方式
+getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.8 验证别名是否可以使用

接口

Result isAliasUsable(String alias)

说明

根据别名名称验证别名是否可用(是否没有被使用)

Result

参数 类型 是否必填 说明
alias String 必填 别名名称

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示别名可以使用
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回 别名不可用的情况
{	//表示别名不可以使用
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • 返回错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

isAliasUsable("factory666");
+

1.9 备份账户

接口

Result backupAccount(String address, String path, String password)

说明

根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码

Result 返回生成的文件地址

参数 类型 是否必填 说明
address String 必填 账户的地址
path String 必填 将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+	    "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore"
+    }
+}
+

e.g 示例代码

//备份一个没有密码的账户至当前目录
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null);
+//备份一个有密码的账户至/backup目录
+backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456");
+

1.10 导入账户

接口

Result importAccountByKeystore

说明

根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。

Result

参数 类型 是否必填 说明
path/fileReader String/FileReader 必填 待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象
password String 非必填 .keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填
overwrite boolean 必填 true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS"
+    }
+}
+

e.g 示例代码

//导入一个有密码的账户
+importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true);
+importAccountByKeystore(fileReader, "nuls123456", true);
+//导入一个没有密码的账户
+importAccountByKeystore("/backup/XXXXXX.keystore", false);
+importAccountByKeystore(fileReader, false);
+

1.11 导入账户(私钥)

接口

Result importAccountByPriKey(String privateKey, String password, boolean overwrite)

说明

根据私钥导入账户

Result

参数 类型 是否必填 说明
privateKey String 必填 账户私钥
password String 非必填 设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
overwrite boolean 必填 true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS"
+    }
+}
+

e.g 示例代码

//导入账户时设置密码
+importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true);
+//导入账户时不设置密码
+importAccountByPriKey("1f9d3ad044e0e120......", true);
+

1.12 验证账户是否加密

接口

Result isEncrypted(String address)

说明

验证账户是否加密

Result

参数 类型 是否必填 说明
address String 必填 账户地址

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示已加密
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回 未加密
{
+    "success": true,
+     "data"{
+        "value": false
+     }
+}
+
  • 返回错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+

1.13 移除账户

接口

Result removeAccount(String address, String password)

说明

移除账户

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 非必填 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5");
+removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.13 设置密码

接口

Result setPassword(String address, String password)

说明

为未加密的账户设置密码,已加密账户不能调用此接口

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 必填 设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456");
+

1.14 修改密码

接口

Result resetPassword(String address, String password, String newPassword)

说明

为已加密的账户修改密码,未加密账户不能调用此接口

Result

参数 类型 是否必填 说明
address String 必填 账户地址
password String 必填 账户当前密码
newPassword String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{	//表示成功
+    "success": true,
+    "data": {
+		"value":true
+    }
+}
+
  • 返回不成功 以及错误的情况,例如参数错误
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+

e.g 示例代码

resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111");
+

1.15 设置别名

接口

Result setAlias(String address, String alias, String password)

说明

为账户设置一个别名

Result 返回设置别名的交易hash

参数 类型 是否必填 说明
address String 必填 账户的地址
alias String 必填 待设置的别名名称
password String 密码 账户密码,如果账户没有加密则不填

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data":{		
+		"value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6"
+	}
+}
+
  • 错误示例
{
+    "success": false,
+     "data"{
+        "code": "ACT007",
+        "msg": "The account already set an alias"
+     }
+}
+

e.g 示例代码

setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111");
+setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666");
+

1.16 设置离线账户密码

接口

Result setPasswordOffline(String address, String priKey, String password)

说明

设置离线账户密码, sdk中独立加密,不与NULS服务交互

Result 返回加密后的私钥(encryptedPriKey)

参数 类型 是否必填 说明
address String 必填 账户地址
priKey String 必填 账户的私钥
password String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g 示例代码

setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456");
+

1.17 修改离线账户密码

接口

Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)

接口

修改离线账户密码, sdk中独立修改, 不与NULS服务交互

Result 返回新密码生成的加密后的私钥(encryptedPriKey)

参数 类型 是否必填 说明
address String 必填 账户的地址
encryptedPriKey String 必填 加密后的私钥
password String 必填 原密码
newPassword String 必填 新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9"
+    }
+}
+

e.g 示例代码

resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456");
+

交易 AccountLedgerService

2.1 创建转账交易

接口

Result createTransaction(List<Input> inputs, List<Output> outputs, String remark)

说明

通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。示例中input和output的属性都为必填项。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。有关手续费的计算会在后面详细说明

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
inputs List<Input> 必填 交易引用的未花费输出
outputs List<Output> 必填 交易新生成的未花费输出
remark String 非必填 交易备注

e.g 示例代码

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+
+//组装交易的inputs,示例中的input属性均必填
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//组装交易的outputs,示例中的output属性均必填
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createTransaction(inputs, outputs, remark);
+

交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):100000 NA/1KB

交易大小的计算:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

2.2 交易签名

接口

Result signTransaction(String txHex, String priKey, String address, String password)

说明

通过私钥,给交易签名

Result.data String 签名后的交易,16进制后的序列化字符串

参数 类型 是否必填 说明
txHex String 必填 十六进制的交易序列化数据
priKey String 必填 交易的私钥
address String 必填 私钥对应的地址,用于验证私钥合法性
password String 非必填 私钥的密码,如果私钥未加密可不传

e.g 示例代码

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8";
+String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM";
+String password = "NULS6352s!f";
+Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password);
+

2.3 根据交易hash查询交易详情

接口

Result getTxByHash(String hash)

说明

根据交易hash查询交易详情

Result.data Transaction

参数 类型 是否必填 说明
hash String 必填 交易的hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+        "type": 2,
+        "time": 1529323198461,
+        "blockHeight": 1884,
+        "fee": 100000,
+        "value": 99900000000,
+        "remark": "转账",
+        "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+        "status": 1,
+        "confirmCount": 14,
+        "size": 255,
+        "inputs": [
+            {
+                "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                "fromIndex": 0,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9999899000000
+            }
+        ],
+        "outputs": [
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 0,
+                "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                "value": 99900000000,
+                "lockTime": 0,
+                "status": 0
+            },
+            {
+                "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "index": 1,
+                "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                "value": 9899998900000,
+                "lockTime": 0,
+                "status": 0
+            }
+        ]
+    }
+}
+

e.g 示例代码

getTxByHash("041f3d2ceed........");
+

2.4 转账

接口

Result transfer(String address, String toAddress, String password, long amount, String remark)

说明

发起转账交易

Result 返回交易hash

参数 类型 是否必填 说明
address String 必填 转出者账户的地址
toAddress String 必填 接收者账户的地址
password String 非必填 转出者账户的密码,如果账户没有加密则不填
amount long 必填 转账金额(单位:Na)
remark String 必填 备注

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2"
+    }
+}
+

e.g 示例代码

	//账户有密码
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "备注1NULS=10000000Na");
+//账户没有密码
+transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, "备注1NULS=10000000Na");
+

2.5 查询账户余额

接口

Result getBalance(String address)

说明

获取账户余额

Result.data BalanceInfo

参数 类型 是否必填 说明
address String 必填 账户地址

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "balance": 1009899998900000,
+        "usable": 1009899998900000,
+        "locked": 0
+    }
+}
+

e.g 示例代码

getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS");
+

2.6 广播交易

接口

Result broadcastTransaction(String txHex);

说明

广播交易

Result.data String 返回交易hash

参数 类型 是否必填 说明
txHex String 必填 十六进制交易序列化数据

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+    	"value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85"
+    }
+}
+
+

e.g 示例代码

String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24";
+Result result = service.broadcastTransaction(txHex);
+if(result.isSuccess()) {
+   String txHash = (String)result.getData();
+}
+

2.7 创建多地址转账交易

接口

Result createMultipleInputAddressTransaction(List<Input> inputs, List<Output> outputs, String remark)

说明

通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。示例中input和output的属性都为必填项。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。有关手续费的计算会在后面详细说明

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
inputs List<Input> 必填 交易引用的未花费输出
outputs List<Output> 必填 交易新生成的未花费输出
nInputAccount int 必填 输入账户数
remark String 非必填 交易备注

e.g 示例代码

String remark = "create transaction demo";
+long fee = 100000;
+List<Input> inputs = new ArrayList<>();
+List<Output> outputs = new ArrayList<>();
+int nInputAccount = 2;
+
+//组装交易的inputs,示例中的input属性均必填
+Input input = new Input();
+input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); 
+input.setFromIndex(1);
+input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5")
+input.setValue(1000000000L);      
+input.setLockTime(0);
+inputs.add(input);
+
+//组装交易的outputs,示例中的output属性均必填
+Output output = new Output();
+output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG");
+output.setValue(1000000L);
+output.setLockTime(0L);
+outputs.add(output);
+
+output = new Output();
+output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM");
+output.setValue(1000000000L - 1000000 - fee);
+output.setLockTime(0L);
+outputs.add(output);
+
+Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark);
+

交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):100000 NA/1KB

交易大小的计算:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

2.8 多地址转账交易签名

接口

Result signMultipleAddressTransaction(String txHex, List<String> privKeys, List<String> passwords)

说明

通过私钥,给交易签名

Result.data String 签名后的交易,16进制后的序列化字符串

参数 类型 是否必填 说明
txHex String 必填 十六进制的交易序列化数据
privKeys List 必填 交易的私钥
passwords List 必填 私钥对应的密码(多个账户密码必须一样)

e.g 示例代码

String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000";
+List<String> priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d");
+List<String> passwords = Arrays.asList("123456","123456");
+Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords);
+

区块 BlockService

3.1 根据区块高度获取区块头

接口

Result getblockHeader(int height)

说明

根据区块高度获取区块头信息

Result.data BlockHeader

参数 类型 是否必填 说明
height int 必填 区块高度

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g 示例代码

getblockHeader(10);
+

3.2 根据区块hash获取区块头

接口

Result getblockHeader(String hash)

说明

根据区块hash获取区块头

Result.data BlockHeader

参数 类型 是否必填 说明
hash String 必填 区块hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+

e.g 示例代码

getblockHeader("041f3d2ceed........");
+

3.3 根据区块高度获取区块

接口

Result getBlock(int height)

说明

根据区块高度获取区块

Result.data Block

参数 类型 是否必填 说明
height int 必填 区块高度

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "转账",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g 示例代码

getBlock(10);
+

3.4 根据区块hash获取区块

接口

Result getBlock(String hash)

说明

根据区块hash获取区块

Result.data Block

参数 类型 是否必填 说明
hash String 必填 区块hash值

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3",
+        "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67",
+        "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168",
+        "time": 1529323210000,
+        "height": 1884,
+        "txCount": 1884,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae",
+        "roundIndex": 420416,
+        "consensusMemberCount": 5,
+        "roundStartTime": 1529323170000,
+        "packingIndexOfRound": 4,
+        "confirmCount": 33,
+        "reward": 100000,
+        "fee": 100000,
+        "size": 5,
+        "txList": [
+            {
+                "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc",
+                "type": 1,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 54,
+                "inputs": [],
+                "outputs": [
+                    {
+                        "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+                        "value": 100000,
+                        "lockTime": 2884
+                    }
+                ]
+            },
+            {
+                "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2",
+                "type": 2,
+                "time": 1529323198461,
+                "blockHeight": 1884,
+                "fee": 100000,
+                "value": 0,
+                "remark": "转账",
+                "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848",
+                "status": 0,
+                "confirmCount": 33,
+                "size": 255,
+                "inputs": [
+                    {
+                        "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7",
+                        "fromIndex": 0,
+                        "address": null,
+                        "value": 9999899000000
+                    }
+                ],
+                "outputs": [
+                    {
+                        "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN",
+                        "value": 99900000000,
+                        "lockTime": 0
+                    },
+                    {
+                        "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS",
+                        "value": 9899998900000,
+                        "lockTime": 0
+                    }
+                ]
+            },
+            {
+                "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f",
+                "type": 7,
+                "time": 1529323210000,
+                "blockHeight": 1884,
+                "fee": 0,
+                "value": 0,
+                "remark": null,
+                "scriptSig": null,
+                "status": 0,
+                "confirmCount": 33,
+                "size": 38,
+                "inputs": [],
+                "outputs": []
+            }
+        ]
+    }
+}
+

e.g 示例代码

getBlock("041f3d2ceed........");
+

3.5 获取最新区块头

接口

Result getNewestBlockHash()

说明

获取最新的区块头

Result.data BlockHeader

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33",
+        "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64",
+        "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488",
+        "time": 1529299160000,
+        "height": 4,
+        "txCount": 4,
+        "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS",
+        "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf",
+        "roundIndex": 419517,
+        "consensusMemberCount": 1,
+        "roundStartTime": 1529299150000,
+        "packingIndexOfRound": 1,
+        "confirmCount": 1909,
+        "reward": 0,
+        "fee": 0,
+        "size": 1
+    }
+}
+
+

e.g 示例代码

getNewestBlockHash();
+

3.6 获取最新区块的高度

接口

Result getNewestBlockHight()

说明

获取最新区块的高度

Result.data 高度(Long)

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "value": 5210
+    }
+}}
+
+

e.g 示例代码

getNewestBlockHight();
+

3.7 获取最新区块的块Hash

接口

Result getNewestBlockHash()

说明

获取最新区块的块Hash

Result.data Hash值(String)

返回结果

  • 返回结果为Result对象,格式如下:
{
+    "success": true,
+    "data": {
+        "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b"
+    }
+}}
+
+

e.g 示例代码

getNewestBlockHash();
+

共识 ConsensusService

4.1 离线组装创建节点交易

接口

Result createAgentTransaction(AgentInfo agentInfo, List<Input> inputs, Na fee)

说明

离线组装创建节点交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
agentInfo Object 必填 创建节点信息
inputs List 必填 输入信息
fee Object 必填 交易手续费

e.g 示例代码

//组装交易的inputs,示例中的input属性均必填
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+//创建节点信息,示例总AgentInfo的属性均必填
+AgentInfo info = new AgentInfo();
+info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");       //申请共识节点的地址
+info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ");     //实际打包区块的地址
+info.setDeposit(200000 * 100000000L);//创建节点的保证金, 最低20000NULS,最高200000NULS     
+info.setCommissionRate(10.0); //佣金比例 1-100
+
+//创建节点的手续费
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

创建共识节点交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):1000000 NA/1KB

交易大小的计算:(288 + 50 * inputs.length)/1024 , +其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

4.2 离线组装委托共识交易

接口

Result createDepositTransaction(DepositInfo depositInfo, List<Input> inputs, Na fee)

说明

离线组装委托共识交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
depositInfo Object 必填 创建节点信息
inputs List 必填 输入信息
fee Object 必填 交易手续费

e.g 示例代码

//组装交易的inputs,示例中的input属性均必填
+List<Input> inputs = new ArrayList<>();
+Input input = new Input();
+input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+input.setFromIndex(1);
+input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+input.setValue(999998760000000L);
+inputs.add(input);
+
+//委托共识信息,示例中DepositInfo的属性均必填
+DepositInfo info = new DepositInfo();
+info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");            //委托共识的地址
+info.setDeposit(300000 * 100000000L);//委托代币数量:2000NULS —— 500000NULS
+info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");//创建共识节点的交易id
+
+//创建节点的手续费
+Na fee = Na.valueOf(1000000L);
+
+Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

创建委托交易手续费的计算:手续费单价 * 交易大小

手续费单价(min):1000000 NA/1KB

交易大小的计算:(288 + 50 * inputs.length)/1024 , +其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。

4.3 离线组装退出委托共识交易

接口

Result createCancelDepositTransaction(Output output)

说明

离线组装退出委托共识交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
output Object 必填 参与共识时被锁定的那条output

e.g 示例代码

//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额,
+//将output作为参数,生成退出委托共识交易
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setValue(20000000000000L);
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createCancelDepositTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.4 离线组装删除共识节点交易

接口

Result createStopAgentTransaction(Output output)

说明

离线组装删除共识节点交易

Result.data String 16进制后的交易序列化字符串

参数 类型 是否必填 说明
output Object 必填 创建节点时被锁定的那条output

e.g 示例代码

//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金,
+//将output作为参数,生成退出委托共识交易
+Output output = new Output();
+output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6");
+output.setIndex(0);
+output.setValue(20000000000000L);
+output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ");
+output.setLockTime(-1);
+
+Result result = NulsSDKTool.createStopAgentTransaction(output);
+Map<String, Object> map = (Map<String, Object>) result.getData();
+String txHex = (String) map.get("value");
+

4.5 获取委托共识列表

接口

Result getDeposits(String address, int pageNumber, int pageSize)

说明

获取地址的委托共识列表

Result.data List委托列表信息

参数 类型 是否必填 说明
address String 必填 委托地址
pageNumber Int 必填 页码
pageSize Int 必填 每页显示条数,1-100之间

返回结果

  • 返回结果为Result对象,格式如下:
{
+  "success":true,
+  "data":{
+    "pageNumber":1,
+    "pageSize":10,
+    "total":1,
+    "pages":1,
+      "list":[
+        {
+        "deposit":20000010000000,
+        "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c",
+        "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA",
+        "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e",
+        "blockHeight":98,
+        "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA"
+        }
+      ]
+  }
+}
+

e.g 示例代码

Result result = NulsSDKTool.getDeposits(address, 1, 10);
+

附录

接口返回Result示例

Result
  • 表示接口访问正常,业务返回具体的数据
{	
+    "success": true,//接口执行的正确性
+    "data": data
+}
+
  • 表示接口访问正常,业务返回true
{	//表示接口访问正常,业务返回true
+    "success": true,//接口执行的正确性
+    "data": {
+		"value":true //接口业务功能的返回结果
+    }
+}
+
  • 表示接口访问正常,业务返回false
{	
+    "success": true, //接口执行的正确性
+     "data"{
+        "value": false //接口业务功能的返回结果
+     }
+}
+
  • 返回错误的情况,例如参数错误,异常等
{	//表示错误的情况
+    "success": false,
+     "data"{
+        "code": "ACT005",
+        "msg": "xxxxxx...."
+     }
+}
+
  • 这是创建一个带密码的离线账户的完整返回结果
{
+    "success": true,
+    //data为List<account>
+    "data": {
+    	"list":[
+        	{
+	           "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr",
+	            "alias": null,
+	            "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0",
+	            "extend": null,
+	            "createTime": 1529041525794,
+	            "encrypted": false,
+	            "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a",
+	            "encryptedPriKey": ""
+	    	}
+	    ]
+    }
+}
+

Account
{
+	"address": String, 账户地址
+	"alias": String, 账户别名
+	"pubKey": String, 公钥
+	"extend": String, 扩展
+	"createTime": Long, 创建时间
+	"encrypted": boolean, 是否加密
+	"priKey": String, 私钥(创建无密码离线账户时才会有值)
+	"encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值)
+}
+

Input
 {
+	"fromHash": String, 来源output的txHash         
+	"fromIndex": Integer, 来源output的outIndex
+	"address": String, 转入地址                   
+	"value": Long 转入金额
+    "lockTime": Long 锁定时间
+}
+

Output
 {
+	"txHash": String, 交易hash
+	"index": Integer, 索引
+	"address": String, 地址
+	"value": Long, 数量
+	"lockTime": Long, 锁定时间
+	"status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费)
+}
+

Transaction
{
+	"hash": String, 交易的hash值
+	"type": Integer, 交易类型
+	"time": Long, 交易发起时间
+	"blockHeight": Long, 区块高度
+	"fee": Long, 交易手续费
+	"value": Long, 交易金额
+	"remark": String, 备注
+	"scriptSig": String, 签名
+	"status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认)
+	"confirmCount": Long, 确认次数
+	"size": int, 大小
+	"inputs": [
+		{
+			"fromHash": String, 来源output的txHash
+			"fromIndex": Integer, 来源output的outIndex
+			"address": String, 转入地址
+			"value": Long 转入金额
+		}
+		],
+	"outputs": [
+		{
+			"txHash": String, 交易hash
+			"index": Integer, 索引
+			"address": String, 地址
+			"value": Long, 数量
+			"lockTime": Long, 锁定时间
+			"status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费)
+		}
+	]
+}
+

BalanceInfo
{
+	"balance": long, 余额
+	"usable": long, 可用余额
+	locked": long 锁定余额
+}
+

BlockHeader
{
+	"hash": String, 区块的hash值
+	"preHash": String, 上一个区块的hash值
+	"merkleHash": String, 梅克尔hash
+	"time": Long, 区块生成时间
+	"height": Long, 区块高度
+	"txCount": Long, 区块打包交易数量
+	"packingAddress": String, 打包地址
+	"scriptSig": String, 签名
+	"roundIndex": Long, 共识轮次
+	"consensusMemberCount": Integer, 参与共识成员数量
+	"roundStartTime": Long, 当前共识轮开始时间
+	"packingIndexOfRound": Integer, 当前轮次打包出块的名次
+	"confirmCount": Long, 确认次数
+	"reward": Long, 共识奖励
+	"fee": Long, 获取的打包手续费
+	"size": int, 大小
+}
+

Block
{
+	"hash": String, 区块的hash值
+	"preHash": String, 上一个区块的hash值
+	"merkleHash": String, 梅克尔hash
+	"time": Long, 区块生成时间
+	"height": Long, 区块高度
+	"txCount": Long, 区块打包交易数量
+	"packingAddress": String, 打包地址
+	"scriptSig": String, 签名
+	"roundIndex": Long, 共识轮次
+	"consensusMemberCount": Integer, 参与共识成员数量
+	"roundStartTime": Long, 当前共识轮开始时间
+	"packingIndexOfRound": Integer, 当前轮次打包出块的名次
+	"confirmCount": Long, 确认次数
+	"reward": Long, 共识奖励
+	"fee": Long, 获取的打包手续费
+	"size": int, 大小
+	"txList": [
+		{
+			"hash": String, 交易的hash值
+			"type": Integer, 交易类型
+			"time": Long, 交易发起时间
+			"blockHeight": Long, 区块高度
+			"fee": Long, 交易手续费
+			"value": Long, 交易金额
+			"remark": String, 备注
+			"scriptSig": String, 签名
+			"status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认)
+			"confirmCount": Long, 确认次数
+			"size": int, 大小
+			"inputs": [ 输入
+				{
+					"fromHash": String, 来源output的txHash
+					"fromIndex": Integer, 来源output的outIndex
+					"address": String, 转入地址
+					"value": Long 转入金额
+				}
+			],
+			"outputs": [ 输出
+				{
+					"address": String, 地址
+					"value": Long, 数量
+					"lockTime": Long, 锁定时间
+				}
+			]
+		}
+	]
+}
+
Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/guide/NULSExplorerGuide.html b/docs/.vuepress/dist/zh/guide/NULSExplorerGuide.html new file mode 100644 index 00000000..5d529c4b --- /dev/null +++ b/docs/.vuepress/dist/zh/guide/NULSExplorerGuide.html @@ -0,0 +1,21 @@ + + + + + + NULS浏览器使用指南 | NULS + + + + + + + +

NULS浏览器使用指南

首先进入NULS Explore

什么是NULS Explorer

​ NULS浏览器是NULS核心团队开发的一个图形化的用户界面,为您提供与NULS区块链交互。通过NULS浏览器,您可以浏览NULS区块链的基本信息、已添加到NULS区块链中的区块、链上的交易、账户、共识及智能合约等相关信息.

1552373134638

搜索

​ 如果您想精确搜索某区块、交易、地址等信息,可以通过NULS Explorer首页或其他页面顶部导航栏中的搜索框进行搜索

20190312145034

20190312145056

共识奖励计算器

​ NULS区块链使用的是POC共识机制,您可以通过锁定一定数目(2000-500000)的NULS进行挖矿。NULS Explorer提供了共识奖励计算器,供您计算参与委托和创建节点的日、周、月、年奖励。共识奖励计算器中的参数都自带默认值,您可以随意进行修改计算(符合参数取值范围)。

20190312150103

20190312150047

区块

​ 在NULS Explorer中,您可以通过导航栏“区块”进入区块页面,区块列表中分页显示NULS链全部区块(高度、时间、交易数量、出块节点、区块大小、块奖励),可以通过列表右上角的“隐藏共识奖励区块”对列表进行筛选(过滤只有共识奖励的区块)。

20190312151157

如果您需要查看某个区块的更多信息,直接点击该区块高度(或搜索框输入高度进行搜索),将跳转至区块详情页面看到该区块更为详细的参数信息。

20190312151528

PS:区块列表中的出块节点、区块详情中的出块节点、打包地址、TXID都可以点击跳转至对应的详情页面。

账户资产

​ 在NULS Explorer中,您可以通过导航栏的“账户”进入账户页面,账户列表显示NULS区块链中所有持有NULS的账户地址信息(地址、总计、总收入、总支出),列表中“总计”列可以进行排序(默认从大到小)。

20190312152642

如果您需要获取某个地址的更多信息,直接点击列表中的地址(或搜索框输入地址进行搜索),将跳转至地址详情页面,展示更多该地址的参数信息。

20190312153112

交易

​ NULS Explorer中,您可以通过导航栏的“交易”进入交易页面(也可以通过首页“14天NULS交易历史”图表右上角的“更多”进入该页面),该页面上半部一图表方式显示交易历史数量,下部分以列表显示NULS区块链的全部交易,可以进行筛选和一次共识奖励交易。

20190312153758

​ 当您需要查看某个交易的详细信息时,您可以点击交易列表中的TXID(或者在导航栏中的搜索框输入该交易的TXID进行搜索)进入该交易的详情页面,获取该交易的更多信息。

20190312154059

共识

​ 在NULS Explorer中,您可以通过导航栏的“共识”进入共识页面(也可以通过点击首页的“共识节点”)。在共识页面,上部分显示NULS区块链的全网委托信息(图表),下部分显示节点信息和轮次信息。

20190312154512

节点信息

​ 您可以对节点信息的进行视图切换、排序、筛选(节点类型、别名、地址、ID)。

20190312154925

如需查看某个节点的更多信息,可以点击节点进入详情页面(运行信息、基本信息、出块列表、当前委托信息、历史委托信息)

20190312155458

轮次信息

​ 轮次信息显示当前轮次的信息和轮次列表(轮次、时间区间、出块节点数、红/黄牌、正常出块节点、丢块率)

20190312155710

您可以点击轮次列表中的轮次查看该轮次的出块详情(首页的区块动图可以点击进入当前轮次详情页面),详情页面将展示更多更详细的轮次信息。

20190312160126

合约

​ 在NULS Explorer中,您可以通过导航栏的“合约”进入合约页面,合约页面有全部合约和NRC-20合约。所有合约列表右上角有“隐藏NRC-20合约”,打开开关即可隐藏NRC-20合约。

20190312160629

如果你需要查看合约的详情,直接点击列表中的合约地址即可进入合约详情页面(基本信息、交易列表、代码、方法)。

20190312160828

代币详情

​ 如果你需要查询NRC-20代币的信息,可以切换到NRC-20列表,点击通证的缩写,或者进入NRC-20合约详情页面点击基本信息中的“通证”。

20190312162211

合约认证

​ 在新版的NULS Explorer中,我们新增了合约代码认证的功能,极大地增强了合约的安全性。您可以在合约列表中直接点击状态列的未认证跳转至代码认证页面,或者进入合约详情页面点击代码,进行合约代码认证,您只需要上传该合约的压缩包即可,会自行认证返回结果。

20190312161634

链接

​ NULS Explorer底部footer提供了一些链接,包含NULS官网、NULS GitHub、NULS网页轻钱包、NULS社区。

20190312162707

Last Updated: 2019-3-26 10:50:05
+ + + diff --git a/docs/.vuepress/dist/zh/guide/NULSTransaction.html b/docs/.vuepress/dist/zh/guide/NULSTransaction.html new file mode 100644 index 00000000..34ed12fd --- /dev/null +++ b/docs/.vuepress/dist/zh/guide/NULSTransaction.html @@ -0,0 +1,21 @@ + + + + + + NULS交易指南 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/guide/clientWalletGuide.html b/docs/.vuepress/dist/zh/guide/clientWalletGuide.html new file mode 100644 index 00000000..8e4af449 --- /dev/null +++ b/docs/.vuepress/dist/zh/guide/clientWalletGuide.html @@ -0,0 +1,21 @@ + + + + + + 客户端钱包使用指南 | NULS + + + + + + + +

客户端钱包使用指南

客户端

获取

​ 在NULS官网(nuls.io)下载钱包客户端后运行程序。

1547434994872

安装

​ NULS钱包客户端是绿色免安装的,文件解压之后直接点击文件夹里的exe应用程序就可以进入客户端界面。

账户

创建账户

钱包无账户时创建账户

​ 钱包语言已切换为中文,开始创建自己的账户。点击顶部菜单的“钱包”开始“创建账户”,界面如图1:

1547458467571

创建有密码的账户

​ 点击“创建账户”之后,首先设置密码,输入两次密码一致,注意密码规则:8-20位字符,需包含字母和数字。

然后点击“确定”,界面如图2:

1547458489793

PS:账户密码一定要认真保存,丢失后将无法进行转账和共识等关键操作。

创建不带密码的账户

​ 点击“创建账户”后,弹出设置密码窗口,直接点击“此账户不需要密码”即可创建无密码账户。

钱包有账户时创建账户

​ 点击顶部菜单的钱包,进入钱包页面后,点击“账户管理”图标(见图3):

1547436510741

​ 进入账户管理界面之后,点击账户列表右上方的“+”(见图4),进入创建或导入账户界面(见下图5)。

1547436748834

1547436768246

​ 选择“创建账户”,之后的操作请参照“创建有密码账户”和“创建不带密码账户”。

备份账户

备份入口

​ 账户创建成功之后,此时需要立即进行账户备份,以保证账户资产安全。

  • 方式一:点击顶部菜单中的“设置”,进入设置页面之后,点击“账户备份”按钮(见图6),进入账户管理界面(如图7)。

1547437357998

1547437427946

  • 方式二:点击顶部菜单“钱包”,再点击“账户管理”图标,进入账户管理界面(图7)。
  • 方式三:钱包地址创建成功后,直接在完成界面进行备份,设置密码的地址备份界面(图8),没有设置密码的地址备份界面(图9)。

1547445305902

1547445221113

  • 当账户已经设置密码,点击“备份”,弹出密码确认框,输入正确账户密码之后进入钱包备份界面(图10),可进行Keystore备份和私钥备份;
  • 当账户未设置密码,点击“备份”,直接跳转至账户备份界面(图11),只能进行Keystore备份。

1547437842317

1547437878443

明文私钥备份

​ 进入已经设置密码账户备份界面,点击“明文私钥备份”,弹出私钥备份窗口,然后点击“复制”按钮(图12),提示复制成功。

1547458691614

Keystore备份

​ 点击“Keystore备份”,直接显示Keystore保存路径(图13),在该路径下可以查看Keystore备份文件。

1547458844211

导入账户

钱包中无账户时导入账户

  • 点击顶部菜单的“钱包”,选择“导入账户”(图14);
  • 进入导入账户页面(图15);
  • 选择备份时的明文私钥或者Keystore文件进行导入,将备份账户导入钱包。

1547459086013

1547459110975

钱包中已有账户时导入账户

  • 如果钱包中已有账户地址,点击顶部菜单的“钱包”进入钱包界面;
  • 点击钱包页面的“账户管理”图标(图16)进入账户管理界面(图17);
  • 点击账户管理界面右上角的“+”进入创建或导入账户界面(图18),选择导入账户进入导入账户界面(图19)
  • 选择明文私钥(导入时可以设置密码,也可以不设置密码)或者Keystore文件(如果备份Keystore文件是账户已经设置了密码,则导入的时候需要进行密码确认才能成功导入)进行导入,将已有的账户导入钱包。

1547459677163

1547459708942

1547459737912

1547459824098

管理账户

  • 在钱包界面,点击账户管理图标进入账户管理界面,此界面展示了钱包的所有账户信息,可花费NULS对账户设置别名(图20),一旦设置便不可更改。
  • 该界面也可以移除和备份账户,备份流程见“备份账户”。
  • 该界面可以进入创建或导入账户界面,其流程与“创建账户”、“导入账户”一致。
  • 该界面可以对没有密码的账户进行密码设置,对已有密码的账户可以进行密码修改(具体流程见“修改密码”、“设置密码”),账户管理界面如图21。

1547461252921

1547461277501

​ 账户管理界面还可以对已有账户设置备注(图22)

1547461383782

交易

  • 钱包首页展示了当前账户的资产情况,包括总额、可用和冻结;
  • 可以通过账户地址的下拉框切换不同账户查看账户信息
  • 在账户资产页面,点击资产后面的“转账”(图23)进入转账界面(图24)。

1547460181242

1547460237710

  • 进入转账界面之后,转出地址可以通过下拉列表进行选择;
  • 输入收款地址(可以点击收款地址输入框后面的头像图标选择通讯录中已经保存的联系人,选择之后地址自动填入收款地址输入框);
  • 输入正确的转账金额(备注可选填);
  • 点击确认转账即可进行转账(若转出地址有密码,需要输入正确的密码发起转账交易);
  • 转账完成之后进入转出地址交易记录界面,可以查看该交易进度(图25)。

1547460590047

​ 点击txid可以查看转账详情,界面如图26。

1547460865338

共识

创建共识节点

​ 点击钱包顶部菜单的“共识”,进入共识界面,该界面展示了共识的总览信息,包括全网的委托总额和节点总数以及自己的参与共识情况,界面下方展示了全网所有的共识节点和自己创建、委托的共识节点信息(图27)

20190115102249

  • 当前账户(未受红牌惩罚)还未创建节点,点击我的总体情况中的创建(图27中红框标识),便可进入创建节点界面(图28)
  • 输入正确的必填信息,考虑到安全问题,出块地址必须使用自己创建的其他账户地址,创建节点的保证金范围:20000-200000NULS,代理佣金比例(10%-100%)一旦确定便不可更改
  • 点击确定经过密码确认之后便成功创建节点,节点创建成功后返回共识页面(图27)。

20190115103504

PS:创建节点时,出块地址不能设置密码,节点正常出块过程中,出块地址不能设置密码,否则无法正常出块并影响节点信用值

注销共识节点

​ 账户自己创建的节点可以进行注销(节点注销之后,创建节点时的保证金会被冻结3天),点击钱包顶端菜单“共识”进入共识界面(图29),点击我的总体情况中创建节点后面的查看(图29红框标识)。

20190115104427

​ 进入节点详情页面(图30),点击“注销节点”按钮,确认密码之后则节点注销成功。

20190115104911

参与共识

  • 在共识界面中,我的总体情况点击委托节点后面的“委托”入口(也可以直接点击节点列表中的某个未委托节点进入);
  • 在参与共识界面(图31)显示节点的信息(节点ID、节点来源、佣金比例、保证金、参与人数、信用值、委托数量);
  • 可以在该界面直接选择委托地址,输入保证金参与委托(需要确认密码)。

20190115110413

追加和退出共识

​ 在共识界面中,我的共识table页中点击某个节点进入节点详情(图32),此页面可以进行追加委托保证金和选择退出共识。

20190115110806

设置

​ 点击顶部菜单的“设置”,进入系统设置界面(图33),可以对系统语言、通讯录、密码进行设置和账户备份、版本升级、退出系统。

20190115111229

语言切换

​ 系统设置界面中可以对系统语言进行中英文切换(图34)。

20190115111447

查看通讯录

​ 系统设置界面可以查看通讯录,在通讯录界面(图35)可以对通讯录进行新增、编辑和删除操作。

20190115111721

设置/修改密码

设置密码

​ 在系统设置中,对为设置密码的账户地址可以进行密码设置(图36),设置密码需要符合密码规则。

20190115112217

修改密码

​ 在系统设置中,对已经设置密码的账户地址可以进行密码修改(图37),修改密码时,需要输入账户地址当前的正确密码,修改的密码需要符合密码规则。

20190115112121

版本升级

​ 在系统设置中,当最新版本号高于当前版本号时,可以直接点击“最新版本”(图38),对系统进行升级。

20190115112741

退出系统

​ 在系统设置界面进行退出操作,直接点击“退出系统”按钮(图38)即可。

Last Updated: 2019-1-17 16:11:06
+ + + diff --git a/docs/.vuepress/dist/zh/guide/lightWalletGuide.html b/docs/.vuepress/dist/zh/guide/lightWalletGuide.html new file mode 100644 index 00000000..8212c44b --- /dev/null +++ b/docs/.vuepress/dist/zh/guide/lightWalletGuide.html @@ -0,0 +1,49 @@ + + + + + + 网页钱包使用指南 | NULS + + + + + + + +

网页钱包使用指南

访问钱包

网页钱包地址:https://wallet.nuls.io

语言切换

点击右上角,可以自由切换页面语言 +

账户

创建账户

1.点击创建账户 + +2.设置钱包密码、仔细阅读并勾选同意服务协议、点击创建账户 + 注:创建好账户后,应立即进行备份,并将备份资料存放在安全的地方,否则有资产丢失的风险!

备份账户

1.点击Keystore备份

+2.当您得到一个Keystore文件后,请点击备份完成 +

导入账户

1.点击导入账户

+2.点击导入Keystore

+3.选择你的Keystore文件后,点击打开

+4.输入账户密码,点击确认 +

设置

点击菜单栏的设置,您可以根据需求,对当前账户进行备份、修改密码、设置别名

账户备份

具体步骤与备份账户相同

修改密码

输入原密码及新密码,点击确认 +

设置别名

输入别名,并确保有足够的余额,点击确定 +

交易

1.点击转账

+2.输入收款地址、转账金额,手续费根据全网交易情况增减,一般默认即可

+3.输入账户密码,点击确认

+4.查看交易记录,状态为“已确认”则表示交易成功 +

共识

点击菜单栏的“共识”可以查看共识信息,参与共识、追加共识、退出共识等操作 +

参与共识

1.点击“加入委托”

+2.选择节点,也可以通过搜索节点名称,找到节点

+3.输入委托金额,点击“确定委托”

+4.输入账户密码,点击确认

追加共识

1.点击我参与的共识节点

+2.点击“追加”

+3.输入委托金额,点击“确定委托”
+4.输入账户密码,点击确认

退出共识

1.点击我参与的共识节点

+2.点击“退出”
+3.输入账户密码,点击确认

投票

1.点击“投票”进入投票页面
+2.点击标题
+3.根据投票规则,选择您支持的事项,点击“投票”
+4.输入账户密码,点击确认

Last Updated: 2019-1-17 16:11:06
+ + + diff --git a/docs/.vuepress/dist/zh/index.html b/docs/.vuepress/dist/zh/index.html new file mode 100644 index 00000000..36aad2e9 --- /dev/null +++ b/docs/.vuepress/dist/zh/index.html @@ -0,0 +1,23 @@ + + + + + + NULS文档 + + + + + + + +

欢迎来到NULS

NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动

NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等

NULS2.0 Alpha版本已发布

亲爱的用户: +11 +很荣幸的宣布,NULS2.0 Alpha版本已于北京时间:2019-03-28日上午10:30发布,诚邀您参与内测。

NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。

此次Alpha版本测试内容主要包含:

  • Linux钱包全部功能,例如:账户创建、导入、转账和创建节点等等
  • 基于NULS2.0核心模块搭建区块链
  • 搭建包含业务模块的区块链

参与测试:

1 下载linux客户端

2 linux钱包使用教程

3 申请测试币并在帖子中回复:Alpha+地址

4 访问区块链浏览器:http://alpha.nulscan.io/

5 使用NULS2.0搭建区块链

6 提交bug:https://github.com/nuls-io/nuls_2.0/issues

相关链接

想了解更多与NULS相关的信息,可以访问我们的官网

Last Updated: 2019-3-28 10:49:32
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NIP-1.html b/docs/.vuepress/dist/zh/learn/NIP-1.html new file mode 100644 index 00000000..38d4bf4a --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NIP-1.html @@ -0,0 +1,47 @@ + + + + + + NIP-1 NIP的目的和指导 | NULS + + + + + + + +

NIP-1 NIP的目的和指导

NIP:1
+标题: NIP的目的和指导
+状态: 公示
+类型: 流程
+作者: 杨霖 <lin@nuls.io>
+创建日期:2018/12/27
+

什么是NIP?

NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.

NIP产生的理由

  • 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录

  • 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。

NIP的类型

NIP当前有六种类型:

  • 核心:NULS核心代码的改善,例如共识机制,网络协议等。
  • 模块:模块的提交和评审要求的改善,例如符合何种标准的模块会被接受并被纳入模块仓库。
  • 接口:NULS客户端API/RPC的规范和标准的改善,例如API名称、方法名称。
  • NRC标准:应用级别的标准的改善,例如合约标准,通证标准等。
  • 信息:描述NULS设计问题,或向NULS社区提供一般性指导或信息,但不提出新功能。 信息NIP不一定代表NULS社区的共识或推荐,因此用户和实施者可以自由选择忽略信息NIP或遵循他们的建议
  • 流程:所有NULS相关的操作流程的改善,例如社区中竞选大使的流程的改善。流程类NIP不仅仅是建议,是社区成员完成某些特定的事需要遵守的规范,但该类NIP不涉及代码层面的规范。

NIP的工作流程

涉及流程的各方包括以下部分或全部角色:

  • 社区的大部分成员

    主要职责为参与NIP的讨论和投票,提出建设性意见。

  • NIP作者

    提出和完善NIP,并负责引导社区展开讨论。

  • NIP编辑

    管理和编辑NIP。

  • NULS理事会

    对即将进入接受或完结状态的NIP做最后把关,理事会有权通过内部投票拒绝NIP。

  • NULS核心开发者

    负责核心,模块,NRC标准和接口这四个类型的NIP的审核和代码实现。

在开始撰写NIP之前,先审查你的想法,这将帮你节省时间。首先询问社区这个想法之前是否被提出过,可行性如何。以免浪费时间在一些肯定会被拒绝的提案上,并有助于确保该想法适用于整个社区而不仅仅是作者。 某个想法对作者有意义并不意味着它对各个地区使用NULS的人都有意义。我们建议可以通过发起投票的方式在社区收集意见,投票的结果也有助于NIP编辑更快做出判断是否合并该NIP。

完成一个最终生效的NIP需要经过以下阶段:

[ 草稿 ]->[ 公示 ]->[ 接受 ]->[ 完结 ]
+

每次NIP状态的更改都是先由NIP的作者提出Pull Request(合并请求,简称PR),然后NIP的编辑会对该NIP进行审查。提出PR的时候最好包含一个可以持续讨论该NIP的链接。

完整的NIP处理流程如下:

  • NIP的作者按照规定的格式和样式编写NIP,然后在社区中进行讨论和调研,确定可行性后,则将NIP通过提PR的方式提交到NIP仓库,并在PR中包含社区讨论的链接。NIP编辑会根据实际情况来处理这些请求。

    • 草稿: 如果同意合并,NIP编辑将为该NIP分配一个编号并合并PR。 NIP编辑不会无理由拒绝某个NIP
    • 草稿: 拒绝合并为草稿的原因包括专注度不够、过于宽泛、重复劳动、技术上不健全、没有提供合理的动机或解决向后兼容性,或者不符合NULS理念。
  • 合并成为草稿状态后,作者可以继续提PR对草稿做进一步更改,直至认为该NIP已经足够成熟并准备好进入下一个状态为止。

    • 公示: 如果获得同意,NIP编辑将会把该NIP的状态从草稿更改为公示,并设置公示结束日期,通常为15天后。
    • 公示: 如果进入公示阶段后,还要对该NIP进行更改,那这个NIP会被退回草稿状态。我们希望一个NIP只进入一次公示状态,避免在社区引起不必要的争论。
  • 公示状态的NIP会置顶在https://nuls.community/

    • 接受(核心,模块,NRC标准和接口的NIP才涉及): 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为接受。
    • 完结(信息和流程才涉及): 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为完结。
    • 公示: 公示期有材料变更或无法解决社区提出的技术问题,则该NIP将会被退回草稿状态。除此之外,如果理事会对该NIP有不同的看法,可以在理事会成员内部发起投票,超过70%的理事会成员否决该NIP(需给出原因)则该NIP将根据实际原因被退回草稿状态或直接改为拒绝状态。
  • 当核心、模块、NRC标准和接口的NIP成为接受状态后,何时能成为完结状态取决于相关的NULS核心开发者,由他们决定如何将该NIP通过编码来实现。

    • 完结(核心,模块,NRC标准和接口的NIP涉及): NIP已通过编码实现,并在主网稳定运行一段时间或得到了有效验证且改动也得到了社区的认可,则状态可变为完结。

其他非常规的状态如下:

  • 延期: 核心、模块、NRC标准和接口相关的NIP成为接受状态后,开发者未按照预定的时间完成开发。
  • 拒绝: 某个NIP被核心开发者拒绝实现或被理事会认定为不可实现。
  • 被取代: NIP以前是完结状态,但不再被认为是最先进的。出现另一个更好的NIP,参考了这个NIP并成为了最终状态。

一个有效的NIP文档应该包含哪些内容?

每个NIP应该包含以下部分:

  • 前言: 与NIP相关的元数据,以RFC 822样式展示。内容包括NIP编号,简短描述性标题(限制为最多44个字符)和作者详细信息。可参阅下文了解详情。
  • 简单总结: NIP作者需要给这个NIP提供一个简单且普通人可以理解的总结,如果你不能很简单地解释它,说明你自己对它的理解还不够深入。
  • 摘要 : 对正在解决的技术问题进行简短(约200字)描述。
  • 动机: 对于想要改善NULS协议的NIP,动机至关重要。 它应该清楚地解释为什么现有的协议规范存在不足。没有足够动机的NIP可能会被彻底拒绝。
  • 规范: 技术规范应描述清楚任何新功能的语法和语义。规范应该足够详细,以允许当前任何基于NULS平台的应用拥有竞争性、可互操作性(例如NULS客户端,浏览器)。
  • 论据 : 论据通过描述什么驱动了这样的设计以及为什么要做出这样的设计决策来充实规范。它应该阐述考虑过的替代性设计和相关工作,例如如何在其他语言中支持该特性。论据也可以提供证据证明社区的意见是一致的,并应讨论提出的重要反对意见或大家关注的事项。
  • 向后兼容性: 所有引入向后不兼容的NIP必须描述存在哪些不兼容及其严重性。NIP中必须解释作者如何处理这些不兼容性。如果没有足够的向后兼容性论述,提交的NIP可能会被直接拒绝。
  • 测试用例: 对于影响共识机制的NIP,其实现方法的测试用例是强制性的。
  • 实现 : 代码的实现必须在任何NIP被赋予完结状态之前完成,但是它不需要在NIP被合并为草稿之前完成。
  • 历史记录: 历史记录是展示了该NIP从提出到成为完结状态的整个过程,可以通过附加链接形式展示。

NIP的格式和模版

NIP应该用markdown的格式编写

NIP的前言

每个NIP的必须以RFC 822的样式作为文档的头部前言,头部必须按照以下顺序进行排列,用*标注的头部为可选项,其他项为必填项

 NIP: <NIP编号>
+ 标题: <NIP标题>
+ 作者: <列出作者的真实名字和电子邮件地址>
+*讨论渠道: <指向官方讨论渠道的链接>
+ 状态: <草稿| 接受 | 完结 | 被取代 | 延期 | 拒绝>
+ 类型: <核心 | 模块 | 接口 | NRC标准 | 信息 | 流程>
+ 创建日期: < 用 ISO 8601 (yyyy-mm-dd) 格式>
+*取代: <NIP 编号>
+*被取代: <NIP 编号>
+

附件

NIPS文档可能包含一些附件,例如流程图。这样的文件必须以NIP-XXXX-Y.ext的格式来命名,“XXXX”指的是NIP的编号,“Y”指的是序列号(从1开始),“ext”指的是文件扩展名(例如:.png)

转移NIP的所有权

有时需要将NIPS的所有权转让给新的作者。一般来说,我们希望保留原作者作为要转移的NIP的合著者,但这实际上取决于原作者。转让所有权的一个很好的理由是,原作者不再有时间或兴趣来更新它或跟进NIP的后续过程,或已经脱离了“网络”(即无法联系或没有回复电子邮件)。转让所有权的一个不好的原因是你不同意NIP的方向。我们努力围绕一个NIP去建立共识,如果你认为不可能达成,你可以提交一个更有说服力的NIP。

如果您对NIP的所有权感兴趣,请发送一封邮件要求接管,该邮件的收件人是原作者和NIP编辑。如果原作者没有及时回复邮件,NIP的编辑就会做出单方面的决定(这样的决定并不是不能逆转的)。

NIP编辑

当前的NIP编辑如下:

Niels <Niels@nuls.io>
+Pen <Pen@nuls.io>
+

NIP编辑的职责

每次收到一个新的NIP, 一个编辑要做如下的事:

  • 阅读NIP来检查它是否较为完备,NIP中的想法必须具有技术意义,即使它们看起来不太可能达到最终状态。
  • 标题和内容要相符。
  • 检查NIP的语言(拼写、语法、句子结构等)、标记(Github风格的标记)、代码风格 。

如果NIP不够完备,编辑会把它发回给作者进行修改,并给出具体的说明。一旦NIP做好了合并到仓库的准备,NIP编辑就会这样做:

  • 分配一个NIP编号(通常是PR编号)

  • 合并相应的PR

  • 将消息发送回NIP作者

许多NIP是由对NULS代码库具有写入权限的开发人员编写和维护的。NIP编辑要关注NIP的变化,并纠正我们看到的任何结构、语法、拼写或标记错误。NIP编辑不会主观地对NIP做出判断,只做管理和编辑这部分工作。

History

这个文档主要引用了 Bitcoin's BIP-0001,由 Amir Taaki 所写,同时他所写的文本也主要来源于 Python's PEP-0001。NIP根据自身的实际情况,基于他们的文档做了一些修改,例如NIP流程中增加了理事会,修改了NIP类型等。后续与NIP相关的问题请直接联系NULS NIP的编辑。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NIP-2.html b/docs/.vuepress/dist/zh/learn/NIP-2.html new file mode 100644 index 00000000..2f387a9e --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NIP-2.html @@ -0,0 +1,36 @@ + + + + + + NIP-2 NULS社区章程 | NULS + + + + + + + +

NIP-2 NULS社区章程

 NIP: 2
+ 标题: NULS社区章程
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2018/12/28
+

前言

根据NULS项目的发展需要,为了更好地促进NULS社区良性运转,达成NULS让区块链技术更简单的愿景。NULS社区将不断探索和实施NULS社区自治,实现NULS项目自治和自进化。基于NULS社区文化和社区理念,特此制定社区发展章程。

NULS社区文化:开放、自由、自治、进化

NULS社区理念:分享、传承、成长、创新

以下规则将会基于NULS开发共识治理模块,在共识治理模块上线前,理事会和大使将由NULS核心团队发起投票来执行。

NULS基金会

2018年12月

摘要

NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

动机

为了构建一个良好的社区运行机制,促进社区自治,推动NULS项目能够让社区自主进化和自主驱动。

规范

以下内容属于NULS社区章程的规范。

NULS社区章程

一、NULS社区简介

NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。

**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

二、NULS基金会

NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。

(一)NULS基金会宗旨

以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:

1、代码贡献

2、应用开发

3、运营推广

4、其他有利于NULS社区生态发展的具体事项

(二)NULS社区基金的来源

NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。

(三)NULS社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

三、理事会

(一)理事会介绍

NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。

(二)理事会成员产生

社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员),由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。

1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。

2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。

3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。

4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。

(三) 理事会成员权责

1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。

(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。

  • 竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。

  • 固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。

(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。

  • 节点下限代理手续费佣金调整。

  • 转账手续费调整。

  • 合约调用手续费调整。

  • 理事会发起提案的手续费调整。

  • 其他系统可调整的系统参数调整。

(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。

  • 委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。

  • 转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。

  • 创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。

  • 调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。

2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。

3、理事会成员的责任。

  • 理事会成员需要能够及时与社区进行沟通。

  • 严格遵照社区章程。

  • 与NULS的愿景和目标一致。

  • 以全体社区成员利益为己任。

注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。

四、CODE CRAFT COUNCIL(CCC)

(一)CCC介绍

CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。

(二)CCC理念

在技术社区里我们坚持以下的理念:

1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。

2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。

3、共享 (Sharing):

  • 社区共享NULS技术成果。

  • 社区共享NULS发展红利。

  • 社区共享NULS的影响力和名誉。

  • 行业共享NULS带来的技术革新。

  • 行业共享NULS推动行业发展的标准制定。

4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。

5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

(三)CCC成员产生

每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。

加入流程如下:

1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。

2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。

3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。

(四)CCC成员权责

1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。

2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。

3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。

4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。

5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。

五、贡献者角色

(一)竞选贡献者角色

竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示nuls.community

(二)固定贡献者角色

固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。

六、项目预算

(一)对于贡献者角色

对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。

(二)对于其他事务资金

理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。

七、其他投票

(一)发起投票

1、理事会成员发起投票。只收取交易手续费。

2、普通成员投票。押金(目前设定是100NULS)+交易手续费。

(二)代理投票

  • 任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。

  • 任何的NULS用户都可以成为代理人。

  • 代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。

  • 代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。

八、建议反馈

如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。

NULS社区网站:https://nuls.community

建议反馈帖:https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NIP-3.html b/docs/.vuepress/dist/zh/learn/NIP-3.html new file mode 100644 index 00000000..946a2563 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NIP-3.html @@ -0,0 +1,36 @@ + + + + + + NIP-3 NULS社区基金管理和使用流程 | NULS + + + + + + + +

NIP-3 NULS社区基金管理和使用流程

 NIP: 3
+ 标题: NULS社区基金管理和使用流程
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/263-ngc20181221
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2018/12/28
+

摘要

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

动机

为了让社区能够有更多的人才加入,所以将社区基金开放给社区来共同管理和使用。

规范

以下内容属于NULS社区基金管理和使用流程的规范。

NULS社区基金管理和使用流程

img

一、社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

社区基金账户地址:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

根据社区章程指导思想,提案执行基金会账户操作。

该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。

注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。

暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei

二、发起申请的成员

1、普通成员

包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。

注:理事会发起的该部分成员的申请提案投票期为15天。

2、贡献者角色

通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。

三、申请类型

1、提案支付资金

申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。

2、预算项目提案

申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。

3、提案创建节点

申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。

4、提案委托资金

申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。

四、申请流程

1、方案公开讨论

(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;

(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;

(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;

(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;

(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;

(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;

(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;

(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;

2、理事会成员提案

(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;

(2)理事会和申请人都需要引导社区正确地进行投票;

(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;

(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。

3、基金会执行提案

(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;

(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。

五、流程解释

所有的社区讨论建议在nuls.community进行。

本流程根据社区章程思想进行管理,流程将会对全体社区公开。

流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。

具体节点产生收益参考NULS POC共识机制。

附:当前贡献者角色的委托和节点

大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC 成员:

Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NIP-4.html b/docs/.vuepress/dist/zh/learn/NIP-4.html new file mode 100644 index 00000000..789adf8d --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NIP-4.html @@ -0,0 +1,36 @@ + + + + + + NIP-4 NULS大使竞选参与规则 | NULS + + + + + + + +

NIP-4 NULS大使竞选参与规则

 NIP: 4
+ 标题: NULS大使竞选参与规则
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/205-ncg-20181114
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2019/2/15
+

摘要

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

动机

从9月-10月期间,我们已经有9位大使,大家都在积极的为NULS社区贡献,发展更多的成员,以及做一些力所能及的事情。NULS在主网智能合约上线后,将会开启一个社区投票工具。大使的竞选本身应该由社区来选择,另一方面由于在大使开展工作的过程中,社区的其他伙伴也提供了很多的建议,在广大社区成员的建议下,我们准备更新NULS大使的竞选规则。这将是NULS开启社区自治道路的第一步,NULS社区自治是未来的重要目标,这需要非常多的基础工具和人才支持。

规范

以下内容属于NULS大使竞选参与规则的规范。

NULS大使竞选参与规则

一、NULS大使介绍

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

二、NULS大使职责和权益

1、参与NULS大使的选举需要具有创建NULS节点的基本条件。

2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员,参选之前请确保能够坚持在任一个季度。

3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。

4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。

5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。

6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。

7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。

8、大使获得的节点的所有奖励一半作为大使的报酬(由于大使的节点服务器需要支出和自己抵押的20000NULS也会产生收益),另外一半必须作为大使发展基金,用于社区发展。

9、大使的离职,如果大使主动离职或者被罢免,请将剩余的大使发展基金返回到社区基金。

10、大使属于社区贡献者角色,如需要发起其他的社区基金申请,按照社区基金使用和管理流程执行。

三、如何参与竞选

  • 第一步:

发布上月的工作情况报告和下月的工作计划:

请发布到论坛https://community.nuls.world/t/elections

  • 第二步:

NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。

  • 第三步:

如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;

NULS基金会将会委托200000NULS在您的节点上。

最后祝愿:

  • 恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。
  • 开始社区建设和拓展工作。
  • 帮助NULS对接更多的DApp接入。
  • 请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。

所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections

欢迎大家加入NULS社区,共同创造NULS美好未来!

如果您能够奉献更多,对您的期望:

1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。

3、分享NULS的故事给社区。

3、分享NULS的故事给社区;

4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。

大使指导手册

前言

欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。

作为NULS的大使,你将获得

1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;

2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;

3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;

4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。

作为NULS的大使,你可以从这些方面来开展工作

1、社区拓展

(1)通过互联网或者线下交流的方式让其他人了解NULS。

(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。

(3)将NULS社区其他地区的发展情况分享到当地社区。

(4)持续分享NULS项目的进展、规划、新闻等到当地社区。

(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。

(6)分享NULS的故事给社区。

(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。

(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。

2、社区活动

(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。

(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。

(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。

了解NULS可以从这里开始

1、NULS大使工作看板(点击进入),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。

2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。

3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。

4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。

5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。

6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。

7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注Githubdev.nuls.io

7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛nuls.community上面发帖。

招募志愿者组织当地的社群

1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。

2、组织开展一些线下见面会活动。

3、让更多的区块链投资人了解NULS,引导他们对NULS投资。

4、帮助NULS寻找更多的区块链技术爱好者加入。

发展当地的NULS生态

1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;

2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。

3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。

将NULS的理念和技术传播到当地

1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。

2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。

3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。

NULStar指南和职责

成为NULStar的要求

1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。

2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。

3、必须住在人口超过35万的城市。

NULStar的职责

1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。

2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。

NULStars的奖励

1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。

2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。

指导手册会不断更新,希望大使们和NULS一起成长!

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NIPIntroduction.html b/docs/.vuepress/dist/zh/learn/NIPIntroduction.html new file mode 100644 index 00000000..a757426e --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NIPIntroduction.html @@ -0,0 +1,29 @@ + + + + + + NIP介绍 | NULS + + + + + + + +

NIP介绍

什么是NIP?

NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.

NIP产生的理由

  • 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录

  • 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。

获取所有NIP

通过NULS的github可以获取所有的NIP,github地址为:https://github.com/nuls-io/NIPs

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NULSExplorerGuide.html b/docs/.vuepress/dist/zh/learn/NULSExplorerGuide.html new file mode 100644 index 00000000..bcb35982 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NULSExplorerGuide.html @@ -0,0 +1,29 @@ + + + + + + NULS浏览器使用指南 | NULS + + + + + + + +

NULS浏览器使用指南

首先进入NULS Explore

什么是NULS Explorer

​ NULS浏览器是NULS核心团队开发的一个图形化的用户界面,为您提供与NULS区块链交互。通过NULS浏览器,您可以浏览NULS区块链的基本信息、已添加到NULS区块链中的区块、链上的交易、账户、共识及智能合约等相关信息.

1552373134638

搜索

​ 如果您想精确搜索某区块、交易、地址等信息,可以通过NULS Explorer首页或其他页面顶部导航栏中的搜索框进行搜索

20190312145034

20190312145056

共识奖励计算器

​ NULS区块链使用的是POC共识机制,您可以通过锁定一定数目(2000-500000)的NULS进行挖矿。NULS Explorer提供了共识奖励计算器,供您计算参与委托和创建节点的日、周、月、年奖励。共识奖励计算器中的参数都自带默认值,您可以随意进行修改计算(符合参数取值范围)。

20190312150103

20190312150047

区块

​ 在NULS Explorer中,您可以通过导航栏“区块”进入区块页面,区块列表中分页显示NULS链全部区块(高度、时间、交易数量、出块节点、区块大小、块奖励),可以通过列表右上角的“隐藏共识奖励区块”对列表进行筛选(过滤只有共识奖励的区块)。

20190312151157

如果您需要查看某个区块的更多信息,直接点击该区块高度(或搜索框输入高度进行搜索),将跳转至区块详情页面看到该区块更为详细的参数信息。

20190312151528

PS:区块列表中的出块节点、区块详情中的出块节点、打包地址、TXID都可以点击跳转至对应的详情页面。

账户资产

​ 在NULS Explorer中,您可以通过导航栏的“账户”进入账户页面,账户列表显示NULS区块链中所有持有NULS的账户地址信息(地址、总计、总收入、总支出),列表中“总计”列可以进行排序(默认从大到小)。

20190312152642

如果您需要获取某个地址的更多信息,直接点击列表中的地址(或搜索框输入地址进行搜索),将跳转至地址详情页面,展示更多该地址的参数信息。

20190312153112

交易

​ NULS Explorer中,您可以通过导航栏的“交易”进入交易页面(也可以通过首页“14天NULS交易历史”图表右上角的“更多”进入该页面),该页面上半部一图表方式显示交易历史数量,下部分以列表显示NULS区块链的全部交易,可以进行筛选和一次共识奖励交易。

20190312153758

​ 当您需要查看某个交易的详细信息时,您可以点击交易列表中的TXID(或者在导航栏中的搜索框输入该交易的TXID进行搜索)进入该交易的详情页面,获取该交易的更多信息。

20190312154059

共识

​ 在NULS Explorer中,您可以通过导航栏的“共识”进入共识页面(也可以通过点击首页的“共识节点”)。在共识页面,上部分显示NULS区块链的全网委托信息(图表),下部分显示节点信息和轮次信息。

20190312154512

节点信息

​ 您可以对节点信息的进行视图切换、排序、筛选(节点类型、别名、地址、ID)。

20190312154925

如需查看某个节点的更多信息,可以点击节点进入详情页面(运行信息、基本信息、出块列表、当前委托信息、历史委托信息)

20190312155458

轮次信息

​ 轮次信息显示当前轮次的信息和轮次列表(轮次、时间区间、出块节点数、红/黄牌、正常出块节点、丢块率)

20190312155710

您可以点击轮次列表中的轮次查看该轮次的出块详情(首页的区块动图可以点击进入当前轮次详情页面),详情页面将展示更多更详细的轮次信息。

20190312160126

合约

​ 在NULS Explorer中,您可以通过导航栏的“合约”进入合约页面,合约页面有全部合约和NRC-20合约。所有合约列表右上角有“隐藏NRC-20合约”,打开开关即可隐藏NRC-20合约。

20190312160629

如果你需要查看合约的详情,直接点击列表中的合约地址即可进入合约详情页面(基本信息、交易列表、代码、方法)。

20190312160828

代币详情

​ 如果你需要查询NRC-20代币的信息,可以切换到NRC-20列表,点击通证的缩写,或者进入NRC-20合约详情页面点击基本信息中的“通证”。

20190312162211

合约认证

​ 在新版的NULS Explorer中,我们新增了合约代码认证的功能,极大地增强了合约的安全性。您可以在合约列表中直接点击状态列的未认证跳转至代码认证页面,或者进入合约详情页面点击代码,进行合约代码认证,您只需要上传该合约的压缩包即可,会自行认证返回结果。

20190312161634

链接

​ NULS Explorer底部footer提供了一些链接,包含NULS官网、NULS GitHub、NULS网页轻钱包、NULS社区。

20190312162707

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/NULSNav.html b/docs/.vuepress/dist/zh/learn/NULSNav.html new file mode 100644 index 00000000..bbc9eef5 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NULSNav.html @@ -0,0 +1,25 @@ + + + + + + NULS 导航 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/learn/NULSTransaction.html b/docs/.vuepress/dist/zh/learn/NULSTransaction.html new file mode 100644 index 00000000..6e2c847c --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/NULSTransaction.html @@ -0,0 +1,29 @@ + + + + + + NULS交易指南 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/learn/ambassadorRules.html b/docs/.vuepress/dist/zh/learn/ambassadorRules.html new file mode 100644 index 00000000..2d4431f8 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/ambassadorRules.html @@ -0,0 +1,29 @@ + + + + + + NULS大使竞选参与规则 | NULS + + + + + + + +

NULS大使竞选参与规则

一、NULS大使介绍

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

二、NULS大使职责和权益

1、参与NULS大使的选举需要具有创建NULS节点的基本条件。

2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员。

3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。

4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。

5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。

6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。

7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。

8、NULS大使可以向NULS基金会提报预算,申请重大事项发展的经费,该预算面向全体社区公开,发起预算投票,投票期为15天,投票量超过1000W NULS且支持率达到70%以上,基金会可以向该预算发放资金。

三、如何参与竞选

  • 第一步:

发布上月的工作情况报告和下月的工作计划:

请发布到论坛https://community.nuls.world/t/elections

  • 第二步:

NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。

  • 第三步:

如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;

NULS基金会将会委托200000NULS在您的节点上。

最后祝愿:

  • 恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。
  • 开始社区建设和拓展工作。
  • 帮助NULS对接更多的DApp接入。
  • 请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。

所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections

欢迎大家加入NULS社区,共同创造NULS美好未来!

如果您能够奉献更多,对您的期望:

1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。

3、分享NULS的故事给社区。

3、分享NULS的故事给社区;

4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。

大使指导手册

前言

欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。

作为NULS的大使,你将获得

1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;

2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;

3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;

4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。

作为NULS的大使,你可以从这些方面来开展工作

1、社区拓展

(1)通过互联网或者线下交流的方式让其他人了解NULS。

(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。

(3)将NULS社区其他地区的发展情况分享到当地社区。

(4)持续分享NULS项目的进展、规划、新闻等到当地社区。

(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。

(6)分享NULS的故事给社区。

(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。

(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。

2、社区活动

(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。

(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。

(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。

了解NULS可以从这里开始

1、NULS大使工作看板(点击进入),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。

2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。

3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。

4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。

5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。

6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。

7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注Githubdev.nuls.io

7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛nuls.community上面发帖。

招募志愿者组织当地的社群

1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。

2、组织开展一些线下见面会活动。

3、让更多的区块链投资人了解NULS,引导他们对NULS投资。

4、帮助NULS寻找更多的区块链技术爱好者加入。

发展当地的NULS生态

1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;

2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。

3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。

将NULS的理念和技术传播到当地

1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。

2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。

3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。

NULStar指南和职责

成为NULStar的要求

1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。

2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。

3、必须住在人口超过35万的城市。

NULStar的职责

1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。

2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。

NULStars的奖励

1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。

2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。

指导手册会不断更新,希望大使们和NULS一起成长!

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/clientWalletGuide.html b/docs/.vuepress/dist/zh/learn/clientWalletGuide.html new file mode 100644 index 00000000..2692ab10 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/clientWalletGuide.html @@ -0,0 +1,29 @@ + + + + + + 客户端钱包使用指南 | NULS + + + + + + + +

客户端钱包使用指南

客户端

获取

​ 在NULS官网(nuls.io)下载钱包客户端后运行程序。

1547434994872

安装

​ NULS钱包客户端是绿色免安装的,文件解压之后直接点击文件夹里的exe应用程序就可以进入客户端界面。

账户

创建账户

钱包无账户时创建账户

​ 钱包语言已切换为中文,开始创建自己的账户。点击顶部菜单的“钱包”开始“创建账户”,界面如图1:

1547458467571

创建有密码的账户

​ 点击“创建账户”之后,首先设置密码,输入两次密码一致,注意密码规则:8-20位字符,需包含字母和数字。

然后点击“确定”,界面如图2:

1547458489793

PS:账户密码一定要认真保存,丢失后将无法进行转账和共识等关键操作。

创建不带密码的账户

​ 点击“创建账户”后,弹出设置密码窗口,直接点击“此账户不需要密码”即可创建无密码账户。

钱包有账户时创建账户

​ 点击顶部菜单的钱包,进入钱包页面后,点击“账户管理”图标(见图3):

1547436510741

​ 进入账户管理界面之后,点击账户列表右上方的“+”(见图4),进入创建或导入账户界面(见下图5)。

1547436748834

1547436768246

​ 选择“创建账户”,之后的操作请参照“创建有密码账户”和“创建不带密码账户”。

备份账户

备份入口

​ 账户创建成功之后,此时需要立即进行账户备份,以保证账户资产安全。

  • 方式一:点击顶部菜单中的“设置”,进入设置页面之后,点击“账户备份”按钮(见图6),进入账户管理界面(如图7)。

1547437357998

1547437427946

  • 方式二:点击顶部菜单“钱包”,再点击“账户管理”图标,进入账户管理界面(图7)。
  • 方式三:钱包地址创建成功后,直接在完成界面进行备份,设置密码的地址备份界面(图8),没有设置密码的地址备份界面(图9)。

1547445305902

1547445221113

  • 当账户已经设置密码,点击“备份”,弹出密码确认框,输入正确账户密码之后进入钱包备份界面(图10),可进行Keystore备份和私钥备份;
  • 当账户未设置密码,点击“备份”,直接跳转至账户备份界面(图11),只能进行Keystore备份。

1547437842317

1547437878443

明文私钥备份

​ 进入已经设置密码账户备份界面,点击“明文私钥备份”,弹出私钥备份窗口,然后点击“复制”按钮(图12),提示复制成功。

1547458691614

Keystore备份

​ 点击“Keystore备份”,直接显示Keystore保存路径(图13),在该路径下可以查看Keystore备份文件。

1547458844211

导入账户

钱包中无账户时导入账户

  • 点击顶部菜单的“钱包”,选择“导入账户”(图14);
  • 进入导入账户页面(图15);
  • 选择备份时的明文私钥或者Keystore文件进行导入,将备份账户导入钱包。

1547459086013

1547459110975

钱包中已有账户时导入账户

  • 如果钱包中已有账户地址,点击顶部菜单的“钱包”进入钱包界面;
  • 点击钱包页面的“账户管理”图标(图16)进入账户管理界面(图17);
  • 点击账户管理界面右上角的“+”进入创建或导入账户界面(图18),选择导入账户进入导入账户界面(图19)
  • 选择明文私钥(导入时可以设置密码,也可以不设置密码)或者Keystore文件(如果备份Keystore文件是账户已经设置了密码,则导入的时候需要进行密码确认才能成功导入)进行导入,将已有的账户导入钱包。

1547459677163

1547459708942

1547459737912

1547459824098

管理账户

  • 在钱包界面,点击账户管理图标进入账户管理界面,此界面展示了钱包的所有账户信息,可花费NULS对账户设置别名(图20),一旦设置便不可更改。
  • 该界面也可以移除和备份账户,备份流程见“备份账户”。
  • 该界面可以进入创建或导入账户界面,其流程与“创建账户”、“导入账户”一致。
  • 该界面可以对没有密码的账户进行密码设置,对已有密码的账户可以进行密码修改(具体流程见“修改密码”、“设置密码”),账户管理界面如图21。

1547461252921

1547461277501

​ 账户管理界面还可以对已有账户设置备注(图22)

1547461383782

交易

  • 钱包首页展示了当前账户的资产情况,包括总额、可用和冻结;
  • 可以通过账户地址的下拉框切换不同账户查看账户信息
  • 在账户资产页面,点击资产后面的“转账”(图23)进入转账界面(图24)。

1547460181242

1547460237710

  • 进入转账界面之后,转出地址可以通过下拉列表进行选择;
  • 输入收款地址(可以点击收款地址输入框后面的头像图标选择通讯录中已经保存的联系人,选择之后地址自动填入收款地址输入框);
  • 输入正确的转账金额(备注可选填);
  • 点击确认转账即可进行转账(若转出地址有密码,需要输入正确的密码发起转账交易);
  • 转账完成之后进入转出地址交易记录界面,可以查看该交易进度(图25)。

1547460590047

​ 点击txid可以查看转账详情,界面如图26。

1547460865338

共识

创建共识节点

​ 点击钱包顶部菜单的“共识”,进入共识界面,该界面展示了共识的总览信息,包括全网的委托总额和节点总数以及自己的参与共识情况,界面下方展示了全网所有的共识节点和自己创建、委托的共识节点信息(图27)

20190115102249

  • 当前账户(未受红牌惩罚)还未创建节点,点击我的总体情况中的创建(图27中红框标识),便可进入创建节点界面(图28)
  • 输入正确的必填信息,考虑到安全问题,出块地址必须使用自己创建的其他账户地址,创建节点的保证金范围:20000-200000NULS,代理佣金比例(10%-100%)一旦确定便不可更改
  • 点击确定经过密码确认之后便成功创建节点,节点创建成功后返回共识页面(图27)。

20190115103504

PS:创建节点时,出块地址不能设置密码,节点正常出块过程中,出块地址不能设置密码,否则无法正常出块并影响节点信用值

注销共识节点

​ 账户自己创建的节点可以进行注销(节点注销之后,创建节点时的保证金会被冻结3天),点击钱包顶端菜单“共识”进入共识界面(图29),点击我的总体情况中创建节点后面的查看(图29红框标识)。

20190115104427

​ 进入节点详情页面(图30),点击“注销节点”按钮,确认密码之后则节点注销成功。

20190115104911

参与共识

  • 在共识界面中,我的总体情况点击委托节点后面的“委托”入口(也可以直接点击节点列表中的某个未委托节点进入);
  • 在参与共识界面(图31)显示节点的信息(节点ID、节点来源、佣金比例、保证金、参与人数、信用值、委托数量);
  • 可以在该界面直接选择委托地址,输入保证金参与委托(需要确认密码)。

20190115110413

追加和退出共识

​ 在共识界面中,我的共识table页中点击某个节点进入节点详情(图32),此页面可以进行追加委托保证金和选择退出共识。

20190115110806

设置

​ 点击顶部菜单的“设置”,进入系统设置界面(图33),可以对系统语言、通讯录、密码进行设置和账户备份、版本升级、退出系统。

20190115111229

语言切换

​ 系统设置界面中可以对系统语言进行中英文切换(图34)。

20190115111447

查看通讯录

​ 系统设置界面可以查看通讯录,在通讯录界面(图35)可以对通讯录进行新增、编辑和删除操作。

20190115111721

设置/修改密码

设置密码

​ 在系统设置中,对为设置密码的账户地址可以进行密码设置(图36),设置密码需要符合密码规则。

20190115112217

修改密码

​ 在系统设置中,对已经设置密码的账户地址可以进行密码修改(图37),修改密码时,需要输入账户地址当前的正确密码,修改的密码需要符合密码规则。

20190115112121

版本升级

​ 在系统设置中,当最新版本号高于当前版本号时,可以直接点击“最新版本”(图38),对系统进行升级。

20190115112741

退出系统

​ 在系统设置界面进行退出操作,直接点击“退出系统”按钮(图38)即可。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/communityConstitution.html b/docs/.vuepress/dist/zh/learn/communityConstitution.html new file mode 100644 index 00000000..672129ff --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/communityConstitution.html @@ -0,0 +1,29 @@ + + + + + + NULS社区章程 | NULS + + + + + + + +

NULS社区章程

一、NULS社区简介

NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。

**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

二、NULS基金会

NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。

(一)NULS基金会宗旨

以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:

1、代码贡献

2、应用开发

3、运营推广

4、其他有利于NULS社区生态发展的具体事项

(二)NULS社区基金的来源

NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。

(三)NULS社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

三、理事会

(一)理事会介绍

NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。

(二)理事会成员产生

社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员),由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。

1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。

2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。

3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。

4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。

(三) 理事会成员权责

1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。

(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。

  • 竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。

  • 固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。

(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。

  • 节点下限代理手续费佣金调整。

  • 转账手续费调整。

  • 合约调用手续费调整。

  • 理事会发起提案的手续费调整。

  • 其他系统可调整的系统参数调整。

(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。

  • 委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。

  • 转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。

  • 创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。

  • 调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。

2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。

3、理事会成员的责任。

  • 理事会成员需要能够及时与社区进行沟通。

  • 严格遵照社区章程。

  • 与NULS的愿景和目标一致。

  • 以全体社区成员利益为己任。

注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。

四、CODE CRAFT COUNCIL(CCC)

(一)CCC介绍

CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。

(二)CCC理念

在技术社区里我们坚持以下的理念:

1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。

2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。

3、共享 (Sharing):

  • 社区共享NULS技术成果。

  • 社区共享NULS发展红利。

  • 社区共享NULS的影响力和名誉。

  • 行业共享NULS带来的技术革新。

  • 行业共享NULS推动行业发展的标准制定。

4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。

5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

(三)CCC成员产生

每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。

加入流程如下:

1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。

2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。

3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。

(四)CCC成员权责

1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。

2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。

3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。

4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。

5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。

五、贡献者角色

(一)竞选贡献者角色

竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示nuls.community

(二)固定贡献者角色

固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。

六、项目预算

(一)对于贡献者角色

对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。

(二)对于其他事务资金

理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。

七、其他投票

(一)发起投票

1、理事会成员发起投票。只收取交易手续费。

2、普通成员投票。押金(目前设定是100NULS)+交易手续费。

(二)代理投票

  • 任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。

  • 任何的NULS用户都可以成为代理人。

  • 代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。

  • 代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。

八、建议反馈

如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。

NULS社区网站:https://nuls.community

建议反馈帖:https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/communityFund.html b/docs/.vuepress/dist/zh/learn/communityFund.html new file mode 100644 index 00000000..04d7a512 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/communityFund.html @@ -0,0 +1,29 @@ + + + + + + NULS社区基金管理和使用流程 | NULS + + + + + + + +

NULS社区基金管理和使用流程

img

一、社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

社区基金账户地址:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

根据社区章程指导思想,提案执行基金会账户操作。

该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。

注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。

暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei

二、发起申请的成员

1、普通成员

包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。

注:理事会发起的该部分成员的申请提案投票期为15天。

2、贡献者角色

通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。

三、申请类型

1、提案支付资金

申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。

2、预算项目提案

申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。

3、提案创建节点

申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。

4、提案委托资金

申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。

四、申请流程

1、方案公开讨论

(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;

(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;

(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;

(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;

(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;

(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;

(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;

(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;

2、理事会成员提案

(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;

(2)理事会和申请人都需要引导社区正确地进行投票;

(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;

(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。

3、基金会执行提案

(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;

(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。

五、流程解释

所有的社区讨论建议在nuls.community进行。

本流程根据社区章程思想进行管理,流程将会对全体社区公开。

流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。

具体节点产生收益参考NULS POC共识机制。

附:当前贡献者角色的委托和节点

大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC 成员:

Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/howToContribute.html b/docs/.vuepress/dist/zh/learn/howToContribute.html new file mode 100644 index 00000000..dac508f8 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/howToContribute.html @@ -0,0 +1,29 @@ + + + + + + 如何做贡献 | NULS + + + + + + + +

如何做贡献

NULS的发展是与社区分不开的,需要社区成员一起参与进来。我们提供了不同的方式让社区成员参与,大家可以选择自己擅长的方式来为NULS做贡献。对每位贡献者,在征得其同意之后,会公示贡献者名字(若拥有节点,我们也会附上其节点名)

加入主网开发

虽然主网现在处于稳定运行的状态,但为了应对变化,主网开发仍然在进行中。我们需要社区的帮助来解决主网开发中面临的挑战,一起完善NULS这个区块链基础设施。我们呼吁社区的开发者能够加入我们,贡献自己的一份力量,同时你的付出也会得到应有的奖励。

报告错误

在软件开发过程中,尽管有严格的测试,但我们还是无法避免程序中出现bug,因此如果你在使用我们应用或者进行开发的过程中发现了bug,请及时反馈给我们,我们会积极进行处理。反馈bug的方式有三种:

  • 通过在社区论坛回帖进行反馈

    • 主网:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs
    • 测试网:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs
  • 发送邮件到support@nuls.io

  • 直接反馈给社区经理或运营人员

编写文档

NULS制定了文档编写激励计划,邀请社区一起编写NULS相关文档,并会根据社区成员的付出给予相应的奖励。

翻译文档

NULS作为一个全球性区块链开源社区项目,需要大量的中英双语文档,如果你是这方面的专业人士,那么我们十分需要你的帮助。

贡献者名单

排名不分先后,仅按照字母排序

名字 邮箱 节点别名/ID
Angang Tang tangangang@nuls.io --
Albert albert@nuls.io --
Charlie Li lichao@nuls.io ---
Cody Lan lanjinsheng@nuls.io ---
Davi Yang davi@nuls.io ---
Yuanchen Jiang jiangyuanchen@nuls.io ---
Yifeng Qin qinyifeng@nuls.io --
Niels niels@nuls.io niels
Pierre Luo luohao@nuls.io ---
Pen Luo pen@nuls.io ---
Siwei 13809668344@139.com siwei
Vivi Zhou zhouwei@nuls.io ---
Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/index.html b/docs/.vuepress/dist/zh/learn/index.html new file mode 100644 index 00000000..021b8633 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/index.html @@ -0,0 +1,21 @@ + + + + + + 欢迎来到NULS | NULS + + + + + + + +

欢迎来到NULS

NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动

NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等

NULS2.0 Alpha版本已发布

前往体验

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/introduction.html b/docs/.vuepress/dist/zh/learn/introduction.html new file mode 100644 index 00000000..14645340 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/introduction.html @@ -0,0 +1,25 @@ + + + + + + NULS是什么 | NULS + + + + + + + +

NULS是什么

NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动

NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程以及链之间的交互

NULS于创立之初,即已提出模块化思维与多链并行基本架构,NULS秉承以“链”为核心的发展理念,着力打造核心产品“链工厂”。同时,NULS将通过跨链模块实现链之间的价值流通,打造区块链大生态

1 NULS的愿景

  • 为企业级应用提供灵活易用的区块链技术支持
  • 突破区块链技术瓶颈,提供稳定、高效、高性能的网络运行环境
  • 通过降低开发和使用成本,推动区块链商业应用进程
  • 通过分布式网络布局,构建强大信用体系

2.白皮书

NULS白皮书是一个权威性的报告,它指出了NULS的目标是什么,以及我们打算如何实现它

查看白皮书了解更多

3.黄皮书

NULS黄皮书是白皮书的技术详解版本,它深入研究了NULS的各个方面

查看黄皮书了解更多

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/joinCCC.html b/docs/.vuepress/dist/zh/learn/joinCCC.html new file mode 100644 index 00000000..fcf9c4da --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/joinCCC.html @@ -0,0 +1,43 @@ + + + + + + 如何成为社区开发者 | NULS + + + + + + + +

如何成为社区开发者

一、NULS简介

NULS 是一个区块链公链项目,其致力于打造由社区驱动的一个真正开源、自我革新的区块链平台。NULS期望通过构建灵活易用的区块链基础设施,最大限度降低企业/个人使用区块链底层技术的难度。 +NULS技术社区,是由来自NULS社区的一批对NULS充满激情与梦想的技术开发人员构建而成。技术社区将和NULS核心开发团队共同搭建NULS底层,通过实现模块化、多链并行、跨链等机制,让企业/个人都可以通过简单配置定制自己的区块链。

在社区里我们坚持以下的理念:

  • 平等 (Equal):技术社区与核心团队是平等关系,一起合作开发;
  • 共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态;
  • 共享 (Sharing): +
    • 社区共享NULS技术成果
    • 社区共享NULS发展红利
    • 社区共享NULS的影响力和名誉
    • 行业共享NULS带来的技术革新
    • 行业共享NULS推动行业发展的标准制定
  • 公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正;
  • 创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

二、你是我们在寻找的TA吗?

NULS技术社区向所有开发者开放。 +如果你: +对区块链世界充满期待,希望用代码创造出新的世界。

请加入我们的技术社区电报群:https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ +注意:我们不是寻求任务外包。任何你认为值得改进的地方,都是你可以发挥的空间。

三、我们能提供什么?

NULS团队会为技术社区的每一个为NULS项目作出贡献的开发者提供奖励,奖励的大小基于贡献的大小。 +目前,如果你能通过前期表现,加入技术社区核心开发团队(Code Craft Council),我们会为你创建一个节点,并委托20万NULS Token,节点奖励的50%部分将用于支持开发者(目前大约1500NULS/月),剩下50%会注入社区基金池。注:50%是初始值,后续调整由社区决定,我们会在社区进行公示。

四、我们的计划

让造链变得容易! +首先,我们希望建立一个涵盖80%区块链底层技术的模块仓库。 +通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更加融入到日常生活中。 +我们正和技术社区一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。 +其次,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),极大的缩短了目前公链开发少则半年多则1年的耗时。 +以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。 +现在NULS技术社区有中西方开发者200余人,我们欢迎更多的开发者加入。你们将协助核心团队进行NULS底层的开发工作。

五、技术社区的现状:

(1)我们一直认为NULS属于社区,NULS技术的长远发展离不开极具创造力的社区技术力量,在过去一年时间里我们很高兴能看到社区开发者自愿为NULS贡献自己的力量。其中来自英国的Josh为NULS开发了官网(nuls.io),来自法国的Moshe为NULS开发了区块链浏览器(nuls.world/)和轻钱包(nuls.world/wallet),来自玻利维亚的Berzeck正在参与NULS的底层开发工作。

(2)尽管如此,我们还有很多的工作尚待完成。我们会在本帖下方持续更新一个任务清单,该清单会包含NULS的设计、开发、改进等方面的工作。所有开发者都可以根据自己的能力和兴趣进行选择。

六、如何加入开发团队

(1)为方便沟通,请先加入技术社区的Telegram群(见上),并阅读群置顶消息;

(2)跟社区开发者Moshe进行初步沟通,简要介绍自己的经历、擅长的编程语言等,社区开发者会跟你交流一些技术相关信息,并了解你希望做些什么,这将决定你接下来的工作内容。 +同时我们强烈建议你通过下面的链接,去了解更多关于NULS的内容:

(3)你可以选择感兴趣并胜任的任务。届时,我们会让你加入各个开发小组,同其他开发人员一起工作。在这里,我们强烈建议你下载微信作为沟通交流工具: +https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh

(4)在小组中,各小组leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

技术社区和核心团队经过仔细审核后,如果申请被批准,我们将为你创建一个节点(这将是你获得奖励的基础)。

七、查看任务清单

任务清单持续更新中

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/lightWalletGuide.html b/docs/.vuepress/dist/zh/learn/lightWalletGuide.html new file mode 100644 index 00000000..2ad96672 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/lightWalletGuide.html @@ -0,0 +1,57 @@ + + + + + + 网页钱包使用指南 | NULS + + + + + + + +

网页钱包使用指南

访问钱包

网页钱包地址:https://wallet.nuls.io

语言切换

点击右上角,可以自由切换页面语言 +

账户

创建账户

1.点击创建账户 + +2.设置钱包密码、仔细阅读并勾选同意服务协议、点击创建账户 + 注:创建好账户后,应立即进行备份,并将备份资料存放在安全的地方,否则有资产丢失的风险!

备份账户

1.点击Keystore备份

+2.当您得到一个Keystore文件后,请点击备份完成 +

导入账户

1.点击导入账户

+2.点击导入Keystore

+3.选择你的Keystore文件后,点击打开

+4.输入账户密码,点击确认 +

设置

点击菜单栏的设置,您可以根据需求,对当前账户进行备份、修改密码、设置别名

账户备份

具体步骤与备份账户相同

修改密码

输入原密码及新密码,点击确认 +

设置别名

输入别名,并确保有足够的余额,点击确定 +

交易

1.点击转账

+2.输入收款地址、转账金额,手续费根据全网交易情况增减,一般默认即可

+3.输入账户密码,点击确认

+4.查看交易记录,状态为“已确认”则表示交易成功 +

共识

点击菜单栏的“共识”可以查看共识信息,参与共识、追加共识、退出共识等操作 +

参与共识

1.点击“加入委托”

+2.选择节点,也可以通过搜索节点名称,找到节点

+3.输入委托金额,点击“确定委托”

+4.输入账户密码,点击确认

追加共识

1.点击我参与的共识节点

+2.点击“追加”

+3.输入委托金额,点击“确定委托”
+4.输入账户密码,点击确认

退出共识

1.点击我参与的共识节点

+2.点击“退出”
+3.输入账户密码,点击确认

投票

1.点击“投票”进入投票页面
+2.点击标题
+3.根据投票规则,选择您支持的事项,点击“投票”
+4.输入账户密码,点击确认

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/structure.html b/docs/.vuepress/dist/zh/learn/structure.html new file mode 100644 index 00000000..7ae1fbc6 --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/structure.html @@ -0,0 +1,21 @@ + + + + + + 本文档的结构 | NULS + + + + + + + +

本文档的结构

本文档分为八个部分

  • 总览

    通过该部分文档可帮助对NULS不熟悉的读者了解NULS是什么,可以做什么

  • 用户操作指南

    如果你是一个新用户,那这里有你需要的东西,进来看看吧

  • 社区

    区块链项目总是以社区为基础的,从这里你可以了解到关于NULS社区各个方面的知识

  • 启动NULS

    想开始使用NULS吗,那就从这里开始吧,该部分文档介绍了如何通过源码启动NULS,如何连接主网和测试网,如何使用节点GUI和节点CLI

  • 快速搭链

    如何你想搭建一条私链,那这部分文档应该可以帮助到你

  • NULS2.0

    模块化设计是什么?NULS2.0是什么?该部分会一一帮你解答这些问题,会详细阐述NULS的设计理念,各个模块的设计细节

  • 智能合约

    想要基于智能合约做DAPP或者其他很酷的事情吗,该部分文档会是你想要的,文档中包含开发者文档,NRC标准,插件,还有一些有趣的合约示例

  • 开发者工具

    NULS一直秉承对开发者友好的理念,因此我们也在不断提供一些工具给到开发者。开发者们都到这里面看看有些什么吧

  • NIPs

    所有与NULS 相关的提案都在这里,通过该部分你可以详细了解NULS的协议,章程,标准等等。

  • NULS导航

    NULS文档库只是NULS的一部分,想要获取更多NULS相关的信息和产品,就到这里面找找入口吧

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/learn/toolsGuide.html b/docs/.vuepress/dist/zh/learn/toolsGuide.html new file mode 100644 index 00000000..74de083d --- /dev/null +++ b/docs/.vuepress/dist/zh/learn/toolsGuide.html @@ -0,0 +1,29 @@ + + + + + + 社区投票指南 | NULS + + + + + + + +

社区投票指南

1 投票

如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。

img

点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。

img

若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。

系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。

投票详情的各个选项,可以点击展开详情,查看票数分布情况。

2 更新投票

如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。

img

同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。

img

3 查看我的投票

在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。

img

点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。

4创建投票

在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。

为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。

img

创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。

Last Updated: 2019-3-28 00:38:23
+ + + diff --git a/docs/.vuepress/dist/zh/nips/NIP-1.html b/docs/.vuepress/dist/zh/nips/NIP-1.html new file mode 100644 index 00000000..0d10b449 --- /dev/null +++ b/docs/.vuepress/dist/zh/nips/NIP-1.html @@ -0,0 +1,39 @@ + + + + + + NIP-1 NIP的目的和指导 | NULS + + + + + + + +

NIP-1 NIP的目的和指导

NIP:1
+标题: NIP的目的和指导
+状态: 公示
+类型: 流程
+作者: 杨霖 <lin@nuls.io>
+创建日期:2018/12/27
+

什么是NIP?

NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.

NIP产生的理由

  • 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录

  • 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。

NIP的类型

NIP当前有六种类型:

  • 核心:NULS核心代码的改善,例如共识机制,网络协议等。
  • 模块:模块的提交和评审要求的改善,例如符合何种标准的模块会被接受并被纳入模块仓库。
  • 接口:NULS客户端API/RPC的规范和标准的改善,例如API名称、方法名称。
  • NRC标准:应用级别的标准的改善,例如合约标准,通证标准等。
  • 信息:描述NULS设计问题,或向NULS社区提供一般性指导或信息,但不提出新功能。 信息NIP不一定代表NULS社区的共识或推荐,因此用户和实施者可以自由选择忽略信息NIP或遵循他们的建议
  • 流程:所有NULS相关的操作流程的改善,例如社区中竞选大使的流程的改善。流程类NIP不仅仅是建议,是社区成员完成某些特定的事需要遵守的规范,但该类NIP不涉及代码层面的规范。

NIP的工作流程

涉及流程的各方包括以下部分或全部角色:

  • 社区的大部分成员

    主要职责为参与NIP的讨论和投票,提出建设性意见。

  • NIP作者

    提出和完善NIP,并负责引导社区展开讨论。

  • NIP编辑

    管理和编辑NIP。

  • NULS理事会

    对即将进入接受或完结状态的NIP做最后把关,理事会有权通过内部投票拒绝NIP。

  • NULS核心开发者

    负责核心,模块,NRC标准和接口这四个类型的NIP的审核和代码实现。

在开始撰写NIP之前,先审查你的想法,这将帮你节省时间。首先询问社区这个想法之前是否被提出过,可行性如何。以免浪费时间在一些肯定会被拒绝的提案上,并有助于确保该想法适用于整个社区而不仅仅是作者。 某个想法对作者有意义并不意味着它对各个地区使用NULS的人都有意义。我们建议可以通过发起投票的方式在社区收集意见,投票的结果也有助于NIP编辑更快做出判断是否合并该NIP。

完成一个最终生效的NIP需要经过以下阶段:

[ 草稿 ]->[ 公示 ]->[ 接受 ]->[ 完结 ]
+

每次NIP状态的更改都是先由NIP的作者提出Pull Request(合并请求,简称PR),然后NIP的编辑会对该NIP进行审查。提出PR的时候最好包含一个可以持续讨论该NIP的链接。

完整的NIP处理流程如下:

  • NIP的作者按照规定的格式和样式编写NIP,然后在社区中进行讨论和调研,确定可行性后,则将NIP通过提PR的方式提交到NIP仓库,并在PR中包含社区讨论的链接。NIP编辑会根据实际情况来处理这些请求。

    • 草稿: 如果同意合并,NIP编辑将为该NIP分配一个编号并合并PR。 NIP编辑不会无理由拒绝某个NIP
    • 草稿: 拒绝合并为草稿的原因包括专注度不够、过于宽泛、重复劳动、技术上不健全、没有提供合理的动机或解决向后兼容性,或者不符合NULS理念。
  • 合并成为草稿状态后,作者可以继续提PR对草稿做进一步更改,直至认为该NIP已经足够成熟并准备好进入下一个状态为止。

    • 公示: 如果获得同意,NIP编辑将会把该NIP的状态从草稿更改为公示,并设置公示结束日期,通常为15天后。
    • 公示: 如果进入公示阶段后,还要对该NIP进行更改,那这个NIP会被退回草稿状态。我们希望一个NIP只进入一次公示状态,避免在社区引起不必要的争论。
  • 公示状态的NIP会置顶在https://nuls.community/

    • 接受(核心,模块,NRC标准和接口的NIP才涉及): 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为接受。
    • 完结(信息和流程才涉及): 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为完结。
    • 公示: 公示期有材料变更或无法解决社区提出的技术问题,则该NIP将会被退回草稿状态。除此之外,如果理事会对该NIP有不同的看法,可以在理事会成员内部发起投票,超过70%的理事会成员否决该NIP(需给出原因)则该NIP将根据实际原因被退回草稿状态或直接改为拒绝状态。
  • 当核心、模块、NRC标准和接口的NIP成为接受状态后,何时能成为完结状态取决于相关的NULS核心开发者,由他们决定如何将该NIP通过编码来实现。

    • 完结(核心,模块,NRC标准和接口的NIP涉及): NIP已通过编码实现,并在主网稳定运行一段时间或得到了有效验证且改动也得到了社区的认可,则状态可变为完结。

其他非常规的状态如下:

  • 延期: 核心、模块、NRC标准和接口相关的NIP成为接受状态后,开发者未按照预定的时间完成开发。
  • 拒绝: 某个NIP被核心开发者拒绝实现或被理事会认定为不可实现。
  • 被取代: NIP以前是完结状态,但不再被认为是最先进的。出现另一个更好的NIP,参考了这个NIP并成为了最终状态。

一个有效的NIP文档应该包含哪些内容?

每个NIP应该包含以下部分:

  • 前言: 与NIP相关的元数据,以RFC 822样式展示。内容包括NIP编号,简短描述性标题(限制为最多44个字符)和作者详细信息。可参阅下文了解详情。
  • 简单总结: NIP作者需要给这个NIP提供一个简单且普通人可以理解的总结,如果你不能很简单地解释它,说明你自己对它的理解还不够深入。
  • 摘要 : 对正在解决的技术问题进行简短(约200字)描述。
  • 动机: 对于想要改善NULS协议的NIP,动机至关重要。 它应该清楚地解释为什么现有的协议规范存在不足。没有足够动机的NIP可能会被彻底拒绝。
  • 规范: 技术规范应描述清楚任何新功能的语法和语义。规范应该足够详细,以允许当前任何基于NULS平台的应用拥有竞争性、可互操作性(例如NULS客户端,浏览器)。
  • 论据 : 论据通过描述什么驱动了这样的设计以及为什么要做出这样的设计决策来充实规范。它应该阐述考虑过的替代性设计和相关工作,例如如何在其他语言中支持该特性。论据也可以提供证据证明社区的意见是一致的,并应讨论提出的重要反对意见或大家关注的事项。
  • 向后兼容性: 所有引入向后不兼容的NIP必须描述存在哪些不兼容及其严重性。NIP中必须解释作者如何处理这些不兼容性。如果没有足够的向后兼容性论述,提交的NIP可能会被直接拒绝。
  • 测试用例: 对于影响共识机制的NIP,其实现方法的测试用例是强制性的。
  • 实现 : 代码的实现必须在任何NIP被赋予完结状态之前完成,但是它不需要在NIP被合并为草稿之前完成。
  • 历史记录: 历史记录是展示了该NIP从提出到成为完结状态的整个过程,可以通过附加链接形式展示。

NIP的格式和模版

NIP应该用markdown的格式编写

NIP的前言

每个NIP的必须以RFC 822的样式作为文档的头部前言,头部必须按照以下顺序进行排列,用*标注的头部为可选项,其他项为必填项

 NIP: <NIP编号>
+ 标题: <NIP标题>
+ 作者: <列出作者的真实名字和电子邮件地址>
+*讨论渠道: <指向官方讨论渠道的链接>
+ 状态: <草稿| 接受 | 完结 | 被取代 | 延期 | 拒绝>
+ 类型: <核心 | 模块 | 接口 | NRC标准 | 信息 | 流程>
+ 创建日期: < 用 ISO 8601 (yyyy-mm-dd) 格式>
+*取代: <NIP 编号>
+*被取代: <NIP 编号>
+

附件

NIPS文档可能包含一些附件,例如流程图。这样的文件必须以NIP-XXXX-Y.ext的格式来命名,“XXXX”指的是NIP的编号,“Y”指的是序列号(从1开始),“ext”指的是文件扩展名(例如:.png)

转移NIP的所有权

有时需要将NIPS的所有权转让给新的作者。一般来说,我们希望保留原作者作为要转移的NIP的合著者,但这实际上取决于原作者。转让所有权的一个很好的理由是,原作者不再有时间或兴趣来更新它或跟进NIP的后续过程,或已经脱离了“网络”(即无法联系或没有回复电子邮件)。转让所有权的一个不好的原因是你不同意NIP的方向。我们努力围绕一个NIP去建立共识,如果你认为不可能达成,你可以提交一个更有说服力的NIP。

如果您对NIP的所有权感兴趣,请发送一封邮件要求接管,该邮件的收件人是原作者和NIP编辑。如果原作者没有及时回复邮件,NIP的编辑就会做出单方面的决定(这样的决定并不是不能逆转的)。

NIP编辑

当前的NIP编辑如下:

Niels <Niels@nuls.io>
+Pen <Pen@nuls.io>
+

NIP编辑的职责

每次收到一个新的NIP, 一个编辑要做如下的事:

  • 阅读NIP来检查它是否较为完备,NIP中的想法必须具有技术意义,即使它们看起来不太可能达到最终状态。
  • 标题和内容要相符。
  • 检查NIP的语言(拼写、语法、句子结构等)、标记(Github风格的标记)、代码风格 。

如果NIP不够完备,编辑会把它发回给作者进行修改,并给出具体的说明。一旦NIP做好了合并到仓库的准备,NIP编辑就会这样做:

  • 分配一个NIP编号(通常是PR编号)

  • 合并相应的PR

  • 将消息发送回NIP作者

许多NIP是由对NULS代码库具有写入权限的开发人员编写和维护的。NIP编辑要关注NIP的变化,并纠正我们看到的任何结构、语法、拼写或标记错误。NIP编辑不会主观地对NIP做出判断,只做管理和编辑这部分工作。

History

这个文档主要引用了 Bitcoin's BIP-0001,由 Amir Taaki 所写,同时他所写的文本也主要来源于 Python's PEP-0001。NIP根据自身的实际情况,基于他们的文档做了一些修改,例如NIP流程中增加了理事会,修改了NIP类型等。后续与NIP相关的问题请直接联系NULS NIP的编辑。

Last Updated: 2018-12-28 15:10:56
+ + + diff --git a/docs/.vuepress/dist/zh/nips/NIP-2.html b/docs/.vuepress/dist/zh/nips/NIP-2.html new file mode 100644 index 00000000..f2aeb5a7 --- /dev/null +++ b/docs/.vuepress/dist/zh/nips/NIP-2.html @@ -0,0 +1,28 @@ + + + + + + NIP-2 NULS社区章程 | NULS + + + + + + + +

NIP-2 NULS社区章程

 NIP: 2
+ 标题: NULS社区章程
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2018/12/28
+

前言

根据NULS项目的发展需要,为了更好地促进NULS社区良性运转,达成NULS让区块链技术更简单的愿景。NULS社区将不断探索和实施NULS社区自治,实现NULS项目自治和自进化。基于NULS社区文化和社区理念,特此制定社区发展章程。

NULS社区文化:开放、自由、自治、进化

NULS社区理念:分享、传承、成长、创新

以下规则将会基于NULS开发共识治理模块,在共识治理模块上线前,理事会和大使将由NULS核心团队发起投票来执行。

NULS基金会

2018年12月

摘要

NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

动机

为了构建一个良好的社区运行机制,促进社区自治,推动NULS项目能够让社区自主进化和自主驱动。

规范

以下内容属于NULS社区章程的规范。

NULS社区章程

一、NULS社区简介

NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。

**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。

二、NULS基金会

NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。

(一)NULS基金会宗旨

以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献:

1、代码贡献

2、应用开发

3、运营推广

4、其他有利于NULS社区生态发展的具体事项

(二)NULS社区基金的来源

NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。

(三)NULS社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

三、理事会

(一)理事会介绍

NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。

(二)理事会成员产生

社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员),由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。

1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。

2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。

3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。

4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。

(三) 理事会成员权责

1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。

(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。

  • 竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。

  • 固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。

(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。

  • 节点下限代理手续费佣金调整。

  • 转账手续费调整。

  • 合约调用手续费调整。

  • 理事会发起提案的手续费调整。

  • 其他系统可调整的系统参数调整。

(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。

  • 委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。

  • 转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。

  • 创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。

  • 调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。

2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。

3、理事会成员的责任。

  • 理事会成员需要能够及时与社区进行沟通。

  • 严格遵照社区章程。

  • 与NULS的愿景和目标一致。

  • 以全体社区成员利益为己任。

注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。

四、CODE CRAFT COUNCIL(CCC)

(一)CCC介绍

CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。

(二)CCC理念

在技术社区里我们坚持以下的理念:

1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。

2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。

3、共享 (Sharing):

  • 社区共享NULS技术成果。

  • 社区共享NULS发展红利。

  • 社区共享NULS的影响力和名誉。

  • 行业共享NULS带来的技术革新。

  • 行业共享NULS推动行业发展的标准制定。

4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。

5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。

(三)CCC成员产生

每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。

加入流程如下:

1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。

2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。

3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。

4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。

(四)CCC成员权责

1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。

2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。

3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。

4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。

5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。

五、贡献者角色

(一)竞选贡献者角色

竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示nuls.community

(二)固定贡献者角色

固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。

六、项目预算

(一)对于贡献者角色

对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。

(二)对于其他事务资金

理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。

七、其他投票

(一)发起投票

1、理事会成员发起投票。只收取交易手续费。

2、普通成员投票。押金(目前设定是100NULS)+交易手续费。

(二)代理投票

  • 任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。

  • 任何的NULS用户都可以成为代理人。

  • 代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。

  • 代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。

八、建议反馈

如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。

NULS社区网站:https://nuls.community

建议反馈帖:https://nuls.community/d/132-we-need-your-suggestions

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/nips/NIP-3.html b/docs/.vuepress/dist/zh/nips/NIP-3.html new file mode 100644 index 00000000..f910448a --- /dev/null +++ b/docs/.vuepress/dist/zh/nips/NIP-3.html @@ -0,0 +1,28 @@ + + + + + + NIP-3 NULS社区基金管理和使用流程 | NULS + + + + + + + +

NIP-3 NULS社区基金管理和使用流程

 NIP: 3
+ 标题: NULS社区基金管理和使用流程
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/263-ngc20181221
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2018/12/28
+

摘要

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

动机

为了让社区能够有更多的人才加入,所以将社区基金开放给社区来共同管理和使用。

规范

以下内容属于NULS社区基金管理和使用流程的规范。

NULS社区基金管理和使用流程

img

一、社区基金管理

根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。

社区基金账户地址:

Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u

根据社区章程指导思想,提案执行基金会账户操作。

该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。

注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。

暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei

二、发起申请的成员

1、普通成员

包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。

注:理事会发起的该部分成员的申请提案投票期为15天。

2、贡献者角色

通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。

三、申请类型

1、提案支付资金

申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。

2、预算项目提案

申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。

3、提案创建节点

申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。

4、提案委托资金

申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。

四、申请流程

1、方案公开讨论

(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问;

(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解;

(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金;

(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估;

(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估;

(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划;

(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划;

(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案;

2、理事会成员提案

(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票;

(2)理事会和申请人都需要引导社区正确地进行投票;

(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作;

(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。

3、基金会执行提案

(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作;

(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。

五、流程解释

所有的社区讨论建议在nuls.community进行。

本流程根据社区章程思想进行管理,流程将会对全体社区公开。

流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。

具体节点产生收益参考NULS POC共识机制。

附:当前贡献者角色的委托和节点

大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR

CCC 成员:

Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q

Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx

Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4

Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH

Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg

Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa

Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G

Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs

Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR

Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW

Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4

Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/nips/NIP-4.html b/docs/.vuepress/dist/zh/nips/NIP-4.html new file mode 100644 index 00000000..b7cdb3b5 --- /dev/null +++ b/docs/.vuepress/dist/zh/nips/NIP-4.html @@ -0,0 +1,28 @@ + + + + + + NIP-4 NULS大使竞选参与规则 | NULS + + + + + + + +

NIP-4 NULS大使竞选参与规则

 NIP: 4
+ 标题: NULS大使竞选参与规则
+ 作者: Reaper Ran <reaper@nuls.io>
+ 讨论渠道: https://nuls.community/d/205-ncg-20181114
+ 状态: 公示
+ 类型: 流程
+ 创建日期: 2019/2/15
+

摘要

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

动机

从9月-10月期间,我们已经有9位大使,大家都在积极的为NULS社区贡献,发展更多的成员,以及做一些力所能及的事情。NULS在主网智能合约上线后,将会开启一个社区投票工具。大使的竞选本身应该由社区来选择,另一方面由于在大使开展工作的过程中,社区的其他伙伴也提供了很多的建议,在广大社区成员的建议下,我们准备更新NULS大使的竞选规则。这将是NULS开启社区自治道路的第一步,NULS社区自治是未来的重要目标,这需要非常多的基础工具和人才支持。

规范

以下内容属于NULS大使竞选参与规则的规范。

NULS大使竞选参与规则

一、NULS大使介绍

NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。

二、NULS大使职责和权益

1、参与NULS大使的选举需要具有创建NULS节点的基本条件。

2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员,参选之前请确保能够坚持在任一个季度。

3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。

4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。

5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。

6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。

7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。

8、大使获得的节点的所有奖励一半作为大使的报酬(由于大使的节点服务器需要支出和自己抵押的20000NULS也会产生收益),另外一半必须作为大使发展基金,用于社区发展。

9、大使的离职,如果大使主动离职或者被罢免,请将剩余的大使发展基金返回到社区基金。

10、大使属于社区贡献者角色,如需要发起其他的社区基金申请,按照社区基金使用和管理流程执行。

三、如何参与竞选

  • 第一步:

发布上月的工作情况报告和下月的工作计划:

请发布到论坛https://community.nuls.world/t/elections

  • 第二步:

NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。

  • 第三步:

如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%;

NULS基金会将会委托200000NULS在您的节点上。

最后祝愿:

  • 恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。
  • 开始社区建设和拓展工作。
  • 帮助NULS对接更多的DApp接入。
  • 请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。

所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections

欢迎大家加入NULS社区,共同创造NULS美好未来!

如果您能够奉献更多,对您的期望:

1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。

3、分享NULS的故事给社区。

3、分享NULS的故事给社区;

4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。

大使指导手册

前言

欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。

作为NULS的大使,你将获得

1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中;

2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区;

3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展;

4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。

作为NULS的大使,你可以从这些方面来开展工作

1、社区拓展

(1)通过互联网或者线下交流的方式让其他人了解NULS。

(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。

(3)将NULS社区其他地区的发展情况分享到当地社区。

(4)持续分享NULS项目的进展、规划、新闻等到当地社区。

(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。

(6)分享NULS的故事给社区。

(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。

(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。

(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。

(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。

2、社区活动

(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。

(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。

(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。

(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。

(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。

了解NULS可以从这里开始

1、NULS大使工作看板(点击进入),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。

2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。

3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。

4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。

5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。

6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。

7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注Githubdev.nuls.io

7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛nuls.community上面发帖。

招募志愿者组织当地的社群

1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。

2、组织开展一些线下见面会活动。

3、让更多的区块链投资人了解NULS,引导他们对NULS投资。

4、帮助NULS寻找更多的区块链技术爱好者加入。

发展当地的NULS生态

1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队;

2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。

3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。

将NULS的理念和技术传播到当地

1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。

2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。

3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。

NULStar指南和职责

成为NULStar的要求

1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。

2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。

3、必须住在人口超过35万的城市。

NULStar的职责

1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。

2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。

NULStars的奖励

1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。

2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。

指导手册会不断更新,希望大使们和NULS一起成长!

Last Updated: 2019-2-19 10:38:50
+ + + diff --git a/docs/.vuepress/dist/zh/nips/NIPIntroduction.html b/docs/.vuepress/dist/zh/nips/NIPIntroduction.html new file mode 100644 index 00000000..ff8656cf --- /dev/null +++ b/docs/.vuepress/dist/zh/nips/NIPIntroduction.html @@ -0,0 +1,21 @@ + + + + + + NIP介绍 | NULS + + + + + + + +

NIP介绍

什么是NIP?

NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见.

NIP产生的理由

  • 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录

  • 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。

获取所有NIP

通过NULS的github可以获取所有的NIP,github地址为:https://github.com/nuls-io/NIPs

Last Updated: 2018-12-28 15:10:56
+ + + diff --git a/docs/.vuepress/dist/zh/nulsNav/NULSNav.html b/docs/.vuepress/dist/zh/nulsNav/NULSNav.html new file mode 100644 index 00000000..45d32b26 --- /dev/null +++ b/docs/.vuepress/dist/zh/nulsNav/NULSNav.html @@ -0,0 +1,21 @@ + + + + + + NULS 导航 | NULS + + + + + + + + + + + diff --git a/docs/.vuepress/dist/zh/overview/howToContribute.html b/docs/.vuepress/dist/zh/overview/howToContribute.html new file mode 100644 index 00000000..aa235ce3 --- /dev/null +++ b/docs/.vuepress/dist/zh/overview/howToContribute.html @@ -0,0 +1,21 @@ + + + + + + 如何做贡献 | NULS + + + + + + + +

如何做贡献

NULS的发展是与社区分不开的,需要社区成员一起参与进来。我们提供了不同的方式让社区成员参与,大家可以选择自己擅长的方式来为NULS做贡献。对每位贡献者,在征得其同意之后,会公示贡献者名字(若拥有节点,我们也会附上其节点名)

加入主网开发

虽然主网现在处于稳定运行的状态,但为了应对变化,主网开发仍然在进行中。我们需要社区的帮助来解决主网开发中面临的挑战,一起完善NULS这个区块链基础设施。我们呼吁社区的开发者能够加入我们,贡献自己的一份力量,同时你的付出也会得到应有的奖励。

报告错误

在软件开发过程中,尽管有严格的测试,但我们还是无法避免程序中出现bug,因此如果你在使用我们应用或者进行开发的过程中发现了bug,请及时反馈给我们,我们会积极进行处理。反馈bug的方式有三种:

  • 通过在社区论坛回帖进行反馈

    • 主网:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs
    • 测试网:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs
  • 发送邮件到support@nuls.io

  • 直接反馈给社区经理或运营人员

编写文档

NULS制定了文档编写激励计划,邀请社区一起编写NULS相关文档,并会根据社区成员的付出给予相应的奖励。

翻译文档

NULS作为一个全球性区块链开源社区项目,需要大量的中英双语文档,如果你是这方面的专业人士,那么我们十分需要你的帮助。

贡献者名单

排名不分先后,仅按照字母排序

名字 邮箱 节点别名/ID
Angang Tang tangangang@nuls.io --
Albert albert@nuls.io --
Charlie Li lichao@nuls.io ---
Cody Lan lanjinsheng@nuls.io ---
Davi Yang davi@nuls.io ---
Yuanchen Jiang jiangyuanchen@nuls.io ---
Yifeng Qin qinyifeng@nuls.io --
Niels niels@nuls.io niels
Pierre Luo luohao@nuls.io ---
Pen Luo pen@nuls.io ---
Siwei 13809668344@139.com siwei
Vivi Zhou zhouwei@nuls.io ---
Last Updated: 2019-1-25 13:51:56
+ + + diff --git a/docs/.vuepress/dist/zh/overview/introduction.html b/docs/.vuepress/dist/zh/overview/introduction.html new file mode 100644 index 00000000..183cedc3 --- /dev/null +++ b/docs/.vuepress/dist/zh/overview/introduction.html @@ -0,0 +1,21 @@ + + + + + + NULS是什么 | NULS + + + + + + + +

NULS是什么

NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动

NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程以及链之间的交互

NULS于创立之初,即已提出模块化思维与多链并行基本架构,NULS秉承以“链”为核心的发展理念,着力打造核心产品“链工厂”。同时,NULS将通过跨链模块实现链之间的价值流通,打造区块链大生态

1 NULS的愿景

  • 为企业级应用提供灵活易用的区块链技术支持
  • 突破区块链技术瓶颈,提供稳定、高效、高性能的网络运行环境
  • 通过降低开发和使用成本,推动区块链商业应用进程
  • 通过分布式网络布局,构建强大信用体系

2.白皮书

NULS白皮书是一个权威性的报告,它指出了NULS的目标是什么,以及我们打算如何实现它

查看白皮书了解更多

3.黄皮书

NULS黄皮书是白皮书的技术详解版本,它深入研究了NULS的各个方面

查看黄皮书了解更多

Last Updated: 2019-1-7 14:00:22
+ + + diff --git a/docs/.vuepress/dist/zh/overview/structure.html b/docs/.vuepress/dist/zh/overview/structure.html new file mode 100644 index 00000000..43908c68 --- /dev/null +++ b/docs/.vuepress/dist/zh/overview/structure.html @@ -0,0 +1,21 @@ + + + + + + 本文档的结构 | NULS + + + + + + + +

本文档的结构

本文档分为八个部分

  • 总览

    通过该部分文档可帮助对NULS不熟悉的读者了解NULS是什么,可以做什么

  • 用户操作指南

    如果你是一个新用户,那这里有你需要的东西,进来看看吧

  • 社区

    区块链项目总是以社区为基础的,从这里你可以了解到关于NULS社区各个方面的知识

  • 启动NULS

    想开始使用NULS吗,那就从这里开始吧,该部分文档介绍了如何通过源码启动NULS,如何连接主网和测试网,如何使用节点GUI和节点CLI

  • 快速搭链

    如何你想搭建一条私链,那这部分文档应该可以帮助到你

  • NULS2.0

    模块化设计是什么?NULS2.0是什么?该部分会一一帮你解答这些问题,会详细阐述NULS的设计理念,各个模块的设计细节

  • 智能合约

    想要基于智能合约做DAPP或者其他很酷的事情吗,该部分文档会是你想要的,文档中包含开发者文档,NRC标准,插件,还有一些有趣的合约示例

  • 开发者工具

    NULS一直秉承对开发者友好的理念,因此我们也在不断提供一些工具给到开发者。开发者们都到这里面看看有些什么吧

  • NIPs

    所有与NULS 相关的提案都在这里,通过该部分你可以详细了解NULS的协议,章程,标准等等。

  • NULS导航

    NULS文档库只是NULS的一部分,想要获取更多NULS相关的信息和产品,就到这里面找找入口吧

Last Updated: 2019-3-26 10:50:05
+ + + diff --git a/docs/.vuepress/override.styl b/docs/.vuepress/override.styl new file mode 100644 index 00000000..0ccb6f21 --- /dev/null +++ b/docs/.vuepress/override.styl @@ -0,0 +1,3 @@ +body { + font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif; +} \ No newline at end of file diff --git a/docs/NULS1.0/APIManual.md b/docs/NULS1.0/APIManual.md new file mode 100644 index 00000000..656aad02 --- /dev/null +++ b/docs/NULS1.0/APIManual.md @@ -0,0 +1 @@ +# API手册 \ No newline at end of file diff --git a/source/contract/smartContract.md b/docs/NULS1.0/GUIForSmartContract.md similarity index 100% rename from source/contract/smartContract.md rename to docs/NULS1.0/GUIForSmartContract.md diff --git a/source/contract/NRC-20_Token_Standard.md b/docs/NULS1.0/NRC-20TokenStandard.md similarity index 100% rename from source/contract/NRC-20_Token_Standard.md rename to docs/NULS1.0/NRC-20TokenStandard.md diff --git a/docs/NULS1.0/README.md b/docs/NULS1.0/README.md new file mode 100644 index 00000000..65c9ab64 --- /dev/null +++ b/docs/NULS1.0/README.md @@ -0,0 +1,15 @@ +# Welcome to NULS + + +> NULS is a blockchain infrastructure for customizable services, driven by our global open-source community. + + +The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects. + + +## NULS2.0 Beta Version is released + +#### [Have a try](/NULS2.0/) + + + diff --git a/source/docs/assert/launcher.jpg b/docs/NULS1.0/assert/launcher.jpg similarity index 100% rename from source/docs/assert/launcher.jpg rename to docs/NULS1.0/assert/launcher.jpg diff --git a/docs/NULS1.0/buildPrivateChain.md b/docs/NULS1.0/buildPrivateChain.md new file mode 100644 index 00000000..bb60bc09 --- /dev/null +++ b/docs/NULS1.0/buildPrivateChain.md @@ -0,0 +1,79 @@ +# Build Chain + +## Introduction + +This tutorial guides you to build a private chain based on NULS source code, to make is easier for users to learn about the operation, development or experiment of the NULS Blockchain. By building a chain to fully understand the operation of each node and data interaction, we can better grasp the overall operating mechanism of the NULS Blockchain, which is conducive to further research. We assume that readers have the skills to set up and debug a Java development environment. + + + +## Setting up environment + +- Operating systems: macOS, Windows +- Build Tools: Maven +- Development Tools: IntelliJ IDEA +- NULS source code on github: https://github.com/nuls-io/nuls + + + +## Beginning + +Since blockchain is a decentralized network composed of multiple nodes, we will take a private chain with three nodes as an example. Although we recommend using a Linux server to run the NULS main-net consensus node, in this tutorial, we choose macOS system that can set up a Java development environment to run and debug nodes. + +## Development environment + +First, clone the NULS source code using IntelliJ IDEA and open the project. Make sure JDK is the jdk1.8 version and Maven is configured correctly. + +## Steps to build + +1. Open the module.ini file, which is the configuration file for joining or building the network. In this tutorial, it is the configuration information of the NULS test-net. + +![image-20190103193901967](./images/image-20190103193901967.png) + +2. We will use three nodes to build a private chain. First we need to prepare devices (virtual machine works) for three nodes to run. + +- Node A: 192.168.1.1 +- Node B: 192.168.1.2 +- Node C: 192.168.1.3 + +We also need to set up a seed node to maintain the operation of the blockchain, i.e., to package and forge blocks. In addition, we need to prepare a block-forging address (including private key, to import into the seed node), which can be prepared in advance. + +In this tutorial, the initial block-forging address we prepare is: +`Nse4zpZHsUuU7h5ymv28pcGbwHju3joV` + +PS: You may find that the first few letters of the address we prepare differs from those of the test-net address in the figure, which is for the sake of distinguishing the test-net address from the main-net address, so as to avoid confusion that may result in adverse consequences. Specifically, we set the test-net address to start with "TT" and the main-net address to start with "Ns". This tutorial uses the NULS main-branch code, so the address starts with "Ns". If you prefer to custom the starting letters of the private-chain account address, you can try to modify the `chain.id` parameter in the nuls.ini file. The parameters of the same chain must be in consistence. + +3. Assuming node A is the seed node, then modify the network and consensus sections of the module.ini configuration file of three nodes A, B and C according to the following configuration: + +```ini +[network] +Bootstrap=io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap +Network.server.port=8003 +Network.magic=20190101 +Network.max.in=100 +Network.max.out=10 +Network.seed.ip=192.168.1.1:8003 + +[consensus] +Bootstrap=io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap +Partake.packing=true +Min.upgrade.delay=1000 +Seed.nodes=Nse4zpZHsUuU7h5ymv28pcGbwHju3joV +``` + +- Modify `work.seed.ip` to the ip and port of the seed node. +- Modify `seed.nodes` to the block-forging address. +- The consistency of the magic parameters `network.magic` of all nodes in the private chain is a must. + +4. Run the three nodes separately through IntelliJ IDEA. If you only need to debug one node, the other two nodes can be packaged with maven and sent to a Linux server to run. Remarkably, a jre must be placed in the NULS root directory to run properly. +5. After launching the three nodes, once the IntelliJ IDEA console has the following log output, it means that the three nodes have successfully formed a private chain network, but it still cannot produce new blocks and the block height is 0. If there is no log output, you need to uncomment the `` in logback.xml. + +``` +io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash :xxxxxxx,192.168.1.2:8003,192.168.1.2:8003 + +``` + +6. Then import the prepared block-forging account `Nse4zpZHsUuU7h5ymv28pcGbwHju3joV` via wallet interface of the seed node A. After a while, you can see the latest height displayed in the console increasing, which indicates that the network is producing new blocks. At the same time, the height of the node B, C will also increase and the height of the three nodes will remain the same. At this point, the setup of the private chain network is completed. + +## Conclusion + +This tutorial mainly introduces the easiest way to build a private chain for the development and debugging of NULS, without modification on the source code of NULS. If you want to dig deeper into NULS, you can refer to the relevant documentation of NULS to modify and debug the source code. Maybe you will find more secrets! \ No newline at end of file diff --git a/docs/NULS1.0/clientCLI.md b/docs/NULS1.0/clientCLI.md new file mode 100644 index 00000000..1af70225 --- /dev/null +++ b/docs/NULS1.0/clientCLI.md @@ -0,0 +1,1550 @@ + +# Linux CLI Manual + +### Introduction + +​ The User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server. + +### Version Update Records + +| Version | Date updated | Contents | +| :----: | :--------: | :----------------: | +| V1.0.0 | 2018-07-12 | All functions of official version | + +### Preparation + +#### Server hardware + +**Server for creating NULS nodes shall be with configurations not lower than the following** + +| CPU | Memory | Hard Disk | Broadband | +|:---------:| :----: | :------: | :---:| +|Quad-core 3.0GHz | 16G | 128G Hard Disk | 20M Uplink | + +**Recommendation** + +| CPU | Memory | Hard Disk | Broadband | +| :---------: | :---: | :------: | :------: | +| 8-core 3.0GHz | 32G | 256G Hard Disk | 100M Uplink | + +#### Version of system and core + +**Linux system** + +- CentOS (recommended) + +It is recommended to use core of version 2.6.32 or higher. + +### Start + +#### Download + +* NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet +* GitHub:https://github.com/nuls-io/nuls-wallet-release + +* Enter [wallet download on NULS website](http://nuls.io/wallet),and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users. + + The following is for downloading wallet (v1.0.0) in Linux system: + + ```shell + $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz + ``` + + Note: the downloading link for the subsequent versions is subject to change. + +#### Install + +- Extract downloaded files in Linux system + + ```shell + $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz + ``` + +#### Operate + +- Enter bin catalogue and run startup script to start full-node wallet + + ```shell + $ cd bin + $ ./start.sh + ``` + +### Use wallet + +#### Quick-start + +- Upon confirming the wallet is started, start the command line of wallet to run it. + + Enter bin catalogue to execute the following commands: + + ```shell + $ ./cmd.sh + ``` + + Display NULS naming prompt `nuls>>> `, and then directly input NULS wallet operation command to run it. + + The following gives an example of account creating: + + ```shell + nuls>>> create + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********* + Please confirm new password:********* + [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ] + nuls>>> + ``` + + Command `create` is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully. + + + +### Conventions + +- For password: it must be 8 to 20 digits, including letters and figures. +- Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required. + +### Wallet command + +#### Help command + +All commands for output and printing + +- **Command: help [-a] ** + +| Parameter | Description | +| :--- | :------------------- | +| -a | Formatting printing command, optional | + +Return message help + +```json +getaccount
--get account information +``` + +Return message help -a + +```json +getaccount
--get account information + OPTIONS: +
the account address - Required +``` + +Example + +```shell +nuls>>> help +nuls>>> help -a +``` + + + +#### Create account + +Create account and return to account addresses collection + +- **Command: create [number] ** + +| Parameter | Description | +| :------- | :------------------- | +| [number] | Quantity of accounts created, optional | + +Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter; + +Return accounts collection + +```json +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + +Example, to create 2 accounts without password + +```shell +nuls>>> create 2 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password: +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + + + +#### Backup account + +For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account + +- **Command: backup <address> [path]** + +| Parameter | Description | +| --------------- | ---------------------------------------------------- | +| <address> | Account address, required | +| [path] | The target folder of backup files, defaults to be the current folder, optional | + +Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe. + +Return message + +```shell +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + +Example: backup of an account with password + +```shell +nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + + + +#### Remove account + +Remove local account according to account address; if the account is encrypted, insert password. + +- **Command: remove <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +Success +``` + + + +#### Set account password + +Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts. + +- **Command: setpwd <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### Change account password + +Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one. + +- **Command: resetpwd <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Enter your old password:********** +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### Set nickname + +Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source. + +- **Command:setalias <address> <alias>** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | +| <alias> | Nickname, required | + +Return message, transaction hash + +```json +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + +Example + +```shell +nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + + + +#### Imported account keystore + +Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account. + +- **Command: import keystore <path> ** + +| Parameter | Description | +| ------------ | ------------------------------ | +| <path> | Address of keystore files to be imported, required | + +Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required. + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Imported account’s private key + +Import account’s private key and create a local account. Receive failure to import if there is an existing local account. + +- **Command:import <privatekey> ** + +| Parameter | Description | +| ------------------ | ---------------- | +| <privatekey> | Account’s private key, required | + +注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Imported account’s private key (overwritten) + +Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account. + +- **Command:import <privatekey> ** + +| Parameter | Description | +| ------------------ | ---------------- | +| <privatekey> | Account’s private key, required | + +Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. + +Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import). + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Inquire account information + +Inquire account information based on account address + +- **Command:getaccount <address>** + +| Parameter | Description | +| --------------- | :------------- | +| <address> | Account address, required | + +Return message + +```json +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address + "alias" : null,//Nickname + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//Public key + "priKey" : "",//Private key (unavailable if the account is encrypted) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//Private key after encryption (unavailable if the account is encrypted) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//Creation time + "encrypted" : true//Encrypted or not (set password or not) +} +``` + +Example + +```shell +nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +} +``` + + + +#### Inquire list of accounts + +Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time + +- **Command:getaccounts <pageNumber> <pageSize>** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <pageNumber> | Page, to get the data on which page, required| +| <pageSize> | Number of data displayed on each page, required | + +Return message, output accounts collection + +```json +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address + "alias" : null,//Nickname + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",// Public key + "priKey" : "",//Private key (unavailable if the account is encrypted) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",// Private key after encryption (unavailable if the account is encrypted) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//Creation time + "encrypted" : true//Encrypted or not (set password or not) +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +Example: to get list of accounts, showing page 1, 2 items per page + +```shell +nuls>>> getaccounts 1 2 +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +#### Inquire account’s private key + +Inquire account’s private key based on account address; if the account is encrypted, insert password. + +- **Command:getprikey <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message, imported account address + +```json +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + +Example + +```shell +nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + + + +#### Inquire account balance + +Inquire account balance based on account address + +- **Command:getbalance <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> |Account address, required | + +Return message, imported account address + +```json +{ + "balance" : "9999998.99",//Balance + "locked" : "0",//Locked balance + "usable" : "9999998.99"//Available balance +} +``` + +Example + +```shell +nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "balance" : "9999998.99", + "locked" : "0", + "usable" : "9999998.99" +} +``` + + + +#### Transfer + +Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly. + +- **Command: transfer <address> <toAddress> <amount> [remark] ** + +| Parameter | Description | +| ----------------- | ----------------------------------------------- | +| <address> | transferring address, required | +| <toAddress> | receiving address, required | +| <amount> | transferred amount, round to 8 decimals in total (in NULS), required | +| [remark] | Remarks, required | + +Return message, transfer transaction hash + +```json +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` +Example + +```shell +nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer +Please enter the password. +Enter your password:********** +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` + + + +#### Inquire transaction details + +Inquire transaction details as per transaction hash + +- **Command:gettx <hash>** + +| Parameter | Description | +| ------------ | -------------- | +| <hash> | Transaction hash, required | + +Return message, transaction details + +```json +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash + "type" : "transfer",//Transaction type (transfer transaction as an example) + "time" : "2018-07-16 11:21:46",//Transaction time + "blockHeight" : 26269,//Block height of package transaction + "fee" : "0.001",//Transaction service charge + "value" : "100",//(Transfer) transaction amount + "remark" : "Transfer",//remarks + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//Signature + "status" : "confirm",//Status of transaction confirmation (confirmed or unconfirmed) + "confirmCount" : 46,//Times of confirmation + "size" : 254,//Size of transaction + "inputs" : [ {//Input of transaction + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ {//Output of transaction + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"// Target address of transaction output (means to transfer 100 to the target address) + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//Target address of transaction output (means to give users changes) + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + +Example, to inquire transfer transaction + +```shell +nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596 +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "type" : "transfer", + "time" : "2018-07-16 11:21:46", + "blockHeight" : 26269, + "fee" : "0.001", + "value" : "100", + "remark" : "Transfer", + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1", + "status" : "confirm", + "confirmCount" : 46, + "size" : 254, + "inputs" : [ { + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T", + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + + + +#### Inquire list of transactions + +Inquire list of transactions in this account based on account address + +- **Command:gettxlist <address> <pageNumber> <pageSize>** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> |Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message, transaction details + +```json +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//Transaction hash + "blockHeight" : 26473,//Block height of transaction + "time" : "2018-07-16 11:55:43",//Transaction time + "txType" : "transfer",//Transaction type + "status" : 1,//Status of confirmation + "info" : "+100"//Message +},{ + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + +Example + +```shell +nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10 +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e", + "blockHeight" : 26473, + "time" : "2018-07-16 11:55:43", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +}, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + + + +#### Create node + +Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least. + +- **Command:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> ** + +| Parameter | Description | +| ---------------------- | ------------------------------------------------------------ | +| <agentAddress> | Account address of nodes created, required | +| <packingAddress> | Node account package address, required (note: the account shall have no password, otherwise the node cannot package) | +| <commissionRate> | Agent commission proportion, with a range of 10~100, required | +| <deposit> | Node creating deposit of 2 at least, required | + +Return message, agent hash of return node + +```json +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + +Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS + +```shell +nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 +Please enter the password. +Enter your password:********** +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + + + +#### Include consensus (agency node) + +Include consensus of 2000NULS at least based on account address and node agent hash + +- **Command:deposit <address> <agentHash> <deposit> ** + +| Parameter | Description | +| ----------------- | -------------------------------------- | +| <address> | Account address, required | +| <agentHash> | Node agent hash, required | +| <deposit> | Include consensus deposit, not less than 2000NULS, required | + +Return message, transaction hash for including consensus; to exit the consensus, require such hash. + +```json +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + +Example + +```shell +nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + + + +#### Exit the consensus (agency) + +Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent. + +- **Command: withdraw <address> <txHash> ** + +| Parameter | Description | +| --------------- | ---------------------- | +| <address> | Account address, required | +| <txHash> | Transaction hash upon agency, required | + +Return message, transaction hash upon exiting the consensus + +```json +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + +Example + +```shell +nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + + + +#### Stop node + +Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours. + +- **Command:stopagent <address> ** + +| Parameter | Description | +| --------------- | -------------- | +| <address> | Account address, required | + +Return message, transaction hash of stop node + +```json +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + +Example + +```shell +nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the password. +Enter your password:********** +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + + + +#### Get node details + +Get node details as per agent hash of node + +- **Command: getagent <agentHash> ** + +| Parameter | Description | +| ----------------- | --------------------- | +| <agentHash> | Node agent hash, required | + +Return message + +```json +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 60.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "35024DE6",//Node ID + "time" : "2018-07-16 16:33:38",//Time for creating node + "blockHeight" : 28141,// Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",// Status + "creditVal" : 0.05,//Credit value + "totalDeposit" : "208000",//Current total agency amount of node + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//Quantity of participants +} +``` + +Example + +```shell +nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6 +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.05, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} +``` + + + +#### Get list of nodes + +As per list of consensus nodes + +- **Command:getagents <pageNumber> <pageSize> ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message + +```json +[{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 60.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "35024DE6",//Node ID + "time" : "2018-07-16 16:33:38",//Time for creating node + "blockHeight" : 28141,//Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",//Status + "creditVal" : 0.05,//Credit value + "totalDeposit" : "208000",//Current total agent amount of node + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//Quantity of participants +}] +``` + +Example + +```shell +nuls>>> getagents 1 2 +[ { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.18, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +}, { + "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7", + "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "deposit" : "20000", + "commissionRate" : 10.0, + "agentName" : null, + "agentId" : "5CE291D8", + "time" : "2018-07-16 16:31:12", + "blockHeight" : 28126, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.16, + "totalDeposit" : "208000", + "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "memberCount" : 5 +} ] +``` + + + +#### Get total information of network consensuses + +Inquire total information of network consensuses + +- **Command:getconsensus ** + +Return message + +```json +{ + "agentCount" : 6,//Quantity of nodes + "totalDeposit" : "1758000",//Total quantity of agents + "rewardOfDay" : "0",//Bonus + "consensusAccountNumber" : 6,//Quantity of consensus accounts + "packingAgentCount" : 6//Quantity of package addresses +} +``` + +Example + +```shell +nuls>>> getconsensus +{ + "agentCount" : 6, + "totalDeposit" : "1758000", + "rewardOfDay" : "0", + "consensusAccountNumber" : 6, + "packingAgentCount" : 6 +} +``` + + + +#### Get general of agents in single account + +Get the general of all agents (consensuses) information of the account based on account address + +- **Command:getdepositedinfo <address> ** + +| Parameter | Description | +| --------------- | -------------- | +| <address> |Account address, required | + +Return message + +```json +{ + "agentCount" : 1,//Quantity of nodes created + "totalDeposit" : "1600000",// Quantity of total agents + "joinAgentCount" : 6,//Quantity of nodes in agency + "usableBalance" : "8048998.869",//Available balance + "reward" : "219.65910271",//Total bonuses gained + "rewardOfDay" : "219.65910271",//Bonuses gained a day + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//Node hash +} +``` + +Example + +```shell +nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "agentCount" : 1, + "totalDeposit" : "1600000", + "joinAgentCount" : 6, + "usableBalance" : "8048998.869", + "reward" : "219.65910271", + "rewardOfDay" : "219.65910271", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd" +} +``` + + + +#### Get list of agent information of single account + +Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash. + +- **Command:getdepositeds <address> <pageNumber> <pageSize> [agentHash] ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> | Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | +| [agentHash] | Node hash, optional | + +Return message + +```json +[{ + "deposit" : "2000",//Agency amount + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Address of agent + "time" : "2018-07-16 16:38:25",//Time + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//Agency transaction hash + "blockHeight" : 28148,//Block height of transaction + "delHeight" : -1, + "status" : "consensus",//Node status + "agentName" : "35024DE6",//Node name + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//Node address +}] +``` + +Example + +```shell +nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "deposit" : "2000", + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:25", + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221", + "blockHeight" : 28148, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "35024DE6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh" +}, { + "deposit" : "2000", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:43", + "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234", + "blockHeight" : 28149, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "E09EB7FD", + "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT" +} ] +``` + + + +#### Get list of agency nodes of single account + +Inquire list of agency nodes asper address (return list of node information) + +- **Command:getdepositedagents <address> <pageNumber> <pageSize> ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> |Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message + +```json +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//Node hash + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Account address for creating node + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//Node package (block) address + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 40.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "0198ACAF",// Node ID + "time" : "2018-07-16 16:32:52",//Time for creating node + "blockHeight" : 28136,//Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",//Status + "creditVal" : -0.91,//Credit value + "totalDeposit" : "204000",//Current total agent amount of node + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3// Quantity of participants +}] +``` + +Example, to get page 1, display 2 items per page + +```shell +nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr", + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "deposit" : "20000", + "commissionRate" : 40.0, + "agentName" : null, + "agentId" : "0198ACAF", + "time" : "2018-07-16 16:32:52", + "blockHeight" : 28136, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.91, + "totalDeposit" : "204000", + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3 +}, { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.91, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} ] +``` + + + +#### Get the latest block head information + +Get the latest block head information + +- **Command:getbestblockheader** + +Return message + +```json +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//Block hash + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//Former block hash + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//Merkle hash + "time" : "2018-07-17 10:25:40",//Block generation time + "height" : 33950,//Block height + "txCount" : 1,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 668413,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-17 10:25:30",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0",//Consensus bonus + "fee" : "0",//Package service charge of block + "confirmCount" : 0,//Times of confirmation + "size" : 204,//Size of block + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"// Signature +} +``` + +Example + +```shell +nuls>>> getbestblockheader +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e", + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d", + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877", + "time" : "2018-07-17 10:25:40", + "height" : 33950, + "txCount" : 1, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 668413, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-17 10:25:30", + "packingIndexOfRound" : 1, + "reward" : "0", + "fee" : "0", + "confirmCount" : 0, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9" +} +``` + + + +#### Inquire block information + +Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. + +- **Command:getblock <hash> | <height> ** + +| Parameter | Description | +| -------------- | ------------ | +| <hash> | Block hash | +| <height> | Height of block | + +Return message + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash + "time" : "2018-07-16 16:29:30",//Block generation time + "height" : 28115,//Block height + "txCount" : 2,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 662578,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0.001",//Consensus bonus + "fee" : "0.001",//Package service charge of block + "confirmCount" : 6174,//Times of confirmation + "size" : 507,//Size of block + "txList" : [ {//Transaction collection + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//Transaction hash + "type" : "coinbase",//Transaction type + "time" : "2018-07-16 16:29:30",//Transaction time + "blockHeight" : 28115,//Block height of transaction + "fee" : "0",//Transaction service charge + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ],//Transaction input + "outputs" : [ //Transaction output + { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } + ] + }], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature +} +``` + +Example: to get block as per height + +```shell +nuls>>> getblock 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6174, + "size" : 507, + "txList" : [ { + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841", + "type" : "coinbase", + "time" : "2018-07-16 16:29:30", + "blockHeight" : 28115, + "fee" : "0", + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ], + "outputs" : [ { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } ] + }, { + "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b", + "type" : "transfer", + "time" : "2018-07-16 16:29:27", + "blockHeight" : 28115, + "fee" : "0.001", + "value" : null, + "remark" : null, + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663", + "status" : "confirm", + "confirmCount" : 6174, + "size" : 249, + "inputs" : [ { + "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 972899896100000 + } ], + "outputs" : [ { + "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne", + "value" : 3000000000000, + "lockTime" : 0 + }, { + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 969899896000000, + "lockTime" : 0 + } ] + } ], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### Inquire block head information + +Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. + +- **Command:getblockheader <hash> | <height> ** + +| Parameter | Description | +| -------------- | ------------ | +| <hash> | Block hash | +| <height> | Block height | + +Return message + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash + "time" : "2018-07-16 16:29:30",//Block generation time + "height" : 28115,//Block height + "txCount" : 2,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 662578,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0.001",//Consensus bonus + "fee" : "0.001",//Package service charge of block + "confirmCount" : 6174,//Times of confirmation + "size" : 507,//Size of block + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature +} +``` + +Example: to get block as per height + +```shell +nuls>>> getblockheader 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6280, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### Inquire network information + +Inquire network basic information + +- **Command:getnetinfo ** + +Return message + +```json +{ + "localBestHeight" : 35317,//Height of local latest block + "netBestHeight" : 35317,//Height of latest block online + "timeOffset" : "0ms",//Offset of network time + "inCount" : 0,//Quantity of passive connecting nodes + "outCount" : 1//Quantity of active connecting nodes +} +``` + +Example + +```shell +nuls>>> getnetinfo +{ + "localBestHeight" : 35317, + "netBestHeight" : 35317, + "timeOffset" : "0ms", + "inCount" : 0, + "outCount" : 1 +} +``` + + + +#### Inquire network node IP + +Inquire network node IP + +- **Command: getnetnodes ** + +Return message + +```json +[ "192.168.1.223" ] +``` + +Example: get block as per height + +```shell +nuls>>> getnetnodes +[ "192.168.1.223" ] +``` + + + +#### Inquire current version information + +Inquire current version number + +- **Command:version ** + +Return message + +```json +[ "192.168.1.223" ] +``` + +Example + +```shell +nuls>>> version +{ + "myVersion" : "1.0.0", + "newestVersion" : "0.9.11", + "upgradable" : false, + "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing" +} +``` + + + +#### Version update + +Inquire current version number + +- **Command:upgrade <version> ** + +Example + +```shell +nuls>>> version 1.0.0 +``` + + + +#### Exit wallet command program + +Exiting from wallet command line program does not mean exiting from wallet node started. + +- **Command:exit** + +Example + +```shell +nuls>>> exit +``` diff --git a/docs/NULS1.0/connectMainnet.md b/docs/NULS1.0/connectMainnet.md new file mode 100644 index 00000000..af6d500c --- /dev/null +++ b/docs/NULS1.0/connectMainnet.md @@ -0,0 +1,49 @@ +# Connect Main-net + +## Downloading wallet + +The NULS main-net wallet is available in Windows, Linux and Mac versions, and is constantly updated. You can download for your operating system of choice. + +Option 1: downloading from the official website (https://nuls.io/newWallet) + +![1546518367717](./img/1546518367717.png) + +Option 2: downloading from github (https://github.com/nuls-io/nuls/releases) + +![1546518556230](./img/1546518556230.png) + +Note: The version marked [Main-net] is the main-net wallet. + +## Launching wallet + +After the wallet is downloaded, unzip it according to specific operating systems. + +For Windows users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet. + +![1546518956812](./img/1546518956812.png) + +Double-click NULS-Wallet.exe to launch and run the wallet. The browser will automatically open the wallet interface by default, as shown below: + +![1546519370742](./img/1546519370742.png) + +When the interface is opened for the first time, the page will prompt that currently the block is being synchronized, as shown below: + +![1546519548787](./img/1546519548787.png) + +The appearance of block synchronization means the successful connection to the NULS main-net. Once the synchronization is completed, the wallet can be used normally. To save time, users who do not want to resynchronize data from the first block can also download the latest block data package corresponding to each version on github, as shown below: + +![1546520020388](./img/1546520020388.png) + + +For Linux users, the wallet is unzipped as shown below: the data folder and the logs folder are generated after the first run of the wallet. + +![1546520382686](./img/1546520382686.png) + +Run the command sh bin/start.sh to launch the wallet. Then run the command sh bin/cmd.sh to enter the NULS wallet command line interface (CLI). Run the command getnetinfo on the CLI to check the current network status. When the localBestHeight increases, it indicates that the main-net has been successfully connected, as shown below: + +![1546520727643](./img/1546520727643.png) + +Users can also track the nuls.log in the logs folder to check the latest status of the wallet. + + +For MAC users, steps are almost the same as the Windows users, so let’s skip it. \ No newline at end of file diff --git a/docs/NULS1.0/developerManual.md b/docs/NULS1.0/developerManual.md new file mode 100644 index 00000000..38e8c550 --- /dev/null +++ b/docs/NULS1.0/developerManual.md @@ -0,0 +1,1232 @@ +# Development Manual + +## 1. Introduction + +NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3. + +## 2. Development environment + +### 2.1 Setup of NULS wallet + +### 2.2 Setup of JDK 8 + +### 2.3 Setup of IntelliJ IDEA + +NULS smart contract adopts IntelliJ IDEA as development tool + +### 2.4 Setup of NULS smart contract plug-ins + +[Click to download the plugin](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) + +NULS smart contract plug-ins provide the following main functions: + +* Newly create NULS contract project +* Provide the unavailable Java properties, classes ad methods +* Compile, package and deploy contracts +* Display and call contract methods + +## 3. NULS smart contract specifications and syntax + +NULS smart contract syntax is a subset of Java syntax, with some restrictions + +### 3.1 NULS smart contract specifications + +> **_Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract._** + +### 3.2 Keywords + +Java key words are listed as follows and those not applicable for NULS smart contract will be marked + +Access control + +* public +* protected +* private + +Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class + +* class +* interface +* abstract +* implements +* extends +* new + +Key words of package + +* import +* package + +Key words of data type + +* byte +* char +* boolean +* short +* int +* float +* long +* double +* void +* null +* true +* false + +Conditional loops (process control) + +* if +* else +* while +* for +* switch +* case +* default +* do +* break +* continue +* return +* instanceof + +Error processing + +* catch +* try +* finally +* throw +* throws + +Modification method, class, property and variables + +* static +* final +* super +* this +* native(not supported) +* strictfp(not supported) +* synchronized(not supported) +* transient(not supported) +* volatile(not supported) + +other + +* enum(not supported) +* assert(not supported) + +### 3.3 Basic syntax + +The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java + +* Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign +* Basic data type: byte short int long float double char boolean +* Reference data type: class, interface, array +* Arithmetic operators: + - * /%++ - +* Relational operator: > <> = <= ==! = +* Logical Operators: ! &| ^ && || +* Bit operator: &| ^~>> << >>> +* Assignment operator: = +* Extension assignment operators: + = - = * = / = +* String link operator: + +* Conditional operators: ? : +* Process control sentence (if, switch, for, while, do...while) + + +### 3.4 Available class + +NULS smart contract can be developed with the following class + +* io.nuls.contract.sdk.Address +* io.nuls.contract.sdk.Block +* io.nuls.contract.sdk.BlockHeader +* io.nuls.contract.sdk.Contract +* io.nuls.contract.sdk.Event +* io.nuls.contract.sdk.Msg +* io.nuls.contract.sdk.Utils +* io.nuls.contract.sdk.annotation.View +* io.nuls.contract.sdk.annotation.Required +* io.nuls.contract.sdk.annotation.Payable +* java.lang.Boolean +* java.lang.Byte +* java.lang.Short +* java.lang.Character +* java.lang.Integer +* java.lang.Long +* java.lang.Float +* java.lang.Double +* java.lang.String +* java.lang.StringBuilder +* java.math.BigInteger +* java.math.BigDecimal +* java.util.Collection +* java.util.List +* java.util.ArrayList +* java.util.LinkedList +* java.util.Map +* java.util.HashMap +* java.util.LinkedHashMap +* java.util.Set +* java.util.HashSet + +### 3.5 Other restrictions + +* Contract class can have one construction method. No restriction for other classes +* The maximum gas consumption for executing a contract method once is 10 million, including the method of the `@View` type, Make sure to optimize the contract code as much as possible. + +## 4. Nuls smart contract example + +a simple contract + +> **_Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract_** + + +```java + +package contracts.examples; + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +public class SimpleStorage implements Contract { + + private String storedData; + + @View + public String getStoredData() { + return storedData; + } + + @Payable + public void setStoredData(@Required String storedData) { + this.storedData = storedData; + } + +} +``` + +In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details +The project has several classes and interfaces + +When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class + +After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status + + +Explanatory comments + +@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means + +@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in + +@Required labels the parameter of @Required. When it is called, there must be transfer-in value + +Go to download NULS source code on github, and get some contract examples + +## 5. NULS Contract SDK + +Contract SDK provides several classes to be convenient for contract development: + +### io.nuls.contract.sdk.Address + +```java +public class Address { + + private final String address; + + public Address(String address) { + valid(address); + this.address = address; + } + + /** + * Get the balance of the address (only the balance of contract address) + * + * @return + */ + public native BigInteger balance(); + + /** + * Transfer amount to the address from contract + * + * @param value transfer amount (in Na) + */ + public native void transfer(BigInteger value); + + /** + * Contract method to call the address + * + * @param Method name + * @param Method signature + * @param Parameters + * @param value Incidental currency (in Na) + */ + public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * Call the contract method of this address with a return value(String) + * + * @param Method name + * @param Method signature + * @param Parameters + * @param value Incidental currency (in Na) + * @return return value after calling the contract + */ + public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * Verify the address + * + * @param address + * @see io.nuls.kernel.utils.AddressTool#validAddress(String) + */ + private native void valid(String address); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address1 = (Address) o; + return address != null ? address.equals(address1.address) : address1.address == null; + } + + @Override + public int hashCode() { + return address != null ? address.hashCode() : 0; + } + + @Override + public String toString() { + return address; + } + +} +``` + +### io.nuls.contract.sdk.Block + +```java +public class Block { + + /** + * Given block’s head + * + * @param blockNumber + * @return + */ + public static native BlockHeader getBlockHeader(long blockNumber); + + /** + * Current block’s head + * + * @return + */ + public static native BlockHeader currentBlockHeader(); + + /** + * Newest block’s head + * + * @return + */ + public static native BlockHeader newestBlockHeader(); + + /** + * Given block’s hash + * + * @param blockNumber + * @return + */ + public static String blockhash(long blockNumber) { + return getBlockHeader(blockNumber).getHash(); + } + + /** + * + * CCurrent block’s miner address + * + * @return + */ + public static Address coinbase() { + return currentBlockHeader().getPackingAddress(); + } + + /** + * + * Current block’s No. + * + * @return + */ + public static long number() { + return currentBlockHeader().getHeight(); + } + + /** + * + * Current block’s time stamp + * + * @return + */ + public static long timestamp() { + return currentBlockHeader().getTime(); + } + +} +``` + +### io.nuls.contract.sdk.BlockHeader + +```java +public class BlockHeader { + + private String hash; + private long time; + private long height; + private long txCount; + private Address packingAddress; + private String stateRoot; + + public String getHash() { + return hash; + } + + public long getTime() { + return time; + } + + public long getHeight() { + return height; + } + + public long getTxCount() { + return txCount; + } + + public Address getPackingAddress() { + return packingAddress; + } + + public String getStateRoot() { + return stateRoot; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BlockHeader that = (BlockHeader) o; + + if (time != that.time) return false; + if (height != that.height) return false; + if (txCount != that.txCount) return false; + if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; + if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) + return false; + return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; + } + + @Override + public int hashCode() { + int result = hash != null ? hash.hashCode() : 0; + result = 31 * result + (int) (time ^ (time >>> 32)); + result = 31 * result + (int) (height ^ (height >>> 32)); + result = 31 * result + (int) (txCount ^ (txCount >>> 32)); + result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); + result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "BlockHeader{" + + "hash='" + hash + '\'' + + ", time=" + time + + ", height=" + height + + ", txCount=" + txCount + + ", packingAddress=" + packingAddress + + ", stateRoot='" + stateRoot + '\'' + + '}'; + } + +} +``` + +### io.nuls.contract.sdk.Contract + +```java +/** + * Contract interface, implemented by contract class + */ +public interface Contract { + + /** + * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation. + */ + default void _payable() { + } + +} +``` + +### io.nuls.contract.sdk.Event + +```java +/** +* Event interface, implemented by event class +*/ +public interface Event { +} +``` + +### io.nuls.contract.sdk.Msg + +```java +public class Msg { + + /** + * Remaining gas + * + * @return + */ + public static native long gasleft(); + + /** + * sender of the contract + * + * @return + */ + public static native Address sender(); + + /** + * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na + * + * @return + */ + public static native BigInteger value(); + + /** + * Gas price + * + * @return + */ + public static native long gasprice(); + + /** + * Contract address + * + * @return + */ + public static native Address address(); + +} +``` + +### io.nuls.contract.sdk.Utils + +```java +public class Utils { + + private Utils() { + } + + /** + * Check conditions; if conditions are not met, it will roll back. + * + * @param expression + */ + public static void require(boolean expression) { + if (!expression) { + revert(); + } + } + + /** + * Check conditions; if conditions are not met, it will roll back + * + * @param expression + * @param errorMessage + */ + public static void require(boolean expression, String errorMessage) { + if (!expression) { + revert(errorMessage); + } + } + + /** + * Terminate implementation and restore status + */ + public static void revert() { + revert(null); + } + + /** + * Terminate implementation and restore status + * + * @param errorMessage + */ + public static native void revert(String errorMessage); + + /** + * Send events + * + * @param event + */ + public static native void emit(Event event); + + /** + * @param seed a private seed + * @return pseudo random number (0 ~ 1) +<<<<<<< HEAD:docs/NULS1.0/developerManual.md + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param src source string (hex encoding string) + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(String hexString); + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param bytes source byte array + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(byte[] bytes); + + /** + * [Testnet]verify signature data(ECDSA) + * + * @param data(hex encoding string) + * @param signature(hex encoding string) + * @param pubkey(hex encoding string) + * @return verify result + */ + public static native boolean verifySignatureData(String data, String signature, String pubkey); + + /** + * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @param algorithm Hash algorithm identifier + * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + + /** + * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds. + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); + } + + /** + * [Testnet]Generate a random seed with a specific algorithm based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @param algorithm Hash algorithm identifier + * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + + /** + * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); + } + + /** + * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes))) + */ + public static native List getRandomSeedList(long endHeight, int seedCount); + + /** + * [Testnet]Get a collection of raw seeds based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes))) + */ + public static native List getRandomSeedList(long startHeight, long endHeight); +======= + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * @param src source string + * @return sha3-256 hash (utf-8 encode) + */ + public static native String sha3(String src); + + /** + * @param bytes source byte array + * @return sha3-256 hash + */ + public static native String sha3(byte[] bytes); +>>>>>>> 46bb1d94903094b3bd2ef86b2e87fe5d05d60f24:source/contract/index.md + +} +``` + +### io.nuls.contract.sdk.annotation.Payable + +`@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Payable { +} +``` + +### io.nuls.contract.sdk.annotation.Required + +`@Required labels the parameter of @Required. When it is called, there must be transfer-in value.` + +```java +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Required { +} +``` + +### io.nuls.contract.sdk.annotation.View + +`@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface View { +} +``` + +## 6. Main RPC interface of smart contract + +See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/) +> The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001 + +### 6.1 Create smart contract + +- POST `/api/contract/create` + +|Parameter|Type|Description| +|:-:|:-:|:-:| +|sender* |string |transaction creator | +|password* |string| password of transaction creator| +|gasLimit*| long| max. gas consumption| +|price* | long| unit price of implementation contract| +|contractCode* |string| smart contract code (byte code’s Hex coded string)| +|remark |string |remark| +|args |string[][]|Parameter list| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "gasLimit": 4687, + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "remark": "asd", + "args": [] +} +``` + + + +### 6.2 Estimate the gas consumption for creating smart contract + +- POST `/api/contract/imputedgas/create` + +|Parameter|Type|Description| +|:-:|:-:|:-:| +|sender* |string |transaction creator | +|password* |string| password of transaction creator| +|price* | long| unit price of implementation contract| +|contractCode* |string| smart contract code (byte code’s Hex coded string)| +|args |string[][]|Parameter list| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "args": [] +} +``` + + + +### 6.3 Call smart contract + +- POST `/api/contract/call` + +|Parameter|Type|Description| +|:-:|:-:|:-:| +|sender* |string |transaction creator | +|password* |string| password of transaction creator| +|contractAddress* |string| address of smart contract| +|gasLimit* | long| max. gas consumption| +|price* | long|unit price of implementation contract| +|value |long| amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)| +|methodName* |string| method name| +|methodDesc |string|method signature which may be not transferred if the method name is not repeated| +|remark |string| remark | +|args |string[][]|Parameter list| + + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "password": "", + "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U", + "gasLimit": 8000, + "price": 20, + "value": 0, + "methodName": "balance", + "methodDesc": "", + "remark": "qwe" + "args": [] +} +``` + + +### 6.4 Estimate the gas consumption for calling smart contract (see `Swagger UI`) + +- POST `/api/contract/imputedgas/call` + + + +### 6.5 Estimate the price for calling smart contract (see `Swagger UI`) +- POST `/api/contract/imputedprice` + + + +### 6.6 Terminate smart contract (see `Swagger UI`) + +- POST `/api/contract/delete` + + + +### 6.7 Call the smart contract function which is not linked to blockchain (see `Swagger UI`) + +- POST `/api/contract/view` + + + +### 6.8 Get the implementation results of smart contract (see `Swagger UI`) + +- GET `/api/contract/result/{hash}` + + + +### 6.9 Get the basic information of smart contract (see `Swagger UI`) + +- GET `/api/contract/info/{address}` + + + +### 6.10 Verify if it is contract address (see `Swagger UI`) + +- GET `/api/contract/{address}` + + + +### 6.11 Get the NULS balance of smart contract address (see `Swagger UI`) + +- GET `/api/contract/balance/{address}` + + + +### 6.12 Get the transaction details of smart contract (see `Swagger UI`) + +- GET `/api/contract/tx/{hash}` + + + +### 6.13 Get the transaction list of smart contract (see `Swagger UI`) + +- GET `/api/contract/tx/list/{address}` + + +### 6.14 Inquire contract UTXO as per address and limit (see `Swagger UI`) + +- GET `/api/contract/limit/{address}/{limit}` + + + +### 6.15 Inquire contract UTXO as per address and amount (see `Swagger UI`) + +- GET `/api/contract/amount/{address}/{amount}` + + +### 6.16 Transfer amount to smart contract (see `Swagger UI`) + +- POST `/api/contract/transfer` + + + +## 7. Example + +### 7.1 Voting smart contract code `segments` are as follows + +> Full code: `https://github.com/nuls-io/nuls-vote` + +```java +package io.nuls.vote.contract; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Utils; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.View; +import io.nuls.vote.contract.func.BaseVote; +import io.nuls.vote.contract.func.VoteInterface; +import io.nuls.vote.contract.model.VoteConfig; +import io.nuls.vote.contract.model.VoteEntity; + +import java.math.BigInteger; +import java.util.List; +import java.util.Map; + +public class VoteContract implements Contract { + + private VoteInterface baseVote; + + public VoteContract(long minRecognizance) { + baseVote = new BaseVote(BigInteger.valueOf(minRecognizance)); + } + + @Payable + public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) { + VoteEntity voteEntity = baseVote.create(title, desc, items); + + VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify); + boolean success = baseVote.init(voteEntity.getId(), config); + + Utils.require(success); + + return voteEntity; + } + + public boolean vote(long voteId, long[] itemIds) { + return baseVote.vote(voteId, itemIds); + } + + public boolean redemption(long voteId) { + return baseVote.redemption(voteId); + } + + @View + public boolean canVote(long voteId) { + return baseVote.canVote(voteId); + } + + @View + public VoteEntity queryVote(long voteId) { + return baseVote.queryVote(voteId); + } + + @View + public Map> queryVoteResult(long voteId) { + return baseVote.queryVoteResult(voteId); + } + + @View + public boolean queryAddressHasVote(long voteId, Address address) { + return baseVote.queryAddressHasVote(voteId, address); + } +} + +``` + +If the methods of smart contract include the parameter of `array type`, please use the following method to transfer parameters +> Refer to the `create` method in the aforesaid voting contract code + +```json +{ + "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", + "password": "", + "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", + "gasLimit": 200000, + "price": 1, + "value": 10000000000, + "methodName": "create", + "methodDesc": "", + "remark": "", + "args": [ +     "Test voting 1", +     "Voting contract 1", +     [ +       "Option 1", +       "Option 2", +       "Option 3" +     ], +     1536044066056, 1536184066056, false, 300, false +   ] +} +``` + + +### 7.2 Standard Token Smart contract code `segments` + +> Full code: `https://github.com/nuls-io/nuls-nrc20` + +```java +package io.nuls.contract.token; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Msg; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; + +import static io.nuls.contract.sdk.Utils.emit; +import static io.nuls.contract.sdk.Utils.require; + +public class SimpleToken implements Contract, Token { + + private final String name; + private final String symbol; + private final int decimals; + private BigInteger totalSupply = BigInteger.ZERO; + + private Map balances = new HashMap(); + private Map> allowed = new HashMap>(); + + @Override + @View + public String name() { + return name; + } + + @Override + @View + public String symbol() { + return symbol; + } + + @Override + @View + public int decimals() { + return decimals; + } + + @Override + @View + public BigInteger totalSupply() { + return totalSupply; + } + + public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) { + this.name = name; + this.symbol = symbol; + this.decimals = decimals; + totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));; + balances.put(Msg.sender(), totalSupply); + emit(new TransferEvent(null, Msg.sender(), totalSupply)); + } + + @Override + @View + public BigInteger allowance(@Required Address owner, @Required Address spender) { + Map ownerAllowed = allowed.get(owner); + if (ownerAllowed == null) { + return BigInteger.ZERO; + } + BigInteger value = ownerAllowed.get(spender); + if (value == null) { + value = BigInteger.ZERO; + } + return value; + } + + @Override + public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) { + subtractAllowed(from, Msg.sender(), value); + subtractBalance(from, value); + addBalance(to, value); + emit(new TransferEvent(from, to, value)); + return true; + } + + @Override + @View + public BigInteger balanceOf(@Required Address owner) { + require(owner != null); + BigInteger balance = balances.get(owner); + if (balance == null) { + balance = BigInteger.ZERO; + } + return balance; + } + + @Override + public boolean transfer(@Required Address to, @Required BigInteger value) { + subtractBalance(Msg.sender(), value); + addBalance(to, value); + emit(new TransferEvent(Msg.sender(), to, value)); + return true; + } + + @Override + public boolean approve(@Required Address spender, @Required BigInteger value) { + setAllowed(Msg.sender(), spender, value); + emit(new ApprovalEvent(Msg.sender(), spender, value)); + return true; + } + + public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) { + addAllowed(Msg.sender(), spender, addedValue); + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) { + check(subtractedValue); + BigInteger oldValue = allowance(Msg.sender(), spender); + if (subtractedValue.compareTo(oldValue) > 0) { + setAllowed(Msg.sender(), spender, BigInteger.ZERO); + } else { + subtractAllowed(Msg.sender(), spender, subtractedValue); + } + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + private void addAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance); + check(value); + setAllowed(address1, address2, allowance.add(value)); + } + + private void subtractAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance, value, "Insufficient approved token"); + setAllowed(address1, address2, allowance.subtract(value)); + } + + private void setAllowed(Address address1, Address address2, BigInteger value) { + check(value); + Map address1Allowed = allowed.get(address1); + if (address1Allowed == null) { + address1Allowed = new HashMap(); + allowed.put(address1, address1Allowed); + } + address1Allowed.put(address2, value); + } + + private void addBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(value, "The value must be greater than or equal to 0."); + check(balance); + balances.put(address, balance.add(value)); + } + + private void subtractBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(balance, value, "Insufficient balance of token."); + balances.put(address, balance.subtract(value)); + } + + private void check(BigInteger value) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0); + } + + private void check(BigInteger value1, BigInteger value2) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0); + } + + private void check(BigInteger value, String msg) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg); + } + + private void check(BigInteger value1, BigInteger value2, String msg) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0, msg); + } + + + +} + +``` + + + + + diff --git a/docs/NULS1.0/ideaPlugin.md b/docs/NULS1.0/ideaPlugin.md new file mode 100644 index 00000000..3f535190 --- /dev/null +++ b/docs/NULS1.0/ideaPlugin.md @@ -0,0 +1,99 @@ +# IDEA Plugin + +#### 1 Install NULS Plugin on IDEA +- [Get NULS plugin](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk + +![Install](./pluginImages/Install.jpg) + +- Select the said ZIP, and click OK + +![Install](./pluginImages/Install2.jpg) + +- Tick NULS plugin, and click Apply + +![Install](./pluginImages/Install3.jpg) + +#### 2 Create a NULS project + +![create](./pluginImages/createProject.jpg) + +Input Project name, click finish + +![create](./pluginImages/createProject2.jpg) + +#### 3 Compile smart contract + +Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/) + +![code](./pluginImages/code.jpg) + +#### 4 Set and deploy the node and account for contract + +- Click NULS plugin on the right, and call NULS plugin interface + + ![code](./pluginImages/Deploy.jpg) + +- Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address. + + Click + on the top left corner of panel, and select Add Node. + + ![code](./pluginImages/Add.jpg) + +- Input Node address and clock OK + + ![code](./pluginImages/Add3.jpg) + +- Click + on the top left corner of panel, and select Add Account. Input Account address and click OK. + + ![code](./pluginImages/Add5.jpg) + +#### 5 Package contract + +- Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code + + ![code](./pluginImages/package.jpg) + +- Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step). + + ![code](./pluginImages/package1.jpg) + +- Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface + + ![code](./pluginImages/package3.jpg) + + ![code](./pluginImages/package2.jpg) + +#### 6 Deploy contract + +- On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step. + + ![code](./pluginImages/package4.jpg) + +- Parameters following JarFilePath are the parameters of the contract construction function. + + ![code](./pluginImages/Deploy2.jpg) + +- Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract. + + ![code](./pluginImages/Deploy3.jpg) + +- Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success. + + ![code](./pluginImages/Deploy4.jpg) + +- If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment. + + ![code](./pluginImages/Deploy5.jpg) + +- Review the deployed contract on the top of panel + + ![code](./pluginImages/Deploy6.jpg) + +- Click the deployed contract to review all method of this contract + + ![code](./pluginImages/Deploy7.jpg) + + + diff --git a/docs/NULS1.0/images/image-20190103193901967.png b/docs/NULS1.0/images/image-20190103193901967.png new file mode 100644 index 00000000..5333535f Binary files /dev/null and b/docs/NULS1.0/images/image-20190103193901967.png differ diff --git a/docs/NULS1.0/img/1546518367717.png b/docs/NULS1.0/img/1546518367717.png new file mode 100644 index 00000000..52ffebcd Binary files /dev/null and b/docs/NULS1.0/img/1546518367717.png differ diff --git a/docs/NULS1.0/img/1546518556230.png b/docs/NULS1.0/img/1546518556230.png new file mode 100644 index 00000000..3efe6603 Binary files /dev/null and b/docs/NULS1.0/img/1546518556230.png differ diff --git a/docs/NULS1.0/img/1546518956812.png b/docs/NULS1.0/img/1546518956812.png new file mode 100644 index 00000000..f750592e Binary files /dev/null and b/docs/NULS1.0/img/1546518956812.png differ diff --git a/docs/NULS1.0/img/1546519370742.png b/docs/NULS1.0/img/1546519370742.png new file mode 100644 index 00000000..fb1f2b6c Binary files /dev/null and b/docs/NULS1.0/img/1546519370742.png differ diff --git a/docs/NULS1.0/img/1546519505355.png b/docs/NULS1.0/img/1546519505355.png new file mode 100644 index 00000000..f39780b7 Binary files /dev/null and b/docs/NULS1.0/img/1546519505355.png differ diff --git a/docs/NULS1.0/img/1546519548787.png b/docs/NULS1.0/img/1546519548787.png new file mode 100644 index 00000000..99653773 Binary files /dev/null and b/docs/NULS1.0/img/1546519548787.png differ diff --git a/docs/NULS1.0/img/1546520020388.png b/docs/NULS1.0/img/1546520020388.png new file mode 100644 index 00000000..753bfa6c Binary files /dev/null and b/docs/NULS1.0/img/1546520020388.png differ diff --git a/docs/NULS1.0/img/1546520382686.png b/docs/NULS1.0/img/1546520382686.png new file mode 100644 index 00000000..b088b4b0 Binary files /dev/null and b/docs/NULS1.0/img/1546520382686.png differ diff --git a/docs/NULS1.0/img/1546520727643.png b/docs/NULS1.0/img/1546520727643.png new file mode 100644 index 00000000..6f0fd5fc Binary files /dev/null and b/docs/NULS1.0/img/1546520727643.png differ diff --git a/docs/NULS1.0/img/1546586728639.png b/docs/NULS1.0/img/1546586728639.png new file mode 100644 index 00000000..92909f3a Binary files /dev/null and b/docs/NULS1.0/img/1546586728639.png differ diff --git a/source/contract/pluginImages/1536204986(1).jpg b/docs/NULS1.0/pluginImages/1536204986(1).jpg similarity index 100% rename from source/contract/pluginImages/1536204986(1).jpg rename to docs/NULS1.0/pluginImages/1536204986(1).jpg diff --git a/source/zh-cn/contract/pluginImages/Add.jpg b/docs/NULS1.0/pluginImages/Add.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Add.jpg rename to docs/NULS1.0/pluginImages/Add.jpg diff --git a/source/zh-cn/contract/pluginImages/Add3.jpg b/docs/NULS1.0/pluginImages/Add3.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Add3.jpg rename to docs/NULS1.0/pluginImages/Add3.jpg diff --git a/source/zh-cn/contract/pluginImages/Add5.jpg b/docs/NULS1.0/pluginImages/Add5.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Add5.jpg rename to docs/NULS1.0/pluginImages/Add5.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy.jpg b/docs/NULS1.0/pluginImages/Deploy.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy.jpg rename to docs/NULS1.0/pluginImages/Deploy.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy2.jpg b/docs/NULS1.0/pluginImages/Deploy2.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy2.jpg rename to docs/NULS1.0/pluginImages/Deploy2.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy3.jpg b/docs/NULS1.0/pluginImages/Deploy3.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy3.jpg rename to docs/NULS1.0/pluginImages/Deploy3.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy4.jpg b/docs/NULS1.0/pluginImages/Deploy4.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy4.jpg rename to docs/NULS1.0/pluginImages/Deploy4.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy5.jpg b/docs/NULS1.0/pluginImages/Deploy5.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy5.jpg rename to docs/NULS1.0/pluginImages/Deploy5.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy6.jpg b/docs/NULS1.0/pluginImages/Deploy6.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy6.jpg rename to docs/NULS1.0/pluginImages/Deploy6.jpg diff --git a/source/zh-cn/contract/pluginImages/Deploy7.jpg b/docs/NULS1.0/pluginImages/Deploy7.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Deploy7.jpg rename to docs/NULS1.0/pluginImages/Deploy7.jpg diff --git a/source/zh-cn/contract/pluginImages/Install.jpg b/docs/NULS1.0/pluginImages/Install.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Install.jpg rename to docs/NULS1.0/pluginImages/Install.jpg diff --git a/source/zh-cn/contract/pluginImages/Install2.jpg b/docs/NULS1.0/pluginImages/Install2.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Install2.jpg rename to docs/NULS1.0/pluginImages/Install2.jpg diff --git a/source/zh-cn/contract/pluginImages/Install3.jpg b/docs/NULS1.0/pluginImages/Install3.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/Install3.jpg rename to docs/NULS1.0/pluginImages/Install3.jpg diff --git a/source/zh-cn/contract/pluginImages/code.jpg b/docs/NULS1.0/pluginImages/code.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/code.jpg rename to docs/NULS1.0/pluginImages/code.jpg diff --git a/source/zh-cn/contract/pluginImages/createProject.jpg b/docs/NULS1.0/pluginImages/createProject.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/createProject.jpg rename to docs/NULS1.0/pluginImages/createProject.jpg diff --git a/source/zh-cn/contract/pluginImages/createProject2.jpg b/docs/NULS1.0/pluginImages/createProject2.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/createProject2.jpg rename to docs/NULS1.0/pluginImages/createProject2.jpg diff --git a/source/zh-cn/contract/pluginImages/package.jpg b/docs/NULS1.0/pluginImages/package.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/package.jpg rename to docs/NULS1.0/pluginImages/package.jpg diff --git a/source/zh-cn/contract/pluginImages/package1.jpg b/docs/NULS1.0/pluginImages/package1.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/package1.jpg rename to docs/NULS1.0/pluginImages/package1.jpg diff --git a/source/zh-cn/contract/pluginImages/package2.jpg b/docs/NULS1.0/pluginImages/package2.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/package2.jpg rename to docs/NULS1.0/pluginImages/package2.jpg diff --git a/source/zh-cn/contract/pluginImages/package3.jpg b/docs/NULS1.0/pluginImages/package3.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/package3.jpg rename to docs/NULS1.0/pluginImages/package3.jpg diff --git a/source/zh-cn/contract/pluginImages/package4.jpg b/docs/NULS1.0/pluginImages/package4.jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/package4.jpg rename to docs/NULS1.0/pluginImages/package4.jpg diff --git a/docs/NULS1.0/randomImplementations.md b/docs/NULS1.0/randomImplementations.md new file mode 100644 index 00000000..5a01b860 --- /dev/null +++ b/docs/NULS1.0/randomImplementations.md @@ -0,0 +1,72 @@ +# Ways of creating random numbers + +> References: +> +> [Solidity Pitfalls: Random Number Generation for Ethereum] +(https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/) +> +> [Predicting Random Numbers in Ethereum Smart Contracts] +(https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620) + +### 1. ` Linear Congruential Generator (LCG)`: algorithm to generate pseudorandom numbers + +The NULS smart contract SDK provides a way to create random numbers. It takes the current block's miner address, contract address, contract invoker address, and current block’s timestamp as random factors, and uses the algorithm `linear congruential generator (LCG)` to generate pseudorandom numbers + +Invoking like this: + +```java +io.nuls.contract.sdk.Utils.pseudoRandom(); +/** + * add a random factor + */ +io.nuls.contract.sdk.Utils.pseudoRandom(long seed); +``` + +-- + +### 2. Using the `BlockHash` of the future block + +Taking lottery as an example, it needs to invoke contract transactions twice - close the lottery and pick the winner. + +Once the lottery is closed, record the current block height H1 and generate a number N. Pick the winner when the height of the future block reaches `H1+N`。 + +When picking the winner, add up the recorded block height H1 and block number in interval (0~80] (to be determined) to the block height H2, and take the `BlockHash` of the block H2 as a random seed. + +ETH cannot use this way for the following reasons: +![](https://cdn-images-1.medium.com/max/1600/1*eyNTfWTkmM-3YuMca-1H0A.png) + +-- + +### 3. Random seeds limited to participants + +In the case of lottery, we need more arbitrary data for picking our winner. When we determine the winner, we can use the addresses of the players that have entered our lottery smart contract as random factors to generate random numbers. + +-- + +### 4. commit-reveal + +Also take the lottery as an example. + +* The contract sets aside awards for the random number. + +* Each user generates own secret random number N. + +* Users can hash their N and address to generate the hash value of their secret random numbers: String hash = sha3(N + Msg.sender()). + +Note: step 2 and 3 should be performed locally, for instance, the user submits N to the lottery application, which performs the hash operation. + +* Users submit their hash to the smart contract. + +* Submission is open until the number of blocks reaches a certain value, or until enough participants join. + +* Once the submission is closed, it’s time to pick the winner. + +* Each user submits their random number N to the smart contract. + +* The contract verifies sha3 (N + Msg.sender()) to match the original submission. + +* If the user fails to submit a valid N in time, his deposit will be forfeited. + +* Perform XOR operation on all-verified N to get random numbers. + +* These numbers are used to determine the winners --> (N % numUsers). \ No newline at end of file diff --git a/docs/NULS1.0/randomRPC.md b/docs/NULS1.0/randomRPC.md new file mode 100644 index 00000000..4f323f4e --- /dev/null +++ b/docs/NULS1.0/randomRPC.md @@ -0,0 +1,353 @@ +# Wallet adds a random seed +## Wallet adds a random seed RPC interface + +The random seed you get is a big number, and notice, it could be a negative number + +### Get a random seed list based on the height interval + +URL:/random/seeds/height + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| ----------- | ---- | -------- | -------------------------------------- | +| startHeight | Long | True | Initial height of interval | +| endHeight | Long | True | Interval cutoff height, cannot exceed startHeight+1000 | + +Returns: + +| field | type | Remark | +| ------- | ------- | -------- | +| success | boolean | Successful or not | +| data | array | The seed array | + +Example: + +Request: + +``` +curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": [ + "8486473738212806059384942122915964966516544811115122625378589706648696927875", + "5763677830362183770819418466587054532227472729077319516033962399030101482330", + "-21576822359476915572374120992682286995340746526938743512234391635989859550499", + "21657748356022199241379814087980601843534504184851063250908405386419429001546", + "-31320197741848993348465901825403870475226356831977749494101003161293910010564", + "16054257794265746474880657765642725318937086559191102027715411501558318980478", + "39222628335763902261547055653161137231901517785016195993008289217415793052023", + "28759812140738813907858073405869390691919557824743093132519210315994120629868", + "26779511442264535228335930919961858598639368721086477781863239801135250744386", + "-23481782415506504277094909296039579696138464413290902597168011374639343982630" + ] +} +``` + +### Get random seed list according to height interval + +URL:/random/seeds/count + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| --------- | ---- | -------- | ------------------------- | +| height | Long | True | Gets the maximum height of the seed list | +| count | Long | True | Random seed count, no more than 128 | + +Returns: + +| field | type | Remark | +| ------- | ------- | -------- | +| success | boolean | Successful or not | +| data | array | The seed array | + +Example: + +Request: + +``` +curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": [ + "8486473738212806059384942122915964966516544811115122625378589706648696927875", + "5763677830362183770819418466587054532227472729077319516033962399030101482330", + "-21576822359476915572374120992682286995340746526938743512234391635989859550499", + "21657748356022199241379814087980601843534504184851063250908405386419429001546", + "-31320197741848993348465901825403870475226356831977749494101003161293910010564", + "16054257794265746474880657765642725318937086559191102027715411501558318980478", + "39222628335763902261547055653161137231901517785016195993008289217415793052023", + "28759812140738813907858073405869390691919557824743093132519210315994120629868", + "26779511442264535228335930919961858598639368721086477781863239801135250744386", + "-23481782415506504277094909296039579696138464413290902597168011374639343982630" + ] +} +``` + +### According to the algorithm, the list of random seeds obtained through height interval is calculated as a random seed, and the following is returned + +URL:/random/seed/height + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| ----------- | ------ | -------- | -------------------------------------------- | +| startHeight | Long | True | Initial height of interval | +| endHeight | Long | True | Interval cut-off height,endHeight-startHeight<=1000 | +| algorithm | String | false | The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm | + +Returns: + +| field | type | Remark | +| --------- | ------- | ------------------ | +| success | boolean | Successful or not | +| data | Object | The result object | +| seed | String | Calculate the random seed result | +| algorithm | String | Computational algorithm | +| count | int | Number of original random seeds | + +Example: + +Request: + +``` +curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": { + "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457", + "algorithm": "sha3", + "count": 10 + } +} +``` + +### According to the algorithm, the list of random seeds obtained by height and quantity is calculated as a random seed, and the following is returned + +URL:/random/seed/count + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| --------- | ------ | -------- | -------------------------------------------- | +| height | Long | True | Gets the maximum height of the seed list | +| count | Long | True | Random seed count, no more than 128 | +| algorithm | String | false | The default is sha3 algorithm, supporting sha3, KECCAK, merkle algorithm | + +Returns: + +| field | type | Remark | +| --------- | ------- | ------------------ | +| success | boolean | Successful or not | +| data | Object | The result object | +| seed | String | Calculate the random seed result | +| algorithm | String | Computational algorithm | +| count | int | Number of original random seeds | + +Example: + +Request: + +``` +curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": { + "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457", + "algorithm": "merkle", + "count": 10 + } +} +``` + +## Smart contracts support random Numbers in the underlying chain + +Similar to the above RPC interface, the smart contract SDK supports the same method to obtain the random number seed provided by the underlying blockchain, such as the following code. +Take one of these methods as an example`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)` Shows how to generate random Numbers using random number seeds. + +### 1) io.nuls.contract.sdk.Utils + +```java +/** + * [Testnet]According to the cutoff height and the number of original seeds, a specific algorithm is used to generate a random seed + * + * @param endHeight End height + * @param seedCount Number of original seeds + * @param algorithm Hash algorithm identification + * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes)) + */ +public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + +/** + * [Testnet]According to the height and the original seed number, use the ` SHA3-256 ` hash algorithm to generate a random seed + * + * @param endHeight End height + * @param seedCount Number of original seeds + * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes)) + */ +public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); +} + +/** + * [Testnet]According to the height range, a specific algorithm is used to generate a random seed + * + * @param startHeight Start height + * @param endHeight Number of original seeds + * @param algorithm Hash algorithm identification + * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes)) + */ +public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + +/** + * [Testnet]According to height, use ` SHA3-256 ` hash algorithm to generate a random seed + * + * @param startHeight Start height + * @param endHeight End height + * @return After the original seed byte array is merged, the 32-bit hash byte array is obtained using the hash algorithm and converted to BigInteger(new BigInteger(byte[] bytes)) + */ +public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); +} + +/** + * [Testnet]According to the cutoff height and the number of original seeds, the collection of original seeds was obtained + * + * @param endHeight End height + * @param seedCount Number of original seeds + * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes)) + */ +public static native List getRandomSeedList(long endHeight, int seedCount); + +/** + * [Testnet]Get the set of original seeds according to the height range + * + * @param startHeight Start height + * @param endHeight End height + * @return Returns a collection of original seeds, whose elements are BigInteger converted from byte arrays(new BigInteger(byte[] bytes)) + */ +public static native List getRandomSeedList(long startHeight, long endHeight); +``` + +### 2) A dice ` example ` shaking at the same time N + +#### 2.1) Calculation method 1 + +- Get the original seed`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)` +- The first random number is modeled according to the range of the dice +- The next random number + - The original seed is multiplied by the number of tosses, resulting in an array of bytes + - The byte array is hashed with sha3-256 to get a 32-bit byte array + - Converts the byte array of this Hash to BigInteger + - Use this BigInteger to model the next random number based on the range of the dice + - And so on + +**Refer to the following code** + +```java +public List dice(long endHeight, int count, int range, int times) { + BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3"); + if (orginSeed.equals(BigInteger.ZERO)) { + return null; + } + BigInteger wrapperRange = BigInteger.valueOf((long) range); + List resultList = new ArrayList(times); + for (int i = 0; i < times; i++) { + if(i == 0) { + BigInteger mod = orginSeed.mod(wrapperRange); + resultList.add(mod.intValue()); + } else { + BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1)); + String s = sha3(multiply.toByteArray()); + byte[] decode = decode(s); + BigInteger bigInteger = new BigInteger(decode); + BigInteger mod = bigInteger.mod(wrapperRange); + resultList.add(mod.intValue()); + } + } + return resultList; +} + +public byte[] decode(String hexString) { + byte[] bts = new byte[hexString.length() / 2]; + for (int i = 0; i < bts.length; i++) { + bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16); + } + return bts; +} +``` + +#### 2.2) Calculation method 2 + +- Get the original seed`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)` +- The first random number is modeled according to the range of the dice +- The next random number + - Get the last digit of the large number of the original seed (the last digit is obtained according to the number of tosses), multiply this last digit by the original seed, and the result is converted into a byte array + - The byte array is hashed with sha3-256 to get a 32-bit byte array + - Converts the byte array of this Hash to BigInteger + - Use this BigInteger to model the next random number based on the range of the dice + - And so on + +**Refer to the following code** + +```java +public List diceAnother(long endHeight, int count, int range, int times) { + BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3"); + if (orginSeed.equals(BigInteger.ZERO)) { + return null; + } + BigInteger wrapperRange = BigInteger.valueOf((long) range); + List resultList = new ArrayList(times); + BigInteger mod = orginSeed.mod(wrapperRange); + resultList.add(mod.intValue()); + String orginStr = orginSeed.toString(); + int length = orginStr.length(); + for (int i = 1; i < times; i++) { + int c = orginStr.charAt(length - i); + BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c)); + String s = sha3(multiply.toByteArray()); + byte[] decode = decode(s); + BigInteger bigInteger = new BigInteger(decode); + mod = bigInteger.mod(wrapperRange); + resultList.add(mod.intValue()); + } + return resultList; +} + +public byte[] decode(String hexString) { + byte[] bts = new byte[hexString.length() / 2]; + for (int i = 0; i < bts.length; i++) { + bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16); + } + return bts; +} +``` \ No newline at end of file diff --git a/docs/NULS1.0/sdk.md b/docs/NULS1.0/sdk.md new file mode 100644 index 00000000..dff3ee1b --- /dev/null +++ b/docs/NULS1.0/sdk.md @@ -0,0 +1,2792 @@ + +# SDK + +## Introduction +This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service. +### Convention +- All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article) +- The return object described in each interface refers to the content of the data attribute in the Result +- Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na +- Before running the SDK, you need to confirm that the NULS service is started and running normally +- JDK1.8+ is recommended +### Releases History + + +| Version | Release Date | Release Notes | +| :-------: | :--------: | :----------------------------------------------------------: | +| v0.9.11.0 | 2018-06-19 | Provide interfaces for docking basic functions of the NULS service | +| v0.9.11.1 | 2018-06-22 | Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1 | +| v0.9.14 | 2018-07-04 | Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.) | +| v0.9.15 | 2018-07-07 | Add four consensus interfaces (4.1-4.4)| +| v0.9.16 | 2018-07-11 | Add interface 4.5 | +| v1.0.1 | 2018-07-13 | Add error code | +| v1.1.0 | 2018-09-28 | Add multi-account transfer interface | + + + +## Quick Start +### 1. Importing files +Import jar files by using build tool + +- Use maven + +```xml + + io.nuls.sdk + sdk-all + 1.0.1 + +``` + +### 2. Creating SDK instance +First introduce SDK namespace + +```java +// introduce the namespace of the SDK boot class +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +// introduce the namespace of the SDK calls tool +import io.nuls.sdk.tool.NulsSDKTool; +``` + +After importing, create a client instance using the following code + +- Initiate SDK +- If no parameters are passed in initialization method, the default PRC IP and Port respectively are ` 127.0.0.1 `, 8001 ` ` +```java +//By default +SDKBootstrap.init(); +// Pass in the NULS service’s IP and Port +SDKBootstrap.init("192.168.1.88", "8001"); +``` + +- Call interface methods using the tool class + + +```java +Result result = NulsSDKTool.createAccount("nuls123456"); +``` + *e.g a complete example of creating an account with password* + +```java +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +// introduce the namespace for corresponding modules as required +import io.nuls.sdk.tool.NulsSDKTool; + +public static void main(String[] args) { + SDKBootstrap.init(); + Result result = NulsSDKTool.createAccount("nuls123456"); +} +``` +-- +### Accounts AccountService +#### 1.1 Creating account +Interface + +**`Result createAccount(int count, String password);`** + +Instructions +> Creates one or more accounts with or without a password depending on the parameters passed in. +>The information about the successfully created account will be persisted to the NULS service local database. +> +> Returns a set of successfully created account addresses + + + + + + + + + + + + + + + + + + + +
parametertype required or not note
countintoptional account count to be created (default 1)
passwordString optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: +```json +{ + "success": true, + "data":{ + "list": [ // Return a set of the created account addresses + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv", + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv" + ] + } +} +``` + + +*e.g Sample Code* + +```java +//create an account without password +createAccount(); +//create an account with password +createAccount("nuls123456"); +// create three password-less accounts +createAccount(3); +// create three accounts with passwords +createAccount(3, "nuls123456"); +``` +--- + +#### 1.2 Creating offline account +Interface + +**`Result createOfflineAccount(int count, String password)`** + +Instructions + +> Directly create an offline account and return it completely, without underlying interaction with NULS and persistence +> Creates an encrypted off-line account (Not saved to the database) +> +> Result.data `List` + + + + + + + + + + + + + + + + + + + + +
parametertype required or not note
countintoptional account count to be created (default 1)
passwordString optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "list":[ + { + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) + }, + { + "address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD", + "alias": null, + "pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb", + "extend": null, + "createTime": 1529314943624, + "encrypted": true, + "priKey": "", + "encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0" + } + ] + } +} +``` + +*e.g Sample Code* + +```java +// create an offline account without password +createOfflineAccount(); +// create an offline account with password +createOfflineAccount("nuls123456"); +// create three password-less offline accounts +createOfflineAccount(3); +// create three offline accounts with passwords +createOfflineAccount(3, "nuls123456"); +``` + +--- + +#### 1.3 Getting account + +Interface + +**`Result getAccount(String address)`** + +Instructions + +> Gets information about the account by account address +> +> Result.data `AccountInfo` + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if when a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) + } +} +``` + +*e.g Sample Code* + +```java +getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.4 Getting the fee for setting alias +Interface + +**`Result getAliasFee(String address, String alias)`** + +Instructions + +> Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)> +> Result.data `double`, unit is `NULS` + +**Note!** The unit of the fee returned by this interface is `NULS` + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
aliasStringrequired alias name to be set
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data":{ + "value": 0.01 //( unit: NULS) + } +} +``` + +*e.g Sample Code* + +```java +getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666"); +``` +--- + +#### 1.5 Getting account list + +Interface + +**`Result getAccountList(int pageNumber, int pageSize)`** + +Instructions + +> Gets a list of accounts based on the paging parameters +> +> Result.data Page `List` + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
pageNumberintrequiredpage number, must be greater than 0
pageSizeint required record size displayed per page, ranging from 1 to 100
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "pageNumber": 1, + "pageSize": 10, + "total": 100, + "pages": 10, + "list": [ + { + + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) }, + { + "address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP", + "alias": null, + "pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184", + "extend": null, + "createTime": 1529311250627, + "encrypted": true, + "priKey": null, + "encryptedPriKey": null + } + ... + + ] + } +} +``` + +*e.g Sample Code* + +```java +getAccountList(1, 10); +``` +--- + +#### 1.6 Getting account address by account alias + +Interface + +**`Result getAddressByAlias(String alias)`** + +Instructions +> Gets the account address by the account alias +> +> Result.data `String` + + + + + + + + + + + + + + +
parametertyperequired or notnote
aliasString required account alias
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g Sample Code* + +```java + getAddressByAlias("factory666"); +``` +--- + +#### 1.7 Getting account private key +Interface + +**`Result getPrikey(String address, String password)`** + +Instructions +> Gets the private key of the account by account address and password, and returns the private key string +> +> Result.data `String` + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24" + } +} +``` +*e.g Sample Code* + +```java +// the way of calling the account with password +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +//the way of calling the password-less account +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.8 Verifying the availability of alias +Interface + +**`Result isAliasUsable(String alias)`** + +Instructions +> Verifies that the alias is available (if it is not used) by alias name +> +> Result + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredalias name
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ // indicate the alias is available + "success": true, + "data": { + "value":true + } +} +``` +- Return the case where the alias is unavailable + +```json +{ // indicate the alias is not available + "success": true, + "data":{ + "value": false + } +} +``` +- Return error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +isAliasUsable("factory666"); +``` +--- + +#### 1.9 Account Backup +Interface + +**`Result backupAccount(String address, String path, String password)`** + +Instructions + +> Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing. +> +> Result: the generated file address + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
pathString required the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service.
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore" + } +} +``` +*e.g Sample Code* + +```java +// Backup an password-less account to the current directory +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null); +// Backup an account with password to the /backup directory +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456"); +``` +--- + +#### 1.10 Importing account +Interface + +**`Result importAccountByKeystore`** + +Instrucions + +> Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified. +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
path/fileReaderString/FileReaderrequired the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file
passwordStringoptionalthe password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported
overwritebooleanrequired true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g Sample Code* + +```java +//import an account with password +importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true); +importAccountByKeystore(fileReader, "nuls123456", true); +//import a password-less account +importAccountByKeystore("/backup/XXXXXX.keystore", false); +importAccountByKeystore(fileReader, false); +``` +--- + +#### 1.11 Importing account (private key) +Interface + +**`Result importAccountByPriKey(String privateKey, String password, boolean overwrite)`** + +Instructions + +> Imports an account by private key +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
privateKeyStringrequired private key of the account
passwordStringoptional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
overwriteboolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS" + } +} +``` +*e.g Sample Code* + +```java +// set a password when importing account +importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true); +// no password is set when importing account +importAccountByPriKey("1f9d3ad044e0e120......", true); +``` +--- + +#### 1.12 Verifying account is encrypted +Interface + +**`Result isEncrypted(String address)`** + +Instructions + +> Verifies the account is encrypted +> +> Result + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ // indicate encrypted + "success": true, + "data": { + "value":true + } +} +``` +- Return unencrypted +```json +{ + "success": true, + "data":{ + "value": false + } +} +``` +- Return error cases, such as a parameter error + +```json +{ //indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +*e.g Sample Code* + +```java +isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.13 Removing account +Interface + +**`Result removeAccount(String address, String password)`** + +Instructions + +> Removes an account +> +> Result + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.13 Setting password +Interface + +**`Result setPassword(String address, String password)`** + +Instructions + +> Sets a password for an unencrypted account. Encrypted account cannot call this interface. +> +> Result + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringrequired set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error + +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.14 Modifying password +Interface + +**`Result resetPassword(String address, String password, String newPassword)`** + +Instructions + +> Modifys the password for an encrypted account. Unencrypted account cannot call this interface. +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringrequired the current password of the account
newPasswordStringrequired set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111"); +``` +--- + +#### 1.15 Setting alias +Interface + +**`Result setAlias(String address, String alias, String password)`** + +Instructions + +> Sets alias name for an account +> +> Result: the hash of the transaction for setting the alias + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
aliasString required alias name to be set
passwordString password account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data":{ + "value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6" + } +} +``` +- Example for error + +```json +{ + "success": false, + "data":{ + "code": "ACT007", + "msg": "The account already set an alias" + } +} +``` +*e.g Sample code* + +```java +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111"); +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666"); +``` +--- + +#### 1.16 Setting offline-account password +Interface + +**`Result setPasswordOffline(String address, String priKey, String password)`** + +Instructions + +> Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service +> +> Result: the encrypted private key(encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
priKeyString required account’s private key
passwordStringrequired set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g Sample Code* + +```java +setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456"); +``` +--- + +#### 1.17 Modifying offline-account password +Interface + +**`Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)`** + +Instructions + +> Modifies the password of the offline account independently in SDK, without interaction with NULS service +> +> Result: the encrypted private key generated by the new password (encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
encryptedPriKeyStringrequiredencrypted private key
passwordString required original password
newPasswordString required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g Sample Code* + +```java +resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456"); +``` +--- + +### Transactions AccountLedgerService + +#### 2.1 Creating transfer transaction +Interface + +**`Result createTransaction(List inputs, List outputs, String remark)`** + +Instructions + +> Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. **The calculation of the fee will be explained in detail later** +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
inputsList<Input>required usable output referred by the transaction
outputsList<Output> required usable output newly generated by the transaction
remarkStringoptionaltransaction remarks
+ +*e.g Sample Code* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); + +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +// the outputs for assembly transaction, the attribute of the output in the example is mandatory. +Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createTransaction(inputs, outputs, remark); +``` +--- + + +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:100000 NA/1KB +> +> **Calculation of transaction size**:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + + +#### 2.2 Transaction Signatures + +Interface + +**`Result signTransaction(String txHex, String priKey, String address, String password)`** + +Instructions + +> Signs the transaction by private key +> +> Result.data `String`: the signed transaction, serialized string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
priKeyStringrequiredprivate key of the transaction
addressStringrequired the address corresponding to the private key, used to verify the validity of the private key.
passwordStringoptional the password of the private key, leave it blank if the private key is not encrypted
+ +*e.g Sample Code* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"; +String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"; +String password = "NULS6352s!f"; +Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password); +``` + +> + +--- + +#### 2.3 Querying transaction details by transaction hash +Interface + +**`Result getTxByHash(String hash)`** + +Instructions + +> Queries transaction details by transaction hash +> +> Result.data: `Transaction` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredtransaction hash
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 99900000000, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 1, + "confirmCount": 14, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9999899000000 + } + ], + "outputs": [ + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 0, + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0, + "status": 0 + }, + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 1, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0, + "status": 0 + } + ] + } +} +``` +*e.g Sample Code* + +```java +getTxByHash("041f3d2ceed........"); +``` +--- + +#### 2.4 Transfers +Interface + +**`Result transfer(String address, String toAddress, String password, long amount, String remark)`** + +Instructions + +> Initiates a transfer transaction +> +> Result: the transaction hash + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequired address of the transferor account
toAddressStringrequired address of the transferee account
passwordStringoptional password of the transferor account, leave it blank if the account is not encrypted.
amountlongrequiredtransfer amount (unit: Na)
remarkStringrequiredremarks
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2" + } +} +``` +*e.g Sample Code* + +```java + //account with password +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "remarks 1NULS=10000000Na"); +//account without password +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, " remarks 1NULS=10000000Na"); +``` +--- + +#### 2.5 Querying account balance +Interface + +**`Result getBalance(String address)`** + +Instructions + +> Gets the account balance +> +> Result.data `BalanceInfo ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "balance": 1009899998900000, + "usable": 1009899998900000, + "locked": 0 + } +} +``` +*e.g Sample Code* + +```java +getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS"); +``` +--- + +#### 2.6 Broadcasting transaction +Interface + +**`Result broadcastTransaction(String txHex);`** + +Instruction + +> Broadcasts a transaction +> +> Result.data String: transaction hash + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85" + } +} + +``` +*e.g Sample Code* + +```java +String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"; +Result result = service.broadcastTransaction(txHex); +if(result.isSuccess()) { + String txHash = (String)result.getData(); +} +``` +--- + +#### 2.7 Creating multi-address transfer transaction + +Interface + +**`Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)`** + +Instructions + +> Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. **The calculation of the fee will be explained in detail later** +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
inputsList<Input>required usable output referred by the transaction
outputsList<Output> required usable output newly generated by the transaction
nInputAccountintrequiredinput account number
remarkStringoptionaltransaction remarks
+ +*e.g Sample Code* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); +int nInputAccount = 2; + +//the inputs for assembly transaction, the attribute of the input in the example is mandatory. +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +//the outputs for assembly transaction, the attribute of the output in the example is mandatory. + Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark); +``` + +------ + +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:100000 NA/1KB +> +> **Calculation of transaction size**:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 2.8 Signing multi-address transfer transaction + +Interface + +**`Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)`** + +Instructions + +> Signs a transaction by private key +> +> Result.data `String`: signed transaction, serialized string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
privKeysListrequired private key of the transaction
passwordsListrequired password corresponding to the private key (passwords for multiple accounts must be the same) +
+ +*e.g Sample Code* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +List priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"); +List passwords = Arrays.asList("123456","123456"); +Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords); +``` + +> + +### Blocks BlockService + +#### 3.1 Getting block header by block height +Interface + +**`Result getblockHeader(int height)`** + +Instructions + +> Gets a block header by block height +> +> Result.data `BlockHeader ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
heightintrequiredblock height
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g Sample Code* + +```java +getblockHeader(10); +``` +--- + +#### 3.2 Getting block header by block hash + +Interface + +**`Result getblockHeader(String hash)`** + +Instructions + +> Gets a block header by block hash +> +> Result.data `BlockHeader` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredblock hash
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g Sample Code* + +```java +getblockHeader("041f3d2ceed........"); +``` +--- + +#### 3.3 Getting block by block height + +Interface + +**`Result getBlock(int height)`** + +Instructions + +> Gets a block by block height +> +> Result.data `Block ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
heightintrequiredblock height
+ +Return + +- Return ` Result ` object in the following formats: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g Sample Code* + +```java +getBlock(10); +``` +--- + +#### 3.4 Getting block by block hash + +Interface + +**`Result getBlock(String hash)`** + +Instructions + +> Gets a block by block hash +> +> Result.data `Block ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredblock hash
+ +Return + +-Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g Sample Code* + +```java +getBlock("041f3d2ceed........"); +``` +--- + +#### 3.5 Getting the latest block header + +Interface + +**`Result getNewestBlockHash()`** + +Instrucntions + +> Gets the latest block header +> +> Result.data `BlockHeader` + + +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} + +``` +*e.g Sample Code* + +```java +getNewestBlockHash(); +``` +--- + +#### 3.6 Getting the latest block’s height + +Interface + +**`Result getNewestBlockHight()`** + +Instructions + +> Gets the height of the latest block +> +> Result.data: height (Long) + +Return + +-Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": 5210 + } +}} + +``` +*e.g Sample Code* + +```java +getNewestBlockHight(); +``` +--- + +#### 3.7 Getting the latest block’s Hash + +Interface + +**`Result getNewestBlockHash()`** + +Instructions + +> Gets the block Hash of the latest block +> +> Result.data: Hash (String) + +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b" + } +}} + +``` +*e.g Sample Code* + +```java +getNewestBlockHash(); +``` +--- + + + +### Consensus ConsensusService + +#### 4.1 Offline assembling transaction for creating node + +Interface + +**` Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee) `** + +Instructions + +> Assembles transaction for creating node offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
agentInfoObjectrequiredthe information about the node to be created
inputsListrequiredinput information
feeObjectrequiredtransaction fee
+ +*e.g Sample Code* + +```java +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +// the information about the node to be created, the attribute of AgentInfo in the example is mandatory. +AgentInfo info = new AgentInfo(); +info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); // the agent address of the consensus node +info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"); // the address of the node actually packing block +info.setDeposit(200000 * 100000000L);// deposit for creating a node, not less than 20000NULS and not more than 200000NULS +info.setCommissionRate(10.0); // commission ratio ranging from 1 to 100 + +//fee for creating a node +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:1000000 NA/1KB +> +> **Calculation of transaction size**:(288 + 50 * inputs.length)/1024 +> 210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 4.2 Offline assembling agent consensus transaction + +Interface + +**` Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee) `** + +Instructions + +> Assembles an agent consensus transaction offline. +> +> Result.data `String`: serialized transaction data in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
depositInfoObjectrequiredthe information about the node to be created
inputsListrequiredinput information
feeObjectrequiredtransaction fee
+ +*e.g Sample Code* + +```java +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory. +DepositInfo info = new DepositInfo(); +info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //address of the agent consensus node +info.setDeposit(300000 * 100000000L);// the agent token number ranging from 2000NULS to 500000NULS +info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");// the id of the transaction for creating consensus node + +//fee for creating a node +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ +> ** Calculation of fee for creating an agent transaction**: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:1000000 NA/1KB +> +> **Calculation of transaction size**:(288 + 50 * inputs.length)/1024 +> 210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 4.3 Offline assembling transaction for canceling agent consensus + +Interface + +**` Result createCancelDepositTransaction(Output output) `** + +Instructions + +> Assembles a transaction for canceling agent consensus offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + +
parametertyperequired or notnote
outputObjectrequired the output locked when participating in the consensus
+ +*e.g Sample Code* + +```java +// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus. +/ / use the output as a parameter to generate an transaction for canceling agent consensus +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setValue(20000000000000L); +output.setLockTime(-1); + +Result result = NulsSDKTool.createCancelDepositTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.4 Offline assembling transaction for stopping consensus node + +Interface + +**` Result createStopAgentTransaction(Output output) `** + +Instructions + +> Assembles a transaction for stopping consensus node offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + +
parametertyperequired or notnote
outputObjectrequired the output locked when creating a node
+ +*e.g Sample Code* + +```java +// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. +/ / use the output as a parameter to generate a transaction for canceling agent consensus +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setValue(20000000000000L); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setLockTime(-1); + +Result result = NulsSDKTool.createStopAgentTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.5 Getting list of agent consensus + +Interface + +**` Result getDeposits(String address, int pageNumber, int pageSize) `** + +Instructions + +> Gets a list of agent consensus by agent address +> +> Result.data List: a list of agent consensus + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredagent address
pageNumberintrequiredpage number
pageSizeint required record size displayed per page ranging from 1 to 100<
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success":true, + "data":{ + "pageNumber":1, + "pageSize":10, + "total":1, + "pages":1, + "list":[ + { + "deposit":20000010000000, + "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c", + "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA", + "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e", + "blockHeight":98, + "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA" + } + ] + } +} +``` + +*e.g Sample Code* + +```java +Result result = NulsSDKTool.getDeposits(address, 1, 10); +``` + + + + + +### Appendix + +#### Example of Result returned by interface +##### Result + +- Indicate the normal access to the interface and the specific data returned by the business service. + +```json +{ +"success": true,// interface executes correctly +"data": data +} +``` +- Indicate the normal access to the interface, and the business service returns true. + +```json +{ // indicate the normal access to the interface, and the business service returns true + "success": true,// interface executes correctly + "data": { + "value":true // the result returned by interface business function + } +} +``` +- Indicate the normal access to the interface, and the business service returns false. + +```json +{ + "success": true, // interface executes correctly + "data":{ + "value": false // the result returned by interface business function + } +} +``` +- Return error cases, such as a parameter error, exception, etc. + +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +- This is the full result of creating an offline account with password. + +```json +{ + "success": true, + //data为List + "data": { + "list":[ + { + "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr", + "alias": null, + "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0", + "extend": null, + "createTime": 1529041525794, + "encrypted": false, + "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a", + "encryptedPriKey": "" + } + ] + } +} +``` +--- + +##### Account +```json +{ + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) +} +``` +--- + +##### Input +```json + { + "fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long, transfer-in amount + "lockTime": Long, lock time +} +``` +--- + +##### Output +```json + { + "txHash": String, transaction hash + "index": Integer, index + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + "status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent) +} +``` +--- + +##### Transaction + +```json +{ + "hash": String, transaction hash + "type": Integer, transaction type + "time": Long, transaction initiation time + "blockHeight": Long, block height + "fee": Long, transaction fee + "value": Long, transaction amount + "remark": String, remarks + "scriptSig": String, signature + "status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed) + "confirmCount": Long, confirmation count + "size": int, size + "inputs": [ + { +"fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long, transfer-in amount + + } + ], + "outputs": [ + { + "txHash": String, transaction hash + "index": Integer, index + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + "status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent) + } + ] +} +``` +--- + +##### BalanceInfo +```json +{ + "balance": long, balance + "usable": long, available balance + “locked": long, locked balance +} +``` +--- + +##### BlockHeader + +```json +{ + "hash": String, transaction hash + "preHash": String, hash value of the previous block + "merkleHash": String, merkle hash + "time": Long, block generation time + "height": Long, block height + "txCount": Long, count of transactions packaged by the block + "packingAddress": String, packing address + "scriptSig": String, signature + "roundIndex": Long, consensus round + "consensusMemberCount": Integer, count of members participating in the consensus + "roundStartTime": Long, the start time of the current consensus round + "packingIndexOfRound": Integer, the packing index of the current round + "confirmCount": Long, confirmation count + "reward": Long, consensus reward + "fee": Long, packing fee obtained + "size": int, size +} +``` +--- + +##### Block + +```json +{ + "hash": String, transaction hash + "preHash": String, hash value of the previous block + "merkleHash": String, merkle hash + "time": Long, block generation time + "height": Long, block height + "txCount": Long, count of transactions packaged by the block + "packingAddress": String, packing address + "scriptSig": String, signature + "roundIndex": Long, consensus round + "consensusMemberCount": Integer, count of members participating in the consensus + "roundStartTime": Long, the start time of the current consensus round + "packingIndexOfRound": Integer, the packing index of the current round + "confirmCount": Long, confirmation count + "reward": Long, consensus reward + "fee": Long, packing fee obtained + "size": int, size + "txList": [ + { + "hash": String, transaction hash + "type": Integer, transaction type + "time": Long, transaction initiation time + "blockHeight": Long, block time + "fee": Long, transaction fee + "value": Long, transaction amount + "remark": String, remarks + "scriptSig": String, signature + "status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed) + "confirmCount": Long, confirmation count + "size": int, size + "inputs": [inputs + { + "fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long transfer-in amount + } + ], + "outputs": [ outputs + { + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + } + ] + } + ] +} +``` diff --git a/docs/NULS1.0/smartContractFee.md b/docs/NULS1.0/smartContractFee.md new file mode 100644 index 00000000..e28a25eb --- /dev/null +++ b/docs/NULS1.0/smartContractFee.md @@ -0,0 +1,53 @@ +# Service charge + +## 1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge? + +> `Background:` Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards. + +In the main-net, there are now three more types of transactions: `creating a smart contract`, `invoking a smart contract`, `deleting a smart contract` + +The difference between those three transactions and other transactions such as `transfer` is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards. + +* Calculation of smart contract service charge + +```java +public static final int COMPARISON = 1 ; //Compare bytecode +public static final int CONSTANT = 1 ; //Simple numeric type bytecode +public static final int LDC = 1 ; //Numeric constant, string constant (length * LDC) +public static final int CONTROL = .5 ; //Control bytecode +public static final int TABLESWITCH = 2 ; //Switch bytecode (size * TABLESWITCH) +public static final int LOOKUPSWITCH = 2 ; //Switch bytecode (size * LOOKUPSWITCH) +public static final int CONVERSION = 1 ; //Value conversion +public static final int EXTENDED = 1 ; //Null determine +public static final int MULTIANEWARRAY = 1 ; //Multidimensional Array (size * MULTIANEWARRAY) +public static final int LOAD = 1 ; / /Send the local variable to the top of the stack +public static final int ARRAYLOAD = 5 ; / /Send an item of the array to the top of the stack +public static final int MATH = 1 ; //Mathematical operations and shift operations +public static final int REFERENCE = 10 ; //Object related operations +public static final int NEWARRAY = 1 ; //One-dimensional array (size * NEWARRAY) +public static final int STACK = 2 ; //Stack operation +public static final int STORE = 1 ; // Save the value in the top of the stack to a local variable +public static final int ARRAYSTORE = 5; //Save the value of the stack to an array +public static final int TRANSFER = 1000 ; //Transfer transaction + +``` + +* Total service charge for invoking a smart contract +The total service charge for a contract transaction consists of three parts +- The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS. + +- The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na. +> For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS. + +- The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward. +> Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block. + +* How much does a contract invoker pay? + +To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block. + +* Who receives the service charge? + +> `Precondition:`This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block. + +The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part. \ No newline at end of file diff --git a/docs/NULS1.0/smartContractIDEAPlugin.md b/docs/NULS1.0/smartContractIDEAPlugin.md new file mode 100644 index 00000000..5cf8c68b --- /dev/null +++ b/docs/NULS1.0/smartContractIDEAPlugin.md @@ -0,0 +1,99 @@ +# IDEA Plugin + +#### 1 Install NULS Plugin on IDEA +- [Get NULS plugin](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip) ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk + +![Install](./pluginImages/Install.jpg) + +- Select the said ZIP, and click OK + +![Install](./pluginImages/Install2.jpg) + +- Tick NULS plugin, and click Apply + +![Install](./pluginImages/Install3.jpg) + +#### 2 Create a NULS project + +![create](./pluginImages/createProject.jpg) + +Input Project name, click finish + +![create](./pluginImages/createProject2.jpg) + +#### 3 Compile smart contract + +Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/) + +![code](./pluginImages/code.jpg) + +#### 4 Set and deploy the node and account for contract + +- Click NULS plugin on the right, and call NULS plugin interface + + ![code](./pluginImages/Deploy.jpg) + +- Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address. + + Click + on the top left corner of panel, and select Add Node. + + ![code](./pluginImages/Add.jpg) + +- Input Node address and clock OK + + ![code](./pluginImages/Add3.jpg) + +- Click + on the top left corner of panel, and select Add Account. Input Account address and click OK. + + ![code](./pluginImages/Add5.jpg) + +#### 5 Package contract + +- Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code + + ![code](./pluginImages/package.jpg) + +- Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step). + + ![code](./pluginImages/package1.jpg) + +- Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface + + ![code](./pluginImages/package3.jpg) + + ![code](./pluginImages/package2.jpg) + +#### 6 Deploy contract + +- On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step. + + ![code](./pluginImages/package4.jpg) + +- Parameters following JarFilePath are the parameters of the contract construction function. + + ![code](./pluginImages/Deploy2.jpg) + +- Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract. + + ![code](./pluginImages/Deploy3.jpg) + +- Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success. + + ![code](./pluginImages/Deploy4.jpg) + +- If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment. + + ![code](./pluginImages/Deploy5.jpg) + +- Review the deployed contract on the top of panel + + ![code](./pluginImages/Deploy6.jpg) + +- Click the deployed contract to review all method of this contract + + ![code](./pluginImages/Deploy7.jpg) + + + diff --git a/source/contract/smartContractImages/Assets5.jpg b/docs/NULS1.0/smartContractImages/Assets5.jpg similarity index 100% rename from source/contract/smartContractImages/Assets5.jpg rename to docs/NULS1.0/smartContractImages/Assets5.jpg diff --git a/source/contract/smartContractImages/Deploy5.jpg b/docs/NULS1.0/smartContractImages/Deploy5.jpg similarity index 100% rename from source/contract/smartContractImages/Deploy5.jpg rename to docs/NULS1.0/smartContractImages/Deploy5.jpg diff --git a/source/contract/smartContractImages/Deploy7.jpg b/docs/NULS1.0/smartContractImages/Deploy7.jpg similarity index 100% rename from source/contract/smartContractImages/Deploy7.jpg rename to docs/NULS1.0/smartContractImages/Deploy7.jpg diff --git a/source/contract/smartContractImages/Deploy8.jpg b/docs/NULS1.0/smartContractImages/Deploy8.jpg similarity index 100% rename from source/contract/smartContractImages/Deploy8.jpg rename to docs/NULS1.0/smartContractImages/Deploy8.jpg diff --git a/source/zh-cn/contract/smartContractImages/access1.jpg b/docs/NULS1.0/smartContractImages/access1.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access1.jpg rename to docs/NULS1.0/smartContractImages/access1.jpg diff --git a/source/zh-cn/contract/smartContractImages/access2.jpg b/docs/NULS1.0/smartContractImages/access2.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access2.jpg rename to docs/NULS1.0/smartContractImages/access2.jpg diff --git a/source/zh-cn/contract/smartContractImages/access3.jpg b/docs/NULS1.0/smartContractImages/access3.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access3.jpg rename to docs/NULS1.0/smartContractImages/access3.jpg diff --git a/source/zh-cn/contract/smartContractImages/access4.jpg b/docs/NULS1.0/smartContractImages/access4.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access4.jpg rename to docs/NULS1.0/smartContractImages/access4.jpg diff --git a/source/zh-cn/contract/smartContractImages/access5.jpg b/docs/NULS1.0/smartContractImages/access5.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access5.jpg rename to docs/NULS1.0/smartContractImages/access5.jpg diff --git a/source/zh-cn/contract/smartContractImages/access6.jpg b/docs/NULS1.0/smartContractImages/access6.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access6.jpg rename to docs/NULS1.0/smartContractImages/access6.jpg diff --git a/source/zh-cn/contract/smartContractImages/access7.jpg b/docs/NULS1.0/smartContractImages/access7.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/access7.jpg rename to docs/NULS1.0/smartContractImages/access7.jpg diff --git a/source/zh-cn/contract/smartContractImages/assets1.jpg b/docs/NULS1.0/smartContractImages/assets1.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/assets1.jpg rename to docs/NULS1.0/smartContractImages/assets1.jpg diff --git a/source/zh-cn/contract/smartContractImages/assets2.jpg b/docs/NULS1.0/smartContractImages/assets2.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/assets2.jpg rename to docs/NULS1.0/smartContractImages/assets2.jpg diff --git a/source/zh-cn/contract/smartContractImages/assets3.jpg b/docs/NULS1.0/smartContractImages/assets3.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/assets3.jpg rename to docs/NULS1.0/smartContractImages/assets3.jpg diff --git a/source/zh-cn/contract/smartContractImages/assets4.jpg b/docs/NULS1.0/smartContractImages/assets4.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/assets4.jpg rename to docs/NULS1.0/smartContractImages/assets4.jpg diff --git a/source/zh-cn/contract/smartContractImages/deploy1.jpg b/docs/NULS1.0/smartContractImages/deploy1.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/deploy1.jpg rename to docs/NULS1.0/smartContractImages/deploy1.jpg diff --git a/source/zh-cn/contract/smartContractImages/deploy2.jpg b/docs/NULS1.0/smartContractImages/deploy2.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/deploy2.jpg rename to docs/NULS1.0/smartContractImages/deploy2.jpg diff --git a/source/zh-cn/contract/smartContractImages/deploy3.jpg b/docs/NULS1.0/smartContractImages/deploy3.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/deploy3.jpg rename to docs/NULS1.0/smartContractImages/deploy3.jpg diff --git a/source/zh-cn/contract/smartContractImages/deploy4.jpg b/docs/NULS1.0/smartContractImages/deploy4.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/deploy4.jpg rename to docs/NULS1.0/smartContractImages/deploy4.jpg diff --git a/source/zh-cn/contract/smartContractImages/deploy6.jpg b/docs/NULS1.0/smartContractImages/deploy6.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/deploy6.jpg rename to docs/NULS1.0/smartContractImages/deploy6.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract1.jpg b/docs/NULS1.0/smartContractImages/myContract1.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract1.jpg rename to docs/NULS1.0/smartContractImages/myContract1.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract2.jpg b/docs/NULS1.0/smartContractImages/myContract2.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract2.jpg rename to docs/NULS1.0/smartContractImages/myContract2.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract3.jpg b/docs/NULS1.0/smartContractImages/myContract3.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract3.jpg rename to docs/NULS1.0/smartContractImages/myContract3.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract4.jpg b/docs/NULS1.0/smartContractImages/myContract4.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract4.jpg rename to docs/NULS1.0/smartContractImages/myContract4.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract5.jpg b/docs/NULS1.0/smartContractImages/myContract5.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract5.jpg rename to docs/NULS1.0/smartContractImages/myContract5.jpg diff --git a/source/zh-cn/contract/smartContractImages/myContract6.jpg b/docs/NULS1.0/smartContractImages/myContract6.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/myContract6.jpg rename to docs/NULS1.0/smartContractImages/myContract6.jpg diff --git a/docs/NULS1.0/sourceCodeStartNULS.md b/docs/NULS1.0/sourceCodeStartNULS.md new file mode 100644 index 00000000..052d74e3 --- /dev/null +++ b/docs/NULS1.0/sourceCodeStartNULS.md @@ -0,0 +1,41 @@ +# Launching NULS with source code + +## Downloading source code + +Visit the NULS project on github: https://github.com/nuls-io/nuls + +Option 1: downloading the source code directly + + After accessing the github, click the "Clone or download" button and select Download ZIP to download the source-code package. + +Option 2: running the git command to clone the NULS repository + + ` git clone https://github.com/nuls-io/nuls.git` + +Option 3: (recommended): cloning the NULS repository with development tools such as IntelliJ IDEA. + +## Environment description + + Operating Systems: macOS, Windows + + Building Tools: maven + + Development Tools: IntelliJ IDEA + + Development Language: Java (JDK1.8) + +## Basic introduction of launching NULS + + Since blockchain is a decentralized network composed of multiple nodes, it makes no sense to launch a node with NULS source code alone, and it is also not feasible. This tutorial assumes an existing custom test-net running with NULS source code, and the source code other than the network parameters is not modified when building the network. How can we run the NULS source code and join the network + +1. First install jdk1.8 and the build tool - maven. + + 2. Run IntelliJ IDEA +     - If you download the source code package, extract it and import the NULS project via IntelliJ IDEA +     - If you download the source code by running git command to clone the NULS repository, import the NULS project via IntelliJ IDEA. +     - Clone the NULS repository via IntelliJ IDEA’s Git plugin. + 3. Configure network environment parameters consistent with the existing network. +     - Open the module.ini configuration file in the client-module project +     - It is recommended to replace the module.ini file with that of other nodes in the known custom test-net to ensure the consistency of the network environment parameters. + 4. Run the NULS boot class Bootstrap.java in the client-module project, located in `io.nuls.client` package. + 5. The NULS wallet interface will be opened during start-up process and the block height of the custom test-net will be synchronized, indicating that the startup is successful. \ No newline at end of file diff --git a/docs/NULS1.0/startSmartContract.md b/docs/NULS1.0/startSmartContract.md new file mode 100644 index 00000000..69ca3f90 --- /dev/null +++ b/docs/NULS1.0/startSmartContract.md @@ -0,0 +1,93 @@ +# Quick Start + +## 1. Running the test-net environment, creating an account, and claiming test tokens. + +[Preparations for deployment and invocation of smart contracts](/NULS1.0/connectTestnet.html) + + +## 2. Installing JDK8, IntelliJ IDEA and NULS smart-contract plug-ins + +Preparations for the development of smart contract code + +[Downloading JDK8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (Installation omitted) + +[Downloading IntelliJ IDEA](https://www.jetbrains.com/idea/download/) (Installation omitted) + +[Downloading NULS smart contract plug-ins] +(https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) + +[Installing the NULS smart contract plug-ins](/NULS1.0/ideaPlugin.html) + +## 3. Smart contract example + +**_Quickly compile and deploy a smart contract with the example _** + +* Simple example + +```java + +Import io.nuls.contract.sdk.Contract; +Import io.nuls.contract.sdk.Msg; +Import io.nuls.contract.sdk.annotation.Payable; +Import io.nuls.contract.sdk.annotation.Required; +Import io.nuls.contract.sdk.annotation.View; + +Import java.math.BigDecimal; +Import java.math.BigInteger; + +Public class SimpleContract implements Contract { + +    Private String sayContent; + +    @Override +    @Payable +    Public void _payable() { +        // override this method and mark the @Payable annotation. The smart contract can receive direct transfer of the NULS wallet assets +        // you can do something else +        // ... +    } + +    Public String sayContent(@Required String content) { +        this.sayContent = content; +        Return "you want say " + content; +    } + +    @Payable +    Public String transferToContract() { +        // mark the @Payable annotation. Smart contract can receive NULS when invoking this method +        BigInteger value = Msg.value(); +        BigDecimal nuls = new BigDecimal(value).movePointLeft(8); +        // you can do something else +        // ... + +        Return "I received your transfer amount: " + nuls.toPlainString(); +    } + +    @View +    Public String sayWhat() { +        If(sayContent != null) { +            Return "you want say " + sayContent; +        } +        Return "you want say nothing."; +    } +} + +``` + +## 4. Smart contract repository + +[Smart contract repository collected by NULS officials] (https://github.com/nuls-io/contracts) + +[Community member Angelillou's smart contract - Partnership income distribution smart contract] (https://github.com/amalcaraz/nuls-partnership-smartcontract) + +[Community member Angelillou's smart contract - Lottery factory smart contract for Nuls blockchain) + +[Community member Naveen's Smart Contracts - Contract to write reviews for any product] (https://github.com/naveen7252/ProductReviewContract) + +## 5. Deploying and invoking smart contracts + +[How to deploy and invoke the wallet smart contract](/NULS1.0/GUIForSmartContract.html) + +## 6. Smart contract specifications and syntax + +[Smart contract specifications and syntax](/NULS1.0/developerManual.html) \ No newline at end of file diff --git a/docs/NULS2.0/Introduction/intro1.jpg b/docs/NULS2.0/Introduction/intro1.jpg new file mode 100644 index 00000000..104f1fa9 Binary files /dev/null and b/docs/NULS2.0/Introduction/intro1.jpg differ diff --git a/docs/NULS2.0/Introduction/intro2.jpg b/docs/NULS2.0/Introduction/intro2.jpg new file mode 100644 index 00000000..27c80a81 Binary files /dev/null and b/docs/NULS2.0/Introduction/intro2.jpg differ diff --git a/docs/NULS2.0/NRC-20TokenStandard.md b/docs/NULS2.0/NRC-20TokenStandard.md new file mode 100644 index 00000000..92f3ee84 --- /dev/null +++ b/docs/NULS2.0/NRC-20TokenStandard.md @@ -0,0 +1,158 @@ +# NRC-20 + + +## Simple Summary + +A standard interface for tokens. + + +## Abstract + +The following standard allows for the implementation of a standard API for tokens within smart contracts. +This standard provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party. + + +## Motivation + +A standard interface allows any tokens on Nuls to be re-used by other applications: from wallets to decentralized exchanges. + + +## Specification + +## Token +### Methods + +**NOTE**: Callers MUST handle `false` from `return boolean`. Callers MUST NOT assume that `false` is never returned! + + +#### name + +Returns the name of the token - e.g. `"MyToken"`. + +``` java +@View +public String name(); +``` + + +#### symbol + +Returns the symbol of the token. E.g. "MT". + +``` java +@View +public String symbol(); +``` + +#### decimals + +Returns the number of decimals the token uses - e.g. `8`, means to divide the token amount by `100000000` to get its user representation. + +``` java +@View +public int decimals(); +``` + + +#### totalSupply + +Returns the total token supply. + +``` js +@View +public BigInteger totalSupply(); +``` + + + +#### balanceOf + +Returns the account balance of another account with address `owner`. + +``` java +@View +public BigInteger balanceOf(@Required Address owner); +``` + + + +#### transfer + +Transfers `value` amount of tokens to address `to`, and MUST fire the `TransferEvent` event. +The function SHOULD `revert` if the `from` account balance does not have enough tokens to spend. + +A token contract which creates new tokens SHOULD trigger a Transfer event with the `from` address set to `null` when tokens are created. + +*Note* Transfers of 0 values MUST be treated as normal transfers and fire the `TransferEvent` event. + +``` java +public boolean transfer(@Required Address to, @Required BigInteger value); +``` + + + +#### transferFrom + +Transfers `value` amount of tokens from address `from` to address `to`, and MUST fire the `TransferEvent` event. + +The `transferFrom` method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. +This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. +The function SHOULD `revert` unless the `from` account has deliberately authorized the sender of the message via some mechanism, such as calling `approve(@Required Address spender, @Required BigInteger value)`. + +*Note* Transfers of 0 values MUST be treated as normal transfers and fire the `TransferEvent` event. + +``` java +public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value); +``` + + + +#### approve + +Allows `spender` to withdraw from your account multiple times, up to the `value` amount. If this function is called again it overwrites the current allowance with `value`. + +``` java +public boolean approve(@Required Address spender, @Required BigInteger value); +``` + + +#### allowance + +Returns the amount which `spender` is still allowed to withdraw from `owner`. + +``` java +@View +public BigInteger allowance(@Required Address owner, @Required Address spender); +``` + + + +### Events + + +#### TransferEvent + +MUST trigger when tokens are transferred, including zero value transfers. + +A token contract which creates new tokens SHOULD trigger a Transfer event with the `from` address set to `null` when tokens are created. + +``` java +public TransferEvent(Address from, @Required Address to, @Required BigInteger value) +``` + + + +#### ApprovalEvent + +MUST trigger on any successful call to `approve(@Required Address spender, @Required BigInteger value)`. + +``` java +public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value) +``` + + + +## Implementation + +#### Example implementations are available at +- https://github.com/nuls-io/nuls-contracts/tree/master/nrc20 diff --git a/docs/NULS2.0/NRC-721.md b/docs/NULS2.0/NRC-721.md new file mode 100644 index 00000000..93f290bb --- /dev/null +++ b/docs/NULS2.0/NRC-721.md @@ -0,0 +1,520 @@ +# NRC-721 + +## Simple Summary + +A standard interface for non-fungible tokens, also known as deeds. + +## Abstract + +The following standard allows for the implementation of a standard API for NFTs within smart contracts. This standard provides basic functionality to track and transfer NFTs. + +We considered use cases of NFTs being owned and transacted by individuals as well as consignment to third party brokers/wallets/auctioneers (“operators”). NFTs can represent ownership over digital or physical assets. We considered a diverse universe of assets, and we know you will dream up many more: + +- Physical property — houses, unique artwork +- Virtual collectables — unique pictures of kittens, collectable cards +- “Negative value” assets — loans, burdens and other responsibilities + +In general, all houses are distinct and no two kittens are alike. NFTs are distinguishable and you must track the ownership of each one separately. + +## Specification + +**Every NRC-721 compliant contract must implement the NRC721 and NRC165 interfaces**((subject to “caveats” below): + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Event; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721 { + /** + * Count all NFTs assigned to an owner + * @param owner An address for whom to query the balance + * @return The number of NFTs owned by `owner`, possibly zero + */ + @View + int balanceOf(Address owner); + + /** + * Find the owner of an NFT + * @param tokenId The identifier for an NFT + * @return The address of the owner of the NFT + */ + @View + Address ownerOf(BigInteger tokenId); + + /** + * Transfers the ownership of an NFT from one address to another address. + * When transfer is complete, this function checks if `to` is a smart contract. + * If so, it calls `onNRC721Received` on `to` and throws if the return value is `false`. + * @throws revert unless `Msg.sender()` is the current owner, an authorized + * operator, or the approved address for this NFT. + * @throws revert if `from` is not the current owner. + * @throws revert if `tokenId` is not a valid NFT. + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + * @param data Additional data with no specified format, sent in call to `to` + */ + void safeTransferFrom(Address from, Address to, BigInteger tokenId, String data); + + /** + * Transfers the ownership of an NFT from one address to another address. + * This works identically to the other function with an extra data parameter, + * except this function just sets data to "". + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + */ + void safeTransferFrom(Address from, Address to, BigInteger tokenId); + + /** + * Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + * TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + * THEY MAY BE PERMANENTLY LOST + * @throws Revert unless `Msg.sender()` is the current owner, an authorized + * operator, or the approved address for this NFT. + * @throws Revert if `from` is not the current owner. + * @throws Revert if `tokenId` is not a valid NFT. + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + */ + void transferFrom(Address from, Address to, BigInteger tokenId); + + /** + * Change or reaffirm the approved address for an NFT + * @throws revert unless `Msg.sender()` is the current NFT owner, or an authorized + * operator of the current owner. + * @param approved The new approved NFT controller + * @param tokenId The NFT to approve + */ + void approve(Address to, BigInteger tokenId); + + /** + * Enable or disable approval for a third party ("operator") to manage + * all of `Msg.sender()`'s assets. + * Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner. + * @param operator Address to add to the set of authorized operators + * @param approved True if the operator is approved, false to revoke approval + */ + void setApprovalForAll(Address operator, boolean approved); + + /** + * Get the approved address for a single NFT. + * @throws revert if there is none or if `tokenId` is not a valid NFT. + * @param tokenId The NFT to find the approved address for + * @return The approved address for this NFT. + */ + Address getApproved(BigInteger tokenId); + + /** + * Query if an address is an authorized operator for another address + * @param owner The address that owns the NFTs + * @param operator The address that acts on behalf of the owner + * @return True if `operator` is an approved operator for `owner`, false otherwise + */ + @View + boolean isApprovedForAll(Address owner, Address operator); + + /** + * This emits when ownership of any NFT changes by any mechanism. + * This event emits when NFTs are created (`from` is NULL) and destroyed. + * At the time of any transfer, the approved address for that NFT (if any) is reset to none. + *

Exception: during contract creation, any number of NFTs may be created and assigned without emitting Transfer.

+ */ + class Transfer implements Event { + private Address from; + private Address to; + private BigInteger tokenId; + + public Transfer(Address from, Address to, BigInteger tokenId) { + this.from = from; + this.to = to; + this.tokenId = tokenId; + } + + public Address getFrom() { + return from; + } + + public void setFrom(Address from) { + this.from = from; + } + + public Address getTo() { + return to; + } + + public void setTo(Address to) { + this.to = to; + } + + public BigInteger getTokenId() { + return tokenId; + } + + public void setTokenId(BigInteger tokenId) { + this.tokenId = tokenId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Transfer that = (Transfer) o; + + if (from != null ? !from.equals(that.from) : that.from != null) return false; + if (to != null ? !to.equals(that.to) : that.to != null) return false; + return tokenId != null ? tokenId.equals(that.tokenId) : that.tokenId == null; + } + + @Override + public int hashCode() { + int result = from != null ? from.hashCode() : 0; + result = 31 * result + (to != null ? to.hashCode() : 0); + result = 31 * result + (tokenId != null ? tokenId.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"from\":") + .append('\"').append(from).append('\"'); + sb.append(",\"to\":") + .append('\"').append(to).append('\"'); + sb.append(",\"tokenId\":") + .append('\"').append(tokenId).append('\"'); + sb.append('}'); + return sb.toString(); + } + } + + /** + * This emits when the approved address for an NFT is changed or reaffirmed. + * When a Transfer event emits, this also indicates that the approved address for that NFT (if any) is reset to none. + */ + class Approval implements Event { + private Address owner; + private Address approved; + private BigInteger tokenId; + + public Approval(Address owner, Address approved, BigInteger tokenId) { + this.owner = owner; + this.approved = approved; + this.tokenId = tokenId; + } + + public Address getOwner() { + return owner; + } + + public void setOwner(Address owner) { + this.owner = owner; + } + + public Address getApproved() { + return approved; + } + + public void setApproved(Address approved) { + this.approved = approved; + } + + public BigInteger getTokenId() { + return tokenId; + } + + public void setTokenId(BigInteger tokenId) { + this.tokenId = tokenId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Approval approval = (Approval) o; + + if (owner != null ? !owner.equals(approval.owner) : approval.owner != null) return false; + if (approved != null ? !approved.equals(approval.approved) : approval.approved != null) return false; + if (tokenId != null ? !tokenId.equals(approval.tokenId) : approval.tokenId != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = owner != null ? owner.hashCode() : 0; + result = 31 * result + (approved != null ? approved.hashCode() : 0); + result = 31 * result + (tokenId != null ? tokenId.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"owner\":") + .append('\"').append(owner).append('\"'); + sb.append(",\"approved\":") + .append('\"').append(approved).append('\"'); + sb.append(",\"tokenId\":") + .append('\"').append(tokenId).append('\"'); + sb.append('}'); + return sb.toString(); + } + } + + /** + * This emits when an operator is enabled or disabled for an owner. + * The operator can manage all NFTs of the owner. + */ + class ApprovalForAll implements Event { + private Address owner; + private Address operator; + private Boolean approved; + + public ApprovalForAll(Address owner, Address operator, Boolean approved) { + this.owner = owner; + this.operator = operator; + this.approved = approved; + } + + public Address getOwner() { + return owner; + } + + public void setOwner(Address owner) { + this.owner = owner; + } + + public Address getOperator() { + return operator; + } + + public void setOperator(Address operator) { + this.operator = operator; + } + + public Boolean getApproved() { + return approved; + } + + public void setApproved(Boolean approved) { + this.approved = approved; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ApprovalForAll that = (ApprovalForAll) o; + + if (owner != null ? !owner.equals(that.owner) : that.owner != null) return false; + if (operator != null ? !operator.equals(that.operator) : that.operator != null) return false; + if (approved != null ? !approved.equals(that.approved) : that.approved != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = owner != null ? owner.hashCode() : 0; + result = 31 * result + (operator != null ? operator.hashCode() : 0); + result = 31 * result + (approved != null ? approved.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"owner\":") + .append('\"').append(owner).append('\"'); + sb.append(",\"operator\":") + .append('\"').append(operator).append('\"'); + sb.append(",\"approved\":") + .append(approved); + sb.append('}'); + return sb.toString(); + } + } +} + +``` +```java +package io.nuls.token.interfaces; + + +public interface INRC165 { + /** + * Query if a contract implements an interface + * @param interfaceName The interface name, as specified in the implementation class of NRC-165. + * eg. interfaceName: ['INRC165', 'INRC721', 'INRC721Enumerable', 'INRC721Metadata'] + * @return `true` if the contract implements `interfaceName`, `false` otherwise + */ + boolean supportsInterface(String interfaceName); +} +``` + + +A wallet/broker/auction application MUST implement the **wallet interface** if it will accept safe transfers. + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; + +import java.math.BigInteger; + + +public interface INRC721TokenReceiver { + + /** + * Handle the receipt of an NFT. + * The NRC721 smart contract calls this function on the recipient + * after a `transfer`. This function MAY revert and reject the + * transfer. + * Note: the contract address is always the message sender. + * @param operator The address which called `safeTransferFrom` function + * @param from The address which previously owned the token + * @param tokenId The NFT identifier which is being transferred + * @param data Additional data with no specified format + * @return `true` if it accepts NFTs from other contracts, otherwise `false` + */ + boolean onNRC721Received(Address operator, Address from, BigInteger tokenId, String data); +} +``` + +The **metadata extension** is OPTIONAL for NRC-721 smart contracts (see “caveats”, below). This allows your smart contract to be interrogated for its name and for details about the assets which your NFTs represent. + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721Metadata { + /** + * @return A descriptive name for a collection of NFTs in this contract + */ + @View + String name() ; + + /** + * @return An abbreviated name for NFTs in this contract + */ + @View + String symbol() ; + + /** + * @return A distinct Uniform Resource Identifier (URI) for a given asset. + * NULL if `tokenId` is not a valid NFT. + */ + @View + String tokenURI(BigInteger tokenId) ; +} +``` + +The **enumeration extension** is OPTIONAL for NRC-721 smart contracts (see “caveats”, below). This allows your contract to publish its full list of NFTs and make them discoverable. + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721Enumerable { + /** + * Count NFTs tracked by this contract + * @return A count of valid NFTs tracked by this contract, where each one of + * them has an assigned and queryable owner + */ + @View + int totalSupply(); + + /** + * Enumerate valid NFTs + * @param index A counter less than `totalSupply()` + * @return The token identifier for the `index` NFT, + * (sort order not specified), NULL if `index` >= `totalSupply()`. + */ + @View + BigInteger tokenByIndex(int index); + + /** + * Enumerate NFTs assigned to an owner + * @param owner An address where we are interested in NFTs owned by them + * @param index A counter less than `balanceOf(_owner)` + * @return The token identifier for the `index` NFT assigned to `owner`, + * (sort order not specified), NULL if `index` >= `balanceOf(owner)` or invalid NFTs. + */ + @View + BigInteger tokenOfOwnerByIndex(Address owner, int index); +} +``` + +## Rationale + +There are many proposed uses of Ethereum smart contracts that depend on tracking distinguishable assets. Examples of existing or planned NFTs are LAND in Decentraland, the eponymous punks in CryptoPunks, and in-game items using systems like DMarket or EnjinCoin. Future uses include tracking real-world assets, like real-estate (as envisioned by companies like Ubitquity or Propy. It is critical in each of these cases that these items are not “lumped together” as numbers in a ledger, but instead each asset must have its ownership individually and atomically tracked. Regardless of the nature of these assets, the ecosystem will be stronger if we have a standardized interface that allows for cross-functional asset management and sales platforms. + + +**NFT Identifiers** +Every NFT is identified by a unique `uint256` ID inside the NRC-721 smart contract. This identifying number SHALL NOT change for the life of the contract. The pair `(contract address, uint256 tokenId)` will then be a globally unique and fully-qualified identifier for a specific asset on an NULS chain. While some NRC-721 smart contracts may find it convenient to start with ID 0 and simply increment by one for each new NFT, callers SHALL NOT assume that ID numbers have any specific pattern to them, and MUST treat the ID as a “black box”. Also note that a NFTs MAY become invalid (be destroyed). Please see the enumerations functions for a supported enumeration interface. + + +**Transfer Mechanism** +ERC-721 standardizes a safe transfer function `safeTransferFrom` (overloaded with and without a `bytes` parameter) and an unsafe function `transferFrom`. Transfers may be initiated by: + +- The owner of an NFT +- The approved address of an NFT +- An authorized operator of the current owner of an NFT + +Additionally, an authorized operator may set the approved address for an NFT. This provides a powerful set of tools for wallet, broker and auction applications to quickly use a large number of NFTs. + +**NRC-165 Interface** + +We chose Standard Interface Detection (NRC-165) to expose the interfaces that a NRC-721 smart contract supports. + + +**Gas and Complexity**(regarding the enumeration extension) + +This specification contemplates implementations that manage a few and arbitrarily large numbers of NFTs. If your application is able to grow then avoid using for/while loops in your code (see CryptoKitties bounty issue #4). These indicate your contract may be unable to scale and gas costs will rise over time without bound. + +**Privacy** + +Wallets/brokers/auctioneers identified in the motivation section have a strong need to identify which NFTs an owner owns. + +It may be interesting to consider a use case where NFTs are not enumerable, such as a private registry of property ownership, or a partially-private registry. However, privacy cannot be attained because an attacker can simply (!) call `ownerOf` for every possible `tokenId`. + +**Metadata Choices** (metadata extension) + +We have required `name` and `symbol` functions in the metadata extension. +We remind implementation authors that the empty string is a valid response to name and symbol if you protest to the usage of this mechanism. We also remind everyone that any smart contract can use the same name and symbol as your contract. How a client may determine which NRC-721 smart contracts are well-known (canonical) is outside the scope of this standard. + +A mechanism is provided to associate NFTs with URIs. We expect that many implementations will take advantage of this to provide metadata for each NFT. The image size recommendation is taken from Instagram, they probably know much about image usability. The URI MAY be mutable (i.e. it changes from time to time). We considered an NFT representing ownership of a house, in this case metadata about the house (image, occupants, etc.) can naturally change. + + +Metadata is returned as a string value. Currently this is only usable as calling from web3, not from other contracts. This is acceptable because we have not considered a use case where an on-blockchain application would query such information. + +Alternatives considered: put all metadata for each asset on the blockchain (too expensive), use URL templates to query metadata parts (URL templates do not work with all URL schemes, especially P2P URLs), multiaddr network address (not mature enough) + + +## NFT implementation + +1. Basic Implementaion https://github.com/MIMIEYES/NULS-NRC721-baselib +2. NRC721Metadata function implementation https://github.com/MIMIEYES/NRC721Metadata +3. NRC721Enumerable function implementation https://github.com/MIMIEYES/NRC721Enumerable +4. NRC721Full function implementation https://github.com/MIMIEYES/NRC721Full +5. NRC721Receiver function implementation https://github.com/MIMIEYES/NRC721Receiver \ No newline at end of file diff --git a/docs/NULS2.0/NULS2.0Introduction.md b/docs/NULS2.0/NULS2.0Introduction.md new file mode 100644 index 00000000..b4fbe6dd --- /dev/null +++ b/docs/NULS2.0/NULS2.0Introduction.md @@ -0,0 +1,21 @@ +# Introduction + +## Why NULS 2.0 + +NULS was created to make blockchain very simple. So, in September 2017, the core team defined the modular architecture, which was designed to make it easier for developers to write, and for users to utilize. NULS 1.0 achieves the modular effect at the coding paradigm level, but this design doesn’t solve the problem of tight coupling between modules. Developers who want to use a module or participate in the development of a module would need to understand the design of other modules associated with it and can only use a specific language for the development of their module. This is not friendly to the NULS vision for the technical community which anticipates intense, active participation in the design and development of NULS architecture, as well as the user’s supply of simple and low-cost modules. + +Since its conception in 2017, NULS has been committed to establishing a community-driven open-source project. This community-driven route for development is what stimulates continuous innovation and distinguishes blockchain projects from other commercial projects. Continuous iteration and innovation is both inherent and inevitable in open source projects, and is also a novel and valuable feature of blockchain. In order to allow ease of participation to the open-source and technical community for developing on NULS, and to establish ease of use provided by the “Module Repository”, which is an important part of the revolutionary product “Chain Factory”, the following difficulties had to be overcome: + +1. Loosened coupling and removal of dependencies between modules; + +2. Modules must be easier to extend, modify and replace. Each module must be simple and basic; and modules should not encompass the overall complexity of blockchain applications; + +3. Complete elimination of programming language limitations. + +The core team introduces an innovative microservice concept in the infrastructure design of blockchain, which designs software applications as service suites that can be deployed independently. This concept introduces the most advanced ideas in the 1.0 architecture and transforms them with enhanced flexibility into a new modular design, making modules as flexible as programs that can start independently. This new modular architecture enhanced with microservice suites, that have no programming language limitations, is called NULS 2.0. Modules in this architecture enjoy even more decoupling, while the feature of multi-language development greatly improves the contribution of code and the convenience of users. At the same time, it is even easier to extend, since the enhanced design of modules supports distributed deployment and hot module replacement. Both Chain Factory and Cross-Chain Modules are being developed in coordination with this architecture. + + +## Philosophy of Design + + +The NULS2.0 microservice architecture evolved over time. For more information on how it came about, read the documentation[NULS2.0:Philosophy of Design](https://nuls.io/wp-content/uploads/2019/07/NULS-2.0-Philosophy-of-Design-V0.1-Eng_Final.pdf).The documentation details the NULS2.0 evolutionary path。 \ No newline at end of file diff --git a/docs/NULS2.0/README.md b/docs/NULS2.0/README.md new file mode 100644 index 00000000..56c1cc20 --- /dev/null +++ b/docs/NULS2.0/README.md @@ -0,0 +1,37 @@ + +# NULS2.0 Beta Version is released + +Dear users: + +It is a great honor to announce that the NULS2.0 Beta version has been released on 2019-07-08. We sincerely invite you to participate in the public test. + +The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture. + +The Beta version test mainly includes: +- [NULS ChianBox](/NULS2.0/chainBoxGuide.html) +- [Develope Module](/NULS2.0/developeModule.html) +- [Web wallet](http://beta.wallet.nuls.io/) +- [Node Wallet and Light Wallet](https://github.com/nuls-io/nuls-v2/releases) +- [Blockchain Explorer](http://beta.nulscan.io/) + +### Join Test: + +1 [Download wallet](https://github.com/nuls-io/nuls-v2/releases) or directly access [Web wallet](http://beta.wallet.nuls.io/) + +2 If you want to use linux wallet,you need learn [linux CLI Manual](/NULS2.0/linuxTutorial.html) + +3 [Apply for test NULS](https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141) and reply: beta+address + +4 [Access blockchain explorer](http://beta.nulscan.io/) + +5 [NULS ChianBox](/NULS2.0/chainBoxGuide.html) + +6 Submit bug:[https://github.com/nuls-io/nuls_2.0/issues](https://github.com/nuls-io/nuls_2.0/issues) + +### Related Link + +- Github:[https://github.com/nuls-io/nuls_2.0](https://github.com/nuls-io/nuls_2.0) +- Community:[https://nuls.community](https://nuls.community) +- Tech community Telegram:[https://t.me/nulstest](https://t.me/nulstest) + +To learn more about us, visit [nuls.io](https://nuls.io). diff --git a/docs/NULS2.0/chainBoxGuide.md b/docs/NULS2.0/chainBoxGuide.md new file mode 100644 index 00000000..e2cb1d52 --- /dev/null +++ b/docs/NULS2.0/chainBoxGuide.md @@ -0,0 +1,712 @@ +# NULS ChainBox +## What’s NULS ChainBox + +ChainBox is an out-of-the-box solution to chain-building. It encapsulates six underlying modules: ledger, accounts, transactions, blocks, consensus, and network. ChainBox eliminates the necessity of direct blockchain experience and the need to understand distributed data storage, point-to-point transmission, consensus mechanisms, and encryption algorithms. Instead of spending time on blockchain architecture, developers can focus on creating independent business modules based on standard communication protocols, then form a brand new application chain in minutes with ChainBox. + +## Why Chainbox + +NULS ChainBox is designed to help enterprises or application developers build applications on the blockchain with ease and focus on their own business implementations without concern for the arcane and complex underlying technology of blockchains. + +## Features +Essentially NULS ChainBox is an extension of NULS 2.0 with the positioning to be a one-stop blockchain development platform. It has three core features: +- Quickly set up development environment +- Lower the threshold of application development through templates +- Reduce the difficulty of template integration through conventions and scripts and realize one-click generation of executable programs + +## Quick start +In the following case, you will experience how to quickly build a blockchain application that provides encrypted message services with the help of NULS ChainBox. + +### 1 Environment preparation +- Operating System of Linux Kernel +- Install Git +- Install Maven +- Install JDK11 + +### 2 Get NULS ChainBox +Open the terminal and run the following command + +``` +git clone https://github.com/nuls-io/nuls-chainbox.git chainbox +``` +### 3 Building encrypted message module +Run the command to enter the `example` directory +``` +cd example # enter the sample folder +``` +Run the command to build a module + +``` +./package # execute the build script (provided by the template) +``` +The following output indicates the success of the build +``` +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` + +If the build is successful, you will find the `outer` folder generated in `example`. + +> PS: If you want to know the detailed design of the module, please refer to the [message Module Design](./developeModule.md) + +### 4 Integrated encrypted message module +Go back to the `chainbox` root directory + +``` +cd .. +``` + +Run the command to integrate the encryption module into NULS 2.0 runtime environment + +``` +./tools -p example +``` +The following output indicates the success of the integration + +``` +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` + +After that, the `NULS-WALLET` folder will be generated in the `chainbox` directory, which contains the NULS 2.0 running program integrated with the encrypted message module. + +If multiple nodes are deployed on different machines, it is recommended to modify the following two parameters in the `NULS-WALLET/.default-config.ncf` configuration file. + + ``` +# Minimum number of linking nodes. If the number of linking nodes is lower than this parameter, it will continue to wait +minNodeAmount=0 + +# Seed node block address +seedNodes=tNULSeBaMkrt4z9FYEkkR9D6choPVvQr94oYZp +``` + + + + +### 5 Start node program +After the configuration, run the following command in the `NULS-WALLET` directory + +``` +./start-dev +``` +The following outputs indicate that the module is starting + +``` +LOG PATH : ~/NULS-WALLET/Logs +DATA PATH : ~/NULS-WALLET/data +CONFIG FILE : ~/NULS-WALLET/nuls.ncf +DEBUG : 0 +JAVA_HOME : /Library/java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home +java version "11.0.2" 2019-01-15 LTS +Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) +Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) + +==================== +NULS-WALLET STARING +==================== +``` + +Check the startup status through the following command + +``` +./check-status +``` +The following outputs indicate that all the modules of the node have been successfully started. +``` +==================MODULE PROCESS==================== +account PROCESS IS START +block PROCESS IS START +consensus PROCESS IS START +ledger PROCESS IS START +network PROCESS IS START +transaction PROCESS IS START +==================RPC REDAY MODULE================== +account RPC READY +block RPC READY +consensus RPC READY +ledger RPC READY +network RPC READY +transaction RPC READY +======================REDAY MODULE================== +account STATE IS READY +block STATE IS READY +consensus STATE IS READY +ledger STATE IS READY +network STATE IS READY +transaction STATE IS READY +================TRY RUNNING MODULE================== +account TRY RUNNING +block TRY RUNNING +consensus TRY RUNNING +ledger TRY RUNNING +network TRY RUNNING +transaction TRY RUNNING +===================RUNNING MODULE=================== +account STATE IS RUNNING +block STATE IS RUNNING +consensus STATE IS RUNNING +ledger STATE IS RUNNING +network STATE IS RUNNING +transaction STATE IS RUNNING +==================NULS WALLET STATE================= +========================== +NULS WALLET IS RUNNING +========================== +``` + +### 7 Import block address of seed node + +Now that the seed node is started, we need to enter the command line and import the default block address of the seed node so that the node can produce blocks. + +First enter the command line + +``` +./cmd +``` +Next you must import the block address of the seed node. This is very important, and if you miss this step, the rest won't work. + +Enter: import b54db432bba7e13a6c4a28f65b925b18e63bcb79143f7b894fa735d5d3d09db5 + +Password: nuls123456 + +``` +nuls>>> import b54db432bba7e13a6c4a28f65b925b18e63bcb79143f7b894fa735d5d3d09db5 +# Import the address of the seed node through the private key, and the address generated by the private key must be the same as the second address in Step 5. +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password: nuls123456 +# Set the password for the imported address which must be nuls123456 +Please confirm new password: nuls123456 +# Repeat the password entered in the previous step +tNULSeBaMkrt4z9FYEkkR9D6choPVvQr94oYZp +# Import address successfully, verify that the address is exactly the same as the second configuration item in Step 4 +``` + +### 8 Use encrypted message +- Prepare two accounts to test sending and receiving message. The following two addresses are defined in the genesis block in the test environment, which contain certain amount of assets for testing. + + ``` + nuls>>> import 477059f40708313626cccd26f276646e4466032cabceccbf571a7c46f954eb75 + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********** + Please confirm new password:********** + tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD + + nuls>>> import 8212e7ba23c8b52790c45b0514490356cd819db15d364cbe08659b5888339e78 + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********** + Please confirm new password:********** + tNULSeBaMrbMRiFAUeeAt6swb4xVBNyi81YL24 + ``` + + + +- Enter the `NULS-WALLET/Modules/Nuls/mail-example/1.0.0` directory and open `mail-test.html` with a browser (this is a simple test page that can test the functions of binding messagebox address, sending and receiving messages). First, bind the messagebox address to the account. + + +Set emessage addresses for two test accounts, and enter the password of the test account you just set. The hash value of this transaction will be returned if the submission is successful. Here the emessage addresses we applied for are asd@nuls.io and l24@nuls.io respectively. After setting up, we need to wait about 10 seconds to confirm the block. +- Now let's test sending message to l24@nuls.io with asd@nuls.io. Enter the receiver's emessage address, the sender's account address, and the sender's account password. The hash value of this transaction will be returned if the submission is successful. + +- After waiting for about 10 seconds (to ensure that the transaction has been confirmed), the content of the message can be viewed by the hash value of the message sent. Only the sender and the receiver have the permission to view it. + + + ``` + { + "sendermessageAddress": "asd@nuls.io", //Sender's messagebox address + "receivermessageAddress": "24@nuls.io", /Receiver’s messagebox address + "title": "this is title", //message title + "content": "NULS 666.", //message content + "sender": "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", //Sender’s account address + "date": 1561365228904 //Delivery timestamp (milliseconds from January 1, 1970 to the present) + } + ``` + +## ChainBox Guide +### Directory Structure +#### tools +ChainBox uses the portal to provide operations such as acquiring programs, integrating packages, and so on. [Command Parameter Document](#cmd-doc). +#### document +A list of documents. +#### example +An example module program source code for an encrypted mail developed based on a java module template. +#### rpc-debug-tool +Basic module rpc interface debugging tool. + +#### Get NULS2.0 run environment + +The NULS2.0 running environment contains the most basic block chain program, which contains six core modules: account, ledger, block, network, transaction, consensus (poc). Running NULS2.0 basic run environment you can get the core functions of the underlying blockchain including account model, transfer transaction, POC consensus incentive, etc. If you want to send a simple chain transfer deal, by modifying the configuration file can be completed ([complete configuration list](https://github.com/nuls-io/nuls-v2/blob/develop/useguide.md#nulsncf-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6)). You can integrate your own business modules in the base environment and do so by extending a new type of transaction, which I'll describe in detail in the next section. + + +Use the tools script to get the NULS2.0 run environment + +``` +./tools -n +``` +The script first checks the current environment, then pulls NULS2.0 code from the github repository, executes the package to complete the NULS2.0 compilation and packaging, and outputs the runnable program to the./ nuls-wallet -RUNTIME directory. +When you see the following, the packaging is complete. +``` +============ ~/nuls-engine/NULS-WALLET-RUNTIME PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` +#### NULS-WALLET-RUNTIME directory structure +##### start-dev +Boot node +##### stop-dev +Stop node +##### check-status +Check the operating status of each module +##### cmd +Command line startup script +##### create-address +Create address tool +##### nuls.ncf +Configuration file (created after running the start-dev script for the first time) +##### More usage reference ([NULS2.0 Wallet User Manual](https://github.com/nuls-io/nuls-v2/blob/develop/useguide.md)) + +### How to develop your own module +NULS2.0 is a distributed microservice architecture program written in JAVA language. The entire node program consists of multiple modules, each of which communicates via the websocket protocol. NULS 2.0 defines a standard [module communication protocol](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md), this standard protocol can be implemented in various development languages ​​to communicate with other modules to realize their own business logic. Extending your own business logic is mainly achieved by extending the new transaction type, storing its own business data in the transaction's txData, and txData will follow the transaction in the chain. +#### Creating a transaction process +![node creation transaction](./chainbox/createTX.jpg) +#### Processing network transaction process +![Processing Webcast Transactions](./chainbox/network.jpg) + +As you can see from the figure, there are four main things you need to do to extend a new business module. +1. Register your own transaction type in the trading module. +2. Assemble the transaction data and call the trading module to create a new transaction. +3. Verify that the business data in the transaction is legal. +4. Save the business data in the transaction to the node database. + +Of course, in addition to the above 4 steps, business data needs to be used according to specific business needs. Below I will introduce the above 4 steps in detail. + +Each transaction in the system needs to define a unique transaction type of an integer type (extended transactions typically use values ​​above 200) to distinguish the callback function of the processed transaction. The registration transaction interface provided by the transaction module should normally be called when the module is started (please check the RPC interface documentation of the transaction module). When the transaction module gets a transaction to be processed, it will be verified according to the transaction type to the registered verification function to verify the legality of the transaction data. In addition to validation, there are two functions: commitTx (save transaction business data) and rollbackTx (rollback transaction business data). + +Usually the business module assembles its own extended transaction type. A legal transaction includes transaction type, timestamp, CoinData, txData, remarks, and signature. CoinData includes transfer data, transfer accounts, transfer accounts, transfer amounts, asset information, and so on. The txData mainly uses the save business data, the underlying layer does not verify and process the txData field, and the business module stores its own business data in txData according to the business design. The signature field signs all transaction data by an elliptic curve algorithm to ensure that the data is not skewed during transmission. After the assembly is complete, the transaction module interface is called to create the transaction. + +The trading module will create a transaction through the current node itself, and will also receive the transactions broadcast by other nodes through the network module. After the transaction module gets the transaction, it first checks whether the parameters of the transaction data are legal, then checks whether the account balance is sufficient to pay the transaction fee, and then verifies the nonce value of the account (an algorithm that guarantees that the balance is not reused by controlling the transaction order) )is it legal. After the verification is passed, the callback function of the business verification is found according to the transaction type, and the transaction is verified by the business. + +Finally, when the transaction breaks into the block and the block has been confirmed, a callback function for storing the service data will be found through the transaction type, and the service module can be notified that the service data guide node can be kept local. In some cases, block rollback may occur. When the block is rolled back, the transaction data is also matched to the corresponding transaction rollback callback function to roll back the business data. + +The above are the core steps that need to be done to extend a transaction type. The three interfaces of verifying transactions, saving business data, and rolling back business data are implemented by the business module, and the specific [interface protocol](#registerTx) is viewed. +### Communicate with other modules +NULS 2.0 uses a microservices architecture, and modules communicate using [websocket](https://zh.wikipedia.org/wiki/WebSocket). The links to all modules are governed by Nulstar and the process is as follows: + +![](./chainbox/pic01.jpg) + +All modules are started by the ServiceManager. After startup, the device establishes a connection with the ServiceManager module. The handshake is completed according to the protocol. After the handshake is successful, it is registered with the ServiceManager. The purpose of the registration is to tell the ServiceManager its connection mode, the provided interface protocol, and which modules to rely on. +#### establish connection +The connection is established using the standard websocket protocol, and the connection manner will not be described here. After the connection is established, you can send a packet (interface request) and receive the other party's data packet to the other party. Note: All requests are asynchronous requests, non-synchronous blocking. +#### Shaking hands with ServiceManager +After establishing a connection with the ServiceManager, you need to send a NegotiateConnection object first. The service can process other requests only when the negotiation is successful. Otherwise, you should receive the NegotiateConnectionResponse object with the status set to 0 (failed) and immediately disconnect. +It consists of two fields: + +- CompressionAlgorithm (default: zlib): A String representing the algorithm that will be used to receive and send messages if CompressionRate is greater than zero. The default is zlib, which is supported in most development languages. +- CompressionRate: An integer between 0 and 9 that establishes the level of compression at which messages should be sent and received for this connection. 0 means no compression, and 9 means maximum compression + +Example: + +```json + { + "MessageID": "15622130397455", + "Timestamp": "1562213039745", + "TimeZone": "9", + "MessageType": "NegotiateConnection", + "MessageData": { + "Abbreviation": "ledger", + "ProtocolVersion": "0.1", + "CompressionAlgorithm": "zlib", + "CompressionRate": "0" + } + } +``` +After the handshake is successful, the ServiceManager sends a NegotiateConnectionResponse object to the service module. It consists of two fields: + +- NegotiationStatus: Unsigned small integer value, 0 if negotiation failed, 1 if successful +- NegotiationComment: A string value that describes what went wrong when rejecting the connection. + +Example: + +```json +{ + "MessageID": "156221303974612033", + "Timestamp": "1562213039759", + "TimeZone": "9", + "MessageType": "NegotiateConnectionResponse", + "MessageData": { + "RequestID": "15622130397455", + "NegotiationStatus": "1", + "NegotiationComment": "Connection true!" + } +} +``` + +#### registerAPI (registration module) +After the handshake with the ServiceManager is successful, the RegisterAPI request is sent to the ServiceManager to complete the registration. The ServiceManager will obtain the connection information and interface method of the module through this request, and determine whether the module meets the normal working conditions by analyzing whether the dependent module of the module exists. + +Example: + +``` +{ + "MessageID": "15622130392482", + "Timestamp": "1562213039248", + "TimeZone": "9", + "MessageType": "Request", + "MessageData": { + "RequestAck": "0", + "SubscriptionEventCounter": "0", + "SubscriptionPeriod": "0", + "SubscriptionRange": "0", + "ResponseMaxSize": "0", + "RequestMethods": { + "RegisterAPI": { + "Methods": [ + { + "MethodName": "getAssetsById", + "MethodDescription": "清除所有账户未确认交易", + "MethodMinEvent": "0", + "MethodMinPeriod": "0", + "MethodScope": "public", + "Parameters": [ + { + "ParameterName": "chainId", + "ParameterType": "", + "ParameterValidRange": "[1-65535]", + "ParameterValidRegExp": "" + }, + { + "ParameterName": "assetIds", + "ParameterType": "", + "ParameterValidRange": "", + "ParameterValidRegExp": "" + } + ] + } + ], + "Dependencies": { + "block": "1.0", + "network": "1.0" + }, + "ConnectionInformation": { + "IP": "192.168.0.197", + "Port": "17880" + }, + "ModuleDomain": "Nuls", + "ModuleRoles": { + "ledger": [ + "1.0" + ] + }, + "ModuleVersion": "1.0", + "Abbreviation": "ledger", + "ModuleName": "ledger" + } + } + } +} +``` +When the ServiceManager determines that the dependencies have been started, it returns a Response that contains the way the dependent modules are linked. + +Example: + +``` +{ + "MessageID": "1562213039283455", + "Timestamp": "1562213039283", + "TimeZone": "9", + "MessageType": "Response", + "MessageData": { + "RequestID": "15622130392482", + "ResponseProcessingTime": "2", + "ResponseStatus": 0, + "ResponseComment": "success", + "ResponseMaxSize": "0", + "ResponseData": { + "RegisterAPI": { + "Dependencies": { + "consensus": { + "IP": "192.168.0.197", + "Port": "18735" + }, + "ledger": { + "IP": "192.168.0.197", + "Port": "17880" + }, + "nuls-module-explorer": { + "IP": "192.168.0.197", + "Port": "10130" + }, + "kernel": { + "IP": "0.0.0.0", + "Port": "7771" + }, + "block": { + "IP": "192.168.0.197", + "Port": "13437" + }, + "transaction": { + "IP": "192.168.0.197", + "Port": "14026" + }, + "account": { + "IP": "192.168.0.197", + "Port": "15121" + }, + "network": { + "IP": "192.168.0.197", + "Port": "15481" + } + } + } + }, + "ResponseErrorCode": null + } +} +``` +After the module obtains the link mode of the dependent module, it can establish a connection with the other module to send the interface request. +#### Calling other module interfaces +Before calling the interface of other modules, it is also necessary to complete the operation of establishing a websocket connection and shaking hands with the module. After the handshake is completed, the Request object can be sent to the module. + +Example: + +``` +{ + "MessageID": "156222086356134", + "Timestamp": "1562220863561", + "TimeZone": "9", + "MessageType": "Request", + "MessageData": { + "RequestAck": "0", + "SubscriptionEventCounter": "0", + "SubscriptionPeriod": "0", + "SubscriptionRange": "0", + "ResponseMaxSize": "0", + "RequestMethods": { + "ac_createAccount": { + "chainId": 2, + "count": 1, + "password": "nuls123456" + } + } + } +} +``` +The content of RequestMethods is the requested parameter, and the outer data is the protocol layer. After the business module is processed, the Response object is sent, and the processing result and the result data are returned. + +Example: + +``` +{ + "MessageID": "156222086367037", + "Timestamp": "1562220863664", + "TimeZone": "9", + "MessageType": "Response", + "MessageData": { + "RequestID": "156222086356134", + "ResponseProcessingTime": "107", + "ResponseStatus": 0, + "ResponseComment": "success", + "ResponseMaxSize": "0", + "ResponseData": { + "ac_createAccount": { + "list": [ + "tNULSeBaMkef3L6EsMcigwT1C1uebzfsj63jd3" + ] + } + }, + "ResponseErrorCode": null + } +} +``` +#### Reference Document: +* [Websocket-Tool Design Document](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-EN/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md) +* [Nulstar Module Specification](https://github.com/nuls-io/Nulstar/blob/master/Documents/Nulstar%20-%20Documentation%20-%20Module%20Specification.pdf) +* [Basic Module Interface Document](#doclist) + +### Get module development templates for various development languages +In theory, as long as the connection is established with the module through the websocket, and then the information exchange with the module according to the agreed protocol can realize the expansion of the business module. However, the way to build wheels from scratch is relatively inefficient and the threshold is relatively high. In order to reduce the difficulty of module development, we will provide a quick start template for various languages (currently only java is provided), developers only need to be in the template. The development of the extension module can be completed by inserting specific business logic code at the specified location. + +The module development template for the specified language can be obtained very easily through the tools script. + +``` +tools -t java +``` +After the execution is completed, a folder of nuls-module-java will be created in the current directory, and the common development tools can be imported to start the development business. There will be corresponding usage documents in each template. +### Module debugging method +In the module development process, you need to coordinate with the basic module. After obtaining the NULS2.0 runtime environment, execute the start-mykernel script to start the NULS2.0 basic module, and then address the ws://127.0.0.1:7771 in the service module. Register and register the agreement. After completing the registration, you can get the communication address of each module you depend on and call the module's interface. +### Integrating business modules into the NULS 2.0 runtime environment +After the business module is developed, the business module needs to be integrated into the NULS2.0 runtime environment, and then the output program is deployed to the production environment or output to an external node. There are several conventions that need to be met to complete the integration using the tools script. +1. The packaged executable program should be placed in the outer directory of the module development directory. +2. The outer directory must have a configuration file named Module.ncf (note M capitalization). The contents of the file are as follows (take java as an example) + +``` +[Core] +Language=JAVA # Indicate the development language +Managed=1 # 1 means the module starts with the node program, 0 means manual start +     +[Libraries] +JRE=11.0.2 # Module Operating Environment Version +     +[Script] +Scripted=1 # Whether to use script to start 1 means yes +StartScript=start # Start the module script (start must be in the outer directory) +StopScript=stop # Stop the module script (stop must be in the outer directory)    +     +``` +3. The module can be started and stopped by the script configured in 2 + +> The above convention has been completed in the module development template. + +## Appendix +### tools script manual +### Getting the NULS2.0 runtime environment +#### Command: tools -n +#### parameter list +no +#### Example + +``` +tools -n +``` +### Get the specified language module development template +#### Command: tools -t <language> [out folder] +#### parameter list +| Parameter | Description | +| --- | --- | +| <language> | Language Template Name | +| [out folder] | Output folder name | +#### Example + +``` +tools -t java demo +``` +### View a list of available templates +#### Command: tools -l +#### parameter list +no +##### Example + +``` +doto +``` +### Integrating modules into the NULS 2.0 runtime environment +#### Command: tools -p <module folder> +#### parameter list +| Parameter | Description | +| --- | --- | +| <out folder> | Module folder name | +#### Example + +``` +./tools -p demo +``` +### Business Module Related Interface Protocol +The business module needs to provide three callback functions to the transaction module. The transaction module will call these three functions through the websocket. The parameters of the three functions are the same and the names are different. +#### Verifying a transaction +Cmd name: txValidator + +It is used by the service module to verify whether the txData data is legal. It can also verify whether the data such as coinData meets the business requirements. If the verification fails, the trading module will discard the transaction. +#### Save transaction business data +Cmd name: txCommit + +It is used to save the business data in the transaction to the node local database, or to do the corresponding business logic processing. The transactions that arrive at this step are all consensus data. +#### Rollback transaction business data +Cmd name: txRollback + +When the block is rolled back, the callback function will be triggered. The business module should clear the business data related to the transaction in the function, or perform corresponding reverse processing. +#### Callback function parameter list +| Parameter Name | Type | Parameter Description | +| --- | --- | --- | +| chainId | int | chain id (distinguishing data sources when nodes are running multiple chains) | +| txList | list | Trading List | +| blockHeader | object | block header | + +#### Deserialization, [Common Agreement](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-EN/h.%E9%80%9A%E7%94%A8%E5%8D%8F%E8%AE%AE%E8%AE%BE%E8%AE%A1v1.3.md) +The data of the two parameters txList and blockHeader are transmitted in the form of hexadecimal data. First, the hexadecimal is converted into a byte array, and then deserialized into structured data according to different rules. +##### [Transaction](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/Transaction.java) +The txList stores a list of Transaction objects. Each item is a serialized Transaction object into a hexadecimal string. Deserialize txList first from [General Protocol](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md) takes the value of the txList parameter, which is a string array of json, and then iterates through the array to get the serialized value of a single Transaction object. Convert the serialized value to a byte array. Then take the corresponding data values ​​one by one from the byte array. +The rules for reading data in a byte array are as follows: +1. 2 bytes store unsigned 16-bit int to save the transaction type. +2. 4 bytes store unsigned 32-bit int to save transaction timestamp (January 1, 1970 to the current number of seconds) +3. Variable length type storage remark string, see [variable length type reading method] (# variable length type storage structure) +4. Become a type store txData string, business custom, but still need to be converted into a byte array. +5. The variable length type stores the coinData string, which is the hexadecimal string after the serialData object is serialized. See [CoinData Deserialization Method](#CoinData) +6. The variable length type stores the transaction signature string, which is a hexadecimal string serialized by the TransactionSignature object. + +##### [CoinData](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinData.java) +The CoinData object stores the relationship between the deposit and withdrawal of a transaction. A transaction withdrawal account and a deposit account support a many-to-many relationship. As long as the total withdrawal amount is greater than or equal to the total deposit amount plus the commission transaction, it can be established. +1. The [varint](https://learnmeabitcoin.com/glossary/varint) type stores the list of gold account information. +2. Store the gold account information list in order. The deposit account information is CoinFrom object. Note that the CoinFrom object is not processed in hexadecimal string. +3. [varint](https://learnmeabitcoin.com/glossary/varint) Type The number of lists of deposit account information. +4. Store the deposit account information list in order. The deposit account information is CoinTo object. Note that the CoinTo object is not processed in hexadecimal string. + +##### [CoinFrom](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinFrom.java) +1. Variable length type storage account address. [Address Serialization Code](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/basic/AddressTool.java ) +2. 2 bytes store unsigned 16-bit int to save the asset chain id. +3. 2 bytes store unsigned 16-bit int to save the asset id. +4. 32 bytes store the numeric data of the BigInteger type to save the amount of gold assets. +5. Variable length type storage account nonce value. +6. 1 byte storage lock status (for consensus) + +##### [CoinTo](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinTo.java) +1. Variable length type storage account address. [Address Serialization Code](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/basic/AddressTool.java ) +2. 2 bytes store unsigned 16-bit int to save the asset chain id. +3. 2 bytes store unsigned 16-bit int to save the asset id. +4. 32 bytes store the numeric data of the BigInteger type to save the amount of gold assets. +5. 8 bytes store signed 64-bit long save lock time (time to lock assets) + +##### [TransactionSignature](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/signture/TransactionSignature.java) +There will be multiple signatures in front of the transaction, so the TransactionSignature stores the list of signature data. Multiple signatures are stored sequentially in a byte array. In the case of deserialization, it is rotated in turn. +1. 1 byte stores the public key length. +2. Public key data (length is obtained according to 1) +3. Variable length type stores signature data. + +##### [BlockHeader](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/BlockHeader.java) +BlockHeader is a block header object, which mainly stores the hash value of the previous block, the root hash value of [merkle tree](https://en.wikipedia.org/wiki/Merkle_tree), the block timestamp, the block height, and the block. Total number of transactions, block signatures, and extended data. +Serialization rules: +1. 32 bytes store the hash value of the previous block. +2. 32 bytes store the hash value of the merkle root. +3. 4 bytes store unsigned 32-bit int to save the block timestamp (from January 1, 1970 to the current number of seconds). +4. 4 bytes store unsigned 32-bit int to save block height. +5. 4 bytes store unsigned 32-bit int to save the total number of transactions in the current block. +6. Variable length type storage extension data. +7. The variable length type stores the transaction signature string, which is the hexadecimal string serialized by the BlockSignature object. + +##### [BlockSignature](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/signture/BlockSignature.java) +1. 1 byte stores the public key length. +2. Public key data (length is obtained according to 1) +3. Variable length type stores signature data. + +##### Variable Length Type Storage Structure +The variable length type consists of two parts. The first part is the length of the byte occupied by the varint type storage data, and the second part is the data part. The way to read the variable length type structure is to read the varint data first and read the corresponding length of the business data. +1. [varint](https://learnmeabitcoin.com/glossary/varint) type stores the length of the byte array. +2. Convert the business data into a byte array and store it. + + + + +### Module Template List +* [java module development template](https://github.com/nuls-io/nuls-module-template-java) +* [Blockchain Browser Template](https://github.com/nuls-io/nuls-module-explorer) + +### Document List +* [Java module development template usage documentation](https://github.com/nuls-io/nuls-module-template-java) +* [Encrypted Mail Sample Module Design Document](https://github.com/CQBeer/nuls-chainbox/blob/master/example/%E6%A8%A1%E5%9D%97%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.md) +* [Account Module RPC Interface Document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/account.md) +* [book module RPC interface document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/ledger.md) +* [Transaction Module RPC Interface Document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/transaction.md) +* [Block module RPC interface document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/block.md) +* [Consensus Module RPC Interface Document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/consensus.md) +* [Network Module RPC Interface Document](https://github.com/nuls-io/nuls-chainbox/blob/master/document/netwrok.md) +### Contribution + +Contributions to NULS are welcomed! We sincerely invite developers who experienced in blockchain field to join in NULS technology community. [Details](https://nuls.communimunity/d/9-recruitment-of-community-developers) To be a great community, Nuls needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. + +### License + +Nuls is released under the [MIT](http://opensource.org/licenses/MIT) license. +Modules added in the future may be release under different license, will specified in the module library path. + +### Community + +- [nuls.io](https://nuls.io/) +- [@twitter](https://twitter.com/nulsservice) +- [facebook](https://www.facebook.com/nulscommunity/) +- [YouTube channel](https://www.youtube.com/channel/UC8FkLeF4QW6Undm4B3InN1Q?view_as=subscriber) +- Telegram [NULS Community](https://t.me/Nulsio) +- Telegram [NULS 中文社区](https://t.me/Nulscn) + +#### diff --git a/docs/NULS2.0/chainbox/createTX.jpg b/docs/NULS2.0/chainbox/createTX.jpg new file mode 100644 index 00000000..5aef2551 Binary files /dev/null and b/docs/NULS2.0/chainbox/createTX.jpg differ diff --git a/docs/NULS2.0/chainbox/network.jpg b/docs/NULS2.0/chainbox/network.jpg new file mode 100644 index 00000000..1074b75c Binary files /dev/null and b/docs/NULS2.0/chainbox/network.jpg differ diff --git a/docs/NULS2.0/chainbox/pic01.jpg b/docs/NULS2.0/chainbox/pic01.jpg new file mode 100644 index 00000000..b24c12af Binary files /dev/null and b/docs/NULS2.0/chainbox/pic01.jpg differ diff --git a/docs/NULS2.0/developModule/1.png b/docs/NULS2.0/developModule/1.png new file mode 100755 index 00000000..8e65e2f8 Binary files /dev/null and b/docs/NULS2.0/developModule/1.png differ diff --git a/docs/NULS2.0/developModule/10.png b/docs/NULS2.0/developModule/10.png new file mode 100755 index 00000000..310e04af Binary files /dev/null and b/docs/NULS2.0/developModule/10.png differ diff --git a/docs/NULS2.0/developModule/11.png b/docs/NULS2.0/developModule/11.png new file mode 100755 index 00000000..830865d8 Binary files /dev/null and b/docs/NULS2.0/developModule/11.png differ diff --git a/docs/NULS2.0/developModule/12.png b/docs/NULS2.0/developModule/12.png new file mode 100755 index 00000000..1caae09f Binary files /dev/null and b/docs/NULS2.0/developModule/12.png differ diff --git a/docs/NULS2.0/developModule/2.png b/docs/NULS2.0/developModule/2.png new file mode 100755 index 00000000..f9526d9c Binary files /dev/null and b/docs/NULS2.0/developModule/2.png differ diff --git a/docs/NULS2.0/developModule/3.png b/docs/NULS2.0/developModule/3.png new file mode 100755 index 00000000..7651329f Binary files /dev/null and b/docs/NULS2.0/developModule/3.png differ diff --git a/docs/NULS2.0/developModule/4.png b/docs/NULS2.0/developModule/4.png new file mode 100755 index 00000000..0e7ec9be Binary files /dev/null and b/docs/NULS2.0/developModule/4.png differ diff --git a/docs/NULS2.0/developModule/5.png b/docs/NULS2.0/developModule/5.png new file mode 100755 index 00000000..2c0ebc59 Binary files /dev/null and b/docs/NULS2.0/developModule/5.png differ diff --git a/docs/NULS2.0/developModule/6.png b/docs/NULS2.0/developModule/6.png new file mode 100755 index 00000000..0373a053 Binary files /dev/null and b/docs/NULS2.0/developModule/6.png differ diff --git a/docs/NULS2.0/developModule/7.png b/docs/NULS2.0/developModule/7.png new file mode 100755 index 00000000..58fb580f Binary files /dev/null and b/docs/NULS2.0/developModule/7.png differ diff --git a/docs/NULS2.0/developModule/8.png b/docs/NULS2.0/developModule/8.png new file mode 100755 index 00000000..909b2d41 Binary files /dev/null and b/docs/NULS2.0/developModule/8.png differ diff --git a/docs/NULS2.0/developModule/9.png b/docs/NULS2.0/developModule/9.png new file mode 100755 index 00000000..e732c9a1 Binary files /dev/null and b/docs/NULS2.0/developModule/9.png differ diff --git a/docs/NULS2.0/developeModule.md b/docs/NULS2.0/developeModule.md new file mode 100644 index 00000000..4311b938 --- /dev/null +++ b/docs/NULS2.0/developeModule.md @@ -0,0 +1,82 @@ +# Develope Module + +> This docs is Java version + +Nuls-module-java-template combined with NULS-ChainBox can help you quickly build blockchain business modules implemented in Java. Two core packages of nuls-core-rpc and nuls-base under io.nuls.v2 are imported in the template. The former implements the basic communication protocol with the module, and the latter includes the basic data structure and utility class of the block. + +## Template file structure + +``` +. +├── README.md +├── build # build related scripts +├── init.sh # initialize project scripts +├── module.ncf # configuration file of the module +├── package # build scripts +├── pom.xml # maven pom.xml +└── src # java source code +``` +## Using templates +Download this template using the `tools` script in the NULS-ChainBox project. + +``` +Tool-t Java demo # demo is a custom module name +``` +When the download is complete, `tools` will automatically replace the module names defined in pom.xml and module.ncf with `demo`. Import the project in the way of importing Maven projects using common Java development tools. + +## Introduction to source code structure +``` +. +└── io +    └── nuls +        ├── MyModule.java # the bootstrap class of the module that needs to be implemented, including transaction registration, data table initialization, web service and other preparation work. +        ├── NulsModuleBootstrap.java # the bootstrap class of the module, usually without modification +        ├── Utils.java # utility class with the function of transaction signature +        ├── rpctools # rpc toolkit +        │ ├── AccountTools.java # utility functions related to account module +        │ ├── CallRpc.java +        │ ├── LegderTools.java # utility functions related to ledger module +        │ ├── TransactionTools.java # utility functions related to transaction module +        │ └── vo # data object package +        │ ├── Account.java +        │ ├── AccountBalance.java +        │ └── TxRegisterDetail.java +        └── txhandler # package of transaction callback functions +            ├── TransactionDispatcher.java # dispatcher of transaction callback functions +            ├── TransactionProcessor.java # interface definition of transaction callback functions +            └── TxProcessorImpl.java # interface implementation of transaction callback functions, requiring developers to implement +``` +## Implementation ideas of business modules +1. Define the transaction type and invoke the TransactionTools.registerTx method to complete the transaction registration upon module starting (MyModule.startModule). +2. Implement the entry point of transaction creation, assemble the transaction, and store the business data in txData. Invoke the TransactionTools.registerTx.newTx method to create the transaction in the transaction module. +3. Implement the TxProcessorImpl.validate method to complete the verification code of transaction business. +4. Implement the TxProcessorImpl.commit method to complete the data storage code of transaction business. +5. Implement the TxProcessorImpl.rollback method to complete the data rollback code of transaction business. +6. Implement the application scenario code of business data. + +## Building module program +The `package` script will help you build the code, and the `package` fulfills the requirements of the NULS-ChainBox integrating modules to the NULS2.0 runtime environment. The packaged jar file, startup script, stop script, and Module.ncf will be built into the `outer` folder. + +``` +./package +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` +### Contribution + +Contributions to NULS are welcomed! We sincerely invite developers who experienced in blockchain field to join in NULS technology community. Details: s: https://nuls.communimunity/d/9-recruitment-of-community-developers To be a great community, Nuls needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. + +### License + +Nuls is released under the [MIT](http://opensource.org/licenses/MIT) license. +Modules added in the future may be release under different license, will specified in the module library path. + +### Community + +- [nuls.io](https://nuls.io/) +- [@twitter](https://twitter.com/nulsservice) +- [facebook](https://www.facebook.com/nulscommunity/) +- [YouTube channel](https://www.youtube.com/channel/UC8FkLeF4QW6Undm4B3InN1Q?view_as=subscriber) +- Telegram [NULS Community](https://t.me/Nulsio) +- Telegram [NULS Chinese Community](https://t.me/Nulscn) + +#### diff --git a/docs/NULS2.0/encryptedMessageDesign.md b/docs/NULS2.0/encryptedMessageDesign.md new file mode 100644 index 00000000..55d5a7b5 --- /dev/null +++ b/docs/NULS2.0/encryptedMessageDesign.md @@ -0,0 +1,279 @@ +# Encrypted Message Module Demo +## Functional design + +The core business of the module is to directly send and receive text messages between two addresses and the encrypted message content will be stored on the chain and in the node file system. + +### Core functions + +1. Bind the address to a unique messagebox address on the entire blockchain. +2. Send message to the specified messagebox address. +3. Receive message. +4. View the message details. + +### Secondary functions + +1. View the Inbox and Outbox messageing lists. +2. Pay additional fees for binding messagebox address and sending messages + + + +## General design +### Binding messagebox address + +Create the transaction type of applying for messagebox address (type_200) and business data (txData) includes the application address, messagebox address, address public key. When verifying the transaction, it is necessary to verify whether the messagebox address has been occupied, whether the application address has been bound to a messagebox, and whether the account balance of the application address is sufficient to pay the application fee and transaction fee. When the transaction is confirmed, the node will establish links between the application address, messagebox address and public key, and store them in the file system. + +There are two functions for binding the messagebox address. +1. Provide a format that is more easy to memorize and write for human beings than account addresses. +2. Acquire the public key of the account address through transaction of the account, and asymmetrically encrypt the message content with the public key when sending the message. + +### Sending message + +Create the transaction type of sending message (type_201) and business data (txData) includes sender address (not messagebox address), recipient address (not messagebox address), sending time, encrypted message title, encrypted message content, sender's reading permission `key` and recipient's reading permission `key`. + +#### Assembling transaction + +The parameters of the message to be sent are sender's account address, account password, recipient's messagebox address, message title and message content. The processing steps are as follows: + +1. Query the recipient's messagebox information through the recipient's messagebox address, and obtain the recipient's account address and public key. +2. Generate a pair of keys (KEY) for the encrypted message, encrypt the title and content of message with public key, and encrypt KEY's private key with public keys of recipient and sender to obtain their reading permission `keys` respectively. When viewing the message content, they need to decrypt the reading permission `key` with their own private keys, and then decrypt the message title and content with the reading permission `key`. In this way, data can be stored publicly, but only the sender and the recipient can view the content. + +#### Verifying transaction + +1. Verify the messagebox address bound to the sender’s account address +2. Verify the validity of the recipient’s messagebox address +3. Verify that the specified amount of assets is transferred to the fee account. + + + +#### Storing message data + +Because it is a demo module, data is not stored in the database but in the file system to avoid unnecessary complexity. message storage mainly involves in the relationship between message, recipient, and sender, as well as message content. + +1. Create two folders, `sender` and `recipient`, to store the relationship between the account address and the transaction hash related to the message. A file is created in the folder with the address as the file name, and each line in the file stores a transaction hash of message related to the account address. `Sender` folder stores the relationship between the sender and the message transaction hash, and `recipient` folder stores the relationship between the recipient and the message transaction hash. +2. Create `message-data` folder to store messages and use message transaction hash as the file name to create a storage file. which stores hexadecimal string of the byte array of the message content. + +### Reading message +#### Decrypt message information +The message content is stored after encryption, so decryption is required for reading. The decryption failure throws an exception. The decryption process is as follows: +1. Get the message content by message hash. +2. Deserialize the message content. First convert the hexadecimal string to a byte array, and then parse the byte array following the below rules orderly. +> 1. Store the recipient’s account address in variable-length type +> 2. Store the sender’s account address in variable-length type +> 3. Store the recipient’s reading permission `key` in variable-length type +> 4. Store the sender’s reading permission `key` in variable-length type +> 5. Store the message title in variable-length type +> 6. Store the message content in variable-length type +>7. Store 64-bit integer timestamp with 4 bytes (milliseconds from January 1, 1970 to the current time) + +1. Determine whether the current account is the recipient or the sender by the address, and decrypt the corresponding reading permission `key` by the private key. +2. Decrypt the message title and content with the decrypted reading permission `key`. + +#### Reading the Inbox or Outbox messageing list +Find the file with the same name as the account address in the `sender` and `recipient` folders, read the hash by line, and then use the hash to get the message details through [Decrypt message information] (#Decrypt message information), and finally assemble the list. + +### Charging fees +The fee payment is achieved by verifying that the CoinData of the transaction of binding messagebox and sending message contains the specified amount of assets transferred to the specified black hole address (fee address). + +## Detailed design +### Package structure of source code +``` +. +└── io +    └── nuls +        ├── Config.java +        ├── Constant.java +        ├── MyModule.java +        ├── NulsModuleBootstrap.java +        ├── Utils.java +        ├──controller +        │ ├── CreatemessageAddressController.java +        │ ├── GetmessageController.java +        │ ├── SendmessageController.java +        │ ├── core +        │ │ ├── BaseController.java +        │ │ ├── NulsResourceConfig.java +        │ │ ├── Result.java +        │ │ └── WebServerManager.java +        │ └── vo +        │ ├── CreatemessageAddressReq.java +        │ ├── GetmessageListReq.java +        │ ├── messageAddressData.java +        │ ├── messageContentData.java +        │ ├── SendmessageReq.java +        │ └── ViewmessageReq.java +        ├── rpc +        │ ├── AccountTools.java +        │ ├── CallRpc.java +        │ ├── LegderTools.java +        │ ├── TransactionTools.java +        │ └── vo +        │ ├── Account.java +        │ ├── AccountBalance.java +        │ └── TxRegisterDetail.java +        ├── service +        │ ├── messageAddressService.java +        │ ├── SendmessageService.java +        │ └── dto +        │ ├── messageAddress.java +        │ └── messageContent.java +        └── txhander +            ├── messageAddressProcessor.java +            ├── SendmessageProcessor.java +            ├── TransactionDispatcher.java +            └── TransactionProcessor.java +``` +#### Config.java +A configuration file, it reads the external NULS2.0 general configuration into the class through the configuration file system of the nuls-core. In this module, we need chainId (chain ID), assetId (asset ID), and dataPath (data storage path). These three items belong to the global general configuration and can be read directly. In addition, two business configuration items, messageAddressFee (fee of binding messagebox) and sendmessageFee (fee od sending message), are defined and need to be configured in module.ncf. + +#### Constant.java +A class defining constants, it defines the transaction type pf binding messagebox (200), transaction type pf sending message (201), and the black hole address for fee collection. + +#### MyModule.java +A bootstrap class, it declares that the current module depends on three modules, namely, account, ledger, and transaction. The nuls-core-rpc package will automatically establish a websocket long connection with these 3 modules. +Complete the module initialization: +1. Create a folder to store data. +2. Register the transaction type to the transaction module. +3. Initialize the Restful WebServer service (the user interface is provided using the HTTP protocol). + +#### controller package +`controller` package provides user interface + +##### CreatemessageAddressController.java +The interface for binding account to messagebox address + +##### GetmessageController.java +The interface for obtaining messagebox information. + +##### SendmessageController.java +The interface for sending message + +##### core and vo package +Related to HTTP interface framework and interface protocol. + +#### rpc package +Utility class for accessing the RPC interface of other modules. + +#### service package +Related to data storage logic + +##### messageAddressService.java +Service for storing the information of messagebox address bound to the account + +##### SendmessageService.java +Service for sending message and querying emessage information. + +#### dto package +Defining data storage objects + +#### txhander package +Package of transaction callback functions + +##### TransactionDispatcher.java +Defining the RPC interface of the callback function, dispatching transactions to the specific handling class based on the transaction type. + +##### messageAddressProcessor.java +Defining callback functions that handle the transaction of binding messagebox address (type_200). + +##### SendmessageProcessor.java +Defining callback functions that handle the transaction of sending message (type_201). + +### User interface list +The user interface is provided using HTTP protocol. The `Content type` of Request and Response is `application/json`, and the port is `9999`. + +#### Universal protocol of return + +``` +{ +    "success": true, // success status +    "data": null, //returned data +    "msg": null // the reason for the failure +} +``` +#### Binding messagebox address +##### Access path: /message/createmessageAddress +##### Request mode: POST +##### parameter list + +| Name | Type | Description | +| --- | --- | --- | +| address | string | apply for an account address | +| messageAddress | string | apply for a bound messagebox address | +| password | string | account password | + +##### Return in string format +txHash of the transaction. + +#### Querying the messagebox address bound to the specified account address +##### Access path: /message/getmessageAddress/{address} +##### Request mode: GET +##### parameter list + +| Name | Type | Description | +| --- | --- | --- | +| address | string | account address | +##### Return in string format +emessage address + +#### sending message +##### Access path: /message/sendmessage +##### Request mode: POST +##### parameter list + +| Name | Type | Description | +| --- | --- | --- | +| messageAddress | string | recipient’s messagebox address | +| senderAddress | string | sender’s account address | +| password | string | sender’s account password | +| title | string | message title | +| content | string | message content | + +##### Return in string format +txHash of the transaction +#### Getting the specified message details +##### Access path: /message/viewmessage +##### Request mode: POST +##### parameter list + +| Name | Type | Description | +| --- | --- | --- | +| address | string | account address | +| password | string | account password | +| hash | string | hash of the message transaction | + +##### Return as an object + +| Name | Description | +| --- | --- | +| hash | hash of the message transaction | +| sendermessageAddress | sender’s messagebox address | +| recipientmessageAddress | recipient’s messagebox address | +| title | message title| +| content | message content| +| sender | sender’s account address | +| date | date of sending message| + + +#### Getting Inbox and Box messageing lists + +##### Access path: /message/getSendList, /message/getReceiveList + +##### Request mode: POST + +##### parameter list + +| Name | Type | Description | +| --- | --- | --- | +| address | string | account address | +| password | string | account password | + +##### Return as a list + +| Name | Description | +| --- | --- | +| hash | hash of the message transaction| +| sendermessageAddress | sender’s messagebox address | +| recipientmessageAddress | recipient’s messagebox address| +| title | message title | +| content | message content | +| sender | sender’s account address | +| date | date of sending message | diff --git a/docs/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg b/docs/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg new file mode 100644 index 00000000..04a251a1 Binary files /dev/null and b/docs/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg differ diff --git a/docs/NULS2.0/ideaPlugin.md b/docs/NULS2.0/ideaPlugin.md new file mode 100644 index 00000000..b39fb64c --- /dev/null +++ b/docs/NULS2.0/ideaPlugin.md @@ -0,0 +1,99 @@ +# IDEA Plugin + +#### 1 Install NULS Plugin on IDEA +- [Get NULS plugin](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) ZIP, and save in disk +Click File->Settings->Plugin->Install plugin from disk + +![Install](./pluginImages/Install.jpg) + +- Select the said ZIP, and click OK + +![Install](./pluginImages/Install2.jpg) + +- Tick NULS plugin, and click Apply + +![Install](./pluginImages/Install3.jpg) + +#### 2 Create a NULS project + +![create](./pluginImages/createProject.jpg) + +Input Project name, click finish + +![create](./pluginImages/createProject2.jpg) + +#### 3 Compile smart contract + +Smart contract code compilation refers to [developer document] (http://dev.nuls.io/contract/) + +![code](./pluginImages/code.jpg) + +#### 4 Set and deploy the node and account for contract + +- Click NULS plugin on the right, and call NULS plugin interface + + ![code](./pluginImages/Deploy.jpg) + +- Plugin automatically generates a node 127.0.0.1:8001, and developer adds a node to deploy the contract. +Recommendation: Start the local wallet, and add the wallet address as the node address. + + Click + on the top left corner of panel, and select Add Node. + + ![code](./pluginImages/Add.jpg) + +- Input Node address and clock OK + + ![code](./pluginImages/Add3.jpg) + +- Click + on the top left corner of panel, and select Add Account. Input Account address and click OK. + + ![code](./pluginImages/Add5.jpg) + +#### 5 Package contract + +- Click the second button on the top left corner of plugin to directly package the current Project. Two output forms after packaging: Jar package and Hex code + + ![code](./pluginImages/package.jpg) + +- Click [copy code] to copy the HEX code to the [deploy contract] interface of wallet to deploy contract (optional step). + + ![code](./pluginImages/package1.jpg) + +- Click the third button on the plugin panel top or [Next] at the button of current package interface to access contract deploying interface + + ![code](./pluginImages/package3.jpg) + + ![code](./pluginImages/package2.jpg) + +#### 6 Deploy contract + +- On Deploy interface, select the node and account for deploying contract from pull-down list. JarFilePath default value is the package route of the previous step. + + ![code](./pluginImages/package4.jpg) + +- Parameters following JarFilePath are the parameters of the contract construction function. + + ![code](./pluginImages/Deploy2.jpg) + +- Click [advanced] to set gas value and price value. Gas varies from 1 to 10000000. Recommend to set a greater gas value to avoid failing in deploying contract. + + ![code](./pluginImages/Deploy3.jpg) + +- Click [Test Deploy] to conduct a trial deployment of contract. In case of a success, it gives prompt of Success. + + ![code](./pluginImages/Deploy4.jpg) + +- If success, click [Deploy]. After confirmation of contract creation transaction, it feeds back details of transaction, indicating a success of contract deployment. + + ![code](./pluginImages/Deploy5.jpg) + +- Review the deployed contract on the top of panel + + ![code](./pluginImages/Deploy6.jpg) + +- Click the deployed contract to review all method of this contract + + ![code](./pluginImages/Deploy7.jpg) + + + diff --git a/docs/NULS2.0/linuxTutorial.md b/docs/NULS2.0/linuxTutorial.md new file mode 100644 index 00000000..56778cf2 --- /dev/null +++ b/docs/NULS2.0/linuxTutorial.md @@ -0,0 +1,1710 @@ +# Linux CLI Manual + +## Introduction + +This section is a guide for the use of the full node wallet for the Linux version, it will show how to create accounts, import accounts, transfer, and create nodes or stake, etc. It's assumed you have at least basic skills administering Linux operating systems which is the recommended system to create stable NULS nodes. + +## Version history + +| Versions | Date | Contents | +| :------: | :--------: | :------: | +| V1.0.0 | 2018-03-18 | alpha | +| V1.1.0 | 2019-07-08 | Beta | + +## Preparation + +### Server hardware configuration + +**Minimum requirements:** + +| CPU | Memory | Disk space | Bandwidth | +| :------------: | :----: | :--------: | :-----------: | +| 4-Core 3.0 GHz | 16GB | 128GB | 20Mbps uplink | + +**Recommended requirements:** + +| CPU | Memory | Disk space | Bandwidth | +| :------------: | :----: | :--------: | :------------: | +| 8-core 3.0 GHz | 32GB | 256GB | 100Mbps uplink | + +### System and kernel version + +**Linux system** + +- CentOS 6, 7 + +The Linux kernel version is recommended to use 2.6.32 and above + +## Get started + +### Download + +- Access NULS official website for the latest version of full node wallet: http://nuls.io/wallet.com; GitHub link: https://github.com/nuls-io/nuls-wallet-release +- After entering the interface of [NULS official wallet download](http://nuls.io/wallet), select Linux version. MEGA and Baidu Cloud Disk are available for your choice. + +To download Beta wallet using a Linux system, you can type the following command: + +```shell + $wget http://nuls-usa-west.oss-us-west-1.aliyuncs.com/2.0/NULS-Wallet-linux64-beta1-main.tar.gz +``` + +Note: the download address may be different if there are subsequent versions. + +### Installation + +- Extract the downloaded file in Linux: + +```shell + $ tar -zxf NULS-Wallet-linux64-beta1-main.tar.gz +``` + +### Run + +- Enter the extracted directory and run the boot script to start the full node wallet + +```shell + $ cd NULS-Wallet-linux64-beta1 + $ ./start +``` + +## Use wallet + +### Quick start + +- After confirming that the wallet has been started, execute the command line program to operate the wallet. + +Enter the cmdclient/1.0.0 directory and execute the following command: + +```shell + $ cd cmdclient/1.0.0 + $ ./cmd.sh +``` + +At this point, you can see the input prompt `nuls>>> `, now you can directly type NULS commands to operate the wallet. +For example, to create an account you should type the following command: + +```shell + nuls>>> create + Please enter the new password(8-20 characters, the combination of letters and numbers). + Enter your password:********* + Please confirm new password:********* + [ "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" ] +``` + +Command ` create ` generates a single account, next enter your password and confirm the new password. If successful, the address of the account will be returned. + +## Conventions + +- Password rules: password length varies from 8 to 20 and must contain both letters and digits. +- Command parameter description: + < Parameter> required parameter. + [parameter] optional parameter. + " |" means 'or' logical operator, namely you can choose either the previous parameter or the latter. + +## Wallet commands + +### Help command + +Print all valid commands, + +- **command: help [-a]|[group]|[command]** + +| Parameter | Description | +| :-------- | :----------------------------------------------------------- | +| -a | format the printed command, optional | +| command | view instructions for the specific command | +| group | view all instructions for the commands in the specific command group | + +Return: help + +```json +getaccount
--get account information +``` + +Return: help -a + +```json +getaccount
--get account information + OPTIONS: +
the account address - Required +``` + +Example + +```shell +nuls>>> help +nuls>>> help -a +nuls>>> help account +nuls>>> help create +``` + +### Create an account + +Create an account and return the set of account addresses + +- **command: create [number]** + +| Parameter | Description | +| :----------------------------------------------------------- | :---------- | +| [number] the number of accounts you want to create, optional | | + +When creating an account, you are required to enter the password for the account. A password must be set to ensure the security of the assets. + +Return: accounts set + +```json +[ "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", "tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs", "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4" ] + +``` + +Example + +Create a single account + +```shell +nuls>>> create +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +[ "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" ] + +``` + +Create multiple accounts at once + +``` +nuls>>> create 3 +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +[ "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", "tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs", "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4" ] + +``` + +### Back up account + +To back up an account, a file named as the account address with the extension .keystore is generated, which is the backup file for the account + +- **command: backup <address> [path]** + +| Parameter | Description | +| --------------- | ------------------------------------------------------------ | +| <address> | account address, required | +| [path] | the directory where the generated backup file is included, current directory by default, optional | + +Return + +```shell +The path to the backup file is /home/nuls2/nuls-v2/tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm.keystore + +``` + +Example: backup an account with a password + +``` + shell + nuls>>> backup tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm /home/nuls2/nuls-v2/NULS-Wallet-linux64-beta1 + Please enter the password. + Enter your password:******** + The path to the backup file is /home/nuls2/nuls-v2/tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm.keystore + +``` + +### Remove account + +Enter the password to remove a local account based on the account address + +- **command: remove <address>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | + +Return + +```json +Success + +``` + +Example + +```shell +nuls>>> remove tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs +Please enter the password. +Enter your password:******** +Success + +``` + +### Modify account password + +Set a new password according to the account address and password. + +- **command:resetpwd <address>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | + +Return + +```json +Success + +``` + +Example + +```shell +nuls>>> resetpwd tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4 +Enter your old password:******** +Enter new password********* +Please confirm new password:********* + +``` + +### Set alias + +Set an alias to the account. If a node is created with this account, its alias will be displayed as the node source + +- **command: setalias <address> <alias>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | +| <alias> | alias name, required | + +Return: transaction hash + +```json +txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" + +``` + +Example + +```shell +nuls>>> setalias tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 nuls +Enter your account password********** +txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582 + +``` + +### Import account keystore + +Import the account keystore file to recover a local account. The operation is not executed if the local account already exists locally. + +- **command: importkeystore <path>** + +| Parameter | Description | +| ------------ | -------------------------------------------------- | +| <path> | path of the keystore file to be imported, required | + +Note: the original password is required to import the keystore file and recover the account + +Return: address of the imported account + +```json +"tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" + +``` + +Example + +```shell +nuls>>>importkeystore /home/nuls2/nuls-v2/tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8.keystore +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 + +``` + +### Import account private key + +Import the account private key to generate a local account, overwritten if the local account already exists. You are required to set a password for the account when importing. This function can be used to retrieve the account through the private key if you forget the account password. + +- **command: import <privatekey>** + +| Parameter | Description | +| ------------------ | ------------------------------- | +| <privatekey> | account's private key, required | + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" + +``` + +Example + +```shell +nuls>>> import 74ca3facb66e5e9f2b78e86507d1f36cf601bc3de1d5f5e5b515c4f995d53873 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:******** +Please confirm new password:******** +tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 + +``` + +### Query account information + +Query account information with the account address + +- ** command: getaccount <address>** + +| Parameter | Description | +| --------------- | :------------------------ | +| <address> | account address, required | + +Return + +```json +{ + "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", // the encrypted private key + "alias" : "zlj", // alias + "balance" : { + "freeze" : 0, // frozen assets + "total" : 997999999800000, // total assets + "available" : 997999999800000 // usable assets + }, + "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", // account address + "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" //public key +} + +``` + +Example + +```shell +nuls>>> getaccount 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu +{ + "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d", //encrypted private key + "alias" : "zlj", //alias + "balance" : { + "freeze" : 0, // frozen assets + "total" : 997999999800000, // total assets + "available" : 997999999800000 // usable assets + }, + "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", // account address + "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486" // encrypted public key +} + +``` + +### Query account list + +Query the account list with the paging parameters and return all accounts in descending order by creation time. + +- ** command: getaccounts <pageNumber> <pageSize>** + +| Parameter | Description | +| ------------------ | -------------------------------------------------- | +| <pageNumber> | page number indicating the page to query, required | +| <pageSize> | number of rows displayed per page, required | + +Return: accounts set + +```json +[ { + "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //address + "alias" : null, //alias + "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //public key + "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //private key +}, { + "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW", + "alias" : null, + "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1", + "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57" +}, { + "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9", + "alias" : "zlj", + "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb", + "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77" +} ] + +``` + +Example: get all accounts list + +```shell +nuls>>> getaccounts +[ { + "address" : "5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu", //address + "alias" : null, //alias + "pubkeyHex" : "0211c45f28710cd26a2c45fb790895a0ff2e095a290f1825b31d80ebc30913c486", //encrypted public key + "encryptedPrikeyHex" : "724d68268849f3680d480c9257f33229c0fac88890d5355c0e4d9c457af5c6e8b8f9f7ca9fd52fbd8079fbce1782052d" //encrypted private key +}, { + "address" : "5MR_2CetN1KeWAVsaUsqD7JwMBwjGuRGpGW", + "alias" : null, + "pubkeyHex" : "0205a70731e7653eca328ba7d71f0a789f8cfb1ced32f5a00d4fc3fb2ad8b9f7c1", + "encryptedPrikeyHex" : "e38d2dd08154a0eedf8298f5fe50b86723e521522f38aba5c68072bad365c3e8c57d7ac3ae83f8d646a17f845a38bc57" +}, { + "address" : "5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9", + "alias" : "zlj", + "pubkeyHex" : "03021a46a7e5ea59ae8884340568e9e79511fbd352b4ba28db39f15856918cdbeb", + "encryptedPrikeyHex" : "bfbfdad874f74215e241ad15152d8648925c497b6a826965f5c06c46fd9b008313e6918ebcfcb56f2cdf8d1b9f088f77" +} ] + +``` + +### Query account's private key + +Query the account’s private key with the account address and password + +- **command: getprikey <address>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | + +Return: the private key of the imported account (unencrypted) + +```json +00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 + +``` + +Example + +```shell +nuls>>> getprikey 5MR_2CXrzwoCoP4vnUxHJ5gdUUXZJhCpjq9 +Enter your account password********** +7b4d3ec971fc01ea813b52f6c35091d43beac4a68550bae2db63975149244678 + +``` + +### Query account balance + +Query account balance with the account address + +- **command: getbalance <address>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | + +Return: the address of the imported account + +```json +{ +"total": "9999998.99",// balance +"freeze": "0", // locked balance +"available": "9999998.99"// usable balance +} + +``` + +Example + +```shell +nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "total" : "9999998.99", + "freeze" : "0", + "available" : "9999998.99" +} + +``` + +### Transfer + +Transfer NULS to the specific account with the account address + +- **command:transfer <fromAddress>|<fromAlias> <toAddress>|<toAlias> <amount> [remark]** + +| Parameter | Description | +| ------------------- | ---------------------------------------------------------- | +| <fromAddress> | sender address(Select any item with the fromAlias) | +| <fromAlias> | sender address alias(Select any item with the fromAddress) | +| <toAddress> | receiver address(Select any item with the toAlias) | +| <toAlias> | receiver address(Select any item with the toAddress) | +| <amount> | transfer amount, required | +| [remark] | remark, optional | + +Return: transfer transaction hash + +```json +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" + +``` + +Example + +```shell +nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 transfer +Please enter the password. +Enter your password: ********* +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" + +``` + +### Query transaction details + +Query the transaction details with the transaction hash + +- **command: gettx <hash>** + +| Parameter | Description | +| ------------ | -------------------------- | +| <hash> | transaction hash, optional | + +Return: transaction details + +```json +{ + "type" : 2, //transaction type (refer to the table below for Enumeration type description [Enumeration type]) + "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=", + "txData" : null, + "time" : 1552979783918, + "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==", + "remark" : "6L2s6LSm", + "hash" : { + "digestAlgType" : 0, + "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", + "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" + }, + "blockHeight" : 341, //block height + "status" : "CONFIRMED", //confirmation state + "size" : 225, + "inBlockIndex" : 0, + "coinDataInstance" : { + "from" : [ { + "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=", + "assetsChainId" : 12345, + "assetsId" : 1, + "amount" : 100100000, + "nonce" : "79acNPim+aw=", + "locked" : 0 + } ], + "to" : [ { + "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=", + "assetsChainId" : 12345, + "assetsId" : 1, + "amount" : 100000000, + "lockTime" : 0 + } ] + }, + "fee" : 100000, //fee + "multiSignTx" : false +} + +``` + +Example: query transfer transaction + +```shell +nuls>>> gettx 00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f +{ + "type" : 2, //transaction type (refer to the table below for Enumeration type description [Enumeration type]) + "coinData" : "ARc5MAGYBT3XNVp+BIuhGvGcejuTev8DODkwAQCgZ/cFAAAAAAAAAAAAAAAACO/WnDT4pvmsAAEXOTABL/80LO1f8vxvfNXc5l9eeIDTGKM5MAEAAOH1BQAAAAAAAAAAAAAAAAA=", + "txData" : null, + "time" : 1552979783918, + "transactionSignature" : "IQIRxF8ocQzSaixF+3kIlaD/LglaKQ8YJbMdgOvDCRPEhgBGMEQCICdnNr3HqEg/UZZ6RLBHyGuPChoLdMtcOHXT3Xlb5SC3AiBGAWSPGH3yjtEkaVbLsI5n9UcqDvOfG3Ui1jf672IDCg==", + "remark" : "6L2s6LSm", + "hash" : { + "digestAlgType" : 0, + "digestBytes" : "CivAIHpVyqNr/h87/FWk7vXsXqBekHJ+3kQc5mZp+H8=", + "digestHex" : "00200a2bc0207a55caa36bfe1f3bfc55a4eef5ec5ea05e90727ede441ce66669f87f" + }, + "blockHeight" : 341, //block height + "status" : "CONFIRMED", //confirmation state + "size" : 225, + "inBlockIndex" : 0, + "coinDataInstance" : { + "from" : [ { + "address" : "OTABmAU91zVafgSLoRrxnHo7k3r/Azg=", + "assetsChainId" : 12345, + "assetsId" : 1, + "amount" : 100100000, + "nonce" : "79acNPim+aw=", + "locked" : 0 + } ], + "to" : [ { + "address" : "OTABL/80LO1f8vxvfNXc5l9eeIDTGKM=", + "assetsChainId" : 12345, + "assetsId" : 1, + "amount" : 100000000, + "lockTime" : 0 + } ] + }, + "fee" : 100000, //fee + "multiSignTx" : false +} + +``` + +#### Enumeration type description + +``` +/** coinbase transaction*/ + int TX_TYPE_COINBASE = 1; + /** transfer */ + int TX_TYPE_TRANSFER = 2; + /** set alias */ + int TX_TYPE_ALIAS = 3; + /** create consensus node */ + int TX_TYPE_REGISTER_AGENT = 4; + /** agent (join consensus) */ + int TX_TYPE_JOIN_CONSENSUS = 5; + /** cancel agent (cancel consensus)*/ + int TX_TYPE_CANCEL_DEPOSIT = 6; + /** yellow punish */ + int TX_TYPE_YELLOW_PUNISH = 7; + /** red punish */ + int TX_TYPE_RED_PUNISH = 8; + /** stop node (stop consensus node)*/ + int TX_TYPE_STOP_AGENT = 9; + /** cross-chain transfer */ + int TX_TYPE_CROSS_CHAIN_TRANSFER = 10; + /** register chain */ + int TX_TYPE_REGISTER_CHAIN_AND_ASSET = 11; + /** destroy chain*/ + int TX_TYPE_DESTROY_CHAIN_AND_ASSET = 12; + /** add asset to chain*/ + int TX_TYPE_ADD_ASSET_TO_CHAIN = 13; + /** remove asset from chain*/ + int TX_TYPE_REMOVE_ASSET_FROM_CHAIN = 14; + /** create contract */ + int TX_TYPE_CREATE_CONTRACT = 100; + /** call contract */ + int TX_TYPE_CALL_CONTRACT = 101; + /** delete contract*/ + int TX_TYPE_DELETE_CONTRACT = 102; + +``` + +### Transfer using account alias + +Transfer to an external address with an account alias + +- **command: transfer <address> <toAddress> <amount> [remark]** + +| Parameter | Description | +| ----------------- | -------------------------- | +| <address> | sender address, required | +| <toAddress> | receiver address, required | +| <amount> | transfer amount, required | +| [remark] | remark, optional | + +Return: transaction hash + +``` +00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3 + +``` + +Example: transfer 10,000 NULS to external address through alias "zlj" + +``` +nuls>>> transfer zlj 5MR_2CeG11nRqx7nGNeh8hTXADibqfSYeNu 10000 +Enter your account password********** +00205315329f62824b3fae1675ef9419ae7dd097d6609d61df4b1345f9481f7c8be3 + +``` + +### Create agent node + +To create an agent node, two addresses are required, the first one is the node address, on which you need to provide the password for the node account, the other is the package address, and no password is required. Meanwhile, you’re required to offer no less than 20,000 NULS as a deposit. + +- **command: createagent <agentAddress> <packingAddress> <commissionRate> <deposit>** + +| Parameter | Description | +| ---------------------- | ------------------------------------------------------------ | +| <agentAddress> | account address to create a node, required | +| <packingAddress> | account address of the packaging node, required (note: the account should be password-less, otherwise the node cannot package to generate blocks) | +| <commissionRate> | agent commission ratio with a range from 10 to 100, required | +| <deposit> | deposit to create a node, no less than 20000 NULS, required | + +Return: agent hash of the node + +```json +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" + +``` + +Example: create a node with a commission rate of 10% and a deposit of 20,000 NULS. + +```shell +nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 +Please enter the password. +Enter your password: ********** +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" + +``` + +### Join consensus (agent node) + +Join consensus by account address and node agentHash, which requires at least 2,000NULS + +- **command: deposit <address> <agentHash> <deposit>** + +| Parameter | Description | +| ----------------- | ------------------------------------------------------------ | +| <address> | account address, required | +| <agentHash> | agentHash of the node, optional | +| <deposit> | deposit required to join consensus, no less than 2000NULS, required | + +Return: the hash of the transaction to join consensus, which is needed to cancel the consensus. + +```json +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" + +``` + +Example + +```shell +nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" + +``` + +### Cancel consensus (cancel agent) + +Cancel consensus (agent) according to the account address and the hash of the transaction generated when joining the consensus. When a single account joins consensus on agent nodes multiple times, each agent transaction is independent, so to cancel consensus, the agent can only be canceled by the corresponding transaction hash of the single agent, rather than cancel all the agents at one time. + +- **command: withdraw <address> <txHash>** + +| Parameter | Description | +| --------------- | --------------------------------------- | +| <address> | account address, required | +| <txHash> | hash of the agent transaction, required | + +Return: transaction hash used to cancel consensus + +```json +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" + +``` + +Example + +```shell +nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" + +``` + +### Stop agent + +Stop the node, all NULS delegated to the node will be refunded, and the deposit of the node creator will be locked for 72 hours. + +- **command: stopagent <address>** + +| Parameter | Description | +| --------------- | ------------------------- | +| <address> | account address, required | + +Return: transaction hash to stop a node + +```json +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" + +``` + +Example + +```shell +nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the password. +Enter your password:********** +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" + +``` + +### Get header information of the latest block + +Get the latest block header’s information + +- **command: getbestblockheader** + +Return + +```json +{ + "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash + "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash + "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash + "time" : "2019-03-19 18:26:20.020", //packing time + "height" : 1479, //block height + "txCount" : 1, // number of transactions included in the block + "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block singnature + "size" : 0, //block size + "packingAddress" : null, // packing address + "roundIndex" : 155299118, + "consensusMemberCount" : 100, + "roundStartTime" : "2019-03-19 18:26:10.010", + "packingIndexOfRound" : 1, + "mainVersion" : 1, + "blockVersion" : 0, + "stateRoot" : null +} + +``` + +Example + +```shell +nuls>>> getbestblockheader +{ + "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", + "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", + "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", + "time" : "2019-03-19 18:26:20.020", + "height" : 1479, + "txCount" : 0, + "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", + "size" : 0, + "packingAddress" : null, + "roundIndex" : 155299118, + "consensusMemberCount" : 100, + "roundStartTime" : "2019-03-19 18:26:10.010", + "packingIndexOfRound" : 1, + "mainVersion" : 1, + "blockVersion" : 0, + "stateRoot" : null +} + +``` + +### Query block header information + +Query block information with either a block height or a block hash. + +- **command: getblock <hash> | <height>** + +| Parameter | Description | +| -------------- | ------------ | +| <hash> | block hash | +| <height> | block height | + +Return + +```json +{ + "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash + "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash + "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash + "time" : "2019-03-19 18:26:20.020", //packing time + "height" : 1479, //block height + "txCount" : 1, // number of transactions included in the block + "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature + "size" : 0, //block size + "packingAddress" : null, //packing address + "roundIndex" : 155299118, + "consensusMemberCount" : 100, + "roundStartTime" : "2019-03-19 18:26:10.010", + "packingIndexOfRound" : 1, + "mainVersion" : 1, + "blockVersion" : 0, + "stateRoot" : null +} + +``` + +Example: get block with block height + +```shell +nuls>>> getblock 28115 +{ + "hash" : "0020b446a0244e4e46f8736f1ab56c33616facb836bc8344367f2f048b703f0c8f57", //block hash + "preHash" : "0020c0dcf9209f66ee7e7778c817ba7c04d67b5e6a056b42dec7fbfe44eb5f91bdfc", //previous block hash + "merkleHash" : "00200511ced5779c54aa2170b941a1f9a7ae08dfd009b1dfaacc3679d15da9fb9c3e", //merkle hash + "time" : "2019-03-19 18:26:20.020", //packing time + "height" : 1479, //block height + "txCount" : 1, // number of transactions included in the block + "blockSignature" : "00473045022100b1a07f6da3d4ce46cab278967d76875483527e3fc749a460afdf0c375f2ec2ae022053e40e8b4d8bf4e571284e45f18c46c31163ed640a2328f3ba90ac7708808365", //block signature + "size" : 0, //block size + "packingAddress" : null, //packing address + "roundIndex" : 155299118, + "consensusMemberCount" : 100, + "roundStartTime" : "2019-03-19 18:26:10.010", + "packingIndexOfRound" : 1, + "mainVersion" : 1, + "blockVersion" : 0, + "stateRoot" : null +} + +``` + +### Create smart contracts + +This interface is called to create a smart contract on the chain + +- **command:createcontract <sender> <gaslimt> <price> <contractCode> [remark]** + +| Parameter | Description | +| ----------------- | ------------------------------------------------------------ | +| <sender> | Create the account address for the smart contract | +| <gaslimt> | Consumes of the gas for creating the contract | +| <price> | Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas | +| <contractCode> | Hex code of the contract code | +| [remark] | remark | + +Returns the transaction hash for which the contract was created and the address of the contract + +``` +{ + "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //transaction hash + "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //contract address +} + +``` + +The example creates a contract (contractCode omits the middle) + +``` +nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo +The arguments structure: +[ { + "type" : "String", + "name" : "name", + "required" : true +}, { + "type" : "String", + "name" : "symbol", + "required" : true +}, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true +}, { + "type" : "int", + "name" : "decimals", + "required" : true +} ] +Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"). +Enter the arguments:"KQB","KQB",10000,2 +{ + "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587", + "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK" +} + +``` + +### Get contract basic information + +Gets the description of the smart contract and the argument list of the constructor and the calling method + +- **command:getcontractinfo <contract address>** + +| Parameter | Description | +| ------------------------ | ---------------- | +| <contract address> | contract address | + +Return + +``` +Skip + +``` + +example + +``` +nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +{ + "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f", + "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "createTime" : 1553563706022, + "blockHeight" : 46, + "isNrc20" : true, + "nrc20TokenName" : "QKB", + "nrc20TokenSymbol" : "QKB", + "decimals" : 2, + "totalSupply" : "200000000", + "status" : "normal", + "method" : [ { + "name" : "", + "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void", + "args" : [ { + "type" : "String", + "name" : "name", + "required" : true + }, { + "type" : "String", + "name" : "symbol", + "required" : true + }, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true + }, { + "type" : "int", + "name" : "decimals", + "required" : true + } ], + "returnArg" : "void", + "view" : false, + "event" : false, + "payable" : false + },{ + "name" : "transfer", + "desc" : "(Address to, BigInteger value) return boolean", + "args" : [ { + "type" : "Address", + "name" : "to", + "required" : true + }, { + "type" : "BigInteger", + "name" : "value", + "required" : true + } ], + "returnArg" : "boolean", + "view" : false, + "event" : false, + "payable" : false + }] +} + + +``` + +### Invoke smart contracts + +Call the functions provided by the smart contract + +- **command:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]** + +| Parameter | Description | +| --------------------- | ------------------------------------------------------------ | +| <senderAddress> | The account address invoking the contract | +| <gasLimit> | The maximum amount of Gas that the contract is allowed to consume | +| <price> | Unit price, how much Na is each Gas value.Na is the minimum unit for NULS, 1 NULS = 100 million Na, and the minimum unit price of the system is 25Na/Gas | +| <contractAddress> | The contract address of the call | +| <methodName> | The method name of the contract | +| <value> | If a transfer is to be made to the contract, the amount of the transfer | +| [-d methodDesc] | Use this method to describe the parameter list if there is a method with the same name in the contract | +| [-r remark] | remark | + +Returns: transaction hash + +``` +"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //transaction hash + +``` + +The example calls the nrc20-token transfer function for a specified contract, Example ` tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L ` NRC20 contract address, number of input parameters for receiving address and account transfer + +``` +nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call +callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call +Please Enter your account passwordzhoujun172 +********** +Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"), +If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly. +Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2 +"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" + +``` + +### Delete smart contract + +Stop an available smart contract + +- **commmand:deletecontract <senderAddress> <contractAddress>** + +| Parameter | Description | +| --------------------- | ----------------------------------------- | +| <senderAddress> | The account address invoking the contract | +| <contractAddress> | The contract address of the call | + +Returns: transaction hash + +``` +"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash + +``` + +example + +``` +nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +Please enter your account passwordzhoujun172 +********** +"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" + +``` + +### Call the contract view method + +Calling the contract view method immediately returns the result, no transaction is generated + +- **commmand:viewcontract <contractAddress> <methodName> [-d methodDesc] --view contract** + +| Parameter | Description | +| -------------------- | ------------------------------------------------------------ | +| <contractAddress> | The contract address of the call | +| <methodName> | Method called | +| [-d methodDesc] | Use this method to describe the parameter list if there is a method with the same name in the contract | + +The return value + +``` +The return value varies depending on the function being called + +``` + +The example calls the nrc20-token contract's query Token balance function to query the Token balance of the specified address + +``` +nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf +viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf +Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"), +If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly. +Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD" +"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD" +{ + "result" : "20000000" +} + +``` + +### Transfer money to the contract address + +To the specified contract address into the main network currency + +- **command:transfertocontract <senderAddress> <contractAddress> <amount> [remark]** + +| Parameter | Description | +| ------------------- | ---------------------------------- | +| <senderAddress> | Transfer out account address | +| <contractAddress | transfer into the contract address | +| <amount> | transfer amount | +| [remark] | remark | + +Returns: transaction hash + +``` +"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979" + +``` + +The example transfers two NULS to the specified contract + +``` +nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark +Please enter your account password +********** +"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979" + +``` + +### token transfer + +NRC20 token transfer + +- **command:tokentransfer <fromAddress> <toAddress> <contractAddress> <amount> [remark]** + +| Parameter | Description | +| -------------------- | ---------------- | +| <fromAddress> | sender address | +| <toAddress | receiver address | +| <contractAddress> | contract address | +| <amount> | transfer amount | +| [remark] | remark | + +Returns: transaction hash + +``` +"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8" + +``` + +Token transfer example : + +``` +nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000 +Please enter your account password +********** +"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8" + +``` + +### Get contract transaction + +Gets the transaction information of the contract, including the transaction details, the contract invocation parameters, and the contract execution results + +- **command:getcontracttx <hash>** + +| Parameter | Description | +| --------- | ---------------- | +| <hash> | transaction hash | + +return value + +``` +skip + +``` + +example + +``` +nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +{ + "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f", + "type" : "100", + "time" : "2019-03-26 09:28:26", + "blockHeight" : 46, + "fee" : 0.0, + "value" : 0.0, + "remark" : null, + "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505", + "status" : "confirm", + "confirmCount" : 0, + "size" : 6686, + "inputs" : [ { + "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "assetsChainId" : 2, + "assetsId" : 1, + "amount" : "5700000", + "nonce" : "ffffffff", + "locked" : 0, + "value" : 0.0 + } ], + "outputs" : [ ], + "txData" : { + "data" : { + "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "value" : 0.0, + "hexCode" : "504b03040a0000080...........31600000000", + "gasLimit" : 200000, + "price" : "0.00000025", + "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ] + } + }, + "contractResult" : { + "success" : true, + "errorMessage" : null, + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "result" : null, + "gasLimit" : 200000, + "gasUsed" : 14029, + "price" : "0.00000025", + "totalFee" : 0.0, + "txSizeFee" : 0.0, + "actualContractFee" : 0.0, + "refundFee" : 0.0, + "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba", + "value" : 0.0, + "stackTrace" : null, + "balance" : 0.0, + "transfers" : [ ], + "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ], + "tokenTransfers" : [ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "from" : null, + "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "value" : "200000000", + "name" : "QKB", + "symbol" : "QKB", + "decimals" : 2 + } ], + "remark" : "create" + } +} + + + +``` + +### Get the contract execution result + +Gets the execution result of a contract + +- **command:getcontractresult <hash>** + +| Parameter | Description | +| --------- | ---------------- | +| <hash> | transaction hash | + +return value + +``` +skip + +``` + +example + +``` +nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +{ + "success" : true, + "errorMessage" : null, + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "result" : null, + "gasLimit" : 200000, + "gasUsed" : 14029, + "price" : "0.00000025", + "totalFee" : 0.0, + "txSizeFee" : 0.0, + "actualContractFee" : 0.0, + "refundFee" : 0.0, + "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba", + "value" : 0.0, + "stackTrace" : null, + "balance" : 0.0, + "transfers" : [ ], + "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ], + "tokenTransfers" : [ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "from" : null, + "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "value" : "200000000", + "name" : "QKB", + "symbol" : "QKB", + "decimals" : 2 + } ], + "remark" : "create" +} + + +``` + +### Get the contract constructor + +Gets the list of parameters that need to be passed in to create the specified contract + +- **command:getcontractcontructor <contractCode>** + +| Parameter | Description | +| ----------------- | ----------------------------- | +| <contractCode> | Hex code of the contract code | + +return value + +``` +skip + +``` + +example + +``` +nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000 +{ + "constructor" : { + "name" : "", + "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void", + "args" : [ { + "type" : "String", + "name" : "name", + "required" : true + }, { + "type" : "String", + "name" : "symbol", + "required" : true + }, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true + }, { + "type" : "int", + "name" : "decimals", + "required" : true + } ], + "returnArg" : "void", + "view" : false, + "event" : false, + "payable" : false + }, + "isNrc20" : true +} + + +``` + +### Gets the list of contracts created for the specified account + +Gets the list of contracts created by the specified account address + +- **command:getaccountcontracts <createAddress>** + +| Parameter | Description | +| ------------------ | --------------- | +| <createAddress> | account address | + +return value + +``` +{ + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "createTime" : "2019-03-26 09:28:26.026", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 2, + "msg" : null, + "create" : true +} + +``` + +example + +``` +nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD +[ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "createTime" : "2019-03-26 09:28:26.026", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 2, + "msg" : null, + "create" : true +}, { + "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg", + "createTime" : "2019-03-25 16:08:25.025", + "height" : 253, + "confirmCount" : 195, + "remarkName" : null, + "status" : 0, + "msg" : null, + "create" : true +}, { + "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK", + "createTime" : "2019-03-25 15:33:54.054", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 0, + "msg" : null, + "create" : true +} ] + +``` + +### Query network information + +Query network basic information + +- **command: network info** + +Return + +```json +{ + "localBestHeight" : 35317,//latest block height locally + "netBestHeight" : 35317,//latest block height of the network + "timeOffset" : "0ms",//network time offset + "inCount" : 0,//number of in-nodes + "outCount" : 1//number of out-nodes +} + +``` + +Example + +```shell +nuls>>> network info +{ + "localBestHeight" : 35317, + "netBestHeight" : 35317, + "timeOffset" : "0ms", + "inCount" : 0, + "outCount" : 1 +} + +``` + +### Query IP's of network nodes + +Query IP's of network nodes + +- **command: network nodes** + +Return information + +```json +[" 192.168.1.223 "] + +``` + +Example: get a block with the block height + +```shell +nuls>>> network nodes +[ "192.168.1.223" ] + +``` + +### Register the Parallel Chain in the Main Chain + +Parallel chains need to complete registration in the main chain when sending cross-chain transactions, this command needs to run on the main network node + +- **command: registercrosschain <address> <chainId> <chainName> <magicNumber> <assetId> <symbol> <assetName> <initNumber> [decimalPlaces] [minAvailableNodeNum] [txConfirmedBlockNum]** + +| Parameter | Specification | +| --------------------- | ------------------------------------------------------------ | +| <address> | registered cross-chain fee payment account | +| <chainId> | registered chain id | +| <chainName> | registered chain name | +| <magicNumber> | magic number parameter of the registered running chain | +| <assetId> | registered asset id | +| <symbol> | asset abbreviation e.g. BTC | +| <assetName> | asset name | +| <initNumber> | initiated asset amount | +| [decimalPlaces] | asset decimal places default 8 | +| [minAvailableNodeNum] | cross-chain transaction available conditions: minimum number of available nodes, default 5 | +| [txConfirmedBlockNum] | the number of confirmed blocks for the registered transaction, default 30 | + +Return + +``` +6c29d99c2b02cfc766ef25bee2ea619610a5fce1d778c3038885111f590ae312 #registered transaction hash + +``` + +Example + +```nuls>>> registercrosschain tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 3 testchain 123456 10 TB tb 1000 +Please enter the password. +Enter your password:********** +6c29d99c2b02cfc766ef25bee2ea619610a5fce1d778c3038885111f590ae312 + +``` + +### Query Parallel Chain Registration Information + +Query the registration information of a test on the main network + +- **Command: crosschaininfo <chainId>** + +| Parameter | Specification | +| ------------ | ------------------- | +| <chainId> | registered chain id | + +Return + +```{ + "chainId" : 3, + "chainName" : "testchain", + "addressType" : "1", + "magicNumber" : 123456, + "minAvailableNodeNum" : 5, + "txConfirmedBlockNum" : 0, + "regAddress" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "regTxHash" : "6c29d99c2b02cfc766ef25bee2ea619610a5fce1d778c3038885111f590ae312", + "createTime" : 1557739548367, + "seeds" : "192.168.1.192:8088", + "selfAssetKeyList" : [ "3-10" ], + "totalAssetKeyList" : [ "3-10" ] +} + +``` + +Return chain specification + +| parameter | required | type | description | +| ------------------- | -------- | ------ | ------------------------------------------------------------ | +| chainId | true | int | chain symbol | +| assetId | true | int | asset id | +| chainName | true | string | chain name | +| addressType | true | int | the address type of the account created on the chain: 1 within the ecological 2 non-ecological | +| magicNumber | true | string | magic number | +| minAvailableNodeNum | true | int | minimum number of available nodes | +| txConfirmBlockNum | true | int | transaction confirmation block number | +| symbol | true | string | asset symbol | +| assetName | true | string | asset name | +| initNumber | true | string | asset initial number | +| decimalPlaces | true | int | minimum asset separable digits | +| address | true | string | the main network address of created chain | +| password | true | string | private key password | + +Example + +``` +nuls>>> crosschaininfo 11 +{ + "chainId" : 11, + "chainName" : "Neth", + "addressType" : "1", + "magicNumber" : 20190303, + "minAvailableNodeNum" : 5, + "txConfirmedBlockNum" : 0, + "regAddress" : "tNULSeBaMgDEcAUhPSdF3D3C6mT54HPUt81cQ4", + "regTxHash" : "7a672b093b274b93bc145dda0e598eddf1f1cf0ccb9aba3e67b3899a5b4ad7a1", + "createTime" : 1557921296460, + "seeds" : "192.168.1.192:8088", + "selfAssetKeyList" : [ "11-1" ], + "totalAssetKeyList" : [ "11-1", "2-1" ] +} + +``` + +### Send Cross-chain Transaction + +- **Command: getecrosstx <chainId> <fromAddress> <toAddress> <assetChainId> <assetId> <amount> [remark]** + +| Parameter | Specification | +| ----------------- | ------------------------------- | +| <chainId> | chain id of running transaction | +| <fromAddress> | from address | +| <toAddress> | to address | +| <assetChainId> | chain Id of the transfer asset | +| <assetId> | transfer asset id | +| <amount> | transfer amount of assets | +| <remark> | transfer remark | + +Return :transaction hash + +``` +529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 + +``` + +Example + +``` +nuls>>> createcrosstx 2 tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD M9busmFhQeu1Efn6rDyeQkFjHxv2dSzkuH8 2 1 1 +Please enter the password. +Enter your password:********** +529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 + +``` + +### Query Cross-chain Transaction Confirmation Status + +- **Command:getcrosstxstate <chainId> <txHash>** + +| Parameter | Specification | +| ------------ | -------------------------- | +| <chainId> | currently running chain id | +| <txHash> | transaction hash | + +Return + +``` +Confirmed | Unconfirmed + +``` + +Example + +``` +nuls>>> getcrosstxstate 2 529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 +Unconfirmed + +``` + +### Exit the wallet CLI + +Exit the command line, it won’t stop the wallet. + +- **command: exit** + +Example + +```shell +nuls>>> exit + +``` + diff --git a/docs/NULS2.0/mavenPackage.md b/docs/NULS2.0/mavenPackage.md new file mode 100644 index 00000000..81aeeec5 --- /dev/null +++ b/docs/NULS2.0/mavenPackage.md @@ -0,0 +1,86 @@ +# Development Tool + +## NULS smart contract Maven-archetype usage documentation + +### Introduction to NULS Smart Contract Maven-archetype + +The NULS smart contract Maven-archetype is a smart contract Maven project template defined for developers. Adding the Maven archetype to IntelliJ IDEA and selecting this archetype can quickly generate a NULS smart contract development project. The smart contract project is a maven project with a sample contract class and all required NULS smart contract dependencies are automatically added to the project. Developers only need to focus on code development for smart contract business logic. + +The maven archetype also integrates an offline smart contract client. After the smart contract is packaged through maven, the offline smart contract client is automatically launched, and the developer deploys the smart contract and the contract method call on the client. + + +### New NULS Smart Contract Maven Project + +1、In order to solve the problem of Intellij IDEA creating a Maven project through archetype slowly, increase the maven run parameters: +-DarchetypeCatalog=internal,The operation steps are as follows: + +![](./mavenPackage/jG8M6dR.png) +![](./mavenPackage/axexko4.png) + +2、Select the new maven project in IntelliJ IDEA and add the NULS smart contract Maven archetype to IDEA in the order shown below (Figure 1). The parameters when adding archetype are as follows: + + GroupId:io.nuls.v2 + ArtifactId: nuls-smartcontract-archetype + Version: 0.10 + +![图1](./mavenPackage/jFTBDBh.png) + +3、Select "io.nuls.v2:nuls-smartcontract-archetype" and click Next to create a Maven project as shown below (Figure 2). + +> When you first create it, you may wait 2~3 minutes, please be patient + +![图2](./mavenPackage/roCyIZD.png) + +4、The resulting maven project is shown in the following figure (Figure 3). The pom.xml file has been added to the dependency jar required by the NULS smart contract. The developer does not need to modify this file. + +![图3](./mavenPackage/nw87nAh.png) + +5、Start the business code development of the NULS smart contract, see https://github.com/CCC-NULS/pocm-contract + +### Packing NULS Smart Contracts + +After completing the development of the smart contract, the smart contract is packaged through the “mvn clean pakcage” command or IDEA's maven plugin. After the package is completed, the offline smart contract client will be launched, and the developer can deploy and invoke the smart contract on this client. + +### Deployment contract + +On the "Deployment Contracts" page, the jar package under the target directory of the current smart contract project is automatically loaded, which is the default path for maven packaging. If the developer needs to deploy other jar packages, you can choose another jar package to upload and deploy. + +![](./mavenPackage/O7uEJyE.png) + +### Call contract + +After the contract is successfully deployed, it will be displayed in the list of the “My Contracts” page. The developer clicks the “call” button of the corresponding contract to enter the calling contract page, select the contract method to be called, fill in the parameters related to the contract method, and click “ Call "to complete the call of the contract method. As shown below. + +![](./mavenPackage/XpWvyXg.png) + +### Offline Smart Contract Client Introduction + +The main function of the offline smart contract client is to deploy and publish smart contracts. It also provides functions such as account creation and import, and maintenance of the NULS API module service node address. The main page of the client includes my contract, deployment contract, account management, and service node. + +The main advantage of the offline smart contract client is that the developer does not need to deploy the NULS wallet locally, and only runs the client to deploy smart contracts and legal method calls. + +#### My contract + +On the "My Contracts" page, you can view the list of contracts that have been deployed under the selected account address. Click the "Call" button to enter the calling page of the contract method. + +![](./mavenPackage/dfKpxeU.png) + +#### Deployment contract + +To deploy the contract on the “Deployment Contract” page, you can select the “jar package” or “HEX code” to deploy the contract. + +![](./mavenPackage/qLBQsfK.png) + + +#### Account management + +Before the smart contract is deployed and released, the account address must be selected through the “Enter” button. If there is no account information, it can be realized by creating an account or importing an account. The operation page is shown below. + +![](./mavenPackage/9ydbY9o.png) + +#### Service List + +All service nodes are displayed in the service list. The service node refers to the URL address of the NULS API module. When the service address is not selected, http://apitn1.nulscan.io is used by default. The operation page is as shown in the following figure. + +![](./mavenPackage/vdz2UUE.png) +![](./mavenPackage/7cxoYNz.png) \ No newline at end of file diff --git a/docs/NULS2.0/mavenPackage/7cxoYNz.png b/docs/NULS2.0/mavenPackage/7cxoYNz.png new file mode 100644 index 00000000..8fd2d46f Binary files /dev/null and b/docs/NULS2.0/mavenPackage/7cxoYNz.png differ diff --git a/docs/NULS2.0/mavenPackage/9ydbY9o.png b/docs/NULS2.0/mavenPackage/9ydbY9o.png new file mode 100644 index 00000000..8d637839 Binary files /dev/null and b/docs/NULS2.0/mavenPackage/9ydbY9o.png differ diff --git a/docs/NULS2.0/mavenPackage/O7uEJyE.png b/docs/NULS2.0/mavenPackage/O7uEJyE.png new file mode 100644 index 00000000..bb225130 Binary files /dev/null and b/docs/NULS2.0/mavenPackage/O7uEJyE.png differ diff --git a/docs/NULS2.0/mavenPackage/XpWvyXg.png b/docs/NULS2.0/mavenPackage/XpWvyXg.png new file mode 100644 index 00000000..4191f9a9 Binary files /dev/null and b/docs/NULS2.0/mavenPackage/XpWvyXg.png differ diff --git a/docs/NULS2.0/mavenPackage/axexko4.png b/docs/NULS2.0/mavenPackage/axexko4.png new file mode 100644 index 00000000..fa08e011 Binary files /dev/null and b/docs/NULS2.0/mavenPackage/axexko4.png differ diff --git a/docs/NULS2.0/mavenPackage/dfKpxeU.png b/docs/NULS2.0/mavenPackage/dfKpxeU.png new file mode 100644 index 00000000..d1a10a3d Binary files /dev/null and b/docs/NULS2.0/mavenPackage/dfKpxeU.png differ diff --git a/docs/NULS2.0/mavenPackage/jFTBDBh.png b/docs/NULS2.0/mavenPackage/jFTBDBh.png new file mode 100644 index 00000000..efafb8ed Binary files /dev/null and b/docs/NULS2.0/mavenPackage/jFTBDBh.png differ diff --git a/docs/NULS2.0/mavenPackage/jG8M6dR.png b/docs/NULS2.0/mavenPackage/jG8M6dR.png new file mode 100644 index 00000000..a95a42da Binary files /dev/null and b/docs/NULS2.0/mavenPackage/jG8M6dR.png differ diff --git a/docs/NULS2.0/mavenPackage/nw87nAh.png b/docs/NULS2.0/mavenPackage/nw87nAh.png new file mode 100644 index 00000000..93890ccb Binary files /dev/null and b/docs/NULS2.0/mavenPackage/nw87nAh.png differ diff --git a/docs/NULS2.0/mavenPackage/qLBQsfK.png b/docs/NULS2.0/mavenPackage/qLBQsfK.png new file mode 100644 index 00000000..7a5b7ea9 Binary files /dev/null and b/docs/NULS2.0/mavenPackage/qLBQsfK.png differ diff --git a/docs/NULS2.0/mavenPackage/roCyIZD.png b/docs/NULS2.0/mavenPackage/roCyIZD.png new file mode 100644 index 00000000..0eaa58ae Binary files /dev/null and b/docs/NULS2.0/mavenPackage/roCyIZD.png differ diff --git a/docs/NULS2.0/mavenPackage/vdz2UUE.png b/docs/NULS2.0/mavenPackage/vdz2UUE.png new file mode 100644 index 00000000..21eaa1cb Binary files /dev/null and b/docs/NULS2.0/mavenPackage/vdz2UUE.png differ diff --git a/docs/NULS2.0/nodeGuide.md b/docs/NULS2.0/nodeGuide.md new file mode 100644 index 00000000..eb4053a3 --- /dev/null +++ b/docs/NULS2.0/nodeGuide.md @@ -0,0 +1,231 @@ +# Node Program Configuration +## Configuration files +Core configuration file of the wallet, in which all modules can be configured. +### Structure of configuration file +It employs the structure of Windows-like configuration file, which is divided into group and parameter. + +``` +[network] # group +Port=18001 # Parameter `key` and value +``` +The content inside nuls.ncf looks like this. + +``` +[global] +Encoding=UTF-8 +Language=en +. . . +[account] +keystoreFolder=/keystore/backup + +[network] +Port=10081 +... +``` +[global] is a special group, in which all modules inherit configuration items. The global universal configuration can be configured under this group. +[account], [network] are the exclusive configurations of the account module and network module. The name corresponds to the `APP_NAME` in the `Module.ncf` of the module. +When [global] and the module group have the same configuration item, the configuration in the module group has a higher priority and overrides the configuration in the `global`. + +### Relationship with configuration files in the module +In the module directory (such as Modules/Nuls/account/1.0.0), there is a configuration file of Module.ncf. The priority of external `nuls.ncf` is higher than that of Module.ncf in the module. So when the configuration item with the same name appears, the item in nuls.ncf will override the item with the same name in the module. + +### Generating configuration file +When the wallet program is downloaded or packaged for the first time, the nuls.ncf file does exist. And it will be automatically generated for the first time of executing start or start-dev. + +### [Configuration description of nuls.ncf](#nuls.ncf) + +## Basic Command +### start +Wallet startup script, it is used in the production environment to launch the wallet + +``` +./start +``` +### stop +Wallet stop script, it is used in production environment to stop wallet + +``` +./stop +``` +### start-dev +Start the NULS2.0 development environment (compatible with macOS system) +``` +./start-dev +``` +### stop-dev +Stop the NULS2.0 development environment +``` +./stop-dev +``` +### cmd +Start the command line and perform wallet-related operations. + +``` +./cmd +``` +Specify the log level. ERROR by default, optional log levels are DEBUG, INFO, WARN and ERROR + +``` +./cmd -l DEBUG # set the log level to DEBUG +``` +Specify the path of the configuration file. By default the nuls.ncf is generated in the same directory + +``` +./cmd -c /home/my.ncf +``` +### check-status +Check the startup status of the module. This function allows you to quickly check if each basic module is successfully started. The script logic is to read the log flag bits in the log file. + +``` +./check-status +``` +Execution return +``` +==================MODULE PROCESS==================== +account PROCESS IS START +block PROCESS IS START +consensus PROCESS IS START +ledger PROCESS IS START +network PROCESS IS START +transaction PROCESS IS START +==================RPC REDAY MODULE================== +account RPC READY +block RPC READY +consensus RPC READY +ledger RPC READY +network RPC READY +transaction RPC READY +======================REDAY MODULE================== +account STATE IS READY +block STATE IS READY +consensus STATE IS READY +ledger STATE IS READY +network STATE IS READY +transaction STATE IS READY +================TRY RUNNING MODULE================== +account TRY RUNNING +block TRY RUNNING +consensus TRY RUNNING +ledger TRY RUNNING +network TRY RUNNING +transaction TRY RUNNING +===================RUNNING MODULE=================== +account STATE IS RUNNING +block STATE IS RUNNING +consensus STATE IS RUNNING +ledger STATE IS RUNNING +network STATE IS RUNNING +transaction STATE IS RUNNING +==================NULS WALLET STATE================= +========================== +NULS WALLET IS RUNNING +========================== +``` +The message NULS WALLET IS RUNNING indicates the success of the startup. +### create-address +Generate account address and private key. You can run it independently to generate address without relying on the wallet. +``` +./create-address +chainId: 2 +Number:1 +=========================================================== =========================================================== +Address :tNULSeBaMi3UWVb1hMrsoEmv4XPPLW7CKmBVgn +privateKey:e27e3961384bc4749cb5bd535b16c90c4430d4da2cd34e1edd10b50b0d01fa1d +=========================================================== =========================================================== +``` +Generate the chainId of the specified address + +``` +./create-address -c 1 # specify chainId to 1 (by default, reading chainId from nuls.ncf) +``` +Generate the specified number of addresses + +``` +./create-address -n 100 # generate 100 addresses in batches (1 by default) +``` +## Appendix +### nuls.ncf Configuration File +#### Global configuration: group +| Item | Value Range | Description | +| --- | --- | --- | +| encoding | character set | UTF-8 by default, not recommended to modify | +| language | en/zh_CHS | language package | +| logPath | relative path of the folder| storage path of log file, configuring the context relative path of file | +logLevel | DEBUG,INFO,WARN,ERROR | log level | +| dataPath | relative path of the folder | storage path of data file, configuring the context relative path of file | +| chainId | positive integer | chain ID of the default running chain | +| assetId | positive integer | main asset ID of the default running chain | +| chainName | string | name of the default running chain | +| symbol | string | main asset symbol of the default running chain | +| decimals | positive integer | number of digits to the right of the decimal point of the default asset | +| blackHolePublicKey | string | public key of the black hole address | + +#### Configuration of the network module : network + +| Item | Value Range| Description | +| --- | --- | --- | +| port | positive integer | communication port of network | +| CrossPort | positive Integer | communication port of cross-chain transaction | +| packetMagic | positive integer | network magic parameters, network connection happens only if the magic parameter are be the same | +| selfSeedIps | string | network node IP connected to by default, separated by English commas for multiple IPs| +| maxInCount | positive integer | maximum incoming connections to the current node | +| maxOutCount | Positive integer | maximum outgoing connections for the current node | + +#### Configuration of the account module : account + +| Item | Value Range | Description | +| --- | --- | --- | +| keystoreFolder | folder path | path of the file storing the account keystore, which is the path in the `dataPath` | + +#### Configuration of the block module : block + +| Item | Value Range| Description | +| --- | --- | --- | +| blockMaxSize | positive integer | maximum number of bytes a block can store | +| extendMaxSize | positive integer | maximum number of bytes the extension field in a block can store | +| chainSwtichThreshold | positive Integer | height difference threshold for forking chain switching | +| maxRollback | positive integer | local maximum rollback number in case of local block inconsistent with the network block | +|consistencyNodePercent | positive Integer | percentage threshold of the latest block height and hash consistency of nodes on the network | +| minNodeAmount | positive integer | minimum number of connecting nodes, continually waiting in case of the connecting network node less than this value | +| downloadNumber | positive integer | number of blocks downloaded from nodes on the network each time during block synchronization | +|SingleDownloadTimeout | positive integer | timeout for downloading a single block from nodes on the network | +| batchDownloadTimeout | positive integer | timeout for downloading multiple blocks from nodes on the network | +| cachedBlockSizeLimit | positive integer | maximum number of block bytes cached during block synchronization | + +#### Configuration of the poc consensus module : consensus + +| Item | Value Range| Description | +| --- | --- | --- | +| seedNodes | address list | block address list of seed nodes, separated by English commas for multiple addresses| +| password | string | default password for the seed node's block address. The password set when importing the address must be the same as this configuration item. | +| packingInterval | positive integer | block time in seconds. Configuration of 10 representing generating a new block every 10 seconds | +| agentAssetId | positive integer | asset ID allowed to participate in consensus | +| agentChainId | positive integer | chain ID of the asset allowed to participate in consensus | +| awardAssetId | positive integer | asset ID for consensus awards (must be in the chain where the consensus asset is located, that is, with the same chain ID| +| feeUnit | positive integer | unit price of the fee| + +#### Configuration of the smart contract : smart_contract + +| Item | Value Range | Description | +| --- | --- | --- | +| maxViewGas | positive integer | maximum consumed Gas for contract attempting to invoke methods | + +#### Configuration of API interface module : api-module + +| Item | Value Rang | Description | +| --- | --- | --- | +| rpcPort | port number | used by HTTP interface | +| databaseUrl | IP address | IP address of mongodb database| +| databasePort | port number | used by mongodb database | +| maxAliveConnect | positive integer | maximum number of connections of the database connection pool | +| maxWaitTime | positive integer | maximum waiting time (ms) to get a connection from the database | +| connectTimeOut | positive integer | timeout of database connection (ms) | + +#### Configuration of cross-chain module: cross-chain +| Item | Value Range| Description | +| --- | --- | --- | +| minNodeAmount | positive integer | minimum number of cross-chain node connection| +| maxNodeAmount | positive integer | maximum number of cross-chain node connection | +| sendHeight | positive integer | confirmation number of cross-chain transaction inside the chain| +| byzantineRatio | positive integers | Byzantine ratio of cross-chain transaction | +| CrossSeedIps | IP list | cross-chain seed node list on MainNet| \ No newline at end of file diff --git a/source/zh-cn/contract/pluginImages/1536204986(1).jpg b/docs/NULS2.0/pluginImages/1536204986(1).jpg similarity index 100% rename from source/zh-cn/contract/pluginImages/1536204986(1).jpg rename to docs/NULS2.0/pluginImages/1536204986(1).jpg diff --git a/docs/NULS2.0/pluginImages/Add.jpg b/docs/NULS2.0/pluginImages/Add.jpg new file mode 100644 index 00000000..553c9214 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Add.jpg differ diff --git a/docs/NULS2.0/pluginImages/Add3.jpg b/docs/NULS2.0/pluginImages/Add3.jpg new file mode 100644 index 00000000..350a0607 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Add3.jpg differ diff --git a/docs/NULS2.0/pluginImages/Add5.jpg b/docs/NULS2.0/pluginImages/Add5.jpg new file mode 100644 index 00000000..e792346e Binary files /dev/null and b/docs/NULS2.0/pluginImages/Add5.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy.jpg b/docs/NULS2.0/pluginImages/Deploy.jpg new file mode 100644 index 00000000..785777cc Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy2.jpg b/docs/NULS2.0/pluginImages/Deploy2.jpg new file mode 100644 index 00000000..f6940952 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy2.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy3.jpg b/docs/NULS2.0/pluginImages/Deploy3.jpg new file mode 100644 index 00000000..e36e5cdf Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy3.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy4.jpg b/docs/NULS2.0/pluginImages/Deploy4.jpg new file mode 100644 index 00000000..b2dfa5bb Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy4.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy5.jpg b/docs/NULS2.0/pluginImages/Deploy5.jpg new file mode 100644 index 00000000..54c8794a Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy5.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy6.jpg b/docs/NULS2.0/pluginImages/Deploy6.jpg new file mode 100644 index 00000000..408490e8 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy6.jpg differ diff --git a/docs/NULS2.0/pluginImages/Deploy7.jpg b/docs/NULS2.0/pluginImages/Deploy7.jpg new file mode 100644 index 00000000..ffbaa9f7 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Deploy7.jpg differ diff --git a/docs/NULS2.0/pluginImages/Install.jpg b/docs/NULS2.0/pluginImages/Install.jpg new file mode 100644 index 00000000..f4a00a94 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Install.jpg differ diff --git a/docs/NULS2.0/pluginImages/Install2.jpg b/docs/NULS2.0/pluginImages/Install2.jpg new file mode 100644 index 00000000..f413512b Binary files /dev/null and b/docs/NULS2.0/pluginImages/Install2.jpg differ diff --git a/docs/NULS2.0/pluginImages/Install3.jpg b/docs/NULS2.0/pluginImages/Install3.jpg new file mode 100644 index 00000000..fd11c850 Binary files /dev/null and b/docs/NULS2.0/pluginImages/Install3.jpg differ diff --git a/docs/NULS2.0/pluginImages/code.jpg b/docs/NULS2.0/pluginImages/code.jpg new file mode 100644 index 00000000..9f40aca1 Binary files /dev/null and b/docs/NULS2.0/pluginImages/code.jpg differ diff --git a/docs/NULS2.0/pluginImages/createProject.jpg b/docs/NULS2.0/pluginImages/createProject.jpg new file mode 100644 index 00000000..a7c0a6c3 Binary files /dev/null and b/docs/NULS2.0/pluginImages/createProject.jpg differ diff --git a/docs/NULS2.0/pluginImages/createProject2.jpg b/docs/NULS2.0/pluginImages/createProject2.jpg new file mode 100644 index 00000000..494ea971 Binary files /dev/null and b/docs/NULS2.0/pluginImages/createProject2.jpg differ diff --git a/docs/NULS2.0/pluginImages/package.jpg b/docs/NULS2.0/pluginImages/package.jpg new file mode 100644 index 00000000..2353f253 Binary files /dev/null and b/docs/NULS2.0/pluginImages/package.jpg differ diff --git a/docs/NULS2.0/pluginImages/package1.jpg b/docs/NULS2.0/pluginImages/package1.jpg new file mode 100644 index 00000000..19073268 Binary files /dev/null and b/docs/NULS2.0/pluginImages/package1.jpg differ diff --git a/docs/NULS2.0/pluginImages/package2.jpg b/docs/NULS2.0/pluginImages/package2.jpg new file mode 100644 index 00000000..eabd322b Binary files /dev/null and b/docs/NULS2.0/pluginImages/package2.jpg differ diff --git a/docs/NULS2.0/pluginImages/package3.jpg b/docs/NULS2.0/pluginImages/package3.jpg new file mode 100644 index 00000000..bdbf4eeb Binary files /dev/null and b/docs/NULS2.0/pluginImages/package3.jpg differ diff --git a/docs/NULS2.0/pluginImages/package4.jpg b/docs/NULS2.0/pluginImages/package4.jpg new file mode 100644 index 00000000..34fc4242 Binary files /dev/null and b/docs/NULS2.0/pluginImages/package4.jpg differ diff --git a/docs/NULS2.0/quickStart.md b/docs/NULS2.0/quickStart.md new file mode 100755 index 00000000..985c1cd6 --- /dev/null +++ b/docs/NULS2.0/quickStart.md @@ -0,0 +1,170 @@ +# Quick Start + +## Install JDK11 + +Download JDK11 to the server and extract it. + +### 1 download jdk11 + +Jdk11 download address: [jdk11 download](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html) + +### 2 upload to the server and extract + +``` +tar -zxvf jdk-11.0.2_linux-x64_bin.tar.gz +``` + +![20190327142342](./quickStart/20190327142342.png) + +### 3 configuration environment + +**vi /etc/profile** + +Copy the following code to the file + +``` +JAVA_HOME=/home/nuls2/jdk-11.0.2 +PATH=$PATH:$JAVA_HOME/bin +CLASSPATH=:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar +Export JAVA_HOME PATH CLASSPATH +``` + +**ps**: /home/nuls2/jdk-11.0.2 is the path after jdk is unpacked, please configure according to your actual path. + +**source /etc/profile** The configuration of this command takes effect. + +View the jdk version via java -version: + +![20190327143435](./quickStart/20190327143435.png) + +## Download and install the wallet + +### 1 download NULS wallet + +Go to GitHub and download the latest version of the NULS2.0 wallet: [download address](https://github.com/nuls-io/nuls_2.0/releases) + +### 2 upload to the server and extract + +``` +tar -zxvf NULS-Walltet-linux64-beta1.tar.gz +``` + +![20190327144549](./quickStart/20190327144549.png) + +## Enter the CLI + +### 1 start the wallet + +After the wallet is decompressed, go to the start.sh file directory: /home/nuls2/NULS-Wallet-linux64-beta1 + +![20190327150757](./quickStart/20190327150757.png) + +Execute the command: **./start.sh -D** + +### 2 enter the command line + +After the wallet is started, execute cmd.sh (./cmd.sh) in the same directory to enter the wallet command line. The NULS command prompts the prompt: `nuls>gt;> `, enter the NULS wallet operation command, and operate . + +![20190327223858](./quickStart/20190327223858.png) + +## Part of Instructions + +### 1 create an account + +Command: **create** [Number] + +``` +Number: The number of account addresses created. The default is 1 and the maximum is 100. +``` + + +### 2 Backup keystore + +Command: **backup** <address> [Path] +   +``` +Address: Account address to be backed up (required) +Path: The directory where the backup file is generated. The default is the current directory (optional) +``` + +### 3 Get the private key + +Command: **getprikey** <address> + +``` +Address: Account address for obtaining the private key (required) +``` + +### 4 remove the account + +Command: **remove** <address> + +``` +Address: address to be removed (required) +``` + +### 5 modify the account password + +Command: **resetpwd** <address> + +``` +Address: Account address to change the password (required) +``` + +### 6 Transfer + +Command: **transfer** <FromAddress/FromAlias> <ToAddress/ToAlias><amount> [Remark] + +``` +FromAddress/FromAlias: Transfer the address or export the alias, choose one (required) +ToAddress/ToAlias: Receive address or receive alias, choose one (required) +``` + +### 7 create a consensus node + +Command: **createagent** <AgentAddress> <PackingAddress> <CommissionRate> <Deposit> [RewardAddress] + +``` +AgentAddress: Consensus node creation address (required) +PackingAddress: The address of the consensus node is packed. The password must be the same as the configuration file. The default is: nuls123456 (required) +CommissionRate: commission ratio, range: 10-100, maximum decimal place 2 digits (required) Deposit: margin, range: 20000-200000, maximum decimal place 8 digits (required) RewardAddress: reward address, default is node creation address ( Optional) +``` + +**ps**: Save the hash of the consensus node (or query in [**Browser**] (http://beta.nulscan.io)), join the consensus and query consensus node information needs to be used; Ensure that the consensus node creates an address and a packaged address in one wallet, and one wallet cannot create two consensus nodes at the same time. + +### 8 join the consensus + +Command: **deposit**<Address><AgentHash><Deposit> + +``` +Address: Account address to join the consensus (required) +AgentHash: Create a hash of the consensus node (required) +Deposit: Join the consensus deposit, 2000-500000, up to 8 decimal places (required) +``` + +**ps**: Save the consensus hash, you need to use the exit consensus + +### 9 Exit the consensus + +Command: **withdraw**<Address><TxHash> + +``` +Address: Exit consensus address (required) +TxHash: transaction hash at the time of delegation (required) +``` + +### 10 stop consensus node + +Command: **stopagent**<Address> + +``` +Address: Consensus node creation address (required) +``` + +### 11 query consensus node information + +Command: **getagent**<AgentHash> + +``` +AgentHash: Consensus node creates hash (required) +``` diff --git a/docs/NULS2.0/quickStart/20190327142342.png b/docs/NULS2.0/quickStart/20190327142342.png new file mode 100755 index 00000000..6c0a5468 Binary files /dev/null and b/docs/NULS2.0/quickStart/20190327142342.png differ diff --git a/docs/NULS2.0/quickStart/20190327143435.png b/docs/NULS2.0/quickStart/20190327143435.png new file mode 100755 index 00000000..7320666c Binary files /dev/null and b/docs/NULS2.0/quickStart/20190327143435.png differ diff --git a/docs/NULS2.0/quickStart/20190327144549.png b/docs/NULS2.0/quickStart/20190327144549.png new file mode 100755 index 00000000..0b609bce Binary files /dev/null and b/docs/NULS2.0/quickStart/20190327144549.png differ diff --git a/docs/NULS2.0/quickStart/20190327150757.png b/docs/NULS2.0/quickStart/20190327150757.png new file mode 100755 index 00000000..dcce3d3d Binary files /dev/null and b/docs/NULS2.0/quickStart/20190327150757.png differ diff --git a/docs/NULS2.0/quickStart/20190327223858.png b/docs/NULS2.0/quickStart/20190327223858.png new file mode 100755 index 00000000..49babe23 Binary files /dev/null and b/docs/NULS2.0/quickStart/20190327223858.png differ diff --git a/docs/NULS2.0/smartContractFee.md b/docs/NULS2.0/smartContractFee.md new file mode 100644 index 00000000..6c6013a0 --- /dev/null +++ b/docs/NULS2.0/smartContractFee.md @@ -0,0 +1,1128 @@ +<<<<<<< HEAD:docs/NULS2.0/smartContractFee.md +# Service Charge +======= +# NULS智能合约开发手册 +>>>>>>> 46bb1d94903094b3bd2ef86b2e87fe5d05d60f24:source/zh-cn/contract/index.md + +## 1. 简介 + +NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。 + +## 2. 开发环境 + +### 2.1 安装NULS钱包 + +### 2.2 安装JDK 8 + +### 2.3 安装IntelliJ IDEA + +Nuls智能合约使用的开发工具为IntelliJ IDEA。 + +### 2.4 安装NULS智能合约插件 + +[点击下载插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) + +NULS智能合约插件提供的主要功能: + +* 新建NULS合约工程 +* 提示不支持的Java特性、Java类、Java方法 +* 编译、打包、部署合约 +* 展示、调用合约方法。 + +## 3. NULS智能合约规范与语法 + +Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。 + +### 3.1 NULS智能合约规范 + +> **_合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + +### 3.2 关键字 + +下面列出Java关键字,其中将标注NULS智能合约不支持的关键字 + +访问控制 + +* public +* protected +* private + +定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象 + +* class +* interface +* abstract +* implements +* extends +* new + +包的关键字 + +* import +* package + +数据类型的关键字 + +* byte +* char +* boolean +* short +* int +* float +* long +* double +* void +* null +* true +* false + +条件循环(流程控制) + +* if +* else +* while +* for +* switch +* case +* default +* do +* break +* continue +* return +* instanceof + +错误处理 + +* catch +* try +* finally +* throw +* throws + +修饰方法、类、属性和变量 + +* static +* final +* super +* this +* native(不支持) +* strictfp(不支持) +* synchronized(不支持) +* transient(不支持) +* volatile(不支持) + +其他 + +* enum(不支持) +* assert(不支持) + +### 3.3 基本语法 + +下面的语法与Java相同,只是简单列出,具体可参考Java相关文档 + +* 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头 +* 基本数据类型:byte short int long float double char boolean +* 引用数据类型:类、接口、数组 +* 算术运算符:+ - * / % ++ -- +* 关系运算符:> < >= <= == != +* 逻辑运算符:! & | ^ && || +* 位运算符:& | ^ ~ >> << >>> +* 赋值运算符:= +* 拓展赋值运算符:+ = -= *= /= +* 字符串链接运算符:+ +* 三目条件运算符 ? : +* 流程控制语句(if,switch,for,while,do...while) + +### 3.4 支持的类 + +Nuls智能合约只能使用下面的类进行开发 + +* io.nuls.contract.sdk.Address +* io.nuls.contract.sdk.Block +* io.nuls.contract.sdk.BlockHeader +* io.nuls.contract.sdk.Contract +* io.nuls.contract.sdk.Event +* io.nuls.contract.sdk.Msg +* io.nuls.contract.sdk.Utils +* io.nuls.contract.sdk.annotation.View +* io.nuls.contract.sdk.annotation.Required +* io.nuls.contract.sdk.annotation.Payable +* java.lang.Boolean +* java.lang.Byte +* java.lang.Short +* java.lang.Character +* java.lang.Integer +* java.lang.Long +* java.lang.Float +* java.lang.Double +* java.lang.String +* java.lang.StringBuilder +* java.math.BigInteger +* java.math.BigDecimal +* java.util.Collection +* java.util.List +* java.util.ArrayList +* java.util.LinkedList +* java.util.Map +* java.util.HashMap +* java.util.LinkedHashMap +* java.util.Set +* java.util.HashSet + +### 3.5 其他限制 + +* 合约类只能有一个构造方法,其他类不限制 +* 执行一次合约方法最大的Gas消耗是1000万,包括`@View`类型的方法调用,请保证尽可能的优化合约代码 + +## 4. NULS智能合约简单示例 + +一个简单的合约 + +> **_合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + + +```java +package contracts.examples; + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +public class SimpleStorage implements Contract { + + private String storedData; + + @View + public String getStoredData() { + return storedData; + } + + @Payable + public void setStoredData(@Required String storedData) { + this.storedData = storedData; + } + +} +``` + +在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。 +项目中可以有多个类和接口。 + +合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 +合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。 + +注解说明 + +@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。 + +@Payable 标记@Payable的方法,才能在调用时候传入金额 + +@Required 标记@Required的参数,调用时候必须传入值 + +去github下载NULS源码,里面有一些合约示例。 + +## 5. NULS Contract SDK + +合约SDK提供了几个类,方便合约开发: + +### io.nuls.contract.sdk.Address + +```java +public class Address { + + private final String address; + + public Address(String address) { + valid(address); + this.address = address; + } + + /** + * 获取该地址的余额(只能获取合约地址余额) + * + * @return + */ + public native BigInteger balance(); + + /** + * 合约向该地址转账 + * + * @param value 转账金额(多少Na) + */ + public native void transfer(BigInteger value); + + /** + * 调用该地址的合约方法 + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + */ + public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 调用该地址的合约方法并带有返回值(String) + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + * @return 调用合约后的返回值 + */ + public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 验证地址 + * + * @param address + * @see io.nuls.kernel.utils.AddressTool#validAddress(String) + */ + private native void valid(String address); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address1 = (Address) o; + return address != null ? address.equals(address1.address) : address1.address == null; + } + + @Override + public int hashCode() { + return address != null ? address.hashCode() : 0; + } + + @Override + public String toString() { + return address; + } + +} +``` + +### io.nuls.contract.sdk.Block + +```java +public class Block { + + /** + * 给定块的区块头 + * + * @param blockNumber + * @return + */ + public static native BlockHeader getBlockHeader(long blockNumber); + + /** + * 当前块的区块头 + * + * @return + */ + public static native BlockHeader currentBlockHeader(); + + /** + * 最新块的区块头 + * + * @return 最新块的区块头 + */ + public static native BlockHeader newestBlockHeader(); + + /** + * 给定块的哈希值 + * hash of the given block + * + * @param blockNumber + * @return + */ + public static String blockhash(long blockNumber) { + return getBlockHeader(blockNumber).getHash(); + } + + /** + * 当前块矿工地址 + * current block miner’s address + * + * @return + */ + public static Address coinbase() { + return currentBlockHeader().getPackingAddress(); + } + + /** + * 当前块编号 + * current block number + * + * @return + */ + public static long number() { + return currentBlockHeader().getHeight(); + } + + /** + * 当前块时间戳 + * current block timestamp + * + * @return + */ + public static long timestamp() { + return currentBlockHeader().getTime(); + } + +} +``` + +### io.nuls.contract.sdk.BlockHeader + +```java +public class BlockHeader { + + private String hash; + private long time; + private long height; + private long txCount; + private Address packingAddress; + private String stateRoot; + + public String getHash() { + return hash; + } + + public long getTime() { + return time; + } + + public long getHeight() { + return height; + } + + public long getTxCount() { + return txCount; + } + + public Address getPackingAddress() { + return packingAddress; + } + + public String getStateRoot() { + return stateRoot; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BlockHeader that = (BlockHeader) o; + + if (time != that.time) return false; + if (height != that.height) return false; + if (txCount != that.txCount) return false; + if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; + if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) + return false; + return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; + } + + @Override + public int hashCode() { + int result = hash != null ? hash.hashCode() : 0; + result = 31 * result + (int) (time ^ (time >>> 32)); + result = 31 * result + (int) (height ^ (height >>> 32)); + result = 31 * result + (int) (txCount ^ (txCount >>> 32)); + result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); + result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "BlockHeader{" + + "hash='" + hash + '\'' + + ", time=" + time + + ", height=" + height + + ", txCount=" + txCount + + ", packingAddress=" + packingAddress + + ", stateRoot='" + stateRoot + '\'' + + '}'; + } + +} +``` + +### io.nuls.contract.sdk.Contract + +```java +/** + * 合约接口,合约类实现这个接口 + */ +public interface Contract { + + /** + * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。 + */ + default void _payable() { + } + +} +``` + +### io.nuls.contract.sdk.Event + +```java +/** +* 事件接口,事件类实现这个接口 +*/ +public interface Event { +} +``` + +### io.nuls.contract.sdk.Msg + +```java +public class Msg { + + /** + * 剩余Gas + * remaining gas + * + * @return + */ + public static native long gasleft(); + + /** + * 合约发送者地址 + * sender of the contract + * + * @return + */ + public static native Address sender(); + + /** + * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na + * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na + * + * @return + */ + public static native BigInteger value(); + + /** + * Gas价格 + * gas price + * + * @return + */ + public static native long gasprice(); + + /** + * 合约地址 + * contract address + * + * @return + */ + public static native Address address(); + +} +``` + +### io.nuls.contract.sdk.Utils + +```java +public class Utils { + + private Utils() { + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + */ + public static void require(boolean expression) { + if (!expression) { + revert(); + } + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + * @param errorMessage + */ + public static void require(boolean expression, String errorMessage) { + if (!expression) { + revert(errorMessage); + } + } + + /** + * 终止执行并还原改变的状态 + */ + public static void revert() { + revert(null); + } + + /** + * 终止执行并还原改变的状态 + * + * @param errorMessage + */ + public static native void revert(String errorMessage); + + /** + * 发送事件 + * + * @param event + */ + public static native void emit(Event event); + + /** + * @param seed a private seed + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * @param src source string + * @return sha3-256 hash (utf-8 encode) + */ + public static native String sha3(String src); + + /** + * @param bytes source byte array + * @return sha3-256 hash + */ + public static native String sha3(byte[] bytes); + +} +``` + +### io.nuls.contract.sdk.annotation.Payable + +`@Payable 标记@Payable的方法,才能在调用时候转入金额` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Payable { +} +``` + +### io.nuls.contract.sdk.annotation.Required + +`@Required 标记@Required的参数,调用时候必须传入值` + +```java +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Required { +} +``` + +### io.nuls.contract.sdk.annotation.View + +`@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface View { +} +``` + +## 6. 智能合约主要的RPC接口 + +这里列举几个接口的参数结构及简单实例,其他接口请参见[Swagger UI](http://127.0.0.1:8001/docs#/) +> 测试网的`Swagger UI`的端口默认是8001,正式网的端口默认是6001 + +### 6.1 创建智能合约 + +- POST `/api/contract/create` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|gasLimit*| long| 最大gas消耗| +|price* | long| 执行合约单价| +|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| +|remark |string |备注| +|args |string[][]|参数列表| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "gasLimit": 4687, + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "remark": "asd", + "args": [] +} +``` + + + +### 6.2 估算创建智能合约的Gas消耗 + +- POST `/api/contract/imputedgas/create` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|price* | long| 执行合约单价| +|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| +|args |string[][]|参数列表| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "args": [] +} +``` + + + +### 6.3 调用智能合约 + +- POST `/api/contract/call` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|contractAddress* |string| 智能合约地址| +|gasLimit* | long| 最大Gas消耗| +|price* | long| 执行合约单价| +|value |long| 交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)| +|methodName* |string| 方法名| +|methodDesc |string| 方法签名,如果方法名不重复,可以不传| +|remark |string| 备注| +|args |string[][]|参数列表| + + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "password": "", + "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U", + "gasLimit": 8000, + "price": 20, + "value": 0, + "methodName": "balance", + "methodDesc": "", + "remark": "qwe" + "args": [] +} +``` + + +### 6.4 估算调用智能合约的Gas消耗(参见`Swagger UI`) + +- POST `/api/contract/imputedgas/call` + + + +### 6.5 估算智能合约的price(参见`Swagger UI`) +- POST `/api/contract/imputedprice` + + + +### 6.6 终止智能合约(参见`Swagger UI`) + +- POST `/api/contract/delete` + + + +### 6.7 调用不上链的智能合约函数(参见`Swagger UI`) + +- POST `/api/contract/view` + + + +### 6.8 获取智能合约执行结果(参见`Swagger UI`) + +- GET `/api/contract/result/{hash}` + + + +### 6.9 获取智能合约基本信息(参见`Swagger UI`) + +- GET `/api/contract/info/{address}` + + + +### 6.10 验证是否为合约地址(参见`Swagger UI`) + +- GET `/api/contract/{address}` + + + +### 6.11 获取智能合约地址的NULS余额(参见`Swagger UI`) + +- GET `/api/contract/balance/{address}` + + + +### 6.12 获取智能合约交易详情(参见`Swagger UI`) + +- GET `/api/contract/tx/{hash}` + + + +### 6.13 获取智能合约的交易列表(参见`Swagger UI`) + +- GET `/api/contract/tx/list/{address}` + + +### 6.14 根据address和limit查询合约UTXO(参见`Swagger UI`) + +- GET `/api/contract/limit/{address}/{limit}` + + + +### 6.15 根据address和amount查询合约UTXO(参见`Swagger UI`) + +- GET `/api/contract/amount/{address}/{amount}` + + +### 6.16 向智能合约转账(参见`Swagger UI`) + +- POST `/api/contract/transfer` + + + +## 7. 示例 + +### 7.1 投票智能合约代码`片段`, 如下 + +> 完整代码: `https://github.com/nuls-io/nuls-vote` + +```java +package io.nuls.vote.contract; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Utils; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.View; +import io.nuls.vote.contract.func.BaseVote; +import io.nuls.vote.contract.func.VoteInterface; +import io.nuls.vote.contract.model.VoteConfig; +import io.nuls.vote.contract.model.VoteEntity; + +import java.math.BigInteger; +import java.util.List; +import java.util.Map; + +public class VoteContract implements Contract { + + private VoteInterface baseVote; + + public VoteContract(long minRecognizance) { + baseVote = new BaseVote(BigInteger.valueOf(minRecognizance)); + } + + @Payable + public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) { + VoteEntity voteEntity = baseVote.create(title, desc, items); + + VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify); + boolean success = baseVote.init(voteEntity.getId(), config); + + Utils.require(success); + + return voteEntity; + } + + public boolean vote(long voteId, long[] itemIds) { + return baseVote.vote(voteId, itemIds); + } + + public boolean redemption(long voteId) { + return baseVote.redemption(voteId); + } + + @View + public boolean canVote(long voteId) { + return baseVote.canVote(voteId); + } + + @View + public VoteEntity queryVote(long voteId) { + return baseVote.queryVote(voteId); + } + + @View + public Map> queryVoteResult(long voteId) { + return baseVote.queryVoteResult(voteId); + } + + @View + public boolean queryAddressHasVote(long voteId, Address address) { + return baseVote.queryAddressHasVote(voteId, address); + } +} + +``` + +智能合约的方法中如果有`数组类型`的参数,请使用如下方式传递参数 +> 参考以上投票合约代码中的`create`方法 + +```javascript +{ + "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", + "password": "", + "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", + "gasLimit": 200000, + "price": 1, + "value": 10000000000, + "methodName": "create", + "methodDesc": "", + "remark": "", + "args": [ + "测试投票1", + "第一个投票合约", + [ + "第一个选项", + "第二个选项", + "第三个选项" + ], + 1536044066056, 1536184066056, false, 300, false + ] +} +``` + + +### 7.2 Standard Token 智能合约代码`片段` + +> 完整代码: `https://github.com/nuls-io/nuls-nrc20` + +```java +package io.nuls.contract.token; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Msg; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; + +import static io.nuls.contract.sdk.Utils.emit; +import static io.nuls.contract.sdk.Utils.require; + +public class SimpleToken implements Contract, Token { + + private final String name; + private final String symbol; + private final int decimals; + private BigInteger totalSupply = BigInteger.ZERO; + + private Map balances = new HashMap(); + private Map> allowed = new HashMap>(); + + @Override + @View + public String name() { + return name; + } + + @Override + @View + public String symbol() { + return symbol; + } + + @Override + @View + public int decimals() { + return decimals; + } + + @Override + @View + public BigInteger totalSupply() { + return totalSupply; + } + + public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) { + this.name = name; + this.symbol = symbol; + this.decimals = decimals; + totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));; + balances.put(Msg.sender(), totalSupply); + emit(new TransferEvent(null, Msg.sender(), totalSupply)); + } + + @Override + @View + public BigInteger allowance(@Required Address owner, @Required Address spender) { + Map ownerAllowed = allowed.get(owner); + if (ownerAllowed == null) { + return BigInteger.ZERO; + } + BigInteger value = ownerAllowed.get(spender); + if (value == null) { + value = BigInteger.ZERO; + } + return value; + } + + @Override + public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) { + subtractAllowed(from, Msg.sender(), value); + subtractBalance(from, value); + addBalance(to, value); + emit(new TransferEvent(from, to, value)); + return true; + } + + @Override + @View + public BigInteger balanceOf(@Required Address owner) { + require(owner != null); + BigInteger balance = balances.get(owner); + if (balance == null) { + balance = BigInteger.ZERO; + } + return balance; + } + + @Override + public boolean transfer(@Required Address to, @Required BigInteger value) { + subtractBalance(Msg.sender(), value); + addBalance(to, value); + emit(new TransferEvent(Msg.sender(), to, value)); + return true; + } + + @Override + public boolean approve(@Required Address spender, @Required BigInteger value) { + setAllowed(Msg.sender(), spender, value); + emit(new ApprovalEvent(Msg.sender(), spender, value)); + return true; + } + + public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) { + addAllowed(Msg.sender(), spender, addedValue); + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) { + check(subtractedValue); + BigInteger oldValue = allowance(Msg.sender(), spender); + if (subtractedValue.compareTo(oldValue) > 0) { + setAllowed(Msg.sender(), spender, BigInteger.ZERO); + } else { + subtractAllowed(Msg.sender(), spender, subtractedValue); + } + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + private void addAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance); + check(value); + setAllowed(address1, address2, allowance.add(value)); + } + + private void subtractAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance, value, "Insufficient approved token"); + setAllowed(address1, address2, allowance.subtract(value)); + } + + private void setAllowed(Address address1, Address address2, BigInteger value) { + check(value); + Map address1Allowed = allowed.get(address1); + if (address1Allowed == null) { + address1Allowed = new HashMap(); + allowed.put(address1, address1Allowed); + } + address1Allowed.put(address2, value); + } + + private void addBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(value, "The value must be greater than or equal to 0."); + check(balance); + balances.put(address, balance.add(value)); + } + + private void subtractBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(balance, value, "Insufficient balance of token."); + balances.put(address, balance.subtract(value)); + } + + private void check(BigInteger value) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0); + } + + private void check(BigInteger value1, BigInteger value2) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0); + } + + private void check(BigInteger value, String msg) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg); + } + + private void check(BigInteger value1, BigInteger value2, String msg) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0, msg); + } + + + +} + +``` + + + + + diff --git a/docs/NULS2.0/smartContractManual.md b/docs/NULS2.0/smartContractManual.md new file mode 100644 index 00000000..99238910 --- /dev/null +++ b/docs/NULS2.0/smartContractManual.md @@ -0,0 +1,857 @@ +# Development Manual + +## 1. Introduction + +NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3. + +## 2. Development environment + +### 2.1 Setup of NULS wallet + +### 2.2 Setup of JDK 8 + +### 2.3 Setup of IntelliJ IDEA + +NULS smart contract adopts IntelliJ IDEA as development tool + +### 2.4 NULS Smart Contract Development Tool + +The main features provided by the NULS Smart Contract Development Tool: + +* Create a new NULS smart contract Maven project +* Provide visual pages to compile, package, deploy contracts, call contracts, query contract related data + +> [Documentation for building a NULS smart contract Development Tool](/NULS2.0/mavenPackage.html) + +## 3. NULS smart contract specifications and syntax + +NULS smart contract syntax is a subset of Java syntax, with some restrictions + +### 3.1 NULS smart contract specifications + +> **_Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract._** + +### 3.2 Keywords + +Java key words are listed as follows and those not applicable for NULS smart contract will be marked + +Access control + +* public +* protected +* private + +Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class + +* class +* interface +* abstract +* implements +* extends +* new + +Key words of package + +* import +* package + +Key words of data type + +* byte +* char +* boolean +* short +* int +* float +* long +* double +* void +* null +* true +* false + +Conditional loops (process control) + +* if +* else +* while +* for +* switch +* case +* default +* do +* break +* continue +* return +* instanceof + +Error processing + +* catch +* try +* finally +* throw +* throws + +Modification method, class, property and variables + +* static +* final +* super +* this +* native(not supported) +* strictfp(not supported) +* synchronized(not supported) +* transient(not supported) +* volatile(not supported) + +other + +* enum(not supported) +* assert(not supported) + +### 3.3 Basic syntax + +The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java + +* Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign +* Basic data type: byte short int long float double char boolean +* Reference data type: class, interface, array +* Arithmetic operators: + - * /%++ - +* Relational operator: > <> = <= ==! = +* Logical Operators: ! &| ^ && || +* Bit operator: &| ^~>> << >>> +* Assignment operator: = +* Extension assignment operators: + = - = * = / = +* String link operator: + +* Conditional operators: ? : +* Process control sentence (if, switch, for, while, do...while) + + +### 3.4 Available class + +NULS smart contract can be developed with the following class + +* io.nuls.contract.sdk.Address +* io.nuls.contract.sdk.Block +* io.nuls.contract.sdk.BlockHeader +* io.nuls.contract.sdk.Contract +* io.nuls.contract.sdk.Event +* io.nuls.contract.sdk.Msg +* io.nuls.contract.sdk.Utils +* io.nuls.contract.sdk.annotation.View +* io.nuls.contract.sdk.annotation.Required +* io.nuls.contract.sdk.annotation.Payable +* java.lang.Boolean +* java.lang.Byte +* java.lang.Short +* java.lang.Character +* java.lang.Integer +* java.lang.Long +* java.lang.Float +* java.lang.Double +* java.lang.String +* java.lang.StringBuilder +* java.math.BigInteger +* java.math.BigDecimal +* java.util.Collection +* java.util.List +* java.util.ArrayList +* java.util.LinkedList +* java.util.Map +* java.util.HashMap +* java.util.LinkedHashMap +* java.util.Set +* java.util.HashSet + +### 3.5 Other restrictions + +* Contract class can have one construction method. No restriction for other classes +* The maximum gas consumption for executing a contract method once is 10 million, Make sure to optimize the contract code as much as possible. +* The maximum gas consumption for executing the method of the `@View` type once is 100 million, Make sure to optimize the contract code as much as possible. + +## 4. Nuls smart contract example + +a simple contract + +> **_Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract_** + + +```java + +package contracts.examples; + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +public class SimpleStorage implements Contract { + + private String storedData; + + /** + * Only when `@View` is added, the contract status will remain and it can be researched by such means + */ + @View + public String getStoredData() { + return storedData; + } + + /** + * Only when `@Payable` is added, the amount can be transferred in + */ + @Payable + public void setStoredData(@Required String storedData) { + this.storedData = storedData; + } + + /** + * The return value is automatically serialized by the VM in JSON format and returned as a JSON string. +     * Note: The object level must not exceed 3 layers. The more than 3 layers will call the object's toString method, and will not continue serialization. + */ + @JSONSerializable + public Map vJsonSerializableMap() { + Map map = new HashMap(); + map.put("name", "nuls"); + map.put("url", "https://nuls.io"); + return map; + } + +} +``` + +In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details +The project has several classes and interfaces + +When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class + +After the contract is deployed, _**all public methods of contract class can be called**_ so as to read or modify the contract status + + +Explanatory comments + +@JSONSerializable labels the method of @JSONSerializable, The return value is automatically serialized by the VM in JSON format and returned as a JSON string. + +Note: The object level must not exceed 3 layers. The more than 3 layers will call the object's toString method, and will not continue serialization. + +@View labels the method of @View. After it is added, the contract status will remain and it can be researched by such means + +@Payable labels the method of @Payable. Only when it is added, the amount can be transferred in + +@Required labels the parameter of @Required. When it is added, there must be transfer-in value, _**If you do not want to pass parameters that are not marked with this annotation, you need to fill in 0 or null placeholder.**_ + +### Some contract examples on github + +[NULS Contract Sample Collection](https://github.com/nuls-io/nuls-contracts) + +[NULS Contract Sample - NRC20](https://github.com/nuls-io/nuls-contracts/tree/master/nrc20) + +[NULS Contract Sample - NRC721](https://github.com/MIMIEYES/NULS-NRC721-baselib) + +[NULS Contract Sample - POCM](https://github.com/CCC-NULS/pocm-contract) + +## 5. NULS Contract SDK + +Contract SDK provides several classes to be convenient for contract development: + +### io.nuls.contract.sdk.Address + +```java +public class Address { + + private final String address; + + public Address(String address) { + valid(address); + this.address = address; + } + + /** + * Get the available balance of the address + * + * @return BigInteger + */ + public native BigInteger balance(); + + /** + * Get the total balance of the address + * + * @return BigInteger + */ + public native BigInteger totalBalance(); + + /** + * Transfer amount to the address from contract + * + * @param value transfer amount (in Na) + */ + public native void transfer(BigInteger value); + + /** + * Contract method to call the address + * + * @param Method name + * @param Method signature + * @param Parameters + * @param value Incidental currency (in Na) + */ + public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * Call the contract method of this address with a return value(String) + * + * @param Method name + * @param Method signature + * @param Parameters + * @param value Incidental currency (in Na) + * @return return value after calling the contract + */ + public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * Verify the address + * + * @param address + * @see io.nuls.kernel.utils.AddressTool#validAddress(String) + */ + private native void valid(String address); + + /** + * Verify that the address is a contract address + * + */ + public native boolean isContract(); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address1 = (Address) o; + return address != null ? address.equals(address1.address) : address1.address == null; + } + + @Override + public int hashCode() { + return address != null ? address.hashCode() : 0; + } + + @Override + public String toString() { + return address; + } + +} +``` + +### io.nuls.contract.sdk.Block + +```java +public class Block { + + /** + * Given block’s head + * + * @param blockNumber + * @return + */ + public static native BlockHeader getBlockHeader(long blockNumber); + + /** + * Current block’s head + * + * @return + */ + public static native BlockHeader currentBlockHeader(); + + /** + * Newest block’s head + * + * @return + */ + public static native BlockHeader newestBlockHeader(); + + /** + * Given block’s hash + * + * @param blockNumber + * @return + */ + public static String blockhash(long blockNumber) { + return getBlockHeader(blockNumber).getHash(); + } + + /** + * + * CCurrent block’s miner address + * + * @return + */ + public static Address coinbase() { + return currentBlockHeader().getPackingAddress(); + } + + /** + * + * Current block’s No. + * + * @return + */ + public static long number() { + return currentBlockHeader().getHeight(); + } + + /** + * + * Current block’s time stamp + * + * @return + */ + public static long timestamp() { + return currentBlockHeader().getTime(); + } + +} +``` + +### io.nuls.contract.sdk.BlockHeader + +```java +public class BlockHeader { + + private String hash; + private long time; + private long height; + private long txCount; + private Address packingAddress; + private String stateRoot; + + public String getHash() { + return hash; + } + + public long getTime() { + return time; + } + + public long getHeight() { + return height; + } + + public long getTxCount() { + return txCount; + } + + public Address getPackingAddress() { + return packingAddress; + } + + public String getStateRoot() { + return stateRoot; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BlockHeader that = (BlockHeader) o; + + if (time != that.time) return false; + if (height != that.height) return false; + if (txCount != that.txCount) return false; + if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; + if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) + return false; + return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; + } + + @Override + public int hashCode() { + int result = hash != null ? hash.hashCode() : 0; + result = 31 * result + (int) (time ^ (time >>> 32)); + result = 31 * result + (int) (height ^ (height >>> 32)); + result = 31 * result + (int) (txCount ^ (txCount >>> 32)); + result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); + result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "BlockHeader{" + + "hash='" + hash + '\'' + + ", time=" + time + + ", height=" + height + + ", txCount=" + txCount + + ", packingAddress=" + packingAddress + + ", stateRoot='" + stateRoot + '\'' + + '}'; + } + +} +``` + +### io.nuls.contract.sdk.Contract + +```java +/** + * Contract interface, implemented by contract class + */ +public interface Contract { + + /** + * Directly transfer to the contract, this method will be called, no action is done by default. + * Prerequisite: you need override this method and mark the `@Payable` annotation. + */ + default void _payable() { + } + + /** + * 1. This method is triggered when the consensus node reward address is the contract address, and the parameter is the block reward address detail two-dimensional array data. eg. [[address, amount], [address, amount], ...] + * 2. This method is triggered when the deposit address is a contract address. The parameters are the contract address and the reward amount two-dimensional array data. eg. [[address, amount]] + * Prerequisite: you need override this method and mark the `@Payable` annotation. + */ + default void _payable(String[][] args) { + } + +} +``` + +### io.nuls.contract.sdk.Event + +```java +/** +* Event interface, implemented by event class +*/ +public interface Event { +} +``` + +### io.nuls.contract.sdk.Msg + +```java +public class Msg { + + /** + * Remaining gas + * + * @return + */ + public static native long gasleft(); + + /** + * sender of the contract + * + * @return + */ + public static native Address sender(); + + /** + * sender public key of the contract + * + * @return sender public key of the contract + */ + public static native String senderPublicKey(); + + /** + * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na + * + * @return + */ + public static native BigInteger value(); + + /** + * Gas price + * + * @return + */ + public static native long gasprice(); + + /** + * Contract address + * + * @return + */ + public static native Address address(); + +} +``` + +### io.nuls.contract.sdk.Utils + +```java +public class Utils { + + private Utils() { + } + + /** + * Check conditions; if conditions are not met, it will roll back. + * + * @param expression + */ + public static void require(boolean expression) { + if (!expression) { + revert(); + } + } + + /** + * Check conditions; if conditions are not met, it will roll back + * + * @param expression + * @param errorMessage + */ + public static void require(boolean expression, String errorMessage) { + if (!expression) { + revert(errorMessage); + } + } + + /** + * Terminate implementation and restore status + */ + public static void revert() { + revert(null); + } + + /** + * Terminate implementation and restore status + * + * @param errorMessage + */ + public static native void revert(String errorMessage); + + /** + * Send events + * + * @param event + */ + public static native void emit(Event event); + + /** + * @param seed a private seed + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param src source string (hex encoding string) + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(String hexString); + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param bytes source byte array + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(byte[] bytes); + + /** + * [Testnet]verify signature data(ECDSA) + * + * @param data(hex encoding string) + * @param signature(hex encoding string) + * @param pubkey(hex encoding string) + * @return verify result + */ + public static native boolean verifySignatureData(String data, String signature, String pubkey); + + /** + * [Testnet]Generate a random seed with a specific algorithm based on the cutoff block height and the number of original seeds + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @param algorithm Hash algorithm identifier + * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + + /** + * [Testnet]Generate a random seed using the `SHA3-256`hash algorithm based on the cutoff block height and the number of original seeds. + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); + } + + /** + * [Testnet]Generate a random seed with a specific algorithm based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @param algorithm Hash algorithm identifier + * @return After the original seed byte array is merged, the hash algorithm is used to get a 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + + /** + * [Testnet]Generate a random seed with the `SHA3-256` hash algorithm based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @return After the original seed byte array is merged, the `SHA3-256` hash algorithm is used to get the 32-bit hash byte array, which is then converted into BigInteger(new BigInteger(byte[] bytes)). + */ + public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); + } + + /** + * [Testnet]Get a collection of raw seeds based on the cutoff block height and the number of original seeds + * + * @param endHeight the cutoff block height + * @param seedCount the number of original seeds + * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes))) + */ + public static native List getRandomSeedList(long endHeight, int seedCount); + + /** + * [Testnet]Get a collection of raw seeds based on the block height range + * + * @param startHeight the starting block height + * @param endHeight the cutoff block height + * @return returns a collection of original seeds, the element is a BigInteger (new BigInteger(byte[] bytes))) + */ + public static native List getRandomSeedList(long startHeight, long endHeight); + + /** + * command to call other modules on the chain + * + * @see Detailed documentation for calling the command + * @param cmdName + * @param args + * @return depending on the return type of the registration command, it can return a string, an array of strings, a two-dimensional array of strings + */ + public static native Object invokeExternalCmd(String cmdName, String[] args); + + /** + * Convert an object to a json string + * Note: If the object contains complex objects, the serialization depth must not exceed level 3 + * + * @param obj + * @return Json string + */ + public static native String obj2Json(Object obj); +} +``` + +### io.nuls.contract.sdk.annotation.Payable + +`@Payable` labels the method of `@Payable`. Only when it is added, the amount can be transferred in + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Payable { +} +``` + +### io.nuls.contract.sdk.annotation.Required + +`@Required` labels the parameter of `@Required`. When it is added, there must be transfer-in value, _**If you do not want to pass parameters that are not marked with this annotation, you need to fill in 0 or null placeholder.**_ + +```java +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Required { +} +``` + +### io.nuls.contract.sdk.annotation.View + +`@View` labels the method of `@View`. After it is added, the contract status will remain and it can be researched by such means + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface View { +} +``` + +### io.nuls.contract.sdk.annotation.JSONSerializable + +`@JSONSerializable` labels the method of @JSONSerializable, the return value is automatically serialized by the VM in JSON format and returned as a JSON string. + +Note: The object level must not exceed 3 layers. The more than 3 layers will call the object's toString method, and will not continue serialization. + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface JSONSerializable { +} +``` + +## 6. Main RPC interface of smart contract + +In the NULS 2.0 module [NULS-SDK-PROVIDER] (https://github.com/nuls-io/nuls-sdk-provider/blob/master/README.md), we provide most of the commonly used APIs. Please refer to the Smart Contracts section of this document. + + +## 7. Some instructions for the delivery of smart contract method parameters + + +If the methods of smart contract include the parameter of `array type`, please use the following method to transfer parameters +> Refer to the [vote contract] (https://github.com/nuls-io/nuls-contracts/blob/master/vote/io/nuls/vote/contract/VoteContract.java#L26) code for the `create` method + +```json +{ + "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", + "password": "", + "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", + "gasLimit": 200000, + "price": 1, + "value": 10000000000, + "methodName": "create", + "methodDesc": "", + "remark": "", + "args": [ +     "Test voting 1", +     "Voting contract 1", +     [ +       "Option 1", +       "Option 2", +       "Option 3" +     ], +     1536044066056, 1536184066056, false, 300, false +   ] +} +``` + + + + + diff --git a/docs/NULS2.0/start/ledger.png b/docs/NULS2.0/start/ledger.png new file mode 100644 index 00000000..c6361857 Binary files /dev/null and b/docs/NULS2.0/start/ledger.png differ diff --git a/docs/NULS2.0/start/ledgerstart.png b/docs/NULS2.0/start/ledgerstart.png new file mode 100644 index 00000000..2e2d9ed4 Binary files /dev/null and b/docs/NULS2.0/start/ledgerstart.png differ diff --git a/docs/NULS2.0/start/module.png b/docs/NULS2.0/start/module.png new file mode 100644 index 00000000..9c40bcc2 Binary files /dev/null and b/docs/NULS2.0/start/module.png differ diff --git a/docs/NULS2.0/start/modules.png b/docs/NULS2.0/start/modules.png new file mode 100644 index 00000000..32a9bac7 Binary files /dev/null and b/docs/NULS2.0/start/modules.png differ diff --git a/docs/NULS2.0/start/mykernelstarted.png b/docs/NULS2.0/start/mykernelstarted.png new file mode 100644 index 00000000..2aef3ab5 Binary files /dev/null and b/docs/NULS2.0/start/mykernelstarted.png differ diff --git a/docs/NULS2.0/start/package.png b/docs/NULS2.0/start/package.png new file mode 100644 index 00000000..b4622303 Binary files /dev/null and b/docs/NULS2.0/start/package.png differ diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..56c1cc20 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,37 @@ + +# NULS2.0 Beta Version is released + +Dear users: + +It is a great honor to announce that the NULS2.0 Beta version has been released on 2019-07-08. We sincerely invite you to participate in the public test. + +The NULS core team innovatively introduced micro-service thinking into the design of the underlying infrastructure of the blockchain, designed the software application as a service suite that can be independently deployed, and introduced the most advanced ideas in this architectural design into the module design, making the module as flexible as a program that can be independently started. This modular architecture with no programming language thresholds combined with microservices is what we call NULS 2.0. In this architecture, the coupling degree between modules is smaller. The development of multiple languages greatly improves the contribution of code and the convenience of users. At the same time, it is easier to expand. Meanwhile, the chain factory and cross-chain module will also be designed on this architecture. + +The Beta version test mainly includes: +- [NULS ChianBox](/NULS2.0/chainBoxGuide.html) +- [Develope Module](/NULS2.0/developeModule.html) +- [Web wallet](http://beta.wallet.nuls.io/) +- [Node Wallet and Light Wallet](https://github.com/nuls-io/nuls-v2/releases) +- [Blockchain Explorer](http://beta.nulscan.io/) + +### Join Test: + +1 [Download wallet](https://github.com/nuls-io/nuls-v2/releases) or directly access [Web wallet](http://beta.wallet.nuls.io/) + +2 If you want to use linux wallet,you need learn [linux CLI Manual](/NULS2.0/linuxTutorial.html) + +3 [Apply for test NULS](https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141) and reply: beta+address + +4 [Access blockchain explorer](http://beta.nulscan.io/) + +5 [NULS ChianBox](/NULS2.0/chainBoxGuide.html) + +6 Submit bug:[https://github.com/nuls-io/nuls_2.0/issues](https://github.com/nuls-io/nuls_2.0/issues) + +### Related Link + +- Github:[https://github.com/nuls-io/nuls_2.0](https://github.com/nuls-io/nuls_2.0) +- Community:[https://nuls.community](https://nuls.community) +- Tech community Telegram:[https://t.me/nulstest](https://t.me/nulstest) + +To learn more about us, visit [nuls.io](https://nuls.io). diff --git a/docs/buildChain/buildPrivateChain.md b/docs/buildChain/buildPrivateChain.md new file mode 100644 index 00000000..fb139196 --- /dev/null +++ b/docs/buildChain/buildPrivateChain.md @@ -0,0 +1,79 @@ +# How to build a private chain based on NULS + +## Introduction + +This tutorial guides you to build a private chain based on NULS source code, to make is easier for users to learn about the operation, development or experiment of the NULS Blockchain. By building a chain to fully understand the operation of each node and data interaction, we can better grasp the overall operating mechanism of the NULS Blockchain, which is conducive to further research. We assume that readers have the skills to set up and debug a Java development environment. + + + +## Setting up environment + +- Operating systems: macOS, Windows +- Build Tools: Maven +- Development Tools: IntelliJ IDEA +- NULS source code on github: https://github.com/nuls-io/nuls + + + +## Beginning + +Since blockchain is a decentralized network composed of multiple nodes, we will take a private chain with three nodes as an example. Although we recommend using a Linux server to run the NULS main-net consensus node, in this tutorial, we choose macOS system that can set up a Java development environment to run and debug nodes. + +## Development environment + +First, clone the NULS source code using IntelliJ IDEA and open the project. Make sure JDK is the jdk1.8 version and Maven is configured correctly. + +## Steps to build + +1. Open the module.ini file, which is the configuration file for joining or building the network. In this tutorial, it is the configuration information of the NULS test-net. + +![image-20190103193901967](./images/image-20190103193901967.png) + +2. We will use three nodes to build a private chain. First we need to prepare devices (virtual machine works) for three nodes to run. + +- Node A: 192.168.1.1 +- Node B: 192.168.1.2 +- Node C: 192.168.1.3 + +We also need to set up a seed node to maintain the operation of the blockchain, i.e., to package and forge blocks. In addition, we need to prepare a block-forging address (including private key, to import into the seed node), which can be prepared in advance. + +In this tutorial, the initial block-forging address we prepare is: +`Nse4zpZHsUuU7h5ymv28pcGbwHju3joV` + +PS: You may find that the first few letters of the address we prepare differs from those of the test-net address in the figure, which is for the sake of distinguishing the test-net address from the main-net address, so as to avoid confusion that may result in adverse consequences. Specifically, we set the test-net address to start with "TT" and the main-net address to start with "Ns". This tutorial uses the NULS main-branch code, so the address starts with "Ns". If you prefer to custom the starting letters of the private-chain account address, you can try to modify the `chain.id` parameter in the nuls.ini file. The parameters of the same chain must be in consistence. + +3. Assuming node A is the seed node, then modify the network and consensus sections of the module.ini configuration file of three nodes A, B and C according to the following configuration: + +```ini +[network] +Bootstrap=io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap +Network.server.port=8003 +Network.magic=20190101 +Network.max.in=100 +Network.max.out=10 +Network.seed.ip=192.168.1.1:8003 + +[consensus] +Bootstrap=io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap +Partake.packing=true +Min.upgrade.delay=1000 +Seed.nodes=Nse4zpZHsUuU7h5ymv28pcGbwHju3joV +``` + +- Modify `work.seed.ip` to the ip and port of the seed node. +- Modify `seed.nodes` to the block-forging address. +- The consistency of the magic parameters `network.magic` of all nodes in the private chain is a must. + +4. Run the three nodes separately through IntelliJ IDEA. If you only need to debug one node, the other two nodes can be packaged with maven and sent to a Linux server to run. Remarkably, a jre must be placed in the NULS root directory to run properly. +5. After launching the three nodes, once the IntelliJ IDEA console has the following log output, it means that the three nodes have successfully formed a private chain network, but it still cannot produce new blocks and the block height is 0. If there is no log output, you need to uncomment the `` in logback.xml. + +``` +io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash :xxxxxxx,192.168.1.2:8003,192.168.1.2:8003 + +``` + +6. Then import the prepared block-forging account `Nse4zpZHsUuU7h5ymv28pcGbwHju3joV` via wallet interface of the seed node A. After a while, you can see the latest height displayed in the console increasing, which indicates that the network is producing new blocks. At the same time, the height of the node B, C will also increase and the height of the three nodes will remain the same. At this point, the setup of the private chain network is completed. + +## Conclusion + +This tutorial mainly introduces the easiest way to build a private chain for the development and debugging of NULS, without modification on the source code of NULS. If you want to dig deeper into NULS, you can refer to the relevant documentation of NULS to modify and debug the source code. Maybe you will find more secrets! \ No newline at end of file diff --git a/docs/buildChain/images/image-20190103193901967.png b/docs/buildChain/images/image-20190103193901967.png new file mode 100644 index 00000000..5333535f Binary files /dev/null and b/docs/buildChain/images/image-20190103193901967.png differ diff --git a/docs/community/ambassadorRules.md b/docs/community/ambassadorRules.md new file mode 100644 index 00000000..ff1a9e1e --- /dev/null +++ b/docs/community/ambassadorRules.md @@ -0,0 +1,221 @@ +# Ambassadors participate in the election rules + + + +## 1. Introduction of NULS Ambassadors + +The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador. + +The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly. + +The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month. + +If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum. + +Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors). + +The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter. + + + +## 2. Duties and Compensation for NULS Ambassadors + +a. A candidate for the NULS ambassador is required to create a NULS node. + +b. A candidate is required to agree with the values of NULS, understand the core knowledge of NULS, and respect members of the NULS community. + +c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected. + +d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month. + +e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months. + +f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund. + +g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute. + +h. NULS ambassadors can apply for a budget from the NULS Foundation for major developments. The budget is open to all community members, and a budget vote will be initiated for it. The voting period is 15 days, and if the voting volume exceeds 10 million NULS tokens, and the supporting votes reach 70% or higher, the vote is considered passed and the NULS Foundation will execute. + +## 3. How to participate in the election + +a. Publish the work report for the previous month and the work plan for the next month: + +Please post on the NULS forum: + +b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign! + +c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node. + + + +Final Tribute to your efforts: + +• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you. + +• Start your work of community-building and outreach! + +• Help NULS dock more DApps! + +• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum. + + + + + +For all ambassador related discussions, please post on the NULS forum at + +Welcome to the NULS community! Let’s work together to create a brighter future for NULS! + + + +If you can deliver more, we have these expectations of you: + +*1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;* + +*2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;* + +*3. Share the story of NULS to the community;* + +*4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;* + +*6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;* + +*7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;* + +*8. Help NULS with publicity and be committed to NULS press releases through your local media.* + + + + + +# **Ambassador Guide** + + + +## **Preface** + +Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of: + + + +- Transparency +- Freedom +- Autonomy +- Evolution + + + +## The vision of the NULS project is based on the following mission + + + +- Making blockchain technology easy and simple +- Breaking through the bottleneck of blockchain performance and adoption +- Reducing the cost of using blockchain technology +- Increasing security and reliability of data + + + +NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem. + + + +## **As an Ambassador of NULS, you will obtain** + +1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data. +2. Rewards produced by one node. Rewards are used to develop the local NULS community. +3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS. +4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect. + + + +## **As an Ambassador of NULS, Your Mission is** + +**A. Community Development** + +1. Let others know about NULS via Internet or offline communications. +2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS. +3. Share the development from other areas of the NULS community with your local community. +4. Continuously share the progress, planning, news, etc. of the NULS project to the local community. +5. Contact local media and forums to help NULS publicize presentations or news. +6. Share the story of NULS with the local community. +7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles. +8. Share videos or other content produced by the team in the local language of the people in your country/region. +9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs. +10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps. + + + +**B.** **Community Activities** + +1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS. +2. Participate in any possible cryptocurrency gatherings in your area and represent NULS. +3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS. +4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities. +5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title. + + + +## **Get Started With Everything You Need Here** + +1. NULS Ambassador Board ([[Click to enter](https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador)]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts. +2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc. +3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board. +4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible. +5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you. +6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues. +7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/). +8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum [nuls.community](). + + + +## **Recruit Volunteers to Organize Local Communities** + +1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS. +2. Organize some offline meet-ups. +3. Introduce more blockchain investors to NULS and guide them towards investing in NULS. +4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community. + + + +## **Develop a Local NULS Ecology** + +1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team. +2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS. +3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS. + + + +## **Spread the Concepts and Features of NULS Technology with Local Communities** + +1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants. +2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news. +3. Use local mainstream media websites to spread the news and progress of NULS. + + + + + +# **NULStar Guidelines And Duties** + + + +- **Requirements for becoming a NULStar** + +1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action. +2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project. +3. Must live in a city with over 350k population. + + + +- **Duties of a NULStar** + +1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar. +2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events. + + + +- **Rewards for NULStars** + +1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador. +2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region. \ No newline at end of file diff --git a/docs/community/communityConstitution.md b/docs/community/communityConstitution.md new file mode 100644 index 00000000..749d9b0f --- /dev/null +++ b/docs/community/communityConstitution.md @@ -0,0 +1,232 @@ +# NULS Community Constitution + +## **I. NULS Community Profile** + +NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts. + +**NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.** NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders. + + + +## **II. NULS Foundation** + +NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology. + + + +### **(I)** **Objectives** **of NULS Foundation** + +Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to: + +1. Code writing +2. Applications development +3. Operation and promotion +4. Other actions in favor of NULS community ecology development + + + +### **(II) Source of NULS Foundation** + +20,000,000 NULS from the NULS and entrusted revenues from the contributors. + + + +### **(III) Management of NULS Foundation** + +The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain. + + + +## **III. Council members** + + + +### **(I) Introduction to Council members** + +As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step. + + + +### **(II) Appointment of Council members** + +The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers **(developer council member)** elected based on a ballot participated by all developers; and 7 members elected by ballot within the community **(standing council member)**. The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members. + + + +1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address. +2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members. +3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system. +4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again. + + + +### **(III) Rights and responsibilities of Council member** + +1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types: + + (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid. + +* Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role. + +* Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role. + + (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid. + +* Adjustment of lower node agency commission. + +* Adjustment of transfer commission. + +* Adjustment of contract call commission. + +* Adjustment of Council member proposal commission. + +* Adjustment of adjustable system parameter in other systems. + + (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid. + +* Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role. + +* Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified. + +* Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer. + +* Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC. + +2. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type. +3. Responsibilities of Council member. + +* Council member shall communicate with the community in good time. + +* Act in strict accordance with the community’s Constitution. + +* Share the same vision and purpose with NULS. + +* Take it as its own mission to protect community members’ interests. + + + +**Note:** **All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.** + + + +## **IV. CODE CRAFT COUNCIL (CCC)** + +### **(I) Introduction to the CCC** + +The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team. + + + +### **(II) Philosophy of the CCC** + +We stick to the following philosophy in the technology community: + +1. Equal: the technology community and core team are equal and work together for joint development. +2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together. + +3. Sharing: + +* The whole community shares the achievements of NULS technology. + +* The whole community shares the development dividend of NULS. + +* The whole community shares NULS’s influence and reputation. + +* The industry shares the technical innovation brought by NULS. + +* The industry shares NULS’s standard establishment to promote industry development. + +4. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice. + +5. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain. + + + +### **(III) Appointment of the CCC member** + +The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally). + +The process of joining CCC is: + +1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language. +2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other. +3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community. +4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved. + +### + +### **(IV) Rights and responsibilities of the CCC member** + +1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life. + +2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository. + +3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced. + +4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community. + +5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress. + + + +## **V. Contributor** + +### (I) Contributor for campaign + +Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at **[nuls.community](https://nuls.community/)**. + + + +### (II) Permanent contributor + +Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management. + + + +## **VI. Project Budget** + + + +### **(I) With respect to contributor** + +Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed. + + + +### **(II) With respect to other transaction funds** + +The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned. + + + +## **VII. Other votes** + +### **(I) Start a vote** + +1. The Council member shall start a vote and only the transaction fee is required. + +2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee. + + + +### **(II) Vote by proxy** + +* Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her. + +* Any NULS user can be an agent. + +* Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right. + +* The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress). + + + +## **VIII.** Feedback + +We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs: + +NULS community website: [https://nuls.community](https://nuls.community/) + +Feedback post: [https://nuls.community/d/132-we-need-your-suggestions](https://nuls.community/d/132-we-need-your-suggestions) + + diff --git a/docs/community/communityFund.md b/docs/community/communityFund.md new file mode 100644 index 00000000..b7e84eac --- /dev/null +++ b/docs/community/communityFund.md @@ -0,0 +1,129 @@ +# Community Fund Management and Use of Process  + +![img](https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png) + +## **I. Community Fund Management** + +According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community. + +Community Fund Account Address: + +[Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u](https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u) + +According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account. + +The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%. + +**Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.** + +**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei ** + +## **II. The Application Member** + +### **1. Ordinary Members** + +All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days. + +### **2. Contributor Role** + +Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. **The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.** The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days. + +## **III. The Type of Application** + +### **1. Proposal to Pay Funds** + +The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS. + +### **2. Proposal Budget Item** + +The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS. + +### **3. The Proposal to Create a Node** + +Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS. + +**4. Proposal Entrusted Funds** + +Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS. + +## **IV. The Application Process** + +### **1. The Plan is Openly and Thoroughly Discussed** + +(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community; + +(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community; + +(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds; + +(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained; + +(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates; + +(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner; + +(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner; + +(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals; + +### **2. Council Member Proposal** + +(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote; + +(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem; + +(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process; + +(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles. + +### **3. Foundation Implementation Proposal** + +(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations; + +(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04). + +## **V. Process Explanation** + +All community discussion suggestions are made at [nuls.community](https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/) . + +This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities. + +Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP. + +The specific node generates revenue with reference to the NULS POC consensus mechanism. + +### **Attachment: Current Contributor Role Delegation and Node:** + +Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR + +CCC Members + +Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q + +Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx + +Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4 + +Berzeck’s staking – Same as above + +Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH + +Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg + +Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa + +Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G + +Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs + +Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR + +Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW + +Moshe’s staking – Same as above + +Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4 + +Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN + + diff --git a/docs/community/communityImagesCN/1542526165310.png b/docs/community/communityImagesCN/1542526165310.png new file mode 100644 index 00000000..fe1e8080 Binary files /dev/null and b/docs/community/communityImagesCN/1542526165310.png differ diff --git a/docs/community/communityImagesCN/1542526178695.png b/docs/community/communityImagesCN/1542526178695.png new file mode 100644 index 00000000..b32fb9b8 Binary files /dev/null and b/docs/community/communityImagesCN/1542526178695.png differ diff --git a/docs/community/communityImagesCN/1542526190286.png b/docs/community/communityImagesCN/1542526190286.png new file mode 100644 index 00000000..f7de230b Binary files /dev/null and b/docs/community/communityImagesCN/1542526190286.png differ diff --git a/docs/community/communityImagesCN/1542526202833.png b/docs/community/communityImagesCN/1542526202833.png new file mode 100644 index 00000000..80af24da Binary files /dev/null and b/docs/community/communityImagesCN/1542526202833.png differ diff --git a/docs/community/communityImagesCN/1542526213174.png b/docs/community/communityImagesCN/1542526213174.png new file mode 100644 index 00000000..7f155811 Binary files /dev/null and b/docs/community/communityImagesCN/1542526213174.png differ diff --git a/docs/community/communityImagesCN/1542526223816.png b/docs/community/communityImagesCN/1542526223816.png new file mode 100644 index 00000000..07186d79 Binary files /dev/null and b/docs/community/communityImagesCN/1542526223816.png differ diff --git a/docs/community/joinCCC.md b/docs/community/joinCCC.md new file mode 100644 index 00000000..3ce3175e --- /dev/null +++ b/docs/community/joinCCC.md @@ -0,0 +1,69 @@ +# Invitation of community developers + +## 1. Introduction +NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology. + +NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration. + +In the community, we adhere to the following vision: + +- **Equal**: Members from both the technical community and the core dev team are equal and they shall work together. +- **Synergetic**: The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem. +- **Sharing**: + - Technical achievements of NULS are shared with the community; + - Development bonuses of NULS are shared with the community; + - The influence and brand of NULS are shared with the community; + - Technical innovation of NULS is shared with the whole industry; + - All the industrial standards set by NULS are shared with the whole industry. +- **Fair**: Reward for each developer is based on his/her contribution. +- **Innovative**: A strong technical community is the guarantee for the innovation in the blockchain field. + +## 2. Are you the one? +NULS technical community is open for all developers. +If you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us: + +Please join the NULS dev Telegram group: +[https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ](https://nuls.community) + +**Notice**: We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground! + +## 3. What are we offering? +The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution. +Currently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool. +Note: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well. + +## 4. Our plan +Make it easy to build a blockchain! + +First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life. +The NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository. + +Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months. +For all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives. + +Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more! + +## 5. Current situation of the technical community + +A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently. +B. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests. + +## 6. How to join us + +1. For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group. +2. Talk to our community developer Moshe. Briefly introduce your experience, background, etc. + Community developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future. + + We also strongly recommend you to learn more about NULS through these links below: + - Official website: [https://nuls.io/](https://nuls.io/) + - Code: [https://github.com/nuls-io/nuls](https://github.com/nuls-io/nuls) + - Dev documents: [https://dev.nuls.io/docs/](https://dev.nuls.io/docs/) + - Community forum: [https://nuls.community](https://nuls.community) +3. You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool: + + [https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh](https://nuls.community/d/9-invitation-of-community-developers/4) + +4. In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward. + +## 7. Refer to task list +[https://nuls.community/d/9-invitation-of-community-developers/4](https://nuls.community/d/9-invitation-of-community-developers/4) (Continuously updated) \ No newline at end of file diff --git a/docs/community/toolsGuide.md b/docs/community/toolsGuide.md new file mode 100644 index 00000000..cad17816 --- /dev/null +++ b/docs/community/toolsGuide.md @@ -0,0 +1,52 @@ +--- +typora-copy-images-to: communityImagesCN +--- + +## Guide to Community Vote + +### 1 Voting + +If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list. + +![1542526165310](./communityImagesCN/1542526165310.png) + +Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded. + +![1542526178695](./communityImagesCN/1542526178695.png) + +If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote. + +The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B. + +The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N. + +Each option in the voting details page is clickable to show the current or final distribution of votes. + +### 2 Changing and Updating Your Vote + +As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission. + +![1542526190286](./communityImagesCN/1542526190286.png) + +There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type. + +![1542526202833](./communityImagesCN/1542526202833.png) + +### 3 Checking My Votes + +In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow. + +![1542526213174](./communityImagesCN/1542526213174.png) + +If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules. + +### 4 Creating A Community Vote + +In the voting list, click **“Create Voting"** to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee. + +In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked. + +![1542526223816](./communityImagesCN/1542526223816.png) + +When creating a community vote, **please fill in the item contents** **carefully.** Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed. + diff --git a/docs/developerTools/APIManual.md b/docs/developerTools/APIManual.md new file mode 100644 index 00000000..656aad02 --- /dev/null +++ b/docs/developerTools/APIManual.md @@ -0,0 +1 @@ +# API手册 \ No newline at end of file diff --git a/docs/developerTools/clientCLI.md b/docs/developerTools/clientCLI.md new file mode 100644 index 00000000..977aa6e0 --- /dev/null +++ b/docs/developerTools/clientCLI.md @@ -0,0 +1,1550 @@ + +# CLI User Manual + +### Introduction + +​ The User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server. + +### Version Update Records + +| Version | Date updated | Contents | +| :----: | :--------: | :----------------: | +| V1.0.0 | 2018-07-12 | All functions of official version | + +### Preparation + +#### Server hardware + +**Server for creating NULS nodes shall be with configurations not lower than the following** + +| CPU | Memory | Hard Disk | Broadband | +|:---------:| :----: | :------: | :---:| +|Quad-core 3.0GHz | 16G | 128G Hard Disk | 20M Uplink | + +**Recommendation** + +| CPU | Memory | Hard Disk | Broadband | +| :---------: | :---: | :------: | :------: | +| 8-core 3.0GHz | 32G | 256G Hard Disk | 100M Uplink | + +#### Version of system and core + +**Linux system** + +- CentOS (recommended) + +It is recommended to use core of version 2.6.32 or higher. + +### Start + +#### Download + +* NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet +* GitHub:https://github.com/nuls-io/nuls-wallet-release + +* Enter [wallet download on NULS website](http://nuls.io/wallet),and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users. + + The following is for downloading wallet (v1.0.0) in Linux system: + + ```shell + $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz + ``` + + Note: the downloading link for the subsequent versions is subject to change. + +#### Install + +- Extract downloaded files in Linux system + + ```shell + $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz + ``` + +#### Operate + +- Enter bin catalogue and run startup script to start full-node wallet + + ```shell + $ cd bin + $ ./start.sh + ``` + +### Use wallet + +#### Quick-start + +- Upon confirming the wallet is started, start the command line of wallet to run it. + + Enter bin catalogue to execute the following commands: + + ```shell + $ ./cmd.sh + ``` + + Display NULS naming prompt `nuls>>> `, and then directly input NULS wallet operation command to run it. + + The following gives an example of account creating: + + ```shell + nuls>>> create + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********* + Please confirm new password:********* + [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ] + nuls>>> + ``` + + Command `create` is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully. + + + +### Conventions + +- For password: it must be 8 to 20 digits, including letters and figures. +- Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required. + +### Wallet command + +#### Help command + +All commands for output and printing + +- **Command: help [-a] ** + +| Parameter | Description | +| :--- | :------------------- | +| -a | Formatting printing command, optional | + +Return message help + +```json +getaccount
--get account information +``` + +Return message help -a + +```json +getaccount
--get account information + OPTIONS: +
the account address - Required +``` + +Example + +```shell +nuls>>> help +nuls>>> help -a +``` + + + +#### Create account + +Create account and return to account addresses collection + +- **Command: create [number] ** + +| Parameter | Description | +| :------- | :------------------- | +| [number] | Quantity of accounts created, optional | + +Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter; + +Return accounts collection + +```json +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + +Example, to create 2 accounts without password + +```shell +nuls>>> create 2 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password: +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + + + +#### Backup account + +For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account + +- **Command: backup <address> [path]** + +| Parameter | Description | +| --------------- | ---------------------------------------------------- | +| <address> | Account address, required | +| [path] | The target folder of backup files, defaults to be the current folder, optional | + +Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe. + +Return message + +```shell +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + +Example: backup of an account with password + +```shell +nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + + + +#### Remove account + +Remove local account according to account address; if the account is encrypted, insert password. + +- **Command: remove <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +Success +``` + + + +#### Set account password + +Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts. + +- **Command: setpwd <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### Change account password + +Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one. + +- **Command: resetpwd <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message + +```json +Success +``` + +Example + +```shell +nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Enter your old password:********** +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### Set nickname + +Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source. + +- **Command:setalias <address> <alias>** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | +| <alias> | Nickname, required | + +Return message, transaction hash + +```json +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + +Example + +```shell +nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + + + +#### Imported account keystore + +Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account. + +- **Command: import keystore <path> ** + +| Parameter | Description | +| ------------ | ------------------------------ | +| <path> | Address of keystore files to be imported, required | + +Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required. + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Imported account’s private key + +Import account’s private key and create a local account. Receive failure to import if there is an existing local account. + +- **Command:import <privatekey> ** + +| Parameter | Description | +| ------------------ | ---------------- | +| <privatekey> | Account’s private key, required | + +注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Imported account’s private key (overwritten) + +Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account. + +- **Command:import <privatekey> ** + +| Parameter | Description | +| ------------------ | ---------------- | +| <privatekey> | Account’s private key, required | + +Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. + +Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import). + +Return message, imported account address + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +Example + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### Inquire account information + +Inquire account information based on account address + +- **Command:getaccount <address>** + +| Parameter | Description | +| --------------- | :------------- | +| <address> | Account address, required | + +Return message + +```json +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address + "alias" : null,//Nickname + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//Public key + "priKey" : "",//Private key (unavailable if the account is encrypted) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//Private key after encryption (unavailable if the account is encrypted) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//Creation time + "encrypted" : true//Encrypted or not (set password or not) +} +``` + +Example + +```shell +nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +} +``` + + + +#### Inquire list of accounts + +Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time + +- **Command:getaccounts <pageNumber> <pageSize>** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <pageNumber> | Page, to get the data on which page, required| +| <pageSize> | Number of data displayed on each page, required | + +Return message, output accounts collection + +```json +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address + "alias" : null,//Nickname + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",// Public key + "priKey" : "",//Private key (unavailable if the account is encrypted) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",// Private key after encryption (unavailable if the account is encrypted) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//Creation time + "encrypted" : true//Encrypted or not (set password or not) +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +Example: to get list of accounts, showing page 1, 2 items per page + +```shell +nuls>>> getaccounts 1 2 +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +#### Inquire account’s private key + +Inquire account’s private key based on account address; if the account is encrypted, insert password. + +- **Command:getprikey <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> | Account address, required | + +Return message, imported account address + +```json +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + +Example + +```shell +nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + + + +#### Inquire account balance + +Inquire account balance based on account address + +- **Command:getbalance <address> ** + +| Parameter | Description | +| --------------- | ---------------- | +| <address> |Account address, required | + +Return message, imported account address + +```json +{ + "balance" : "9999998.99",//Balance + "locked" : "0",//Locked balance + "usable" : "9999998.99"//Available balance +} +``` + +Example + +```shell +nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "balance" : "9999998.99", + "locked" : "0", + "usable" : "9999998.99" +} +``` + + + +#### Transfer + +Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly. + +- **Command: transfer <address> <toAddress> <amount> [remark] ** + +| Parameter | Description | +| ----------------- | ----------------------------------------------- | +| <address> | transferring address, required | +| <toAddress> | receiving address, required | +| <amount> | transferred amount, round to 8 decimals in total (in NULS), required | +| [remark] | Remarks, required | + +Return message, transfer transaction hash + +```json +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` +Example + +```shell +nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer +Please enter the password. +Enter your password:********** +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` + + + +#### Inquire transaction details + +Inquire transaction details as per transaction hash + +- **Command:gettx <hash>** + +| Parameter | Description | +| ------------ | -------------- | +| <hash> | Transaction hash, required | + +Return message, transaction details + +```json +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash + "type" : "transfer",//Transaction type (transfer transaction as an example) + "time" : "2018-07-16 11:21:46",//Transaction time + "blockHeight" : 26269,//Block height of package transaction + "fee" : "0.001",//Transaction service charge + "value" : "100",//(Transfer) transaction amount + "remark" : "Transfer",//remarks + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//Signature + "status" : "confirm",//Status of transaction confirmation (confirmed or unconfirmed) + "confirmCount" : 46,//Times of confirmation + "size" : 254,//Size of transaction + "inputs" : [ {//Input of transaction + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ {//Output of transaction + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"// Target address of transaction output (means to transfer 100 to the target address) + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//Target address of transaction output (means to give users changes) + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + +Example, to inquire transfer transaction + +```shell +nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596 +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "type" : "transfer", + "time" : "2018-07-16 11:21:46", + "blockHeight" : 26269, + "fee" : "0.001", + "value" : "100", + "remark" : "Transfer", + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1", + "status" : "confirm", + "confirmCount" : 46, + "size" : 254, + "inputs" : [ { + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T", + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + + + +#### Inquire list of transactions + +Inquire list of transactions in this account based on account address + +- **Command:gettxlist <address> <pageNumber> <pageSize>** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> |Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message, transaction details + +```json +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//Transaction hash + "blockHeight" : 26473,//Block height of transaction + "time" : "2018-07-16 11:55:43",//Transaction time + "txType" : "transfer",//Transaction type + "status" : 1,//Status of confirmation + "info" : "+100"//Message +},{ + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + +Example + +```shell +nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10 +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e", + "blockHeight" : 26473, + "time" : "2018-07-16 11:55:43", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +}, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + + + +#### Create node + +Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least. + +- **Command:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> ** + +| Parameter | Description | +| ---------------------- | ------------------------------------------------------------ | +| <agentAddress> | Account address of nodes created, required | +| <packingAddress> | Node account package address, required (note: the account shall have no password, otherwise the node cannot package) | +| <commissionRate> | Agent commission proportion, with a range of 10~100, required | +| <deposit> | Node creating deposit of 2 at least, required | + +Return message, agent hash of return node + +```json +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + +Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS + +```shell +nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 +Please enter the password. +Enter your password:********** +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + + + +#### Include consensus (agency node) + +Include consensus of 2000NULS at least based on account address and node agent hash + +- **Command:deposit <address> <agentHash> <deposit> ** + +| Parameter | Description | +| ----------------- | -------------------------------------- | +| <address> | Account address, required | +| <agentHash> | Node agent hash, required | +| <deposit> | Include consensus deposit, not less than 2000NULS, required | + +Return message, transaction hash for including consensus; to exit the consensus, require such hash. + +```json +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + +Example + +```shell +nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + + + +#### Exit the consensus (agency) + +Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent. + +- **Command: withdraw <address> <txHash> ** + +| Parameter | Description | +| --------------- | ---------------------- | +| <address> | Account address, required | +| <txHash> | Transaction hash upon agency, required | + +Return message, transaction hash upon exiting the consensus + +```json +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + +Example + +```shell +nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + + + +#### Stop node + +Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours. + +- **Command:stopagent <address> ** + +| Parameter | Description | +| --------------- | -------------- | +| <address> | Account address, required | + +Return message, transaction hash of stop node + +```json +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + +Example + +```shell +nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the password. +Enter your password:********** +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + + + +#### Get node details + +Get node details as per agent hash of node + +- **Command: getagent <agentHash> ** + +| Parameter | Description | +| ----------------- | --------------------- | +| <agentHash> | Node agent hash, required | + +Return message + +```json +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 60.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "35024DE6",//Node ID + "time" : "2018-07-16 16:33:38",//Time for creating node + "blockHeight" : 28141,// Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",// Status + "creditVal" : 0.05,//Credit value + "totalDeposit" : "208000",//Current total agency amount of node + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//Quantity of participants +} +``` + +Example + +```shell +nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6 +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.05, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} +``` + + + +#### Get list of nodes + +As per list of consensus nodes + +- **Command:getagents <pageNumber> <pageSize> ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message + +```json +[{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 60.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "35024DE6",//Node ID + "time" : "2018-07-16 16:33:38",//Time for creating node + "blockHeight" : 28141,//Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",//Status + "creditVal" : 0.05,//Credit value + "totalDeposit" : "208000",//Current total agent amount of node + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//Quantity of participants +}] +``` + +Example + +```shell +nuls>>> getagents 1 2 +[ { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.18, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +}, { + "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7", + "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "deposit" : "20000", + "commissionRate" : 10.0, + "agentName" : null, + "agentId" : "5CE291D8", + "time" : "2018-07-16 16:31:12", + "blockHeight" : 28126, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.16, + "totalDeposit" : "208000", + "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "memberCount" : 5 +} ] +``` + + + +#### Get total information of network consensuses + +Inquire total information of network consensuses + +- **Command:getconsensus ** + +Return message + +```json +{ + "agentCount" : 6,//Quantity of nodes + "totalDeposit" : "1758000",//Total quantity of agents + "rewardOfDay" : "0",//Bonus + "consensusAccountNumber" : 6,//Quantity of consensus accounts + "packingAgentCount" : 6//Quantity of package addresses +} +``` + +Example + +```shell +nuls>>> getconsensus +{ + "agentCount" : 6, + "totalDeposit" : "1758000", + "rewardOfDay" : "0", + "consensusAccountNumber" : 6, + "packingAgentCount" : 6 +} +``` + + + +#### Get general of agents in single account + +Get the general of all agents (consensuses) information of the account based on account address + +- **Command:getdepositedinfo <address> ** + +| Parameter | Description | +| --------------- | -------------- | +| <address> |Account address, required | + +Return message + +```json +{ + "agentCount" : 1,//Quantity of nodes created + "totalDeposit" : "1600000",// Quantity of total agents + "joinAgentCount" : 6,//Quantity of nodes in agency + "usableBalance" : "8048998.869",//Available balance + "reward" : "219.65910271",//Total bonuses gained + "rewardOfDay" : "219.65910271",//Bonuses gained a day + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//Node hash +} +``` + +Example + +```shell +nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "agentCount" : 1, + "totalDeposit" : "1600000", + "joinAgentCount" : 6, + "usableBalance" : "8048998.869", + "reward" : "219.65910271", + "rewardOfDay" : "219.65910271", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd" +} +``` + + + +#### Get list of agent information of single account + +Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash. + +- **Command:getdepositeds <address> <pageNumber> <pageSize> [agentHash] ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> | Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | +| [agentHash] | Node hash, optional | + +Return message + +```json +[{ + "deposit" : "2000",//Agency amount + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Address of agent + "time" : "2018-07-16 16:38:25",//Time + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//Agency transaction hash + "blockHeight" : 28148,//Block height of transaction + "delHeight" : -1, + "status" : "consensus",//Node status + "agentName" : "35024DE6",//Node name + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//Node address +}] +``` + +Example + +```shell +nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "deposit" : "2000", + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:25", + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221", + "blockHeight" : 28148, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "35024DE6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh" +}, { + "deposit" : "2000", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:43", + "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234", + "blockHeight" : 28149, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "E09EB7FD", + "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT" +} ] +``` + + + +#### Get list of agency nodes of single account + +Inquire list of agency nodes asper address (return list of node information) + +- **Command:getdepositedagents <address> <pageNumber> <pageSize> ** + +| Parameter | Description | +| ------------------ | -------------------------------- | +| <address> |Account address, required | +| <pageNumber> | Page, to get the data on which page, required | +| <pageSize> | Number of data displayed on each page, required | + +Return message + +```json +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//Node hash + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Account address for creating node + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//Node package (block) address + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Bonus address (default to be address for creating node) + "deposit" : "20000",//Deposit for creating node + "commissionRate" : 40.0,//Agent commission proportion + "agentName" : null,//Node name (source) + "agentId" : "0198ACAF",// Node ID + "time" : "2018-07-16 16:32:52",//Time for creating node + "blockHeight" : 28136,//Block height of node creating transaction + "delHeight" : -1, + "status" : "consensus",//Status + "creditVal" : -0.91,//Credit value + "totalDeposit" : "204000",//Current total agent amount of node + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3// Quantity of participants +}] +``` + +Example, to get page 1, display 2 items per page + +```shell +nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr", + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "deposit" : "20000", + "commissionRate" : 40.0, + "agentName" : null, + "agentId" : "0198ACAF", + "time" : "2018-07-16 16:32:52", + "blockHeight" : 28136, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.91, + "totalDeposit" : "204000", + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3 +}, { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.91, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} ] +``` + + + +#### Get the latest block head information + +Get the latest block head information + +- **Command:getbestblockheader** + +Return message + +```json +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//Block hash + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//Former block hash + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//Merkle hash + "time" : "2018-07-17 10:25:40",//Block generation time + "height" : 33950,//Block height + "txCount" : 1,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 668413,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-17 10:25:30",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0",//Consensus bonus + "fee" : "0",//Package service charge of block + "confirmCount" : 0,//Times of confirmation + "size" : 204,//Size of block + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"// Signature +} +``` + +Example + +```shell +nuls>>> getbestblockheader +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e", + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d", + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877", + "time" : "2018-07-17 10:25:40", + "height" : 33950, + "txCount" : 1, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 668413, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-17 10:25:30", + "packingIndexOfRound" : 1, + "reward" : "0", + "fee" : "0", + "confirmCount" : 0, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9" +} +``` + + + +#### Inquire block information + +Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. + +- **Command:getblock <hash> | <height> ** + +| Parameter | Description | +| -------------- | ------------ | +| <hash> | Block hash | +| <height> | Height of block | + +Return message + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash + "time" : "2018-07-16 16:29:30",//Block generation time + "height" : 28115,//Block height + "txCount" : 2,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 662578,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0.001",//Consensus bonus + "fee" : "0.001",//Package service charge of block + "confirmCount" : 6174,//Times of confirmation + "size" : 507,//Size of block + "txList" : [ {//Transaction collection + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//Transaction hash + "type" : "coinbase",//Transaction type + "time" : "2018-07-16 16:29:30",//Transaction time + "blockHeight" : 28115,//Block height of transaction + "fee" : "0",//Transaction service charge + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ],//Transaction input + "outputs" : [ //Transaction output + { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } + ] + }], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature +} +``` + +Example: to get block as per height + +```shell +nuls>>> getblock 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6174, + "size" : 507, + "txList" : [ { + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841", + "type" : "coinbase", + "time" : "2018-07-16 16:29:30", + "blockHeight" : 28115, + "fee" : "0", + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ], + "outputs" : [ { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } ] + }, { + "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b", + "type" : "transfer", + "time" : "2018-07-16 16:29:27", + "blockHeight" : 28115, + "fee" : "0.001", + "value" : null, + "remark" : null, + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663", + "status" : "confirm", + "confirmCount" : 6174, + "size" : 249, + "inputs" : [ { + "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 972899896100000 + } ], + "outputs" : [ { + "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne", + "value" : 3000000000000, + "lockTime" : 0 + }, { + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 969899896000000, + "lockTime" : 0 + } ] + } ], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### Inquire block head information + +Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. + +- **Command:getblockheader <hash> | <height> ** + +| Parameter | Description | +| -------------- | ------------ | +| <hash> | Block hash | +| <height> | Block height | + +Return message + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash + "time" : "2018-07-16 16:29:30",//Block generation time + "height" : 28115,//Block height + "txCount" : 2,//Quantity of block package transactions + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address + "roundIndex" : 662578,//Rounds of consensuses + "consensusMemberCount" : 1,//Quantity of participants in consensus + "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round + "packingIndexOfRound" : 1,//Rank of package and block in current round + "reward" : "0.001",//Consensus bonus + "fee" : "0.001",//Package service charge of block + "confirmCount" : 6174,//Times of confirmation + "size" : 507,//Size of block + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature +} +``` + +Example: to get block as per height + +```shell +nuls>>> getblockheader 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6280, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### Inquire network information + +Inquire network basic information + +- **Command:getnetinfo ** + +Return message + +```json +{ + "localBestHeight" : 35317,//Height of local latest block + "netBestHeight" : 35317,//Height of latest block online + "timeOffset" : "0ms",//Offset of network time + "inCount" : 0,//Quantity of passive connecting nodes + "outCount" : 1//Quantity of active connecting nodes +} +``` + +Example + +```shell +nuls>>> getnetinfo +{ + "localBestHeight" : 35317, + "netBestHeight" : 35317, + "timeOffset" : "0ms", + "inCount" : 0, + "outCount" : 1 +} +``` + + + +#### Inquire network node IP + +Inquire network node IP + +- **Command: getnetnodes ** + +Return message + +```json +[ "192.168.1.223" ] +``` + +Example: get block as per height + +```shell +nuls>>> getnetnodes +[ "192.168.1.223" ] +``` + + + +#### Inquire current version information + +Inquire current version number + +- **Command:version ** + +Return message + +```json +[ "192.168.1.223" ] +``` + +Example + +```shell +nuls>>> version +{ + "myVersion" : "1.0.0", + "newestVersion" : "0.9.11", + "upgradable" : false, + "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing" +} +``` + + + +#### Version update + +Inquire current version number + +- **Command:upgrade <version> ** + +Example + +```shell +nuls>>> version 1.0.0 +``` + + + +#### Exit wallet command program + +Exiting from wallet command line program does not mean exiting from wallet node started. + +- **Command:exit** + +Example + +```shell +nuls>>> exit +``` diff --git a/docs/developerTools/pluginImages/1536204986(1).jpg b/docs/developerTools/pluginImages/1536204986(1).jpg new file mode 100644 index 00000000..883d2208 Binary files /dev/null and b/docs/developerTools/pluginImages/1536204986(1).jpg differ diff --git a/docs/developerTools/pluginImages/Add.jpg b/docs/developerTools/pluginImages/Add.jpg new file mode 100644 index 00000000..553c9214 Binary files /dev/null and b/docs/developerTools/pluginImages/Add.jpg differ diff --git a/docs/developerTools/pluginImages/Add3.jpg b/docs/developerTools/pluginImages/Add3.jpg new file mode 100644 index 00000000..350a0607 Binary files /dev/null and b/docs/developerTools/pluginImages/Add3.jpg differ diff --git a/docs/developerTools/pluginImages/Add5.jpg b/docs/developerTools/pluginImages/Add5.jpg new file mode 100644 index 00000000..e792346e Binary files /dev/null and b/docs/developerTools/pluginImages/Add5.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy.jpg b/docs/developerTools/pluginImages/Deploy.jpg new file mode 100644 index 00000000..785777cc Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy2.jpg b/docs/developerTools/pluginImages/Deploy2.jpg new file mode 100644 index 00000000..f6940952 Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy2.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy3.jpg b/docs/developerTools/pluginImages/Deploy3.jpg new file mode 100644 index 00000000..e36e5cdf Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy3.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy4.jpg b/docs/developerTools/pluginImages/Deploy4.jpg new file mode 100644 index 00000000..b2dfa5bb Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy4.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy5.jpg b/docs/developerTools/pluginImages/Deploy5.jpg new file mode 100644 index 00000000..54c8794a Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy5.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy6.jpg b/docs/developerTools/pluginImages/Deploy6.jpg new file mode 100644 index 00000000..408490e8 Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy6.jpg differ diff --git a/docs/developerTools/pluginImages/Deploy7.jpg b/docs/developerTools/pluginImages/Deploy7.jpg new file mode 100644 index 00000000..ffbaa9f7 Binary files /dev/null and b/docs/developerTools/pluginImages/Deploy7.jpg differ diff --git a/docs/developerTools/pluginImages/Install.jpg b/docs/developerTools/pluginImages/Install.jpg new file mode 100644 index 00000000..f4a00a94 Binary files /dev/null and b/docs/developerTools/pluginImages/Install.jpg differ diff --git a/docs/developerTools/pluginImages/Install2.jpg b/docs/developerTools/pluginImages/Install2.jpg new file mode 100644 index 00000000..f413512b Binary files /dev/null and b/docs/developerTools/pluginImages/Install2.jpg differ diff --git a/docs/developerTools/pluginImages/Install3.jpg b/docs/developerTools/pluginImages/Install3.jpg new file mode 100644 index 00000000..fd11c850 Binary files /dev/null and b/docs/developerTools/pluginImages/Install3.jpg differ diff --git a/docs/developerTools/pluginImages/code.jpg b/docs/developerTools/pluginImages/code.jpg new file mode 100644 index 00000000..9f40aca1 Binary files /dev/null and b/docs/developerTools/pluginImages/code.jpg differ diff --git a/docs/developerTools/pluginImages/createProject.jpg b/docs/developerTools/pluginImages/createProject.jpg new file mode 100644 index 00000000..a7c0a6c3 Binary files /dev/null and b/docs/developerTools/pluginImages/createProject.jpg differ diff --git a/docs/developerTools/pluginImages/createProject2.jpg b/docs/developerTools/pluginImages/createProject2.jpg new file mode 100644 index 00000000..494ea971 Binary files /dev/null and b/docs/developerTools/pluginImages/createProject2.jpg differ diff --git a/docs/developerTools/pluginImages/package.jpg b/docs/developerTools/pluginImages/package.jpg new file mode 100644 index 00000000..2353f253 Binary files /dev/null and b/docs/developerTools/pluginImages/package.jpg differ diff --git a/docs/developerTools/pluginImages/package1.jpg b/docs/developerTools/pluginImages/package1.jpg new file mode 100644 index 00000000..19073268 Binary files /dev/null and b/docs/developerTools/pluginImages/package1.jpg differ diff --git a/docs/developerTools/pluginImages/package2.jpg b/docs/developerTools/pluginImages/package2.jpg new file mode 100644 index 00000000..eabd322b Binary files /dev/null and b/docs/developerTools/pluginImages/package2.jpg differ diff --git a/docs/developerTools/pluginImages/package3.jpg b/docs/developerTools/pluginImages/package3.jpg new file mode 100644 index 00000000..bdbf4eeb Binary files /dev/null and b/docs/developerTools/pluginImages/package3.jpg differ diff --git a/docs/developerTools/pluginImages/package4.jpg b/docs/developerTools/pluginImages/package4.jpg new file mode 100644 index 00000000..34fc4242 Binary files /dev/null and b/docs/developerTools/pluginImages/package4.jpg differ diff --git a/docs/developerTools/sdk.md b/docs/developerTools/sdk.md new file mode 100644 index 00000000..dff3ee1b --- /dev/null +++ b/docs/developerTools/sdk.md @@ -0,0 +1,2792 @@ + +# SDK + +## Introduction +This document is the user guide for the NULS Java SDK. It describes the usage instructions of the basic functional interfaces such as accounts, transactions, and blocks provided by the NULS service. +### Convention +- All SDK interfaces uniformly return Result (referring to the data explanation in the appendix part at the end of the article) +- The return object described in each interface refers to the content of the data attribute in the Result +- Unless otherwise noted, NULS in this document is in Na unit, 1NULS = 100,000,000 Na +- Before running the SDK, you need to confirm that the NULS service is started and running normally +- JDK1.8+ is recommended +### Releases History + + +| Version | Release Date | Release Notes | +| :-------: | :--------: | :----------------------------------------------------------: | +| v0.9.11.0 | 2018-06-19 | Provide interfaces for docking basic functions of the NULS service | +| v0.9.11.1 | 2018-06-22 | Add interfaces to get the latest block height and hash (3.6, 3.7), and modify 2.1 | +| v0.9.14 | 2018-07-04 | Modify the initialization method of the SDK to init in Quick Start and the usage of SDK, and alter the name of the returned encapsulated object (removing Dto, etc.) | +| v0.9.15 | 2018-07-07 | Add four consensus interfaces (4.1-4.4)| +| v0.9.16 | 2018-07-11 | Add interface 4.5 | +| v1.0.1 | 2018-07-13 | Add error code | +| v1.1.0 | 2018-09-28 | Add multi-account transfer interface | + + + +## Quick Start +### 1. Importing files +Import jar files by using build tool + +- Use maven + +```xml + + io.nuls.sdk + sdk-all + 1.0.1 + +``` + +### 2. Creating SDK instance +First introduce SDK namespace + +```java +// introduce the namespace of the SDK boot class +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +// introduce the namespace of the SDK calls tool +import io.nuls.sdk.tool.NulsSDKTool; +``` + +After importing, create a client instance using the following code + +- Initiate SDK +- If no parameters are passed in initialization method, the default PRC IP and Port respectively are ` 127.0.0.1 `, 8001 ` ` +```java +//By default +SDKBootstrap.init(); +// Pass in the NULS service’s IP and Port +SDKBootstrap.init("192.168.1.88", "8001"); +``` + +- Call interface methods using the tool class + + +```java +Result result = NulsSDKTool.createAccount("nuls123456"); +``` + *e.g a complete example of creating an account with password* + +```java +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +// introduce the namespace for corresponding modules as required +import io.nuls.sdk.tool.NulsSDKTool; + +public static void main(String[] args) { + SDKBootstrap.init(); + Result result = NulsSDKTool.createAccount("nuls123456"); +} +``` +-- +### Accounts AccountService +#### 1.1 Creating account +Interface + +**`Result createAccount(int count, String password);`** + +Instructions +> Creates one or more accounts with or without a password depending on the parameters passed in. +>The information about the successfully created account will be persisted to the NULS service local database. +> +> Returns a set of successfully created account addresses + + + + + + + + + + + + + + + + + + + +
parametertype required or not note
countintoptional account count to be created (default 1)
passwordString optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: +```json +{ + "success": true, + "data":{ + "list": [ // Return a set of the created account addresses + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv", + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv" + ] + } +} +``` + + +*e.g Sample Code* + +```java +//create an account without password +createAccount(); +//create an account with password +createAccount("nuls123456"); +// create three password-less accounts +createAccount(3); +// create three accounts with passwords +createAccount(3, "nuls123456"); +``` +--- + +#### 1.2 Creating offline account +Interface + +**`Result createOfflineAccount(int count, String password)`** + +Instructions + +> Directly create an offline account and return it completely, without underlying interaction with NULS and persistence +> Creates an encrypted off-line account (Not saved to the database) +> +> Result.data `List` + + + + + + + + + + + + + + + + + + + + +
parametertype required or not note
countintoptional account count to be created (default 1)
passwordString optional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "list":[ + { + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) + }, + { + "address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD", + "alias": null, + "pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb", + "extend": null, + "createTime": 1529314943624, + "encrypted": true, + "priKey": "", + "encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0" + } + ] + } +} +``` + +*e.g Sample Code* + +```java +// create an offline account without password +createOfflineAccount(); +// create an offline account with password +createOfflineAccount("nuls123456"); +// create three password-less offline accounts +createOfflineAccount(3); +// create three offline accounts with passwords +createOfflineAccount(3, "nuls123456"); +``` + +--- + +#### 1.3 Getting account + +Interface + +**`Result getAccount(String address)`** + +Instructions + +> Gets information about the account by account address +> +> Result.data `AccountInfo` + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if when a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) + } +} +``` + +*e.g Sample Code* + +```java +getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.4 Getting the fee for setting alias +Interface + +**`Result getAliasFee(String address, String alias)`** + +Instructions + +> Gets the fee required to set the alias name based on the account address and the alias name to be set (excluding the fixed cost 1NULS of setting the alias name)> +> Result.data `double`, unit is `NULS` + +**Note!** The unit of the fee returned by this interface is `NULS` + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
aliasStringrequired alias name to be set
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data":{ + "value": 0.01 //( unit: NULS) + } +} +``` + +*e.g Sample Code* + +```java +getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666"); +``` +--- + +#### 1.5 Getting account list + +Interface + +**`Result getAccountList(int pageNumber, int pageSize)`** + +Instructions + +> Gets a list of accounts based on the paging parameters +> +> Result.data Page `List` + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
pageNumberintrequiredpage number, must be greater than 0
pageSizeint required record size displayed per page, ranging from 1 to 100
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "pageNumber": 1, + "pageSize": 10, + "total": 100, + "pages": 10, + "list": [ + { + + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) }, + { + "address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP", + "alias": null, + "pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184", + "extend": null, + "createTime": 1529311250627, + "encrypted": true, + "priKey": null, + "encryptedPriKey": null + } + ... + + ] + } +} +``` + +*e.g Sample Code* + +```java +getAccountList(1, 10); +``` +--- + +#### 1.6 Getting account address by account alias + +Interface + +**`Result getAddressByAlias(String alias)`** + +Instructions +> Gets the account address by the account alias +> +> Result.data `String` + + + + + + + + + + + + + + +
parametertyperequired or notnote
aliasString required account alias
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g Sample Code* + +```java + getAddressByAlias("factory666"); +``` +--- + +#### 1.7 Getting account private key +Interface + +**`Result getPrikey(String address, String password)`** + +Instructions +> Gets the private key of the account by account address and password, and returns the private key string +> +> Result.data `String` + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24" + } +} +``` +*e.g Sample Code* + +```java +// the way of calling the account with password +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +//the way of calling the password-less account +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.8 Verifying the availability of alias +Interface + +**`Result isAliasUsable(String alias)`** + +Instructions +> Verifies that the alias is available (if it is not used) by alias name +> +> Result + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredalias name
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ // indicate the alias is available + "success": true, + "data": { + "value":true + } +} +``` +- Return the case where the alias is unavailable + +```json +{ // indicate the alias is not available + "success": true, + "data":{ + "value": false + } +} +``` +- Return error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +isAliasUsable("factory666"); +``` +--- + +#### 1.9 Account Backup +Interface + +**`Result backupAccount(String address, String path, String password)`** + +Instructions + +> Backups the account (exporting .Keystore file) based on the account address, password and output address. If the account is encrypted, the exported keystore file is encrypted by the current password. The password of the account needs to be verified when importing. +> +> Result: the generated file address + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
pathString required the folder where the backup file will be stored. When null is passed in, it will be backed up to the current directory of the NULS service.
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore" + } +} +``` +*e.g Sample Code* + +```java +// Backup an password-less account to the current directory +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null); +// Backup an account with password to the /backup directory +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456"); +``` +--- + +#### 1.10 Importing account +Interface + +**`Result importAccountByKeystore`** + +Instrucions + +> Imports the account using the keystore file. If the keystore file is generated by an encrypted account backup, the password of the account at the time of backup needs to be verified. +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
path/fileReaderString/FileReaderrequired the url of the .keystore file to be imported, or the FileReader object generated by the .keystore file
passwordStringoptionalthe password of the account corresponding to the .keystore file, leave it blank if the account is not encrypted when the .keystore is exported
overwritebooleanrequired true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g Sample Code* + +```java +//import an account with password +importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true); +importAccountByKeystore(fileReader, "nuls123456", true); +//import a password-less account +importAccountByKeystore("/backup/XXXXXX.keystore", false); +importAccountByKeystore(fileReader, false); +``` +--- + +#### 1.11 Importing account (private key) +Interface + +**`Result importAccountByPriKey(String privateKey, String password, boolean overwrite)`** + +Instructions + +> Imports an account by private key +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
privateKeyStringrequired private key of the account
passwordStringoptional set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
overwriteboolean required true: perform overwrite import; false: if the account already exists in the wallet, the import will not be performed and an error prompt will be returned.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS" + } +} +``` +*e.g Sample Code* + +```java +// set a password when importing account +importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true); +// no password is set when importing account +importAccountByPriKey("1f9d3ad044e0e120......", true); +``` +--- + +#### 1.12 Verifying account is encrypted +Interface + +**`Result isEncrypted(String address)`** + +Instructions + +> Verifies the account is encrypted +> +> Result + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ // indicate encrypted + "success": true, + "data": { + "value":true + } +} +``` +- Return unencrypted +```json +{ + "success": true, + "data":{ + "value": false + } +} +``` +- Return error cases, such as a parameter error + +```json +{ //indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +*e.g Sample Code* + +```java +isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.13 Removing account +Interface + +**`Result removeAccount(String address, String password)`** + +Instructions + +> Removes an account +> +> Result + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringoptional account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.13 Setting password +Interface + +**`Result setPassword(String address, String password)`** + +Instructions + +> Sets a password for an unencrypted account. Encrypted account cannot call this interface. +> +> Result + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringrequired set the password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error + +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.14 Modifying password +Interface + +**`Result resetPassword(String address, String password, String newPassword)`** + +Instructions + +> Modifys the password for an encrypted account. Unencrypted account cannot call this interface. +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
passwordStringrequired the current password of the account
newPasswordStringrequired set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed.
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ //indicate a success + "success": true, + "data": { + "value":true + } +} +``` + +- Return failure and error cases, such as a parameter error +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g Sample Code* + +```java +resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111"); +``` +--- + +#### 1.15 Setting alias +Interface + +**`Result setAlias(String address, String alias, String password)`** + +Instructions + +> Sets alias name for an account +> +> Result: the hash of the transaction for setting the alias + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
aliasString required alias name to be set
passwordString password account password, leave it blank if the account is not encrypted
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data":{ + "value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6" + } +} +``` +- Example for error + +```json +{ + "success": false, + "data":{ + "code": "ACT007", + "msg": "The account already set an alias" + } +} +``` +*e.g Sample code* + +```java +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111"); +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666"); +``` +--- + +#### 1.16 Setting offline-account password +Interface + +**`Result setPasswordOffline(String address, String priKey, String password)`** + +Instructions + +> Sets the password of the offline account, independently encrypted in SDK, without interaction with NULS service +> +> Result: the encrypted private key(encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
priKeyString required account’s private key
passwordStringrequired set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g Sample Code* + +```java +setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456"); +``` +--- + +#### 1.17 Modifying offline-account password +Interface + +**`Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)`** + +Instructions + +> Modifies the password of the offline account independently in SDK, without interaction with NULS service +> +> Result: the encrypted private key generated by the new password (encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
encryptedPriKeyStringrequiredencrypted private key
passwordString required original password
newPasswordString required set new password of the account with length between 8 and 20, must containing both letters and digitals, the space not allowed
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g Sample Code* + +```java +resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456"); +``` +--- + +### Transactions AccountLedgerService + +#### 2.1 Creating transfer transaction +Interface + +**`Result createTransaction(List inputs, List outputs, String remark)`** + +Instructions + +> Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. **The calculation of the fee will be explained in detail later** +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
inputsList<Input>required usable output referred by the transaction
outputsList<Output> required usable output newly generated by the transaction
remarkStringoptionaltransaction remarks
+ +*e.g Sample Code* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); + +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +// the outputs for assembly transaction, the attribute of the output in the example is mandatory. +Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createTransaction(inputs, outputs, remark); +``` +--- + + +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:100000 NA/1KB +> +> **Calculation of transaction size**:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + + +#### 2.2 Transaction Signatures + +Interface + +**`Result signTransaction(String txHex, String priKey, String address, String password)`** + +Instructions + +> Signs the transaction by private key +> +> Result.data `String`: the signed transaction, serialized string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
priKeyStringrequiredprivate key of the transaction
addressStringrequired the address corresponding to the private key, used to verify the validity of the private key.
passwordStringoptional the password of the private key, leave it blank if the private key is not encrypted
+ +*e.g Sample Code* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"; +String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"; +String password = "NULS6352s!f"; +Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password); +``` + +> + +--- + +#### 2.3 Querying transaction details by transaction hash +Interface + +**`Result getTxByHash(String hash)`** + +Instructions + +> Queries transaction details by transaction hash +> +> Result.data: `Transaction` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredtransaction hash
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 99900000000, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 1, + "confirmCount": 14, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9999899000000 + } + ], + "outputs": [ + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 0, + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0, + "status": 0 + }, + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 1, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0, + "status": 0 + } + ] + } +} +``` +*e.g Sample Code* + +```java +getTxByHash("041f3d2ceed........"); +``` +--- + +#### 2.4 Transfers +Interface + +**`Result transfer(String address, String toAddress, String password, long amount, String remark)`** + +Instructions + +> Initiates a transfer transaction +> +> Result: the transaction hash + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequired address of the transferor account
toAddressStringrequired address of the transferee account
passwordStringoptional password of the transferor account, leave it blank if the account is not encrypted.
amountlongrequiredtransfer amount (unit: Na)
remarkStringrequiredremarks
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2" + } +} +``` +*e.g Sample Code* + +```java + //account with password +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "remarks 1NULS=10000000Na"); +//account without password +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, " remarks 1NULS=10000000Na"); +``` +--- + +#### 2.5 Querying account balance +Interface + +**`Result getBalance(String address)`** + +Instructions + +> Gets the account balance +> +> Result.data `BalanceInfo ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredaccount address
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "balance": 1009899998900000, + "usable": 1009899998900000, + "locked": 0 + } +} +``` +*e.g Sample Code* + +```java +getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS"); +``` +--- + +#### 2.6 Broadcasting transaction +Interface + +**`Result broadcastTransaction(String txHex);`** + +Instruction + +> Broadcasts a transaction +> +> Result.data String: transaction hash + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85" + } +} + +``` +*e.g Sample Code* + +```java +String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"; +Result result = service.broadcastTransaction(txHex); +if(result.isSuccess()) { + String txHash = (String)result.getData(); +} +``` +--- + +#### 2.7 Creating multi-address transfer transaction + +Interface + +**`Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)`** + +Instructions + +> Assembles the transaction by the input/output of the transaction passed in by the user. The parameters passed in are json objects, as shown in the e.g. section. **The input and output attributes in the example are mandatory. ** The fee is the difference between the total amount of inputs and outputs. There will be a minimum value for the fee based on the transaction size. When its fee is lower than the minimum value, the transaction will not be packaged. **The calculation of the fee will be explained in detail later** +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
inputsList<Input>required usable output referred by the transaction
outputsList<Output> required usable output newly generated by the transaction
nInputAccountintrequiredinput account number
remarkStringoptionaltransaction remarks
+ +*e.g Sample Code* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); +int nInputAccount = 2; + +//the inputs for assembly transaction, the attribute of the input in the example is mandatory. +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +//the outputs for assembly transaction, the attribute of the output in the example is mandatory. + Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark); +``` + +------ + +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:100000 NA/1KB +> +> **Calculation of transaction size**:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 2.8 Signing multi-address transfer transaction + +Interface + +**`Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)`** + +Instructions + +> Signs a transaction by private key +> +> Result.data `String`: signed transaction, serialized string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
txHexStringrequiredserialized transaction data in hexadecimal
privKeysListrequired private key of the transaction
passwordsListrequired password corresponding to the private key (passwords for multiple accounts must be the same) +
+ +*e.g Sample Code* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +List priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"); +List passwords = Arrays.asList("123456","123456"); +Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords); +``` + +> + +### Blocks BlockService + +#### 3.1 Getting block header by block height +Interface + +**`Result getblockHeader(int height)`** + +Instructions + +> Gets a block header by block height +> +> Result.data `BlockHeader ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
heightintrequiredblock height
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g Sample Code* + +```java +getblockHeader(10); +``` +--- + +#### 3.2 Getting block header by block hash + +Interface + +**`Result getblockHeader(String hash)`** + +Instructions + +> Gets a block header by block hash +> +> Result.data `BlockHeader` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredblock hash
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g Sample Code* + +```java +getblockHeader("041f3d2ceed........"); +``` +--- + +#### 3.3 Getting block by block height + +Interface + +**`Result getBlock(int height)`** + +Instructions + +> Gets a block by block height +> +> Result.data `Block ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
heightintrequiredblock height
+ +Return + +- Return ` Result ` object in the following formats: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g Sample Code* + +```java +getBlock(10); +``` +--- + +#### 3.4 Getting block by block hash + +Interface + +**`Result getBlock(String hash)`** + +Instructions + +> Gets a block by block hash +> +> Result.data `Block ` + + + + + + + + + + + + + + +
parametertyperequired or notnote
hashStringrequiredblock hash
+ +Return + +-Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "transfer", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g Sample Code* + +```java +getBlock("041f3d2ceed........"); +``` +--- + +#### 3.5 Getting the latest block header + +Interface + +**`Result getNewestBlockHash()`** + +Instrucntions + +> Gets the latest block header +> +> Result.data `BlockHeader` + + +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} + +``` +*e.g Sample Code* + +```java +getNewestBlockHash(); +``` +--- + +#### 3.6 Getting the latest block’s height + +Interface + +**`Result getNewestBlockHight()`** + +Instructions + +> Gets the height of the latest block +> +> Result.data: height (Long) + +Return + +-Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": 5210 + } +}} + +``` +*e.g Sample Code* + +```java +getNewestBlockHight(); +``` +--- + +#### 3.7 Getting the latest block’s Hash + +Interface + +**`Result getNewestBlockHash()`** + +Instructions + +> Gets the block Hash of the latest block +> +> Result.data: Hash (String) + +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success": true, + "data": { + "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b" + } +}} + +``` +*e.g Sample Code* + +```java +getNewestBlockHash(); +``` +--- + + + +### Consensus ConsensusService + +#### 4.1 Offline assembling transaction for creating node + +Interface + +**` Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee) `** + +Instructions + +> Assembles transaction for creating node offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
agentInfoObjectrequiredthe information about the node to be created
inputsListrequiredinput information
feeObjectrequiredtransaction fee
+ +*e.g Sample Code* + +```java +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +// the information about the node to be created, the attribute of AgentInfo in the example is mandatory. +AgentInfo info = new AgentInfo(); +info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); // the agent address of the consensus node +info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"); // the address of the node actually packing block +info.setDeposit(200000 * 100000000L);// deposit for creating a node, not less than 20000NULS and not more than 200000NULS +info.setCommissionRate(10.0); // commission ratio ranging from 1 to 100 + +//fee for creating a node +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ +> ** Calculation of transaction fee **: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:1000000 NA/1KB +> +> **Calculation of transaction size**:(288 + 50 * inputs.length)/1024 +> 210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 4.2 Offline assembling agent consensus transaction + +Interface + +**` Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee) `** + +Instructions + +> Assembles an agent consensus transaction offline. +> +> Result.data `String`: serialized transaction data in hexadecimal + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
depositInfoObjectrequiredthe information about the node to be created
inputsListrequiredinput information
feeObjectrequiredtransaction fee
+ +*e.g Sample Code* + +```java +// the inputs for assembly transaction, the attribute of the input in the example is mandatory. +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +// the information about the agent consensus node, the attribute of AgentInfo in the example is mandatory. +DepositInfo info = new DepositInfo(); +info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //address of the agent consensus node +info.setDeposit(300000 * 100000000L);// the agent token number ranging from 2000NULS to 500000NULS +info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");// the id of the transaction for creating consensus node + +//fee for creating a node +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ +> ** Calculation of fee for creating an agent transaction**: unit price of the fee\* transaction size +> +> ** unit price of the fee (min)**:1000000 NA/1KB +> +> **Calculation of transaction size**:(288 + 50 * inputs.length)/1024 +> 210 is the fixed length of the basic information, 50 is the length of a single input, 38 is the length of a single output, and remark is an optional field, whose byte length is calculated according to the UTF-8 character encoding when needed. The transaction size is in KB, and its maximum value is 300 KB. The part less than 1 KB is calculated as 1 KB. +> When the block-forging node verifies each transaction, the difference between the input and the output is regarded as the fee paid by the user when the transaction is sent, and the minimum value of the fee is calculated based on the transaction size. If the user's fee is less than the minimum value, it will be regarded as an invalid transaction and will not be packaged. Therefore, when creating a transaction, you should calculate the fee with care to avoid transaction failure. + +#### 4.3 Offline assembling transaction for canceling agent consensus + +Interface + +**` Result createCancelDepositTransaction(Output output) `** + +Instructions + +> Assembles a transaction for canceling agent consensus offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + +
parametertyperequired or notnote
outputObjectrequired the output locked when participating in the consensus
+ +*e.g Sample Code* + +```java +// after the transaction for participating in agent consensus is packaged, there is an output record of lockTime = -1, which is the agent amount locked after the user delegates the consensus. +/ / use the output as a parameter to generate an transaction for canceling agent consensus +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setValue(20000000000000L); +output.setLockTime(-1); + +Result result = NulsSDKTool.createCancelDepositTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.4 Offline assembling transaction for stopping consensus node + +Interface + +**` Result createStopAgentTransaction(Output output) `** + +Instructions + +> Assembles a transaction for stopping consensus node offline +> +> Result.data `String`: serialized transaction string in hexadecimal + + + + + + + + + + + + + + +
parametertyperequired or notnote
outputObjectrequired the output locked when creating a node
+ +*e.g Sample Code* + +```java +// after the transaction for creating a node is packaged, there is an output record of lockTime = -1, which is the deposit amount locked after the user create a node. +/ / use the output as a parameter to generate a transaction for canceling agent consensus +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setValue(20000000000000L); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setLockTime(-1); + +Result result = NulsSDKTool.createStopAgentTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.5 Getting list of agent consensus + +Interface + +**` Result getDeposits(String address, int pageNumber, int pageSize) `** + +Instructions + +> Gets a list of agent consensus by agent address +> +> Result.data List: a list of agent consensus + + + + + + + + + + + + + + + + + + + + + + + + + + +
parametertyperequired or notnote
addressStringrequiredagent address
pageNumberintrequiredpage number
pageSizeint required record size displayed per page ranging from 1 to 100<
+ +Return + +- Return ` Result ` object in the following format: + +```json +{ + "success":true, + "data":{ + "pageNumber":1, + "pageSize":10, + "total":1, + "pages":1, + "list":[ + { + "deposit":20000010000000, + "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c", + "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA", + "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e", + "blockHeight":98, + "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA" + } + ] + } +} +``` + +*e.g Sample Code* + +```java +Result result = NulsSDKTool.getDeposits(address, 1, 10); +``` + + + + + +### Appendix + +#### Example of Result returned by interface +##### Result + +- Indicate the normal access to the interface and the specific data returned by the business service. + +```json +{ +"success": true,// interface executes correctly +"data": data +} +``` +- Indicate the normal access to the interface, and the business service returns true. + +```json +{ // indicate the normal access to the interface, and the business service returns true + "success": true,// interface executes correctly + "data": { + "value":true // the result returned by interface business function + } +} +``` +- Indicate the normal access to the interface, and the business service returns false. + +```json +{ + "success": true, // interface executes correctly + "data":{ + "value": false // the result returned by interface business function + } +} +``` +- Return error cases, such as a parameter error, exception, etc. + +```json +{ // indicate an error + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +- This is the full result of creating an offline account with password. + +```json +{ + "success": true, + //data为List + "data": { + "list":[ + { + "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr", + "alias": null, + "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0", + "extend": null, + "createTime": 1529041525794, + "encrypted": false, + "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a", + "encryptedPriKey": "" + } + ] + } +} +``` +--- + +##### Account +```json +{ + "address": String, account address + "alias": String, account alias + "pubKey": String, public key + "extend": String, extension + "createTime": Long, create time + "encrypted": boolean, encrypted or not + "priKey": String, private key(not null only if a password-less offline account is created) + "encryptedPriKey": String, encrypted private key(not null only if an offline account with password is created) +} +``` +--- + +##### Input +```json + { + "fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long, transfer-in amount + "lockTime": Long, lock time +} +``` +--- + +##### Output +```json + { + "txHash": String, transaction hash + "index": Integer, index + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + "status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent) +} +``` +--- + +##### Transaction + +```json +{ + "hash": String, transaction hash + "type": Integer, transaction type + "time": Long, transaction initiation time + "blockHeight": Long, block height + "fee": Long, transaction fee + "value": Long, transaction amount + "remark": String, remarks + "scriptSig": String, signature + "status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed) + "confirmCount": Long, confirmation count + "size": int, size + "inputs": [ + { +"fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long, transfer-in amount + + } + ], + "outputs": [ + { + "txHash": String, transaction hash + "index": Integer, index + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + "status": Integer status 0:usable(usable), 1:timeLock(time lock), 2:consensusLock(consensus lock), 3:spent(spent) + } + ] +} +``` +--- + +##### BalanceInfo +```json +{ + "balance": long, balance + "usable": long, available balance + “locked": long, locked balance +} +``` +--- + +##### BlockHeader + +```json +{ + "hash": String, transaction hash + "preHash": String, hash value of the previous block + "merkleHash": String, merkle hash + "time": Long, block generation time + "height": Long, block height + "txCount": Long, count of transactions packaged by the block + "packingAddress": String, packing address + "scriptSig": String, signature + "roundIndex": Long, consensus round + "consensusMemberCount": Integer, count of members participating in the consensus + "roundStartTime": Long, the start time of the current consensus round + "packingIndexOfRound": Integer, the packing index of the current round + "confirmCount": Long, confirmation count + "reward": Long, consensus reward + "fee": Long, packing fee obtained + "size": int, size +} +``` +--- + +##### Block + +```json +{ + "hash": String, transaction hash + "preHash": String, hash value of the previous block + "merkleHash": String, merkle hash + "time": Long, block generation time + "height": Long, block height + "txCount": Long, count of transactions packaged by the block + "packingAddress": String, packing address + "scriptSig": String, signature + "roundIndex": Long, consensus round + "consensusMemberCount": Integer, count of members participating in the consensus + "roundStartTime": Long, the start time of the current consensus round + "packingIndexOfRound": Integer, the packing index of the current round + "confirmCount": Long, confirmation count + "reward": Long, consensus reward + "fee": Long, packing fee obtained + "size": int, size + "txList": [ + { + "hash": String, transaction hash + "type": Integer, transaction type + "time": Long, transaction initiation time + "blockHeight": Long, block time + "fee": Long, transaction fee + "value": Long, transaction amount + "remark": String, remarks + "scriptSig": String, signature + "status": Integer, transaction status 0:unConfirm(to be confirmed), 1:confirm(confirmed) + "confirmCount": Long, confirmation count + "size": int, size + "inputs": [inputs + { + "fromHash": String, txHash of the output + "fromIndex": Integer, outIndexof the output + "address": String, transfer-in address + "value": Long transfer-in amount + } + ], + "outputs": [ outputs + { + "address": String, address + "value": Long, amount + "lockTime": Long, lock time + } + ] + } + ] +} +``` diff --git a/source/contract/IdeaPlugin.md b/docs/developerTools/smartContractIDEAPlugin.md similarity index 100% rename from source/contract/IdeaPlugin.md rename to docs/developerTools/smartContractIDEAPlugin.md diff --git a/docs/guide/GUIGuide.md b/docs/guide/GUIGuide.md new file mode 100644 index 00000000..65730f68 --- /dev/null +++ b/docs/guide/GUIGuide.md @@ -0,0 +1,3 @@ +# Client wallet user guide +Community members are writing... + diff --git a/docs/guide/NULSTransaction.md b/docs/guide/NULSTransaction.md new file mode 100644 index 00000000..38b0f9b7 --- /dev/null +++ b/docs/guide/NULSTransaction.md @@ -0,0 +1,16 @@ +# Trading guide for NULS + +## Trade guide for Huobi platform + +- 中文:[https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432](https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432) +- English:[https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432](https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432) + +## Trade guide for Binance platform + +- 中文:[https://support.binance.com/hc/zh-cn/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) +- English:[https://support.binance.com/hc/en-us/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) + +## Trade guide for OKEX platform + +- 中文:[https://support.okex.com/hc/zh-cn/categories/115000275231](https://support.okex.com/hc/zh-cn/categories/115000275231) +- English:[https://support.okex.com/hc/en-us/categories/115000275231](https://support.okex.com/hc/en-us/categories/115000275231) \ No newline at end of file diff --git a/docs/guide/webGuide.md b/docs/guide/webGuide.md new file mode 100644 index 00000000..99ae0603 --- /dev/null +++ b/docs/guide/webGuide.md @@ -0,0 +1,5 @@ +# Light wallet user guide +Community members are writing... + + + diff --git a/docs/learn/NIP-1.md b/docs/learn/NIP-1.md new file mode 100644 index 00000000..259833a5 --- /dev/null +++ b/docs/learn/NIP-1.md @@ -0,0 +1,171 @@ +# NIP-1 NIP Purpose and Guidelines + +``` +NIP: 1 +Title: NIP Purpose and Guidelines +Status: Last call +Type: Process +Author: Lin Yang +Created: 2018-12-27 +``` + +## **What is a NIP?** + +NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions. + +## Reasons for NIP + +- We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal. +- For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library. + +## NIP Types + +There are six types of NIP: + +- A Core NIP describes improvements in the NULS core code, such as consensus mechanisms, network protocols, etc. +- A Module NIP describes improvements in module submission and review requirements, such as the certain minimum criteria a NIP must meet to be accepted and merged into the module repository. +- An Interface NIP describes improvements in the specifications and standards of the NULS client API/RPC, such as API name and method name. +- An NRC Standards NIP describes improvements in application-level standards, such as contract standards, token standards, etc. +- An Informational NIP describes a NULS design issue or provides general guidelines or information to the NULS community--but does not propose a new feature. Informational NIPs do not necessarily represent a NULS community consensus or recommendation, so users and implementers are free to ignore Informational NIPs or follow their advice. +- A Process NIP describes improvements in all NULS-related operational processes, such as the ambassador election in the community. A Process NIP is not only a recommendation, but also a specification that community members need to follow to accomplish certain things, but it does not involve code-level specifications. + +## NIP Work Flow + +**The parties involved in the workflow include some or all of the following roles:** + +- Most members of the community + + The main responsibility is to participate in the discussion and voting of the NIPs, making constructive comments as well. + +- NIP Authors + + Propose and improve NIPs and lead the community to discuss. + +- NIP Editors + + Manage and edit NIPs. + +- NULS Council + + The NIPs, about to “Final” or “Accepted”, can be rejected by the final decision of the Council via internal voting. + +- NULS Core Developers + + They are responsible for the audit and code implementation of the Core, Module, NRC Standards and Interface NIPs. + +Vetting an idea publicly before going as far as writing a NIP is meant to save your time. Asking the community first if an idea is original helps prevent too much time being spent on something that is guaranteed to be rejected based on prior discussions. It also helps to make sure the idea is applicable to the entire community and not just the author. Just because an idea sounds good to the author does not mean it will work for most people in most areas where NULS is used. We recommend that comments can be collected in the community via voting, and the results will also help the NIP editors to make quicker decisions on whether to merge the NIP. + +A successful NIP requires the following stages: + +``` + [ Draft ]->[ Last Call ]->[ Accepted ]->[ Final ] +``` + +Each change to the NIP status should be submitted by the NIP author as a pull request (PR), and the NIP editors will review the NIP. It's a good idea to add a link to the discussion post when you submit a PR. + +**A complete NIP process is as follows:** + +- The NIP author writes the NIP using the mandated format and style and shepherds the discussions in the community. The NIP author should first attempt to ascertain whether the idea is NIP-able, and then submit the NIP as a PR to the NIP repository, including a link to the discussion post. The NIP editors will handle these requests based on actual situation. + - **Draft:** Once approved, the NIP editors will assign the NIP a number and squash commit the pull request onto master. The NIP editors will not unreasonably deny a NIP. + - **Draft:** Reasons for denying NIP status include being unfocused or too broad, duplication of effort, being technically unsound, not providing proper motivation or addressing backwards compatibility, or not in keeping with the NULS philosophy. +- Updates to drafts may also be submitted by the author as pull requests before it can be considered mature enough and ready for the next status. + - **Last call**: Once approved, the NIP editors will change the NIP status from Draft to last call and set the end date for the last call, usually 15 days. + - **Last call**: Once the NIP has been published, it will be re-assigned to Draft status when necessary revisions are made on the NIP. We hope that a NIP will enter last call status only once to avoid unnecessary controversy in the community. +- The NIP in last call status will be pinned at https://nuls.community/ + - **Accepted (involved in Core, Module, NRC Standards and Interface NIPs only):** If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Accepted” by the NIP editors. + - **Final (involved in Informational and Process NIPs only):** If there are no major revisions or open technical issues, the status of the NIP through the last call period will be changed to “Final” by the NIP editors. + - **Last call:** The NIP will be re-assigned to Draft status if there are material changes or technical issues raised by the community cannot be solved during the last call period. In addition, if the Council has different views on the NIP, a vote can be initiated within the Council members. If more than 70% of the Council members reject the NIP (giving reasons), the NIP will be re-assigned to “Draft” status or directly “Rejected” according to actual reasons. + + + +- Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the NULS core developers must implement the NIPs in the form of code before they can be considered “Final”. + - **Final (involved in Core, Module, NRC Standards and Interface NIPs only):** After the NIP is implemented in the form of code, and is running on the main-net stably for certain amount of time or has become effectively verified, with changes recognized by the community as well, the status can be changed to "Final". + +Other exceptional statuses are: + +- **Deferred:** Once the Core, Module, NRC Standards and Interface NIPs have been accepted, the developers do not complete the reference implementation as scheduled. +- **Rejected:** A NIP can also be “Rejected”. Perhaps core developers reject to propose an implementation or the Council finds it unfeasible. +- **Superseded:** A NIP used to “Final”, but it is no longer considered the most advanced. Another better NIP appears, referring to this NIP, and becomes the Final status. + +## What belongs in a successful NIP? + +Each NIP should have the following parts: + +- **Preamble:** RFC 822 style headers containing meta-data about the NIP, including the NIP number, a short descriptive title (limited to a maximum of 44 characters), the names, and optionally the contact info for each author, etc. See NIP Header Preamble for details. +- **Summary:** The NIP author needs to provide a simple and understandable summary of the NIP for the general public. If you can't explain it in a simple way, it means that you don't fully understand it. +- **Abstract:**  A short (~200 word) description of the technical issue being addressed. +- **Motivation:** The motivation is critical for NIPs that want to change the NULS protocol. It should clearly explain why the existing protocol specification is inadequate to address the problem that the NIP solves. NIP submissions without sufficient motivation may be rejected outright. +- **Specification:** The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current NULS platforms (NULS client, explorer). +- **Rationale:** The rationale fleshes out the specification by describing what motivated the design and why particular design decisions were made. It should describe alternate designs that were considered and related work, e.g. how the feature is supported in other languages. The rationale should provide evidence of consensus within the community and discuss important objections or concerns raised during discussion. +- **Backwards Compatibility:** All NIPs that introduce backwards incompatibilities must include a section describing these incompatibilities and their severity. The NIP must explain how the author proposes to deal with these incompatibilities. NIP submissions without a sufficient backwards compatibility treatise may be rejected outright. +- **Test Cases:** For NIPs that affect the consensus mechanism, test cases for their implementation must be provided. +- **Reference Implementation:** The reference implementation must be completed before any NIP is given status "Final", but it need not be completed before the NIP is accepted. +- **History:** History records show the whole process of the NIP from being proposed to the Final state, which can be displayed as additional links. + + +## NIP Formats and Templates + +NIP should be written in markdown format. + +## NIP Header Preamble + +Each NIP must use the RFC 822 style as the head of the document. The headers must be arranged in the following order. The headers marked with * are optional, others are required. + +``` + Title: < NIP title> + Author: +* Discussions-To: < links to official discussion channels> + Status: + Type: + Created: +* Replaces: < NIP number> +* Superseded-By: < NIP number> +``` + +## Auxiliary Files + +NIPs may include auxiliary files such as diagrams. Auxiliary files must be named NIP-XXXX-Y.ext, where "XXXX" is the NIP number, "Y" is a serial number (starting at 1), and "ext" is replaced by the actual file extension (e.g. "png"). + +## Transferring NIP Ownership + +It occasionally becomes necessary to transfer ownership of NIPs to a new champion. In general, we'd like to retain the original author as a co-author of the transferred NIP, but that's really up to the original author. A good reason to transfer ownership is because the original author no longer has the time or interest in updating it or following through with the NIP process or has fallen off the face of the 'net' (i.e. is unreachable or not responding to email). A bad reason to transfer ownership is because you don't agree with the direction of the NIP. We try to build consensus around a NIP, but if that's not possible, you can always submit a competing NIP. + +If you are interested in assuming ownership of a NIP, send a message asking to take over, addressed to both the original author and the NIP editors. If the original author doesn't respond to email in a timely manner, the NIP editors will make a unilateral decision (it's not like such decisions can't be reversed). + +## NIP Editors + +The current NIP editors are: + +``` +Niels +Pen +``` + + + +## NIP Editor Responsibilities + +For each new NIP that comes in an editor does the following: + +- Read the NIP to check if it is ready: sound and complete. The ideas in the NIP must make technical sense, even if they don’t seem likely to be accepted. +- The title should accurately describe the content. +- Skim the NIP for obvious defects in language (spelling, grammar, sentence structure, etc.), markup (for Github style), and code style. + +If the NIP isn't ready, an editor will send it back to the author for revision, with specific instructions. Once the NIP is ready for the repository, a NIP editor will: + +- Assign a NIP number (usually a PR number) +- Merge the pull request +- Send email back to the NIP author with next steps + +Many NIPs are written and maintained by developers with write access to the NULS codebase. The NIP editors monitor NIP changes, and correct any structure, grammar, spelling, or markup mistakes they see. NIP editors don't pass judgment on NIPs. They merely do the administrative and editorial part. + + +## History + +This document was derived heavily from Bitcoin's [Bitcoin's BIP-0001](https://github.com/bitcoin/bips), written by Amir Taake, and the text he wrote was mainly from [Python's PEP-0001](https://www.python.org/dev/peps/). According to this situation, NIP makes some modifications based on their documents, such as adding the Council in the NIP process, modifying NIP types, etc. Please direct all comments to the NULS NIP editors. + + + + + +​ \ No newline at end of file diff --git a/docs/learn/NIP-2.md b/docs/learn/NIP-2.md new file mode 100644 index 00000000..a4057ecd --- /dev/null +++ b/docs/learn/NIP-2.md @@ -0,0 +1,284 @@ +# NIP-2 NULS Community Constitution + +``` + NIP: 2 + Title: NULS Community Constitution + Author: Reaper Ran + Discussions-To: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207 + Status: Last call + Type: Process + Created: 2018-12-28 +``` + + + +## Preamble + +Due to the development requirement of NULS and to better facilitate the favorable operation of the NULS community and to make blockchain technology easier with NULS, the NULS community will constantly seek and implement NULS community autonomy for the realization of self-governance and self-evolution. This Constitution is hereby formulated based on the NULS community culture and philosophy. + + + +NULS community culture: openness, freedom, autonomy, evolution + +NULS community philosophy: share, inherit, grow, innovate + +**The following rules will be based on the NULS development consensus governance module. The Council members and Ambassadors will be appointed by a vote within the NULS core team before consensus governance module is set in motion.** + + + +NULS Foundation + +December 2018 + + + +## Abstract + +NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology. NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders. + + + +## Motivation + +In order to build a good community operation mechanism, promote community autonomy, and promote the NULS project to enable the community to evolve and drive independently. + + + +## Specification + +The following is a specification of the NULS Community Constitution. + + + +# NULS Community Constitution + +## **I. NULS Community Profile** + +NULS is a blockchain infrastructure for customizable services and a global open-source community. The designed technical architecture of NULS consists of a micro-kernel and functional modules. With innovative ideas on reducing the main block chain and decoupling events and services, high modularization on underlying architecture is achieved. The NULS project, following the principles of hot plugging, modularization and parallel expansion, provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and use, and to promote the application of blockchain in the commercial field. With the proposal of basic framework containing modular thinking and multi-chain mechanism, NULS upholds the “chain” as its core development philosophy and is striving for building a core product - “Chain Factory” where users can select core function modules as they like to create their own blockchains on the NULS chain network and define their own business logic with little programming, to include smart contracts. + +**NULS community is an organization of a group of people who highly assent to NULS community culture and philosophy and have the same purpose and vision to work for the development of NULS community ecology.** NULS community members include the NULS Foundation, Council members, contributors, the open-source technology community - CODE CRAFT COUNCIL (CCC) and other all NULS Holders. + + + +## **II. NULS Foundation** + +NULS Foundation, short for the NULS FOUNDATION PTE. LTD. (201729333G), is a limited liability company incorporated in Singapore. It focuses on supporting the construction of NULS community ecology and technical research and development to promote the security, harmony and development of NULS community ecology, with the primary target of ensuring sustainable development of NULS Community ecology. + + + +### **(I)** **Objectives** **of NULS Foundation** + +Give rewards to contributors, CCC members and members of other communities according to their contributions with the aim to promote development of community ecology and support the NULS community development, including but not limited to: + +1. Code writing +2. Applications development +3. Operation and promotion +4. Other actions in favor of NULS community ecology development + + + +### **(II) Source of NULS Foundation** + +20,000,000 NULS from the NULS and entrusted revenues from the contributors. + + + +### **(III) Management of NULS Foundation** + +The NULS Foundation shall be managed and utilized based on the principles of fairness, justice and openness with respect to the development needs of the NULS Community ecology. NULS’ fund account is open to the community and subject to supervision of all community members. All proposals of incentives shall be managed under this Constitution and incentives may be given at the back end. The funds in the account shall be managed by the Foundation’s executives in its earlier stage, but then shall be handed over to the community for on-chain management once the governance mechanism is available on the chain. + + + +## **III. Council members** + + + +### **(I) Introduction to Council members** + +As a member organization established under the Regulations on Foundation Management, NULS Community’s Council members shall be responsible for NULS Foundation’s objectives as well as the whole community and will add the roles into NULS self-governance model step by step. + + + +### **(II) Appointment of Council members** + +The Council members, consisting of 11 members, is formed based on a popular vote within the community. The 11 Council members, which may be changed by proposal, shall be composed of 4 technology community developers **(developer council member)** elected based on a ballot participated by all developers; and 7 members elected by ballot within the community **(standing council member)**. The top 4 in ballot within the developer community shall be elected and the remaining members shall be the first 7 in dynamic poll. Equivalently, there will be at least 4 core developers in the Council members. + + + +1. Application. All community members are allowed to run for a position in NULS community’s Council members. The participants only need to meet the following conditions: have at least 50,000 NULS in the application address and accept real-time supervision by the system; provide personal information, as detailed as possible and reserve at least 50,000 NULS in the application address; participants applying for developer council member shall retain at least 20,000 NULS in the application address. +2. Voting. If the application is approved, all applicants will be ranked by votes from high to low and all NULS Holders can cast a vote. The voting right shall be assigned according to the token ownership accurate to the fourth decimal place. Token and voting right shall be inseparable. Each vote is allowed to select at least 4 developers and 7 Council members. +3. Appointment. According to votes, the first 7 in the candidate list of Council members and the top 4 in the developers list shall be appointed as the Council members and the addresses of these Council members will be given the permission to put forward a proposal with respect to the system. +4. Dropping out. If the NULS holdings in candidate’s address are less than 100,000, the candidate is deemed to drop out of the campaign and all the votes will be cleared without his / her presence on the candidate list. If the candidate exits the race of his / her own accord, all his / her votes will be also cleared without his / her presence on the candidate list. After dropping out, a new application shall be made if the application address wants to run for Council member again. + + + +### **(III) Rights and responsibilities of Council member** + +1. Proposal. Council member will be given the permission to put forward a proposal and the proposal will be charged 0.1 NULS. In addition, the proposal may be modified later. Proposal includes the following types: + + (1) Put forward a proposal to create the role of contributor and delete the role of contributor. The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid. + +* Role for campaign. The Council member shall put forward a proposal to create a role for campaign and provide fixed incentives or delegation. This role works in a similar way with the Council membership. One or more persons may be elected by ballot within the community to take on the role. + +* Permanent role. Put forward a proposal to create a role to give incentives or delegate. The community may vote for or against the assumption of the role. + + (2) Put forward a proposal to modify system parameters. The voting period will last 30 days and if the approval rating reaches 90%, the proposal will be executed; otherwise it will be invalid. + +* Adjustment of lower node agency commission. + +* Adjustment of transfer commission. + +* Adjustment of contract call commission. + +* Adjustment of Council member proposal commission. + +* Adjustment of adjustable system parameter in other systems. + + (3) Put forward a proposal to perform Foundation account operations. The voting period will last 15 days and that of the contributor role proposal will last 5 days; if the approval rating reaches 70%, the proposal will be executed; otherwise it will be invalid. + +* Delegation. For example, a Council member puts forward a proposal to delegate the node of an important role, the node rewards will be used to support the work to be performed by the role. + +* Fund transfer. For example, a Council member puts forward a proposal to transfer funds to financially support a community activity. The initial upper limit of transfer shall be 10,000 NULS and this parameter can be modified. + +* Node creation. For example, a Council member puts forward a proposal to create nodes with respect to developers and carry out a certain amount of delegation; the node rewards will be used to support the work to be performed by the developer. + +* Smart contract call. It aims to perform NRC20 token operation by calling the smart contract. For example, the Council member shall call the smart contract with respect to the CCC. + +2. Start a vote. Council member doesn’t need to pay a deposit if starting a vote and may initiate a vote of another type. +3. Responsibilities of Council member. + +* Council member shall communicate with the community in good time. + +* Act in strict accordance with the community’s Constitution. + +* Share the same vision and purpose with NULS. + +* Take it as its own mission to protect community members’ interests. + + + +**Note:** **All community members shall take an active part in all proposals and voting because every proposal is critical to the development of the NULS project. As a member of NULS Community, every holder should participate in voting. The absence from voting of any member shall be deemed a waiver of the proposal or the voting right.** + + + +## **IV. CODE CRAFT COUNCIL (CCC)** + +### **(I) Introduction to the CCC** + +The CCC consists of core developers from the global NULS Community and those who are interested in blockchain technology and highly agree with the NULS philosophy. They will take part in underlying architecture development of the NULS project and create the technical ecology together with the core development team. + + + +### **(II) Philosophy of the CCC** + +We stick to the following philosophy in the technology community: + +1. Equal: the technology community and core team are equal and work together for joint development. +2. Synergetic: the technology community and core team co-build the underlying architecture and create NULS ecology together. + +3. Sharing: + +* The whole community shares the achievements of NULS technology. + +* The whole community shares the development dividend of NULS. + +* The whole community shares NULS’s influence and reputation. + +* The industry shares the technical innovation brought by NULS. + +* The industry shares NULS’s standard establishment to promote industry development. + +4. Fair: the gains of every developer are based on his / her ability and contribution to seek for fairness and justice. + +5. Innovative: strong technology community is the basic guarantee of innovative thinking of blockchain. + + + +### **(III) Appointment of the CCC member** + +The joining of every CCC member shall be put to vote. Before that they need to present output worthy and recognized to include a period of adaptation (1 or 2 months generally). + +The process of joining CCC is: + +1. Have a preliminary communication with a CCC developer to briefly introduce his / her own experience and skilled programming language. +2. Select tasks they are interested in and capable of. We will let developers join in each development taskforce to work with each other. +3. Leader of the taskforce will provide necessary documentary information to help developers start in an efficient, expedient manner. We also hope developers can maintain effective communication with one another for smooth, ease of work. About 1 month later, the developer who remains consistent with the work and produces a high-quality product, can file a node application with the technology community. +4. After intense review by the technology community and core team, the developer will be one of the CCC if the application is approved. + +### + +### **(IV) Rights and responsibilities of the CCC member** + +1. NULS hopes to build a module repository covering 80% of underlying technologies in the blockchain field. We aim to lower the entry threshold of blockchain industry by increasing the modules in the repository. In doing so, the enterprises will undertake a much lower chain issuing cost and users will find it easier to use chains. We believe that only in this way can blockchain technology become a part of our daily life. + +2. The technology community will work with the core team to build a brand new architecture – NULS 2.0, which will enable NULS modules to work independently and the low-coupling module shall interact via the interface defined by standard. Then, developers (regardless of development language) can use adept programming languages as long as they comply with NULS module standard to develop the functional modules they need to enrich the module repository. + +3. After that, NULS will launch Chain Factory, a chain creation tool based on the module repository. If the developer is very clear about parameters of the blockchain developed by himself / herself, like the consensus mechanism, block size and block producing time, even if he / she doesn’t have much understanding of the underlying technology, he / she can own a public chain within several minutes in 4 simple steps (of course consortium blockchain and private blockchain are available). The public blockchain development time, which is usually six months to one year, is greatly reduced. + +4. Technology community will take part in all of the work mentioned above. You can bring forward any suggestions and comments to our plans regarding the technology community. + +5. The CCC members, the same as the core team members, shall have the right to know, participate in, assent or object to project progress. + + + +## **V. Contributor** + +### (I) Contributor for campaign + +Contributor role for campaign will be deemed a post in the community available for post-based recruitment and community supervision and management. The Ambassador is a contributor role for campaign and the current Ambassador campaign rules can be seen at **[nuls.community](https://nuls.community/)**. + + + +### (II) Permanent contributor + +Permanent contributor will be deemed a post in the community available for people-based post setting and community supervision and management. + + + +## **VI. Project Budget** + + + +### **(I) With respect to contributor** + +Where the Foundation account operation is performed based on the approved proposal of a contributor role in accordance with the established requirements, the Council members shall put forward a proposal to start a vote. The voting period will last 7 days and if the approval rating reaches 70%, the proposal will be executed. + + + +### **(II) With respect to other transaction funds** + +The Council members shall put forward a proposal to apply for other budget items. According to the proposal, The voting period will last 15 days and if the approval rating reaches 70%, the proposal will be executed as planned. + + + +## **VII. Other votes** + +### **(I) Start a vote** + +1. The Council member shall start a vote and only the transaction fee is required. + +2. Ordinary members shall cast a vote. Deposit (100 NULS now) + transaction fee. + + + +### **(II) Vote by proxy** + +* Anyone can delegate his / her voting right to an agent who shall cast a vote on behalf of him / her. + +* Any NULS user can be an agent. + +* Only primary agency is allowed; secondary agency is prohibited. Every NULS user is only allowed to delegate his / her own voting right. + +* The agency can be cancelled at any time and the vote that has been given will be revoked (voting in progress). + + + +## **VIII.** Feedback + +We welcome all of your suggestions and comments on this Constitution. Please contribute your suggestions to the following URLs: + +NULS community website: [https://nuls.community](https://nuls.community/) + +Feedback post: [https://nuls.community/d/132-we-need-your-suggestions](https://nuls.community/d/132-we-need-your-suggestions) + + diff --git a/docs/learn/NIP-3.md b/docs/learn/NIP-3.md new file mode 100644 index 00000000..b54c2b33 --- /dev/null +++ b/docs/learn/NIP-3.md @@ -0,0 +1,167 @@ +# NIP-3 Community Fund Management and Use of Process + +``` + NIP: 3 + Title: Community Fund Management and Use of Process + Author: Reaper Ran + Discussions-To: https://nuls.community/d/262-community-fund-management-and-use-of-process-discussion-draft-ngc20181221 + Status: Last call + Type: Process + Created: 2018-12-28 +``` + + + + + +## Abstract + +According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community. + + + +## Motivation + +In order to enable the community to have more talents to join, community funds are opened to the community for joint management and use. + + + +## Specification + +The following is a specification of the Community Fund Management and Use of Process. + + + +# Community Fund Management and Use of Process  + +![img](https://nuls.community/assets/files/2018-12-21/1545375254-226196-20181221145220.png) + +## **I. Community Fund Management** + +According to the needs of the ecological development of the NULS community, the management and use of the NULS community fund is based on the principles of fairness, justice and openness. The NULS Community Fund account is open to the community and is monitored by community members. All incentive proposals are managed according to the community Charter and can be used to cover expenses. The funds will be managed by select NULS team management members of the NULS Foundation in the early stage. With the maturation and step-by-step implementation of the governance mechanism, the funds will be gradually managed by the community. + +Community Fund Account Address: + +[Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u](https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u) + +According to the guiding ideology of the community Charter, the proposal implements the operation of the Foundation account. + +The proposal is initiated by the Council members: the voting period after the proposal is 15 days, the voting period for the Contributor role proposal is 7 days, and the voting support rate must reach 70%, otherwise it fails.The Council members may increase the standard of support rate according to the content of the proposal, but not less than 70%. + +**Note: The Council members are appointed by the designated members of the core team. After the governance tools and community regulations are improved, the council will be elected by all community members.** + +**Tentative first Council members: Liesa, Isaac, Omar, Reaper, Emerson, Penny, Berzeck, Moshe, Niels, Lin, Siwei ** + +## **II. The Application Member** + +### **1. Ordinary Members** + +All NULS Holders, community volunteers, and any other members who want to participate in the NULS community contributions. The Council members initiate the proposal for the ordinary members. The community vote for the proposal is held for 15 days. + +### **2. Contributor Role** + +Contributor role includes members of the CODE CRAFT COUNCIL (CCC) selected through the community's voting campaign and other members of the contributor role that will be generated through the community governance process in the future under the guidance of the community charter. **The contributor role generation process is performed in accordance with a separate proposal in the community charter, and changes to the rewards that are required by the role of the contributor still follow this process.** The Council members initiate the proposal for the contributor role members. The community vote for the proposal is held for 7 days. + +## **III. The Type of Application** + +### **1. Proposal to Pay Funds** + +The applicant has already done something and needs to pay for some of the costs incurred by the matter. This payment applies to a one-time payment or a specific transaction. Based on NULS, a single application does not exceed 10,000 NULS. + +### **2. Proposal Budget Item** + +The applicant has a plan to execute and needs to initiate a proposal for a budgeted project. Proposal budget item is applicable to specific contributor roles or community members to participate in the contribution. After the proposal is passed, periodic payment will be made in installments. For example, community management, platform information maintenance, etc. The budget project is based on NULS and the maximum single-budget application does not exceed 20,000 NULS. + +### **3. The Proposal to Create a Node** + +Applicants can apply for a proposal to create a node through a community fund. The creation node can specify and obtain the reward address, and the funds that create the node and/or deposit requirement are still owned by the community fund. This approach is suitable for long-term cooperation such as CCC members, other capable teams, developers, or operational partners. Creation of a node deposit is equal to 20,000 NULS. + +**4. Proposal Entrusted Funds** + +Applicants can apply for NULS to be entrusted to a node through a community fund. It can be a node created by the proposal, or a node created by the applicant itself. The entrusted NULS and the consensus rewards generated by the commission are owned by the community fund. This approach can be combined with a proposal creation node and is suitable for long-term cooperation to include Ambassadors, CCC members, other capable teams, developers, or operational partners, etc. The maximum amount of funds requested for application is 500,000 NULS. + +## **IV. The Application Process** + +### **1. The Plan is Openly and Thoroughly Discussed** + +(1) Display the plan, program or proposal in the community forum and openly discuss and answer the questions raised by the community; + +(2) Make the plan or revisions to the plan more complete according to the suggestions made by the community, to include the use of the funding for the program which needs to be clear, forthright, transparent and fully understood by the whole community; + +(3) The methods that can be applied for in the scheme include payment of funds, budget items, creation of nodes, and entrusted funds; + +(4) The proposal to pay the funds necessitates clarification of the amount of funds, the purpose for the funds, and the effective evaluation and clear projections of the results to be obtained; + +(5) Proposal budget items require detailed plans, funding amounts, uses, payment cycles and performance estimates; + +(6) For proposal to create a node, you need to specify the address of the reward, the purpose of creating the node, quantify and present the reward calculation generated by the node, and include the future plan of the applicant or the partner; + +(7) The entrusted funds of the proposal need to clarify the address of the award, the purpose of the entrustment, the calculation of the amount generated by the entrustment, and the future plan of the applicant or the partner; + +(8) All proposals initiated by the community are fully discussed (for no less than 7 days) and are fully understood by all community members and submitted to the Council members for formal proposals; + +### **2. Council Member Proposal** + +(1) Council members receive community-sponsored proposals that have been fully discussed, and then need to assign an NCG number (NCG + date + Item Number 01, 02 ) and make a formal proposal and initiate a community vote; + +(2) Both the council and the applicant need to guide the community to vote correctly in the best interest of NULS ecosystem; + +(3) After the completion of the voting, if the support rate of the community charter is greater than or equal to the proposal it passes, and if lower than the proposal support rate the vote is considered invalid, and needs to be revised, and re-submitted according to the entire process; + +(4) The members of the Council submit applications for funds to the Foundation. The proposal application needs to provide a link for discussion, a link to vote, and an NCG number. The foundation must implement the proposal adopted by the community if the fund has no security risks or other immediate insurmountable obstacles. + +### **3. Foundation Implementation Proposal** + +(1) If the Foundation receives an application for a proposal submitted by a member of the Council, it will take 3 working days to carry out the relevant operations; + +(2) In the processed transaction note, you need to fill in the NCG number of each transaction. If it is a multi-period or installment payment budget item, you need to add the period or payment installment number. (NCG+date+item+period/installment number such as 01 or 04). + +## **V. Process Explanation** + +All community discussion suggestions are made at [nuls.community](https://translate.google.com/translate?hl=zh-CN&prev=_t&sl=auto&tl=en&u=https://nuls.community/) . + +This process is managed according to the community's charter ideas, and the process will be open to entirety of all and any NULS global communities. + +Updates to process rules can also be presented as a proposal, in accordance with the Community Charter and NIP. + +The specific node generates revenue with reference to the NULS POC consensus mechanism. + +### **Attachment: Current Contributor Role Delegation and Node:** + +Ambassador Entrustment node - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR + +CCC Members + +Angel's node - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q + +Angel's staking - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx + +Berzeck’s node - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4 + +Berzeck’s staking – Same as above + +Claudio's node - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH + +Claudio's staking - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg + +Edward's node - NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa + +Edward's staking - Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G + +Josh’s node - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs + +Josh's staking - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR + +Moshe’s node - Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW + +Moshe’s staking – Same as above + +Naveen's node - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4 + +Naveen's staking - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN + + + +### + + \ No newline at end of file diff --git a/docs/learn/NIP-4.md b/docs/learn/NIP-4.md new file mode 100644 index 00000000..c19d705b --- /dev/null +++ b/docs/learn/NIP-4.md @@ -0,0 +1,269 @@ +# NIP-4 Ambassadors participate in the election rules + +``` + NIP: 4 + Title: Ambassadors participate in the election rules + Author: Reaper Ran Penny + Discussions-To: https://nuls.community/d/206-ambassadors-participate-in-the-election-rules-ncg-20181114 + Status: Last call + Type: Process + Created: 2019-2-15 +``` + + + +## Abstract + +The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador. + +The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly. + +The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month. + +If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum. + +Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors). + +The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter. + + + +## Motivation + +During the period between September to November 2018, we have had 9 ambassadors who have actively worked within the NULS Community to attract more members and developers. Once smart contracts are launched on the NULS main-net, there will be a community voting tool. Appointments of the ambassadors should be decided by the community. During this time, community members have given many suggestions, so we have set up some new detailed campaigning rules for the ambassadors. This will be the first step toward community autonomy, which is an important goal for NULS. It requires many fundamental tools, as well as the support from everyone in the community. + + + +## Specification + +The following is a specification of the Ambassadors participate in the election rules. + + + + + +# Ambassadors participate in the election rules + + + +## 1. Introduction of NULS Ambassadors + +The NULS ambassadors conduct community-building and development in various parts of the world. NULS ambassadors are divided into countries or regions, and each is limited to the selection of one NULS ambassador. + +The ambassador for each country will be chosen through competition by vote. Ambassadors will run quarterly. + +The incumbent ambassadors participating in the upcoming vote, shall provide a work report from previous month, as well as a plan for the next month. The work report should include expenses for that month. + +If the ambassador is a new candidate for the position, the will be required to first carry out some groundwork building their community for one month prior to the election, and then participate in the vote to become an ambassador. Participants will independently launch their candidacy on the community forum. + +Based on the number of participants, only 1/3 will get elected (e.g., if there are 10 participants, four will be elected). Also, the number of ambassadors should not exceed 1/10 of the number of nodes that have reached consensus (e.g., if there are 83 consensus nodes, there will be less than nine ambassadors). + +The voting will last for 15 days and once complete, the NULS Foundation will stake 200,000 NULS tokens into the ambassador’s node within a week’s time. The election for the ambassadors will be held in the last month of each quarter. + + + +## 2. Duties and Compensation for NULS Ambassadors + +a. A candidate for the NULS ambassador is required to create a NULS node. + +b. Identify with the NULS concepts of values, understand the core knowledge of NULS and respect the members of the NULS community. The election cycle is quarterly and requires a full 3 month commitment. Consider this commitment before running for election. Ambassadors are expected to meet the full term of the quarterly commitment. + +c. The appointment of NULS ambassadors is implemented through community voting. Candidates are able to apply for the position of ambassador during the first two months of a quarter. At the beginning of the third month of a quarter, the NULS team will initiate the voting and 1/3 of the candidates with the most votes will become the new ambassadors. For example, if 10 persons apply, 4 candidates with the most votes will get elected. + +d. Ambassadors are required to publicly display their work report summary to the whole community at the end of each month, and show the development and growth of the community as well as their plan for the next month on the forum. The work report should include expenses for that month. + +e. The dismissal of an ambassador: Any node can initiate a vote to dismiss an ambassador. The vote will last for a period of 7 days. If the votes in support the dismissal exceeds 50%, then the ambassador will be dismissed. The ambassador who is dismissed cannot participate in the ambassadors’ election again for 3 months. + +f. Each NULS ambassador will be entrusted with 200,000 NULS tokens from the community fund of NULS Foundation. The elected NULS ambassadors can use 80% of the consensus rewards for community building, and the remaining 20% will returned to the community fund. + +g. 80% is the initial parameter fir ambassador nodes. With market fluctuations, this parameter can be modified. Any node can propose to change this parameter, with a voting period of 15 days. If the voting volume exceeds 5 million NULS tokens and the supporting votes are 70% or higher, the vote is considered passed, and the NULS Foundation will execute. + +h. Half of all rewards of the ambassador's nodes are rewarded to ambassador(for he need to pay the node server cost and he shall get the rewards of 20,000 NULS he is staking on this nodes). And the other half must be used as development fund of ambassador for community development. + +i.About the resignation of ambassador, if the ambassador is voluntarily resigned or subject to recall by the community, please ambassador return the remaining development fund of ambassador to the community fund. + +j.The ambassador is a community contributor. If you need to initiate other community fund applications, please carry them out based on the community fund use and management process. + +## 3. How to participate in the election + +a. Publish the work report for the previous month and the work plan for the next month: + +Please post on the NULS forum: + +b. The NULS team will gather information and initiate a vote on the forum. The vote will last for a 15-day period, so do your best to swing the votes and campaign! + +c. If you’re elected, create a node and name it (Country+Ambassador). Set the commission rate to 80%. The NULS Foundation will stake 200,000 NULS tokens in your node. + + + +Final Tribute to your efforts: + +• Congratulations on becoming a NULS ambassador! If you encounter any difficulty, the NULS team and the community will assist you. + +• Start your work of community-building and outreach! + +• Help NULS dock more DApps! + +• At the end of each month, be sure to submit your report for the current month of community development as well as next month's work plan on the forum. + + + + + +For all ambassador related discussions, please post on the NULS forum at + +Welcome to the NULS community! Let’s work together to create a brighter future for NULS! + + + +If you can deliver more, we have these expectations of you: + +*1. Host a local meet-up in your city/country, to meet with members of the NULS community and guide new members;* + +*2. Provide us with any materials we can use to assist in our marketing, such as photos, videos, meet-ups and articles on business cooperation;* + +*3. Share the story of NULS to the community;* + +*4. Translate the videos and other contents produced by the team to your native languages and share with people in your country/region;* + +*6. If possible, coordinate and communicate with the team and local exchanges to add NULS trading pairs;* + +*7. Try to get to any possible cryptocurrency conferences in your area, and attend on behalf of NULS;* + +*8. Help NULS with publicity and be committed to NULS press releases through your local media.* + + + + + +# **Ambassador Guide** + + + +## **Preface** + +Congratulations on becoming an Ambassador for the NULS community! This guide will help you get started on your mission to engage and grow the NULS community and network effect. The NULS community is a global open-source project that promotes NULS and community development, and is based on the principles of: + + + +- Transparency +- Freedom +- Autonomy +- Evolution + + + +## The vision of the NULS project is based on the following mission + + + +- Making blockchain technology easy and simple +- Breaking through the bottleneck of blockchain performance and adoption +- Reducing the cost of using blockchain technology +- Increasing security and reliability of data + + + +NULS Ambassadors are the main conduit to engage the community and encourage community members to participate and further promote community development. As such, NULS Ambassadors should always lead by example, and make significant and even greater contributions to community development and the NULS ecosystem. + + + +## **As an Ambassador of NULS, you will obtain** + +1. The high honor of leadership in the NULS community. All Ambassadors' work will be recorded in the history of the NULS community. In the future, they will be recorded in NULS block data. +2. Rewards produced by one node. Rewards are used to develop the local NULS community. +3. Cooperate and work with other Ambassadors from other parts of the world, including in-depth exchanges with the NULS Council on the future development of NULS. +4. The support of the NULS community members. It will be very easy to establish your own nodes based on the community’s approval of your developments, planning, performance and effect. + + + +## **As an Ambassador of NULS, Your Mission is** + +**A. Community Development** + +1. Let others know about NULS via Internet or offline communications. +2. Organize some NULS fans or volunteers to promote the technology and concepts of NULS. +3. Share the development from other areas of the NULS community with your local community. +4. Continuously share the progress, planning, news, etc. of the NULS project to the local community. +5. Contact local media and forums to help NULS publicize presentations or news. +6. Share the story of NULS with the local community. +7. Any materials can be provided from the marketing team to assist the Ambassadors, such as photos, videos, meet-ups, and business cooperation articles. +8. Share videos or other content produced by the team in the local language of the people in your country/region. +9. If possible, coordinate with exchange teams for local exchanges to add NULS trading pairs. +10. Help to build some blockchain projects based on NULS, including both blockchains and/or DApps. + + + +**B.** **Community Activities** + +1. Host local meet-ups in your city or country, meet with members of the NULS community, and guide beginners to learn more about NULS. +2. Participate in any possible cryptocurrency gatherings in your area and represent NULS. +3. Organize other local members (NULStars) to participate in or attend offline activities on behalf of NULS. +4. Publicize and sponsor NULS in combination with events, conferences, hackathons, workshops, festivals, etc. by organizing in local forums or offline activities. +5. Try to work with some businesses and guide them to support the use of cryptocurrency for deduction, payment or title. + + + +## **Get Started With Everything You Need Here** + +1. NULS Ambassador Board ([[Click to enter](https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador)]), you can add your own list to the board, add all the work you are currently doing and plan to do, onto the board to make it easier for other Ambassadors and members to see and support your work, or coordinate with your efforts. +2. You can access and learn about the basic properties and content of NULS, such as the introduction of NULS, online exchanges, graphic content, partners, media channels, community groups, community websites, etc. +3. If you use publicity materials, please note that the logos and letters of NULS are always capitalized, and please use the standard VIS, including PPT templates, hats, cultural shirts, stationery, announcements, logos, etc., which can also be found on the board. +4. Please complete your email address, Telegram, LinkedIn and other accounts on the board so as to better communicate with each other, and join the NULS Ambassador group as soon as possible. +5. You need to pay attention to the board and Telegram groups, so that your partners can contact you when they need you. +6. If you need any help and support, or answers to any questions, you can raise them in groups. Team members will respond to your issues. +7. If you want to learn more about the technology and help others understand it, you can follow [Github] (https://github.com/nuls-io) and [dev.nuls.io](https://dev .nuls.io/). +8. Any suggestions, questions and ideas, and all work progress can be posted on the community forum [nuls.community](). + + + +## **Recruit Volunteers to Organize Local Communities** + +1. Recruit local NULS fans or volunteers to set up online communication groups, and guide them to promote the development of NULS. +2. Organize some offline meet-ups. +3. Introduce more blockchain investors to NULS and guide them towards investing in NULS. +4. Help grow out network effect by encouraging blockchain technology enthusiasts, developers, and content producers to join our community. + + + +## **Develop a Local NULS Ecology** + +1. Try to contact some local exchanges to list NULS for free. If some good exchanges require listing fees, you can introduce them to the NULS team. +2. Dock blockchain projects to develop on NULS and create blockchains and DApps built on NULS. +3. If you have any third-party wallet apps or hardware wallets that you are used to, please try to contact them to support NULS. + + + +## **Spread the Concepts and Features of NULS Technology with Local Communities** + +1. Find some local technology forums or blockchain forums to help NULS present relevant information to the participants. +2. Get in touch with some local technology media or blockchain media to do some interviews or reports on behalf of NULS, and also publish some NULS news. +3. Use local mainstream media websites to spread the news and progress of NULS. + + + + + +# **NULStar Guidelines And Duties** + + + +- **Requirements for becoming a NULStar** + +1. Must be an active member in the community. This includes retweeting, subscribing, following and liking material and content on social media outlets or creating social media accounts to help promote NULS. It also includes contributing some manner of content (art, ads, articles, or active positive participation in NULS Discord, TG, WeChat communities, etc.) or participating in our community activities and contests with an entry of content or action. +2. Must be knowledgeable about the NULS project—understand concept, mission, values, goals and be abreast of developments and news surrounding the project. A test accompanies this position to verify a potential NULStar is adequately informed about the project. +3. Must live in a city with over 350k population. + + + +- **Duties of a NULStar** + +1. Display a working knowledge of concepts of our technology, the vision of the platform, the values of NULS community, and goals of growing our community. Anything over 85% score on NULStar test qualifies an individual to become a NULStar. +2. Attend regular crypto meetups held within the NULStar city/area to present and discuss NULS project. The meetups can include Ethereum, Bitcoin, and blockchain meetups and events. + + + +- **Rewards for NULStars** + +1. NULStars are commissioned by NULS Ambassadors in their respective regions, and NULStars are paid individual bounties negotiated by each Ambassador. All bounties are paid in NULS and run between 50-100 NULS per meetup. Bounty amounts are designated at the discretion of the Ambassador. +2. NULStars who have demonstrated excellent communication skills and adhered to the mission and values of the project, including contributing growth to the community as a direct reflection of efforts made by them in their city, can participate in future campaigns as Ambassadors in their region. \ No newline at end of file diff --git a/docs/learn/NIPIntroduction.md b/docs/learn/NIPIntroduction.md new file mode 100644 index 00000000..a3123ec5 --- /dev/null +++ b/docs/learn/NIPIntroduction.md @@ -0,0 +1,15 @@ +# NIP introduction + +## What is NIP? + +NIP stands for NULS Improvement Proposal. A NIP is a design document providing information to the NULS community, and can be used for describing a new feature for NULS or its processes or environment. The NIP author is responsible for building consensus within the community and documenting dissenting opinions. + +## Reasons for NIP + +- We intend NIPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into NULS. Because the NIPs are maintained as text files in a versioned repository, their revision history is the historical record of the feature proposal. + +- For NULS implementers, NIP is a convenient means to track their progress. Ideally, the maintainers of each feature will list the NIPs they have implemented. This provides a convenient way for users to understand the current status of a feature or library. + +## Get all the NIP + +All NIP files are available through NULS's github:[https://github.com/nuls-io/NIPs](https://github.com/nuls-io/NIPs) \ No newline at end of file diff --git a/docs/learn/NULSNav.md b/docs/learn/NULSNav.md new file mode 100644 index 00000000..00d33c3b --- /dev/null +++ b/docs/learn/NULSNav.md @@ -0,0 +1,3 @@ +# NULS Portal + + \ No newline at end of file diff --git a/docs/learn/NULSTransaction.md b/docs/learn/NULSTransaction.md new file mode 100644 index 00000000..38b0f9b7 --- /dev/null +++ b/docs/learn/NULSTransaction.md @@ -0,0 +1,16 @@ +# Trading guide for NULS + +## Trade guide for Huobi platform + +- 中文:[https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432](https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432) +- English:[https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432](https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432) + +## Trade guide for Binance platform + +- 中文:[https://support.binance.com/hc/zh-cn/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) +- English:[https://support.binance.com/hc/en-us/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) + +## Trade guide for OKEX platform + +- 中文:[https://support.okex.com/hc/zh-cn/categories/115000275231](https://support.okex.com/hc/zh-cn/categories/115000275231) +- English:[https://support.okex.com/hc/en-us/categories/115000275231](https://support.okex.com/hc/en-us/categories/115000275231) \ No newline at end of file diff --git a/docs/learn/README.md b/docs/learn/README.md new file mode 100644 index 00000000..a8d15332 --- /dev/null +++ b/docs/learn/README.md @@ -0,0 +1,12 @@ +# Welcome to NULS + + +> NULS is a blockchain infrastructure for customizable services, driven by our global open-source community. + + +The NULS document library is a collection of all NULS documents. Here you can learn about technical manuals of NULS, NULS community, user manuals and other aspects. + + +## NULS2.0 Beta Version is released + +[Have a try](/NULS2.0/) diff --git a/docs/learn/communityImagesCN/1542526165310.png b/docs/learn/communityImagesCN/1542526165310.png new file mode 100644 index 00000000..fe1e8080 Binary files /dev/null and b/docs/learn/communityImagesCN/1542526165310.png differ diff --git a/docs/learn/communityImagesCN/1542526178695.png b/docs/learn/communityImagesCN/1542526178695.png new file mode 100644 index 00000000..b32fb9b8 Binary files /dev/null and b/docs/learn/communityImagesCN/1542526178695.png differ diff --git a/docs/learn/communityImagesCN/1542526190286.png b/docs/learn/communityImagesCN/1542526190286.png new file mode 100644 index 00000000..f7de230b Binary files /dev/null and b/docs/learn/communityImagesCN/1542526190286.png differ diff --git a/docs/learn/communityImagesCN/1542526202833.png b/docs/learn/communityImagesCN/1542526202833.png new file mode 100644 index 00000000..80af24da Binary files /dev/null and b/docs/learn/communityImagesCN/1542526202833.png differ diff --git a/docs/learn/communityImagesCN/1542526213174.png b/docs/learn/communityImagesCN/1542526213174.png new file mode 100644 index 00000000..7f155811 Binary files /dev/null and b/docs/learn/communityImagesCN/1542526213174.png differ diff --git a/docs/learn/communityImagesCN/1542526223816.png b/docs/learn/communityImagesCN/1542526223816.png new file mode 100644 index 00000000..07186d79 Binary files /dev/null and b/docs/learn/communityImagesCN/1542526223816.png differ diff --git a/docs/learn/howToContribute.md b/docs/learn/howToContribute.md new file mode 100644 index 00000000..b0dbf9ea --- /dev/null +++ b/docs/learn/howToContribute.md @@ -0,0 +1,45 @@ +# How to contribute +> The development of NULS is inseparable from the community and requires the participation of community members. We provide different ways for community members to participate, and you can choose what you are good at to contribute to NULS. For each contributor, the name of the contributor is published with its consent (we also attach the node name if the node is owned) +## Join the Mainnet development +Although the main network is now in a stable state of operation, in order to cope with changes, the development of the main network is still in progress. We need the help of the community to solve the challenges in the development of the main network and improve the NULS blockchain infrastructure together. We urge developers in the community to join us and contribute, and your efforts will be rewarded. + +- How to join the tech community:[https://nuls.io/developer](https://nuls.io/developer) +- NULS Github:[https://github.com/nuls-io](https://github.com/nuls-io) +## Report bugs +In the software development process, although there are strict tests, we still can't avoid bugs in the program. So if you find bugs in the process of using our application or developing, please timely feedback to us, and we will actively deal with them. There are three ways to feed back bugs: +- Feedback through [community forum](https://nuls.community/) + - Mainnet:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs + - Testnet:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs + +- Send email to support@nuls.io +- Direct feedback to the community manager or operations staff + +## Write document +NULS formulated the document writing incentive plan, invited the community to write NULS related documents together, and gave corresponding rewards according to the efforts of community members. + +## Translate document +As a global open source blockchain project, NULS needs a lot of bilingual documents in Chinese and English. If you are a professional in this field, we really need your help. + +## List of contributors + +> The rankings are arranged alphabetically, in no particular order + +Name|Email| Node Alias/ID +:--|:--|:-- +Angang Tang | tangangang@nuls.io | -- +Albert | albert@nuls.io | -- +Charlie Li | lichao@nuls.io | --- +Cody Lan | lanjinsheng@nuls.io | --- +Davi Yang | davi@nuls.io | --- +Yuanchen Jiang | jiangyuanchen@nuls.io | --- +Yifeng Qin | qinyifeng@nuls.io |-- +Niels | niels@nuls.io | niels +Pierre Luo | luohao@nuls.io |--- +Pen Luo | pen@nuls.io |--- +Siwei | 13809668344@139.com |siwei +Vivi Zhou | zhouwei@nuls.io |--- + + + + + diff --git a/docs/learn/introduction.md b/docs/learn/introduction.md new file mode 100644 index 00000000..9d87c134 --- /dev/null +++ b/docs/learn/introduction.md @@ -0,0 +1,25 @@ +# What is NULS + +### NULS is a blockchain infrastructure for customizable services, driven by our global open-source community. + +Following the principles of pluggability, modularization and parallel expansion, NULS provides smart contracts, multi-chain mechanism and cross-chain consensus to reduce cost of development and usage, and to promote the application of blockchain in the commercial field and the interaction among chains + +Upholding the "chain" as the core in the NULS development philosophy, NULS is striving for building its core product: "Chain Factory". In the meantime, NULS will realize the value circulation among chains through cross-chain module and build the ecosystem of blockchains. + +## 1. Our Mission + +- Provide flexible blockchain technology that supports a wide variety of enterprise applications +- Efficient, high performance technology to solve bottlenecks +- Promote usage of blockchain technology by reducing the barrier of entry development cost +- Provide the most powerful system of trust through a decentralized network +## 2. Whitepaper +The NULS whitepaper is an authoritative report that addresses what NULS’ goal is and how we plan to achieve it. + +[Learn more from whitepaper](https://nuls.io/api/v1/download/files/papers/white/NulsWhitepaper1.1.pdf) + +## 3. Yellowpaper + +The NULS yellowpaper is the technical detailed version of the whitepaper, which drills down into the underlying aspects of NULS. + + +[Learn more from Yellowpaper](https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf) \ No newline at end of file diff --git a/docs/learn/joinCCC.md b/docs/learn/joinCCC.md new file mode 100644 index 00000000..3ce3175e --- /dev/null +++ b/docs/learn/joinCCC.md @@ -0,0 +1,69 @@ +# Invitation of community developers + +## 1. Introduction +NULS is a public blockchain project, dedicated to creating a truly open-source, self-innovative blockchain platform driven by our community. NULS wants to lower the barrier for enterprises/individuals to use the base-level blockchain technology. + +NULS technical community is organized by a group of developers who are passionate and enthusiastic about NULS. The technical community will work closely with the NULS core dev team to design and build the underlying NULS architecture and applications. By implementing the modular design, multi-chain mechanism, cross-chain consensus and other mechanisms, enterprises/individuals can customize their own blockchains with very simple configuration. + +In the community, we adhere to the following vision: + +- **Equal**: Members from both the technical community and the core dev team are equal and they shall work together. +- **Synergetic**: The technical community and the dev team jointly develop the base-level technology to build the NULS ecosystem. +- **Sharing**: + - Technical achievements of NULS are shared with the community; + - Development bonuses of NULS are shared with the community; + - The influence and brand of NULS are shared with the community; + - Technical innovation of NULS is shared with the whole industry; + - All the industrial standards set by NULS are shared with the whole industry. +- **Fair**: Reward for each developer is based on his/her contribution. +- **Innovative**: A strong technical community is the guarantee for the innovation in the blockchain field. + +## 2. Are you the one? +NULS technical community is open for all developers. +If you are expecting the revolution driven by the blockchain technology and you’d like to create a brave new world with us: + +Please join the NULS dev Telegram group: +[https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ](https://nuls.community) + +**Notice**: We are not seeking for out-sourcing services. If you see anything here which can be improved, it can just be your playground! + +## 3. What are we offering? +The NULS team will give reward for each developer who contributes to NULS. The amount of reward depends on the contribution. +Currently, if you prove yourself to be a competent developer and join the core group of technical community - CCC (Code Craft Council), we will create a node in the NULS main-net for you and stake 200,000 NULS tokens to help get consensus reward. 50% of the reward (Currently around 1,500 NULS tokens per month) will be used to support the developers and the remaining 50% will go back into the community fund pool. +Note: The parameter of 50% is the initial setting, the subsequent adjustments are decided by the community, and we will announce the changes in the community as well. + +## 4. Our plan +Make it easy to build a blockchain! + +First, we would like to build a module repository which covers 80% of underlying technology of blockchain. By increasing the number of modules in the module repository, we will lower the barriers to get into the blockchain world. The cost for enterprises to build blockchains will be much lower, and the chains will be user friendly. We believe that in this way blockchain technology can be more integrated into our daily life. +The NULS team and technical community are currently building a new architecture: NULS 2.0 that will allow NULS modules to run independently, with low-coupling modules interacting with standard defined interfaces. Developers will no longer be limited to the programming language used by the blockchain system itself, and will only need to follow the NULS module standard to develop their own functional modules by using their preferred programming language, which will surely remove the threshold to develop more basic and business modules in the NULS module repository. + +Second, based on the module repository, NULS will launch its core product: Chain Factory. For developers who are familiar with the parameters of the blockchain they want to build, such as the consensus mechanism, block size and block generation time, they can build their own blockchains with only 4 steps and just a few minutes. Even if they don’t know the details about the base-level blockchain technology, this will greatly shorten the amount of time spent on blockchain development, estimated between 6 and 12 months. +For all the works above, we would never get done without the active involvement of the technical community. If you have any suggestions, you can always address them in our technical community. As always, we love to see new perspectives. + +Currently, there are more than 200 NULS technical community members across the world. We welcome more developers to join us. You will work directly with core dev team to develop the NULS base-level archicture and more! + +## 5. Current situation of the technical community + +A. From the very beginning, we believe that NULS belongs to the whole community, and the long-term development of NULS can't be achieved without the creativity of the community. In the past year, we were glad to witness how community developers volunteered to contribute to the NULS ecosystem. Josh from the United Kingdom developed our official website (nuls.io). Moshe from France developed blockchain browsers (nuls.world/) and web wallet (nuls.world/wallet) for NULS. Berzeck from Bolivia is working on the base-level development of NULS currently. +B. Despite this, we still have lots of work to be finished. We will continue to update a to-do list under this post, which will include the design, development, and improvement of NULS. All developers can choose accordingly, based on their abilities and interests. + +## 6. How to join us + +1. For the convenience of communication, you should join the Telegram group of our technical community (mentioned above), and firstly read through the pinned message in the group. +2. Talk to our community developer Moshe. Briefly introduce your experience, background, etc. + Community developers will discuss about some technical issues with you and get a brief understanding about what you want to do, which will determine what you could work on in the future. + + We also strongly recommend you to learn more about NULS through these links below: + - Official website: [https://nuls.io/](https://nuls.io/) + - Code: [https://github.com/nuls-io/nuls](https://github.com/nuls-io/nuls) + - Dev documents: [https://dev.nuls.io/docs/](https://dev.nuls.io/docs/) + - Community forum: [https://nuls.community](https://nuls.community) +3. You are going to choose an interesting and competent task. At that time, we will ask you to join one of the development group due to your subject and work with other developers. We strongly recommend that you download WeChat as a communication tool: + + [https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh](https://nuls.community/d/9-invitation-of-community-developers/4) + +4. In the group, each group leader will provide necessary documentations to help new developers to get started quickly. At the same time, we hope that developers will maintain effective communication with each other in order to work efficiently. After about a month of work, developers who are stable, efficient and have high quality output may apply to have a consensus node in the NULS main-net. Your application will be evaluated by the technical community and the core team. If the application is approved, we will create a consensus node for you as reward. + +## 7. Refer to task list +[https://nuls.community/d/9-invitation-of-community-developers/4](https://nuls.community/d/9-invitation-of-community-developers/4) (Continuously updated) \ No newline at end of file diff --git a/docs/learn/toolsGuide.md b/docs/learn/toolsGuide.md new file mode 100644 index 00000000..1f9aacb4 --- /dev/null +++ b/docs/learn/toolsGuide.md @@ -0,0 +1,49 @@ + +# Guide to Community Vote + +## Voting + +If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list. + +![1542526165310](./communityImagesCN/1542526165310.png) + +Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded. + +![1542526178695](./communityImagesCN/1542526178695.png) + +If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote. + +The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B. + +The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N. + +Each option in the voting details page is clickable to show the current or final distribution of votes. + +## Changing and Updating Your Vote + +As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission. + +![1542526190286](./communityImagesCN/1542526190286.png) + +There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type. + +![1542526202833](./communityImagesCN/1542526202833.png) + +## Checking My Votes + +In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow. + +![1542526213174](./communityImagesCN/1542526213174.png) + +If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules. + +## Creating A Community Vote + +In the voting list, click **“Create Voting"** to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee. + +In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked. + +![1542526223816](./communityImagesCN/1542526223816.png) + +When creating a community vote, **please fill in the item contents** **carefully.** Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed. + diff --git a/docs/zh/NULS1.0/APIManual.md b/docs/zh/NULS1.0/APIManual.md new file mode 100644 index 00000000..656aad02 --- /dev/null +++ b/docs/zh/NULS1.0/APIManual.md @@ -0,0 +1 @@ +# API手册 \ No newline at end of file diff --git a/docs/zh/NULS1.0/GUIForSmartContract.md b/docs/zh/NULS1.0/GUIForSmartContract.md new file mode 100644 index 00000000..caafc8b8 --- /dev/null +++ b/docs/zh/NULS1.0/GUIForSmartContract.md @@ -0,0 +1,137 @@ + +# 智能合约钱包操作手册 + +## 部署合约 + +1 启动钱包,点击【合约】,点击【部署合约】tab页 + +![deploy](./smartContractImages/deploy1.jpg) + +2 在文本框中填入合约的Hex编码 + >文章底部有发行NRC-20Token的合约hex编码示例 + + +3 填写合约构造函数参数,注意必填项和值类型,否则表单校验无法通过 + +![deploy](./smartContractImages/deploy2.jpg) + +4 点击【高级选项】,可更改GasLimit和GasPrice的默认值,还可继续填写附加信息,该字段为非必填项。(此步骤为可选操作) + +![deploy](./smartContractImages/deploy3.jpg) + +5 表单填写完成后,点击【测试合约】,钱包将对该合约进行一次测试部署,验证合约的合法性。 + +![deploy](./smartContractImages/deploy4.jpg) + +6 测试通过后,点击【部署合约】,若当前账户有密码则输入密码,然后点击【确认】。无密码,则直接点击【确认】。此时系统会跳转到【我的合约】页面,可在此页面查看部署合约的确认进度。 + + +查看部署合约的确认进度 + +![deploy](./smartContractImages/deploy6.jpg) + +7 确认完成后 + +- 点击表格右方的操作【去调用】可直接进入【调用合约】页面 + +- 点击合约地址可直接进入合约概览的页面 + + +## 查看合约 + +1 启动钱包,点击【合约】,点击【查看合约】tab页 + +![access](./smartContractImages/access1.jpg) + +2 在输入框中输入合法的合约地址,点击【访问】,下方会出现一个面板 + +- 点击面板中的【下拉列表】,可以选择要调用的合约方法 +- 点击合约地址旁的星星图标,可以收藏该合约至我的合约列表 + +![access](./smartContractImages/access2.jpg) + +3 选择某一个方法后有以下两种情况 + +- 方法为只读方法,点击【调用】则会在网络请求完成后立即返回调用结果 + + ![access](./smartContractImages/access3.jpg) + +- 方法为可写方法(需上链),可点击高级选项,更改GasLimit和GasPrice的默认值,点击【调用】后,该操作会发起一个交易,需要消耗nuls,因此若设置了账户密码,则需要输入密码。交易确认后,返回调用结果。 + + [查看智能合约手续费详情](http://dev.nuls.io/zh-cn/contract/SmartContractFee.html) + + 调用合约交易确认中 + + ![access](./smartContractImages/access4.jpg) + + 调用合约交易已确认 + + ![access](./smartContractImages/access5.jpg) + +4 若调用的上链方法,可点击面板中的TxID查看本次调用合约交易的详情 + +![access](./smartContractImages/access6.jpg) + +调用合约交易详情 + +![access](./smartContractImages/access7.jpg) + +## 我的合约 + +1 我的合约列表中展示了当前账户创建的合约和收藏的合约 + +![access](./smartContractImages/myContract1.jpg) + +- 点击合约地址,可进入合约概览页面 + + ![access](./smartContractImages/myContract2.jpg) + +- 点击去调用,可进入该合约的【调用合约】页面 + + ![access](./smartContractImages/myContract3.jpg) + +- 点击【取消收藏】可将该合约从【我的合约】列表中移除 + +3 【交易记录】中展示的是该合约内部的交易,点击TxID,可查看该条交易的详情 + +![access](./smartContractImages/myContract4.jpg) + +4 【合约详情】中展示的是该合约的所有方法,对应的参数和返回值类型 + +![access](./smartContractImages/myContract5.jpg) + +5 若合约由当前账户创建,可点击合约概览右上方的【删除】图标删除该合约,合约被删除后,可继续查看合约详细信息,但无法继续调用合约的方法 + +![access](./smartContractImages/myContract6.jpg) + +## 账户多资产 + +通过智能合约发行Token或由其他账户转入不同类型Token后,账户就会出现多资产 + +1 进入钱包,可查看当前账户地址下的所有类型资产 + +![access](./smartContractImages/assets1.jpg) + +2 点击【转账】可进入该类型资产的转账界面,输入收款地址和转账金额,可进行该类型资产的转账操作 + +![access](./smartContractImages/assets2.jpg) + +3 点击【交易记录】可进入该类型资产的交易记录页面 + +![access](./smartContractImages/assets3.jpg) + +4 在【交易记录】页面可通过点击下拉列表进行切换不同类型资产的交易记录 + +![access](./smartContractImages/assets4.jpg) + +5 点击TxID可查看该条交易记录详情 + +*** + +>发行NRC-20 Token的合约hex编码示例 + +``` +504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000 + + +``` diff --git a/docs/zh/NULS1.0/NRC-20TokenStandard.md b/docs/zh/NULS1.0/NRC-20TokenStandard.md new file mode 100644 index 00000000..eba56d14 --- /dev/null +++ b/docs/zh/NULS1.0/NRC-20TokenStandard.md @@ -0,0 +1,153 @@ +# NRC-20合约标准 + + +## 简述 + +token的接口标准 + + +## 摘要 + +以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。 + +## 动机 + +标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。 + +## 规则 + +## Token +### 方法 + +**注意**: 调用者必须处理返回`false`的`return boolean`.调用者绝对不能假设返回`false`的情况不存在。 + + +#### name + +返回令牌的名称 - 例如 `"MyToken"`. + +``` java +@View +public String name(); +``` + + +#### symbol + +返回令牌的符号 - 例如 "MT". + +``` java +@View +public String symbol(); +``` + +#### decimals + +返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。 + +``` java +@View +public int decimals(); +``` + + +#### totalSupply + +返回总令牌供应量。 + +``` js +@View +public BigInteger totalSupply(); +``` + + + +#### balanceOf + +返回地址为“owner”的帐户余额。 + +``` java +@View +public BigInteger balanceOf(@Required Address owner); +``` + + + +#### transfer + +转移`value`的token数量到的地址`to`,并且必须触发`TransferEvent`事件。 如果`from`帐户余额没有足够的令牌来支出,该函数应该被revert。 + +创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 + +注意 0值的传输必须被视为正常传输并触发`TransferEvent`事件。 + +``` java +public boolean transfer(@Required Address to, @Required BigInteger value); +``` + + + +#### transferFrom + +从地址`from`发送数量为`value`的token到地址`to`,必须触发`TransferEvent`事件。 + +`transferFrom`方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了`from`帐户已经通过某种机制(比如调用`approve(@Required Address spender, @Required BigInteger value)`)故意地授权消息的发送者之外,否则该函数应该`revert`。 + +注意 0值的传输必须被视为正常传输并触发传输事件。 + +``` java +public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value); +``` + + + +#### approve + +允许`spender`多次支配您的帐户,最高达`value`金额。 如果再次调用此函数,它将以`value`覆盖当前的余量。 + +``` java +public boolean approve(@Required Address spender, @Required BigInteger value); +``` + + +#### allowance + +返回`spender`仍然被允许从`owner`提取的金额。 +Returns the amount which `spender` is still allowed to withdraw from `owner`. + +``` java +@View +public BigInteger allowance(@Required Address owner, @Required Address spender); +``` + + + +### Events + + +#### TransferEvent + +当token被转移(包括0值),必须被触发。 + +创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 + +``` java +public TransferEvent(Address from, @Required Address to, @Required BigInteger value) +``` + + + +#### ApprovalEvent + +当任何成功调用`approve(@Required Address spender, @Required BigInteger value)`后,必须被触发。 + +``` java +public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value) +``` + + + +## Implementation + +#### Example implementations are available at +- https://github.com/nuls-io/nuls-nrc20 diff --git a/docs/zh/NULS1.0/README.md b/docs/zh/NULS1.0/README.md new file mode 100644 index 00000000..9b05f36e --- /dev/null +++ b/docs/zh/NULS1.0/README.md @@ -0,0 +1,12 @@ +# 欢迎来到NULS + + +> NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动 + +NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等 + +## NULS2.0 Beta版本已发布 + +#### [前往体验](/zh/NULS2.0/) + + diff --git a/source/zh-cn/docs/assert/launcher.jpg b/docs/zh/NULS1.0/assert/launcher.jpg similarity index 100% rename from source/zh-cn/docs/assert/launcher.jpg rename to docs/zh/NULS1.0/assert/launcher.jpg diff --git a/docs/zh/NULS1.0/buildPrivateChain.md b/docs/zh/NULS1.0/buildPrivateChain.md new file mode 100644 index 00000000..27720ea0 --- /dev/null +++ b/docs/zh/NULS1.0/buildPrivateChain.md @@ -0,0 +1,79 @@ +# 搭建区块链 + +## 简介 + +​ 本教程是基于NULS源代码介绍如何搭建私链,目的是为了方便学习了解NULS区块链网络运行,开发或者实验。自己搭建一条链来全方位的了解各节点是如何运行以及数据交互等,可以更好的把握NULS区块链网络的整体运行机制,有助于更深一步的研究。我们默认本文阅读者是具备Java开发环境的构建和调试技能的。 + + + +## 环境搭建 + +- 操作系统:macOS、Windows +- 构建工具:Maven +- 开发工具:IntelliJ IDEA +- NULS源码github地址:https://github.com/nuls-io/nuls + + + +## 开始 + +​ 由于区块链是去中心化网络,是由多个节点组成,我们将以3个节点搭建一条私链为例进行介绍。虽然我们建议使用Linux服务器来作为运行NULS主网共识节点的服务器,但由于涉及到开发调试的需求,本文我们将在可以搭建Java开发环境的macOS系统上运行调试节点。 + +## 开发环境 + +​ 首先使用IntelliJ IDEA克隆NULS源代码,并打开项目。确保Java使用的是jdk1.8,以及Maven工具配置正确。 + +## 如何搭建 + +​ 1.打开module.ini 文件,该文件为加入或组建网络的配置文件,此示例是NULS测试网的配置信息。 + +![image-20190103193901967](./images/image-20190103193901967.png) + +2.我们将用3个节点来搭建一条私链,首先需要准备可供3个节点运行的设备(可以是虚拟机)。 + +- 节点A:192.168.1.1 +- 节点B:192.168.1.2 +- 节点C:192.168.1.3 + +我们还需要设置一个种子节点,用来进行维持区块链的运行,即打包出块。同时我们还需要准备一个出块地址(包括私钥,用于在种子节点导入该地址),可以事先准备。 + +本例我们准备的初始出块地址为:`Nse4zpZHsUuU7h5ymv28pcGbwHju3joV` + +PS:如果你比较细心你可能为发现我们准备的地址和图中测试网的地址的开头字母是不一样的,那是为了让用户更容易识别测试网地址和主网地址,以免混淆导致不良后果,我们特意将测试网地址设置为以"TT"开头,将主网地址设置为"Ns"开头,而本教程使用的是NULS主分支代码,所以使用"Ns"开头的地址。如果您想自定义私链的账户地址开头字母,可以尝试修改nuls.ini文件中的`chain.id`参数,同一条链的节点该参数必须一致。 + +3. 假设节点A为种子节点,那么将A、B、C三个节点的module.ini配置文件的network、consensus节都按照以下配置进行修改: + +```ini +[network] +bootstrap=io.nuls.network.netty.module.impl.NettyNetworkModuleBootstrap +network.server.port=8003 +network.magic=20190101 +network.max.in=100 +network.max.out=10 +network.seed.ip=192.168.1.1:8003 + +[consensus] +bootstrap=io.nuls.consensus.poc.module.impl.PocConsensusModuleBootstrap +partake.packing=true +min.upgrade.delay=1000 +seed.nodes=Nse4zpZHsUuU7h5ymv28pcGbwHju3joV +``` + +- 将`work.seed.ip`修改为种子节点的ip和端口。 +- 将`seed.nodes`修改为出块地址。 +- 必须保证私链所有节点的魔法参数`network.magic`一致 + +4. 通过IntelliJ IDEA分别将3个节点运行起来,如果只需要调试其中一个节点,那么其他两个节点可以用maven打包发送到Linux服务器中运行,但是要注意的是需要准备一个jre放到NULS根目录中才能正常运行。 +5. 这3个节点启动后直到IntelliJ IDEA控制台有类似以下日志输出,则表示3个节点已近组成一个私有链的网络,但是没有打包出块,高度为0。如果没有日志输出,需要打开logback.xml中``的注释。 + +``` +io.nuls.client.Bootstrap.sysStart(Bootstrap.java:156):bestHeight:0 , txCount : 1 io.nuls.client.Bootstrap.sysStart(Bootstrap.java:174):height:0,count:2, hash:xxxxxxx,192.168.1.2:8003,192.168.1.2:8003 + +``` + +6. 这时在种子节点A的钱包界面中,导入事先准备的出块账户`Nse4zpZHsUuU7h5ymv28pcGbwHju3joV`,稍等一会儿,则可以看见控制台的最新高度在增加了,表示网络已经在打包出块了,而与此同时B节点、C节点高度也会增加并且3个节点高度保持一致,此时表示私有链网络已经搭建完成。 + +## 总结 + +​ 本文主要介绍使用最简便的方式搭建一个用于开发调试NULS的私链,并没有修改NULS的源代码。如果您需要更进一步探索NULS,可以查阅NULS的相关文档并在此基础上对源码进行修改调试,或许您会发现更多的奥秘! + diff --git a/docs/zh/NULS1.0/clientCLI.md b/docs/zh/NULS1.0/clientCLI.md new file mode 100644 index 00000000..befd51b5 --- /dev/null +++ b/docs/zh/NULS1.0/clientCLI.md @@ -0,0 +1,1554 @@ +# Linux CLI 手册 + + +### 介绍 + +​ 本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。 + +### 版本更新记录 + +| 版本 | 更新日期 | 内容 | +| :----: | :--------: | :----------------: | +| V1.0.0 | 2018-07-12 | 主网正式版全部功能 | + +### 准备 + +#### 服务器硬件配置 + + +**建立NULS节点的服务器不低于如下配置:** + + | CPU | 内存 | 硬盘 | 宽带 | + | :---------: | :---: | :------: | :-----: | + | 四核 3.0GHz | 16G | 128G硬盘 | 20M上行 | + + +**推荐配置:** + + | CPU | 内存 | 硬盘 | 宽带 | + | :---------: | :---: | :------: | :------: | + | 八核 3.0GHz | 32G | 256G硬盘 | 100M上行 | + + + +#### 系统及内核版本 + +**Linux系统** + +- CentOS (推荐) + +Linux内核版本推荐使用 2.6.32及以上 + +### 开始 + +#### 下载 + +- 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release + +- 进入[NULS官网钱包下载](http://nuls.io/wallet)界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。 + + Linux系统中下载v1.0.0版的钱包可以使用如下命令: + + ```shell + $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz + ``` + + 注:如果后续有其他版本,下载地址可能会不同。 + +#### 安装 + +- 在Linux中解压已下载的文件 + + ```shell + $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz + ``` + +#### 运行 + +- 进入解压后的bin目录,并运行启动脚本,启动全节点钱包 + + ```shell + $ cd bin + $ ./start.sh + ``` + +### 使用钱包 + +#### 快速入门 + +- 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。 + + 进入bin目录,执行如下命令: + + ```shell + $ ./cmd.sh + ``` + + 将会出现NULS命名输入提示符`nuls>>> ` ,然后可直接输入NULS钱包操作命令,来进行操作。 + + 例如,创建账户的示例如下: + + ```shell + nuls>>> create + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********* + Please confirm new password:********* + [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ] + nuls>>> + ``` + + 执行`create`命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。 + + + +### 约定 + +- 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。 +- 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。 + +### 钱包命令 + +#### 帮助命令 + +输出打印所有的命令, + +- **命令: help [-a] ** + +| 参数 | 说明 | +| :--- | :------------------- | +| -a | 格式化打印命令,选填 | + +返回信息 help + +```json +getaccount
--get account information +``` + +返回信息 help -a + +```json +getaccount
--get account information + OPTIONS: +
the account address - Required +``` + +示例 + +```shell +nuls>>> help +nuls>>> help -a +``` + + + +#### 创建账户 + +创建账户,返回账户地址集合 + +- **命令: create [number] ** + +| 参数 | 说明 | +| :------- | :------------------- | +| [number] | 创建账户的数量,选填 | + +创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter; + +返回账户集合 + +```json +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + +示例 创建2个没有密码的账户 + +```shell +nuls>>> create 2 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password: +[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] +``` + + + +#### 备份账户 + +备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件 + +- **命令:backup <address> [path]** + +| 参数 | 说明 | +| --------------- | ---------------------------------------------------- | +| <address> | 账户地址,必填 | +| [path] | 文件生成备份文件的目标文件夹,默认为当前文件夹,选填 | + +注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。 + +返回信息 + +```shell +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + +示例 备份一个有密码的账户 + +```shell +nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +``` + + + +#### 移除账户 + +根据账户地址移除本地账户,如果账户已加密,则需要输入密码 + +- **命令:remove <address> ** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 + +```json +Success +``` + +示例 + +```shell +nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +Success +``` + + + +#### 设置账户密码 + +根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。 + +- **命令:setpwd <address> ** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 + +```json +Success +``` + +示例 + +```shell +nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### 修改账户密码 + +根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。 + +- **命令:resetpwd <address> ** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 + +```json +Success +``` + +示例 + +```shell +nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Enter your old password:********** +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:********** +Please confirm new password:********** +Success +``` + + + +#### 设置别名 + +给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示 + +- **命令:setalias <address> <alias>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | +| <alias> | 别名名称,必填 | + +返回信息 交易hash + +```json +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + +示例 + +```shell +nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias +"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + + + +#### 导入账户keystore + +导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。 + +- **命令:importkeystore <path> ** + +| 参数 | 说明 | +| ------------ | ------------------------------ | +| <path> | 待导入的keystore文件地址,必填 | + +注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。 + +返回信息 导入的账户地址 + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +示例 + +```shell +nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### 导入账户私钥 + +导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。 + +- **命令:import <privatekey> ** + +| 参数 | 说明 | +| ------------------ | ---------------- | +| <privatekey> | 账户的私钥,必填 | + +注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。 + +返回信息 导入的账户地址 + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +示例 + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### 导入账户私钥(覆盖导入) + +导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。 + +- **命令:import <privatekey> ** + +| 参数 | 说明 | +| ------------------ | ---------------- | +| <privatekey> | 账户的私钥,必填 | + +注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。 + +覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。 + +返回信息 导入的账户地址 + +```json +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + +示例 + +```shell +nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** +Please confirm new password:********** +"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" +``` + + + +#### 查询账户信息 + +根据账户地址查询账户信息 + +- **命令:getaccount <address>** + +| 参数 | 说明 | +| --------------- | :------------- | +| <address> | 账户地址,必填 | + +返回信息 + +```json +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址 + "alias" : null,//别名 + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥 + "priKey" : "",//私钥(如果账户设置了密码,该项为空) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//创建时间 + "encrypted" : true//是否加密(是否设置了密码) +} +``` + +示例 + +```shell +nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +{ + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +} +``` + + + +#### 查询账户列表 + +根据分页参数查询账户列表,所有账户以创建时间倒序输出。 + +- **命令:getaccounts <pageNumber> <pageSize>** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | + +返回信息,将输出账户集合 + +```json +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址 + "alias" : null,//别名 + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥 + "priKey" : "",//私钥(如果账户设置了密码,该项为空) + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空) + "extend" : null, + "createTime" : "2018-07-13 11:39:14",//创建时间 + "encrypted" : true//是否加密(是否设置了密码) +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +示例 获取账户列表 显示第一页,每页显示2条 + +```shell +nuls>>> getaccounts 1 2 +[ { + "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", + "alias" : null, + "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", + "priKey" : "", + "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", + "extend" : null, + "createTime" : "2018-07-13 11:39:14", + "encrypted" : true +}, { + "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", + "alias" : null, + "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", + "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", + "encryptedPriKey" : "", + "extend" : null, + "createTime" : "2018-07-13 11:02:23", + "encrypted" : false +} ] +``` + + + +#### 查询账户私钥 + +根据账户地址查询账户私钥,如果账户已加密,则需要输入密码 + +- **命令:getprikey <address> ** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 导入的账户地址 + +```json +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + +示例 + +```shell +nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy +Please enter the password. +Enter your password:********** +"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" +``` + + + +#### 查询账户余额 + +根据账户地址查询账户余额 + +- **命令:getbalance <address> ** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 导入的账户地址 + +```json +{ + "balance" : "9999998.99",//余额 + "locked" : "0",//已锁定余额 + "usable" : "9999998.99"//可用余额 +} +``` + +示例 + +```shell +nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "balance" : "9999998.99", + "locked" : "0", + "usable" : "9999998.99" +} +``` + + + +#### 转账 + +根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。 + +- **命令:transfer <address> <toAddress> <amount> [remark] ** + +| 参数 | 说明 | +| ----------------- | ----------------------------------------------- | +| <address> | 转出地址,必填 | +| <toAddress> | 接收地址,必填 | +| <amount> | 转账数量,最多可以有8位小数(单位:NULS),必填 | +| [remark] | 备注信息,选填 | + +返回信息 转账交易hash + +```json +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` + +示例 + +```shell +nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账 +Please enter the password. +Enter your password:********** +"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" +``` + + + +#### 查询交易详情 + +根据交易hash查询交易详细信息 + +- **命令:gettx <hash>** + +| 参数 | 说明 | +| ------------ | -------------- | +| <hash> | 交易hash,必填 | + +返回信息 交易详细信息 + +```json +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash + "type" : "transfer",//交易类型(此示例为转账交易) + "time" : "2018-07-16 11:21:46",//交易时间 + "blockHeight" : 26269,//打包交易的区块高度 + "fee" : "0.001",//交易手续费 + "value" : "100",//(转账)交易数量 + "remark" : "转账",//备注 + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//签名 + "status" : "confirm",//交易确认状态(已确认或者未确认) + "confirmCount" : 46,//确认次数 + "size" : 254,//交易大小 + "inputs" : [ {//交易的输入 + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ {//交易的输出 + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"//交易输出的目标地址(此数据相当于转出100给目标地址) + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//交易输出的目标地址(此数据相当于找零给自己) + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + +示例 查询转账交易 + +```shell +nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596 +{ + "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "type" : "transfer", + "time" : "2018-07-16 11:21:46", + "blockHeight" : 26269, + "fee" : "0.001", + "value" : "100", + "remark" : "转账", + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1", + "status" : "confirm", + "confirmCount" : 46, + "size" : 254, + "inputs" : [ { + "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979998.98", + "lockTime" : 0 + } ], + "outputs" : [ { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 0, + "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T", + "value" : "100", + "lockTime" : 0, + "status" : "usable" + }, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "index" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : "9979898.979", + "lockTime" : 0, + "status" : "usable" + } ] +} +``` + + + +#### 查询交易列表 + +根据账户地址,查询该账户的交易列表 + +- **命令:gettxlist <address> <pageNumber> <pageSize>** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <address> | 账户地址,必填 | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | + +返回信息 交易详细信息 + +```json +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//交易hash + "blockHeight" : 26473,//交易的区块高度 + "time" : "2018-07-16 11:55:43",//交易时间 + "txType" : "transfer",//交易类型 + "status" : 1,//确认状态 + "info" : "+100"//信息 +},{ + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + +示例 + +```shell +nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10 +[ { + "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e", + "blockHeight" : 26473, + "time" : "2018-07-16 11:55:43", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +}, { + "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", + "blockHeight" : 26269, + "time" : "2018-07-16 11:21:46", + "txType" : "transfer", + "status" : 1, + "info" : "+100" +} ] +``` + + + +#### 创建节点 + +根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。 + +- **命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> ** + +| 参数 | 说明 | +| ---------------------- | ------------------------------------------------------------ | +| <agentAddress> | 创建节点的账户地址,必填 | +| <packingAddress> | 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块) | +| <commissionRate> | 代理佣金比例,范围:10~100,必填 | +| <deposit> | 创建节点的保证金,不能低于20000NULS,必填 | + +返回信息 返回节点的agent hash + +```json +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + +示例 创建一个节点,佣金比例为10%,押金20000NULS。 + +```shell +nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 +Please enter the password. +Enter your password:********** +"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" +``` + + + +#### 加入共识(委托节点) + +根据账户地址和节点agentHash,加入共识,至少需要2000NULS + +- **命令:deposit <address> <agentHash> <deposit> ** + +| 参数 | 说明 | +| ----------------- | -------------------------------------- | +| <address> | 账户地址,必填 | +| <agentHash> | 节点的agentHash,必填 | +| <deposit> | 加入共识保证金,不能低于2000NULS,必填 | + +返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。 + +```json +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + +示例 + +```shell +nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 +"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" +``` + + + +#### 退出共识(退出委托) + +根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。 + +- **命令:withdraw <address> <txHash> ** + +| 参数 | 说明 | +| --------------- | ---------------------- | +| <address> | 账户地址,必填 | +| <txHash> | 委托时的交易hash,必填 | + +返回信息 退出共识交易hash + +```json +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + +示例 + +```shell +nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 +"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" +``` + + + +#### 停止节点 + +停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。 + +- **命令:stopagent <address> ** + +| 参数 | 说明 | +| --------------- | -------------- | +| <address> | 账户地址,必填 | + +返回信息 停止节点交易hash + +```json +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + +示例 + +```shell +nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the password. +Enter your password:********** +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + + + +#### 获取节点详情 + +根据节点agentHash获取节点详情 + +- **命令:getagent <agentHash> ** + +| 参数 | 说明 | +| ----------------- | --------------------- | +| <agentHash> | 节点agentHash值,必填 | + +返回信息 + +```json +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址 + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址 + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址) + "deposit" : "20000",//创建节点的保证金 + "commissionRate" : 60.0,//代理佣金比例 + "agentName" : null,//节点名称(来源) + "agentId" : "35024DE6",//节点ID + "time" : "2018-07-16 16:33:38",//创建节点时间 + "blockHeight" : 28141,//创建节点交易的块高度 + "delHeight" : -1, + "status" : "consensus",//状态 + "creditVal" : 0.05,//信用值 + "totalDeposit" : "208000",//节点当前委托总额 + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//参与数 +} +``` + +示例 + +```shell +nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6 +{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.05, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} +``` + + + +#### 获取节点列表 + +根据共识节点列表 + +- **命令:getagents <pageNumber> <pageSize> ** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | + +返回信息 + +```json +[{ + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址 + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址 + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址) + "deposit" : "20000",//创建节点的保证金 + "commissionRate" : 60.0,//代理佣金比例 + "agentName" : null,//节点名称(来源) + "agentId" : "35024DE6",//节点ID + "time" : "2018-07-16 16:33:38",//创建节点时间 + "blockHeight" : 28141,//创建节点交易的块高度 + "delHeight" : -1, + "status" : "consensus",//状态 + "creditVal" : 0.05,//信用值 + "totalDeposit" : "208000",//节点当前委托总额 + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5//参与数 +}] +``` + +示例 + +```shell +nuls>>> getagents 1 2 +[ { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.18, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +}, { + "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7", + "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", + "deposit" : "20000", + "commissionRate" : 10.0, + "agentName" : null, + "agentId" : "5CE291D8", + "time" : "2018-07-16 16:31:12", + "blockHeight" : 28126, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.16, + "totalDeposit" : "208000", + "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", + "memberCount" : 5 +} ] +``` + + + +#### 获取全网共识总体信息 + +查询全网共识总体信息 + +- **命令:getconsensus ** + +返回信息 + +```json +{ + "agentCount" : 6,//节点数 + "totalDeposit" : "1758000",//总委托数 + "rewardOfDay" : "0",//奖励 + "consensusAccountNumber" : 6,//共识账户数量 + "packingAgentCount" : 6//打包地址数量 +} +``` + +示例 + +```shell +nuls>>> getconsensus +{ + "agentCount" : 6, + "totalDeposit" : "1758000", + "rewardOfDay" : "0", + "consensusAccountNumber" : 6, + "packingAgentCount" : 6 +} +``` + + + +#### 获取单个账户的委托总览 + +根据账户地址获取该账户参与的所有委托(共识)信息的总览 + +- **命令:getdepositedinfo <address> ** + +| 参数 | 说明 | +| --------------- | -------------- | +| <address> | 账户地址,必填 | + +返回信息 + +```json +{ + "agentCount" : 1,//创建的节点数 + "totalDeposit" : "1600000",//总共委托的数量 + "joinAgentCount" : 6,//加入委托的节点数 + "usableBalance" : "8048998.869",//可用余额 + "reward" : "219.65910271",//得到的奖励总数 + "rewardOfDay" : "219.65910271",//一天得到的奖励数 + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//节点hash +} +``` + +示例 + +```shell +nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +{ + "agentCount" : 1, + "totalDeposit" : "1600000", + "joinAgentCount" : 6, + "usableBalance" : "8048998.869", + "reward" : "219.65910271", + "rewardOfDay" : "219.65910271", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd" +} +``` + + + +#### 获取单个账户的委托信息列表 + +根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表 + +- **命令:getdepositeds <address> <pageNumber> <pageSize> [agentHash] ** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <address> | 账户地址,必填 | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | +| [agentHash] | 节点Hash,选填 | + +返回信息 + +```json +[{ + "deposit" : "2000",//委托金额 + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//委托者地址 + "time" : "2018-07-16 16:38:25",//时间 + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//委托交易hash + "blockHeight" : 28148,//交易的块高度 + "delHeight" : -1, + "status" : "consensus",//节点状态 + "agentName" : "35024DE6",//节点名 + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//节点地址 +}] +``` + +示例 + +```shell +nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "deposit" : "2000", + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:25", + "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221", + "blockHeight" : 28148, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "35024DE6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh" +}, { + "deposit" : "2000", + "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd", + "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "time" : "2018-07-16 16:38:43", + "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234", + "blockHeight" : 28149, + "delHeight" : -1, + "status" : "consensus", + "agentName" : "E09EB7FD", + "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT" +} ] +``` + + + +#### 获取单个账户的委托节点列表 + +根据地址查询该账户委托的节点列表(返回节点信息列表) + +- **命令:getdepositedagents <address> <pageNumber> <pageSize> ** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <address> | 账户地址,必填 | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | + +返回信息 + +```json +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//节点hash + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//创建节点的账户地址 + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//节点打包(出块)地址 + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//奖励地址(默认为创建节点地址) + "deposit" : "20000",//创建节点的保证金 + "commissionRate" : 40.0,//代理佣金比例 + "agentName" : null,//节点名称(来源) + "agentId" : "0198ACAF",//节点ID + "time" : "2018-07-16 16:32:52",//创建节点时间 + "blockHeight" : 28136,//创建节点交易的块高度 + "delHeight" : -1, + "status" : "consensus",//状态 + "creditVal" : -0.91,//信用值 + "totalDeposit" : "204000",//节点当前委托总额 + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3//参与数 +}] +``` + +示例 获取第一页,每页显示两条 + +```shell +nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 +[ { + "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr", + "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", + "deposit" : "20000", + "commissionRate" : 40.0, + "agentName" : null, + "agentId" : "0198ACAF", + "time" : "2018-07-16 16:32:52", + "blockHeight" : 28136, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : -0.91, + "totalDeposit" : "204000", + "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", + "memberCount" : 3 +}, { + "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", + "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", + "deposit" : "20000", + "commissionRate" : 60.0, + "agentName" : null, + "agentId" : "35024DE6", + "time" : "2018-07-16 16:33:38", + "blockHeight" : 28141, + "delHeight" : -1, + "status" : "consensus", + "creditVal" : 0.91, + "totalDeposit" : "208000", + "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", + "memberCount" : 5 +} ] +``` + + + +#### 获取最新的区块头信息 + +获取最新的区块头信息 + +- **命令:getbestblockheader** + +返回信息 + +```json +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//区块hash + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//前一区块hash + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//梅克尔hash + "time" : "2018-07-17 10:25:40",//区块生成时间 + "height" : 33950,//区块高度 + "txCount" : 1,//区块打包交易数量 + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 + "roundIndex" : 668413,//共识轮次 + "consensusMemberCount" : 1,//参与共识成员数量 + "roundStartTime" : "2018-07-17 10:25:30",//当前轮次开始时间 + "packingIndexOfRound" : 1,//当前轮次打包出块的名次 + "reward" : "0",//共识奖励 + "fee" : "0",//区块的打包手续费 + "confirmCount" : 0,//确认次数 + "size" : 204,//区块大小 + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"//签名 +} +``` + +示例 + +```shell +nuls>>> getbestblockheader +{ + "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e", + "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d", + "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877", + "time" : "2018-07-17 10:25:40", + "height" : 33950, + "txCount" : 1, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 668413, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-17 10:25:30", + "packingIndexOfRound" : 1, + "reward" : "0", + "fee" : "0", + "confirmCount" : 0, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9" +} +``` + + + +#### 查询区块信息 + +根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。 + +- **命令:getblock <hash> | <height> ** + +| 参数 | 说明 | +| -------------- | ------------ | +| <hash> | 区块的hash值 | +| <height> | 区块的高度 | + +返回信息 + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash + "time" : "2018-07-16 16:29:30",//区块生成时间 + "height" : 28115,//区块高度 + "txCount" : 2,//区块打包交易数量 + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 + "roundIndex" : 662578,//共识轮次 + "consensusMemberCount" : 1,//参与共识成员数量 + "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间 + "packingIndexOfRound" : 1,//当前轮次打包出块的名次 + "reward" : "0.001",//共识奖励 + "fee" : "0.001",//区块的打包手续费 + "confirmCount" : 6174,//确认次数 + "size" : 507,//区块大小 + "txList" : [ {//交易集合 + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//交易hash + "type" : "coinbase",//交易类型 + "time" : "2018-07-16 16:29:30",//交易时间 + "blockHeight" : 28115,//交易所在区块高度 + "fee" : "0",//交易手续费 + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ],//交易的输入 + "outputs" : [ //交易的输出 + { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } + ] + }], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名 +} +``` + +示例 根据高度获取区块 + +```shell +nuls>>> getblock 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6174, + "size" : 507, + "txList" : [ { + "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841", + "type" : "coinbase", + "time" : "2018-07-16 16:29:30", + "blockHeight" : 28115, + "fee" : "0", + "value" : null, + "remark" : null, + "scriptSig" : null, + "status" : "confirm", + "confirmCount" : 6174, + "size" : 54, + "inputs" : [ ], + "outputs" : [ { + "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "value" : 100000, + "lockTime" : 29115 + } ] + }, { + "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b", + "type" : "transfer", + "time" : "2018-07-16 16:29:27", + "blockHeight" : 28115, + "fee" : "0.001", + "value" : null, + "remark" : null, + "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663", + "status" : "confirm", + "confirmCount" : 6174, + "size" : 249, + "inputs" : [ { + "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459", + "fromIndex" : 1, + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 972899896100000 + } ], + "outputs" : [ { + "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne", + "value" : 3000000000000, + "lockTime" : 0 + }, { + "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", + "value" : 969899896000000, + "lockTime" : 0 + } ] + } ], + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### 查询区块头信息 + +根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。 + +- **命令:getblockheader <hash> | <height> ** + +| 参数 | 说明 | +| -------------- | ------------ | +| <hash> | 区块的hash值 | +| <height> | 区块的高度 | + +返回信息 + +```json +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash + "time" : "2018-07-16 16:29:30",//区块生成时间 + "height" : 28115,//区块高度 + "txCount" : 2,//区块打包交易数量 + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 + "roundIndex" : 662578,//共识轮次 + "consensusMemberCount" : 1,//参与共识成员数量 + "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间 + "packingIndexOfRound" : 1,//当前轮次打包出块的名次 + "reward" : "0.001",//共识奖励 + "fee" : "0.001",//区块的打包手续费 + "confirmCount" : 6174,//确认次数 + "size" : 507,//区块大小 + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名 +} +``` + +示例 根据高度获取区块头 + +```shell +nuls>>> getblockheader 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6280, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + + + +#### 查询网络信息 + +查询网络基本信息 + +- **命令:getnetinfo ** + +返回信息 + +```json +{ + "localBestHeight" : 35317,//本地最新区块高度 + "netBestHeight" : 35317,//网络最新区块高度 + "timeOffset" : "0ms",//网络时间偏移值 + "inCount" : 0,//被动连接节点数量 + "outCount" : 1//主动连接节点数量 +} +``` + +示例 + +```shell +nuls>>> getnetinfo +{ + "localBestHeight" : 35317, + "netBestHeight" : 35317, + "timeOffset" : "0ms", + "inCount" : 0, + "outCount" : 1 +} +``` + + + +#### 查询网络节点IP + +查询网络节点IP + +- **命令:getnetnodes ** + +返回信息 + +```json +[ "192.168.1.223" ] +``` + +示例 根据高度获取区块 + +```shell +nuls>>> getnetnodes +[ "192.168.1.223" ] +``` + + + +#### 查询当前版本信息 + +查询当前版本号 + +- **命令:version ** + +返回信息 + +```json +[ "192.168.1.223" ] +``` + +示例 + +```shell +nuls>>> version +{ + "myVersion" : "1.0.0", + "newestVersion" : "0.9.11", + "upgradable" : false, + "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization" +} +``` + + + +#### 版本更新 + +查询当前版本号 + +- **命令:upgrade <version> ** + +示例 + +```shell +nuls>>> version 1.0.0 +``` + + + +#### 退出钱包命令程序 + +退出操作钱包的命令行程序,不会退出已启动的钱包节点。 + +- **命令:exit** + +示例 + +```shell +nuls>>> exit +``` diff --git a/docs/zh/NULS1.0/connectMainnet.md b/docs/zh/NULS1.0/connectMainnet.md new file mode 100644 index 00000000..30ceb863 --- /dev/null +++ b/docs/zh/NULS1.0/connectMainnet.md @@ -0,0 +1,51 @@ +# 连接主网 + +## 下载钱包 + +NULS全节点钱包,有Windows、Linux、Mac三个版本,且持续更新,用户可以根据自己的服务器系统下载。 + +方式1:官网下载(https://nuls.io/newWallet) + +![1546518367717](./img/1546518367717.png) + +方式2:github下载(https://github.com/nuls-io/nuls/releases) + +![1546518556230](./img/1546518556230.png) + +注:版本号后标注了[Main-net]的版本为主网的钱包 + +## 运行钱包 + +钱包下载好后,根据不同的操作系统解压 + +Windows系统钱包解压后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。 + +![1546518956812](./img/1546518956812.png) + +双击NULS-Wallet.exe启动并运行钱包,系统默认浏览器会自动打开钱包界面,如下图: + +![1546519370742](./img/1546519370742.png) + +首次打开界面时,页面还会提示当前正在同步区块中,如下图: + +![1546519548787](./img/1546519548787.png) + +出现正在同步区块后,表面已成功连接上NULS主网,待区块同步完成后,即可正常使用钱包。用户为节约时间不想从第一个区块开始重新同步数据,也可以到github上下载每个版本对应的最新区块数据包,如下图: + +![1546520020388](./img/1546520020388.png) + + + +Linux系统解压钱包后如下图:其中data文件夹和logs文件夹是在首次运行钱包后才会生成。 + +![1546520382686](./img/1546520382686.png) + +执行命令 sh bin/start.sh 启动钱包,启动后可根据命令 sh bin/cmd.sh 进入nuls钱包命令行,在命令行里执行getnetinfo命令,查看当前网络状态,当localBestHeight出现增长时,则表明连接主网成功。如下图: + +![1546520727643](./img/1546520727643.png) + +用户也可跟踪logs文件夹下的nuls.log日志文件,查看钱包最新状态 + + + +MAC版本的钱包运行与Windows钱包基本一致,不再复述。 \ No newline at end of file diff --git a/docs/zh/NULS1.0/developerManual.md b/docs/zh/NULS1.0/developerManual.md new file mode 100644 index 00000000..07dcbe68 --- /dev/null +++ b/docs/zh/NULS1.0/developerManual.md @@ -0,0 +1,1200 @@ +# 开发手册 + +## 1. 简介 + +NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。 + +## 2. 开发环境 + +### 2.1 安装NULS钱包 + +### 2.2 安装JDK 8 + +### 2.3 安装IntelliJ IDEA + +Nuls智能合约使用的开发工具为IntelliJ IDEA。 + +### 2.4 安装NULS智能合约插件 + +[点击下载插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) + +NULS智能合约插件提供的主要功能: + +* 新建NULS合约工程 +* 提示不支持的Java特性、Java类、Java方法 +* 编译、打包、部署合约 +* 展示、调用合约方法。 + +## 3. NULS智能合约规范与语法 + +Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。 + +### 3.1 NULS智能合约规范 + +> **_合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + +### 3.2 关键字 + +下面列出Java关键字,其中将标注NULS智能合约不支持的关键字 + +访问控制 + +* public +* protected +* private + +定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象 + +* class +* interface +* abstract +* implements +* extends +* new + +包的关键字 + +* import +* package + +数据类型的关键字 + +* byte +* char +* boolean +* short +* int +* float +* long +* double +* void +* null +* true +* false + +条件循环(流程控制) + +* if +* else +* while +* for +* switch +* case +* default +* do +* break +* continue +* return +* instanceof + +错误处理 + +* catch +* try +* finally +* throw +* throws + +修饰方法、类、属性和变量 + +* static +* final +* super +* this +* native(不支持) +* strictfp(不支持) +* synchronized(不支持) +* transient(不支持) +* volatile(不支持) + +其他 + +* enum(不支持) +* assert(不支持) + +### 3.3 基本语法 + +下面的语法与Java相同,只是简单列出,具体可参考Java相关文档 + +* 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头 +* 基本数据类型:byte short int long float double char boolean +* 引用数据类型:类、接口、数组 +* 算术运算符:+ - * / % ++ -- +* 关系运算符:> < >= <= == != +* 逻辑运算符:! & | ^ && || +* 位运算符:& | ^ ~ >> << >>> +* 赋值运算符:= +* 拓展赋值运算符:+ = -= *= /= +* 字符串链接运算符:+ +* 三目条件运算符 ? : +* 流程控制语句(if,switch,for,while,do...while) + +### 3.4 支持的类 + +Nuls智能合约只能使用下面的类进行开发 + +* io.nuls.contract.sdk.Address +* io.nuls.contract.sdk.Block +* io.nuls.contract.sdk.BlockHeader +* io.nuls.contract.sdk.Contract +* io.nuls.contract.sdk.Event +* io.nuls.contract.sdk.Msg +* io.nuls.contract.sdk.Utils +* io.nuls.contract.sdk.annotation.View +* io.nuls.contract.sdk.annotation.Required +* io.nuls.contract.sdk.annotation.Payable +* java.lang.Boolean +* java.lang.Byte +* java.lang.Short +* java.lang.Character +* java.lang.Integer +* java.lang.Long +* java.lang.Float +* java.lang.Double +* java.lang.String +* java.lang.StringBuilder +* java.math.BigInteger +* java.math.BigDecimal +* java.util.Collection +* java.util.List +* java.util.ArrayList +* java.util.LinkedList +* java.util.Map +* java.util.HashMap +* java.util.LinkedHashMap +* java.util.Set +* java.util.HashSet + +### 3.5 其他限制 + +* 合约类只能有一个构造方法,其他类不限制 +* 执行一次合约方法最大的Gas消耗是1000万,包括`@View`类型的方法调用,请保证尽可能的优化合约代码 + +## 4. NULS智能合约简单示例 + +一个简单的合约 + +> **_合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + + +```java +package contracts.examples; + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +public class SimpleStorage implements Contract { + + private String storedData; + + @View + public String getStoredData() { + return storedData; + } + + @Payable + public void setStoredData(@Required String storedData) { + this.storedData = storedData; + } + +} +``` + +在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。 +项目中可以有多个类和接口。 + +合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 +合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。 + +注解说明 + +@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。 + +@Payable 标记@Payable的方法,才能在调用时候传入金额 + +@Required 标记@Required的参数,调用时候必须传入值 + +去github下载NULS源码,里面有一些合约示例。 + +## 5. NULS Contract SDK + +合约SDK提供了几个类,方便合约开发: + +### io.nuls.contract.sdk.Address + +```java +public class Address { + + private final String address; + + public Address(String address) { + valid(address); + this.address = address; + } + + /** + * 获取该地址的余额(只能获取合约地址余额) + * + * @return + */ + public native BigInteger balance(); + + /** + * 合约向该地址转账 + * + * @param value 转账金额(多少Na) + */ + public native void transfer(BigInteger value); + + /** + * 调用该地址的合约方法 + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + */ + public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 调用该地址的合约方法并带有返回值(String) + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + * @return 调用合约后的返回值 + */ + public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 验证地址 + * + * @param address + * @see io.nuls.kernel.utils.AddressTool#validAddress(String) + */ + private native void valid(String address); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address1 = (Address) o; + return address != null ? address.equals(address1.address) : address1.address == null; + } + + @Override + public int hashCode() { + return address != null ? address.hashCode() : 0; + } + + @Override + public String toString() { + return address; + } + +} +``` + +### io.nuls.contract.sdk.Block + +```java +public class Block { + + /** + * 给定块的区块头 + * + * @param blockNumber + * @return + */ + public static native BlockHeader getBlockHeader(long blockNumber); + + /** + * 当前块的区块头 + * + * @return + */ + public static native BlockHeader currentBlockHeader(); + + /** + * 最新块的区块头 + * + * @return 最新块的区块头 + */ + public static native BlockHeader newestBlockHeader(); + + /** + * 给定块的哈希值 + * hash of the given block + * + * @param blockNumber + * @return + */ + public static String blockhash(long blockNumber) { + return getBlockHeader(blockNumber).getHash(); + } + + /** + * 当前块矿工地址 + * current block miner’s address + * + * @return + */ + public static Address coinbase() { + return currentBlockHeader().getPackingAddress(); + } + + /** + * 当前块编号 + * current block number + * + * @return + */ + public static long number() { + return currentBlockHeader().getHeight(); + } + + /** + * 当前块时间戳 + * current block timestamp + * + * @return + */ + public static long timestamp() { + return currentBlockHeader().getTime(); + } + +} +``` + +### io.nuls.contract.sdk.BlockHeader + +```java +public class BlockHeader { + + private String hash; + private long time; + private long height; + private long txCount; + private Address packingAddress; + private String stateRoot; + + public String getHash() { + return hash; + } + + public long getTime() { + return time; + } + + public long getHeight() { + return height; + } + + public long getTxCount() { + return txCount; + } + + public Address getPackingAddress() { + return packingAddress; + } + + public String getStateRoot() { + return stateRoot; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BlockHeader that = (BlockHeader) o; + + if (time != that.time) return false; + if (height != that.height) return false; + if (txCount != that.txCount) return false; + if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; + if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) + return false; + return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; + } + + @Override + public int hashCode() { + int result = hash != null ? hash.hashCode() : 0; + result = 31 * result + (int) (time ^ (time >>> 32)); + result = 31 * result + (int) (height ^ (height >>> 32)); + result = 31 * result + (int) (txCount ^ (txCount >>> 32)); + result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); + result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "BlockHeader{" + + "hash='" + hash + '\'' + + ", time=" + time + + ", height=" + height + + ", txCount=" + txCount + + ", packingAddress=" + packingAddress + + ", stateRoot='" + stateRoot + '\'' + + '}'; + } + +} +``` + +### io.nuls.contract.sdk.Contract + +```java +/** + * 合约接口,合约类实现这个接口 + */ +public interface Contract { + + /** + * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。 + */ + default void _payable() { + } + +} +``` + +### io.nuls.contract.sdk.Event + +```java +/** +* 事件接口,事件类实现这个接口 +*/ +public interface Event { +} +``` + +### io.nuls.contract.sdk.Msg + +```java +public class Msg { + + /** + * 剩余Gas + * remaining gas + * + * @return + */ + public static native long gasleft(); + + /** + * 合约发送者地址 + * sender of the contract + * + * @return + */ + public static native Address sender(); + + /** + * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na + * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na + * + * @return + */ + public static native BigInteger value(); + + /** + * Gas价格 + * gas price + * + * @return + */ + public static native long gasprice(); + + /** + * 合约地址 + * contract address + * + * @return + */ + public static native Address address(); + +} +``` + +### io.nuls.contract.sdk.Utils + +```java +public class Utils { + + private Utils() { + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + */ + public static void require(boolean expression) { + if (!expression) { + revert(); + } + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + * @param errorMessage + */ + public static void require(boolean expression, String errorMessage) { + if (!expression) { + revert(errorMessage); + } + } + + /** + * 终止执行并还原改变的状态 + */ + public static void revert() { + revert(null); + } + + /** + * 终止执行并还原改变的状态 + * + * @param errorMessage + */ + public static native void revert(String errorMessage); + + /** + * 发送事件 + * + * @param event + */ + public static native void emit(Event event); + + /** + * @param seed a private seed + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param src source string (hex encoding string) + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(String hexString); + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param bytes source byte array + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(byte[] bytes); + + /** + * [Testnet]verify signature data(ECDSA) + * + * @param data(hex encoding string) + * @param signature(hex encoding string) + * @param pubkey(hex encoding string) + * @return verify result + */ + public static native boolean verifySignatureData(String data, String signature, String pubkey); + + /** + * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + + /** + * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); + } + + /** + * [Testnet]根据高度范围,用特定的算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + + /** + * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); + } + + /** + * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ + public static native List getRandomSeedList(long endHeight, int seedCount); + + /** + * [Testnet]根据高度范围,获取原始种子的集合 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ + public static native List getRandomSeedList(long startHeight, long endHeight); + +} +``` + +### io.nuls.contract.sdk.annotation.Payable + +`@Payable 标记@Payable的方法,才能在调用时候转入金额` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Payable { +} +``` + +### io.nuls.contract.sdk.annotation.Required + +`@Required 标记@Required的参数,调用时候必须传入值` + +```java +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Required { +} +``` + +### io.nuls.contract.sdk.annotation.View + +`@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。` + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface View { +} +``` + +## 6. 智能合约主要的RPC接口 + +这里列举几个接口的参数结构及简单实例,其他接口请参见[Swagger UI](http://127.0.0.1:8001/docs#/) +> 测试网的`Swagger UI`的端口默认是8001,正式网的端口默认是6001 + +### 6.1 创建智能合约 + +- POST `/api/contract/create` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|gasLimit*| long| 最大gas消耗| +|price* | long| 执行合约单价| +|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| +|remark |string |备注| +|args |string[][]|参数列表| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "gasLimit": 4687, + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "remark": "asd", + "args": [] +} +``` + + + +### 6.2 估算创建智能合约的Gas消耗 + +- POST `/api/contract/imputedgas/create` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|price* | long| 执行合约单价| +|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| +|args |string[][]|参数列表| + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "price": 20, + "password": "xxx", + "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", + "args": [] +} +``` + + + +### 6.3 调用智能合约 + +- POST `/api/contract/call` + +|参数|类型|说明| +|:-:|:-:|:-:| +|sender* |string |交易创建者| +|password* |string| 交易创建者账户密码| +|contractAddress* |string| 智能合约地址| +|gasLimit* | long| 最大Gas消耗| +|price* | long| 执行合约单价| +|value |long| 交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)| +|methodName* |string| 方法名| +|methodDesc |string| 方法签名,如果方法名不重复,可以不传| +|remark |string| 备注| +|args |string[][]|参数列表| + + +- Example Value + +```json +{ + "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", + "password": "", + "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U", + "gasLimit": 8000, + "price": 20, + "value": 0, + "methodName": "balance", + "methodDesc": "", + "remark": "qwe" + "args": [] +} +``` + + +### 6.4 估算调用智能合约的Gas消耗(参见`Swagger UI`) + +- POST `/api/contract/imputedgas/call` + + + +### 6.5 估算智能合约的price(参见`Swagger UI`) +- POST `/api/contract/imputedprice` + + + +### 6.6 终止智能合约(参见`Swagger UI`) + +- POST `/api/contract/delete` + + + +### 6.7 调用不上链的智能合约函数(参见`Swagger UI`) + +- POST `/api/contract/view` + + + +### 6.8 获取智能合约执行结果(参见`Swagger UI`) + +- GET `/api/contract/result/{hash}` + + + +### 6.9 获取智能合约基本信息(参见`Swagger UI`) + +- GET `/api/contract/info/{address}` + + + +### 6.10 验证是否为合约地址(参见`Swagger UI`) + +- GET `/api/contract/{address}` + + + +### 6.11 获取智能合约地址的NULS余额(参见`Swagger UI`) + +- GET `/api/contract/balance/{address}` + + + +### 6.12 获取智能合约交易详情(参见`Swagger UI`) + +- GET `/api/contract/tx/{hash}` + + + +### 6.13 获取智能合约的交易列表(参见`Swagger UI`) + +- GET `/api/contract/tx/list/{address}` + + +### 6.14 根据address和limit查询合约UTXO(参见`Swagger UI`) + +- GET `/api/contract/limit/{address}/{limit}` + + + +### 6.15 根据address和amount查询合约UTXO(参见`Swagger UI`) + +- GET `/api/contract/amount/{address}/{amount}` + + +### 6.16 向智能合约转账(参见`Swagger UI`) + +- POST `/api/contract/transfer` + + + +## 7. 示例 + +### 7.1 投票智能合约代码`片段`, 如下 + +> 完整代码: `https://github.com/nuls-io/nuls-vote` + +```java +package io.nuls.vote.contract; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Utils; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.View; +import io.nuls.vote.contract.func.BaseVote; +import io.nuls.vote.contract.func.VoteInterface; +import io.nuls.vote.contract.model.VoteConfig; +import io.nuls.vote.contract.model.VoteEntity; + +import java.math.BigInteger; +import java.util.List; +import java.util.Map; + +public class VoteContract implements Contract { + + private VoteInterface baseVote; + + public VoteContract(long minRecognizance) { + baseVote = new BaseVote(BigInteger.valueOf(minRecognizance)); + } + + @Payable + public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) { + VoteEntity voteEntity = baseVote.create(title, desc, items); + + VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify); + boolean success = baseVote.init(voteEntity.getId(), config); + + Utils.require(success); + + return voteEntity; + } + + public boolean vote(long voteId, long[] itemIds) { + return baseVote.vote(voteId, itemIds); + } + + public boolean redemption(long voteId) { + return baseVote.redemption(voteId); + } + + @View + public boolean canVote(long voteId) { + return baseVote.canVote(voteId); + } + + @View + public VoteEntity queryVote(long voteId) { + return baseVote.queryVote(voteId); + } + + @View + public Map> queryVoteResult(long voteId) { + return baseVote.queryVoteResult(voteId); + } + + @View + public boolean queryAddressHasVote(long voteId, Address address) { + return baseVote.queryAddressHasVote(voteId, address); + } +} + +``` + +智能合约的方法中如果有`数组类型`的参数,请使用如下方式传递参数 +> 参考以上投票合约代码中的`create`方法 + +```json +{ + "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", + "password": "", + "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", + "gasLimit": 200000, + "price": 1, + "value": 10000000000, + "methodName": "create", + "methodDesc": "", + "remark": "", + "args": [ + "测试投票1", + "第一个投票合约", + [ + "第一个选项", + "第二个选项", + "第三个选项" + ], + 1536044066056, 1536184066056, false, 300, false + ] +} +``` + + +### 7.2 Standard Token 智能合约代码`片段` + +> 完整代码: `https://github.com/nuls-io/nuls-nrc20` + +```java +package io.nuls.contract.token; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Msg; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; +import java.util.HashMap; +import java.util.Map; + +import static io.nuls.contract.sdk.Utils.emit; +import static io.nuls.contract.sdk.Utils.require; + +public class SimpleToken implements Contract, Token { + + private final String name; + private final String symbol; + private final int decimals; + private BigInteger totalSupply = BigInteger.ZERO; + + private Map balances = new HashMap(); + private Map> allowed = new HashMap>(); + + @Override + @View + public String name() { + return name; + } + + @Override + @View + public String symbol() { + return symbol; + } + + @Override + @View + public int decimals() { + return decimals; + } + + @Override + @View + public BigInteger totalSupply() { + return totalSupply; + } + + public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) { + this.name = name; + this.symbol = symbol; + this.decimals = decimals; + totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));; + balances.put(Msg.sender(), totalSupply); + emit(new TransferEvent(null, Msg.sender(), totalSupply)); + } + + @Override + @View + public BigInteger allowance(@Required Address owner, @Required Address spender) { + Map ownerAllowed = allowed.get(owner); + if (ownerAllowed == null) { + return BigInteger.ZERO; + } + BigInteger value = ownerAllowed.get(spender); + if (value == null) { + value = BigInteger.ZERO; + } + return value; + } + + @Override + public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) { + subtractAllowed(from, Msg.sender(), value); + subtractBalance(from, value); + addBalance(to, value); + emit(new TransferEvent(from, to, value)); + return true; + } + + @Override + @View + public BigInteger balanceOf(@Required Address owner) { + require(owner != null); + BigInteger balance = balances.get(owner); + if (balance == null) { + balance = BigInteger.ZERO; + } + return balance; + } + + @Override + public boolean transfer(@Required Address to, @Required BigInteger value) { + subtractBalance(Msg.sender(), value); + addBalance(to, value); + emit(new TransferEvent(Msg.sender(), to, value)); + return true; + } + + @Override + public boolean approve(@Required Address spender, @Required BigInteger value) { + setAllowed(Msg.sender(), spender, value); + emit(new ApprovalEvent(Msg.sender(), spender, value)); + return true; + } + + public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) { + addAllowed(Msg.sender(), spender, addedValue); + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) { + check(subtractedValue); + BigInteger oldValue = allowance(Msg.sender(), spender); + if (subtractedValue.compareTo(oldValue) > 0) { + setAllowed(Msg.sender(), spender, BigInteger.ZERO); + } else { + subtractAllowed(Msg.sender(), spender, subtractedValue); + } + emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); + return true; + } + + private void addAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance); + check(value); + setAllowed(address1, address2, allowance.add(value)); + } + + private void subtractAllowed(Address address1, Address address2, BigInteger value) { + BigInteger allowance = allowance(address1, address2); + check(allowance, value, "Insufficient approved token"); + setAllowed(address1, address2, allowance.subtract(value)); + } + + private void setAllowed(Address address1, Address address2, BigInteger value) { + check(value); + Map address1Allowed = allowed.get(address1); + if (address1Allowed == null) { + address1Allowed = new HashMap(); + allowed.put(address1, address1Allowed); + } + address1Allowed.put(address2, value); + } + + private void addBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(value, "The value must be greater than or equal to 0."); + check(balance); + balances.put(address, balance.add(value)); + } + + private void subtractBalance(Address address, BigInteger value) { + BigInteger balance = balanceOf(address); + check(balance, value, "Insufficient balance of token."); + balances.put(address, balance.subtract(value)); + } + + private void check(BigInteger value) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0); + } + + private void check(BigInteger value1, BigInteger value2) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0); + } + + private void check(BigInteger value, String msg) { + require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg); + } + + private void check(BigInteger value1, BigInteger value2, String msg) { + check(value1); + check(value2); + require(value1.compareTo(value2) >= 0, msg); + } + + + +} + +``` + + + + + diff --git a/docs/zh/NULS1.0/guessTheSize.md b/docs/zh/NULS1.0/guessTheSize.md new file mode 100644 index 00000000..3d480f87 --- /dev/null +++ b/docs/zh/NULS1.0/guessTheSize.md @@ -0,0 +1,97 @@ +# 猜大小游戏客户端操作手册 + + +> 目前猜大小游戏合约部署在测试网上运行,如果需要测试网NULS,可[进行申请](http://testnet.wallet.nuls.io/#/testNetNULS/testNetNULS) + +#### 合约地址:TTb4653R7bUL9Pw2qKLtS4K7FiWKnZ8N + +## 查找合约 + +1 打开钱包客户端,点击顶部【合约】菜单 + +2 点击【查找合约】,在输入框中填入合约地址,点击访问。即可查找到该合约 + +![1547780793](./guessTheSize/1547780793.png) + +3 还可点击合约右侧的星进行收藏。收藏后可在【我的合约】中看到该合约 + +## 创建游戏 + +1 下拉列表中选择【createGame】方法 + +2 在【selection】输入框中填写值: + +- 0代表【猜小】 +- 1代表【猜大】 + +3 点击【高级选项】,在【value】输入框中填入值,该值代表本轮猜大小游戏中你所下注的NULS数量 + +![1547628483706](./guessTheSize/1547627744781.png) + +4 点击【调用】按钮,创建本轮游戏 + +5 从返回结果中找到该轮游戏的ID + +![1547628433529](./guessTheSize/1547628433529.png) + +## 加入游戏 + +1 从游戏创建者或等待参与的游戏列表中拿到想要参与的某轮游戏ID + +2 在下拉列表中选择【joinGame】方法,在【gameId】输入框中填入本轮游戏的ID + +3 点击【高级选项】,在【value】输入框中填入下注的NULS数量,且该数量要和创建者的下注数量相同 + +![1547628433529](./guessTheSize/1547628433529.png) + +4 点击【调用】按钮,加入游戏 + +## 开奖 + +> 为防止技术作弊,合约会要求随机确认几个块才可开奖,上限为10。因此加入游戏后最多确认10个块之后即可进行开奖 + +1 下拉列表中选择【draw】方法,【gameID】输入框中填入本轮游戏的ID + +![1547629113708](./guessTheSize/1547629113708.png) + +2 点击【调用】按钮,进行开奖。调用完成后会返回游戏结果,且合约会将赢得的NULS和抵押的NULS一起转入获胜账户地址 + +> 由于需防止技术作弊, + +![1547629614931](./guessTheSize/1547629614931.png) + +## 撤销游戏 + +> 若创建游戏100个块之后还没有参与者,则本轮游戏创建者可选择撤销游戏,拿回下注的NULS + +1 下拉列表中选择【interrupt】 + +2 【gameId】输入框中填入想要撤销游戏的Id,点击【调用】按钮,即可撤销该轮游戏 + +![1547631195826](./guessTheSize/1547631195826.png) + +## 查看游戏详情 + +1 下拉列表中选择【viewGameDetail】 + +2 【gameId】输入框中填入想要查询游戏的Id,点击【调用】按钮,即可获取该轮游戏详情 + +![1547630048933](./guessTheSize/1547630048933.png) + +## 查看本合约创建了多少个游戏 + +下拉列表中选择【viewGamesTotalCount】方法,点击【调用】按钮即可 + +![1547630351497](./guessTheSize/1547630351497.png) + +## 查看等待参与的游戏 + +下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可 + +![1547630438203](./guessTheSize/1547630438203.png) + +## 查看等待开奖的游戏 + +下拉列表中选择【listRunningGames】方法,点击【调用】按钮即可 + +![1547630589355](./guessTheSize/1547630589355.png) \ No newline at end of file diff --git a/docs/zh/NULS1.0/guessTheSize/1547627744781.png b/docs/zh/NULS1.0/guessTheSize/1547627744781.png new file mode 100644 index 00000000..bd27d5cb Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547627744781.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547628433529.png b/docs/zh/NULS1.0/guessTheSize/1547628433529.png new file mode 100644 index 00000000..bfceb4f4 Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547628433529.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547628729315.png b/docs/zh/NULS1.0/guessTheSize/1547628729315.png new file mode 100644 index 00000000..40f53c1d Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547628729315.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547629113708.png b/docs/zh/NULS1.0/guessTheSize/1547629113708.png new file mode 100644 index 00000000..43a0c2c7 Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547629113708.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547629614931.png b/docs/zh/NULS1.0/guessTheSize/1547629614931.png new file mode 100644 index 00000000..b5c8e379 Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547629614931.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547630048933.png b/docs/zh/NULS1.0/guessTheSize/1547630048933.png new file mode 100644 index 00000000..090ad76a Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547630048933.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547630351497.png b/docs/zh/NULS1.0/guessTheSize/1547630351497.png new file mode 100644 index 00000000..61966d34 Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547630351497.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547630438203.png b/docs/zh/NULS1.0/guessTheSize/1547630438203.png new file mode 100644 index 00000000..1f45008c Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547630438203.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547630589355.png b/docs/zh/NULS1.0/guessTheSize/1547630589355.png new file mode 100644 index 00000000..897368db Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547630589355.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547631195826.png b/docs/zh/NULS1.0/guessTheSize/1547631195826.png new file mode 100644 index 00000000..397e8948 Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547631195826.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547632381269.png b/docs/zh/NULS1.0/guessTheSize/1547632381269.png new file mode 100644 index 00000000..d9fa796a Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547632381269.png differ diff --git a/docs/zh/NULS1.0/guessTheSize/1547780793.png b/docs/zh/NULS1.0/guessTheSize/1547780793.png new file mode 100644 index 00000000..dc4ea67d Binary files /dev/null and b/docs/zh/NULS1.0/guessTheSize/1547780793.png differ diff --git a/docs/zh/NULS1.0/ideaPlugin.md b/docs/zh/NULS1.0/ideaPlugin.md new file mode 100644 index 00000000..188eaca6 --- /dev/null +++ b/docs/zh/NULS1.0/ideaPlugin.md @@ -0,0 +1,99 @@ +# IDEA插件 + +#### 1 在IDEA安装NULS插件 +- [获取NULS插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)ZIP包,存放在磁盘 +点击File->Settings->Plugin->Install plugin from disk + +![Install](./pluginImages/Install.jpg) + +- 选择之前获取到的ZIP包,然后点击OK + +![Install](./pluginImages/Install2.jpg) + +- 勾选上NULS插件,点击Apply + +![Install](./pluginImages/Install3.jpg) + +#### 2 创建一个NULS项目 + +![create](./pluginImages/createProject.jpg) + +输入Project名,点击finish + + +![create](./pluginImages/createProject2.jpg) + +#### 3 编写智能合约 + +智能合约代码编写可查看[开发者文档](http://dev.nuls.io/contract/) + +![code](./pluginImages/code.jpg) + +#### 4 设置部署合约的节点和账户 + +- 点击右方的NULS插件,调出NULS插件面板 + + ![code](./pluginImages/Deploy.jpg) + +- 插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址 + + 点击面板左上角的+号,选择Add Node + + ![code](./pluginImages/Add.jpg) + +- 输入Node地址,点击OK + + ![code](./pluginImages/Add3.jpg) + +- 点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK + + ![code](./pluginImages/Add5.jpg) + +#### 5 打包合约 + +- 点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码 + + ![code](./pluginImages/package.jpg) + +- 可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤) + + ![code](./pluginImages/package1.jpg) + +- 点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面 + + ![code](./pluginImages/package3.jpg) + + ![code](./pluginImages/package2.jpg) + +#### 6 部署合约 + +- 在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径 + + ![code](./pluginImages/package4.jpg) + +- 紧接JarFilePath的参数为该合约构造函数的参数 + + ![code](./pluginImages/Deploy2.jpg) + +- 点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败 + + ![code](./pluginImages/Deploy3.jpg) + +- 点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息 + + ![code](./pluginImages/Deploy4.jpg) + +- 若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功 + + ![code](./pluginImages/Deploy5.jpg) + +- 可在面板上方查看已部署的合约 + + ![code](./pluginImages/Deploy6.jpg) + +- 点击部署成功的合约,可查看该合约的所有方法 + + ![code](./pluginImages/Deploy7.jpg) + + + diff --git a/docs/zh/NULS1.0/images/image-20190103193901967.png b/docs/zh/NULS1.0/images/image-20190103193901967.png new file mode 100644 index 00000000..5333535f Binary files /dev/null and b/docs/zh/NULS1.0/images/image-20190103193901967.png differ diff --git a/docs/zh/NULS1.0/img/1546518367717.png b/docs/zh/NULS1.0/img/1546518367717.png new file mode 100644 index 00000000..52ffebcd Binary files /dev/null and b/docs/zh/NULS1.0/img/1546518367717.png differ diff --git a/docs/zh/NULS1.0/img/1546518556230.png b/docs/zh/NULS1.0/img/1546518556230.png new file mode 100644 index 00000000..3efe6603 Binary files /dev/null and b/docs/zh/NULS1.0/img/1546518556230.png differ diff --git a/docs/zh/NULS1.0/img/1546518956812.png b/docs/zh/NULS1.0/img/1546518956812.png new file mode 100644 index 00000000..f750592e Binary files /dev/null and b/docs/zh/NULS1.0/img/1546518956812.png differ diff --git a/docs/zh/NULS1.0/img/1546519370742.png b/docs/zh/NULS1.0/img/1546519370742.png new file mode 100644 index 00000000..fb1f2b6c Binary files /dev/null and b/docs/zh/NULS1.0/img/1546519370742.png differ diff --git a/docs/zh/NULS1.0/img/1546519505355.png b/docs/zh/NULS1.0/img/1546519505355.png new file mode 100644 index 00000000..f39780b7 Binary files /dev/null and b/docs/zh/NULS1.0/img/1546519505355.png differ diff --git a/docs/zh/NULS1.0/img/1546519548787.png b/docs/zh/NULS1.0/img/1546519548787.png new file mode 100644 index 00000000..99653773 Binary files /dev/null and b/docs/zh/NULS1.0/img/1546519548787.png differ diff --git a/docs/zh/NULS1.0/img/1546520020388.png b/docs/zh/NULS1.0/img/1546520020388.png new file mode 100644 index 00000000..753bfa6c Binary files /dev/null and b/docs/zh/NULS1.0/img/1546520020388.png differ diff --git a/docs/zh/NULS1.0/img/1546520382686.png b/docs/zh/NULS1.0/img/1546520382686.png new file mode 100644 index 00000000..b088b4b0 Binary files /dev/null and b/docs/zh/NULS1.0/img/1546520382686.png differ diff --git a/docs/zh/NULS1.0/img/1546520727643.png b/docs/zh/NULS1.0/img/1546520727643.png new file mode 100644 index 00000000..6f0fd5fc Binary files /dev/null and b/docs/zh/NULS1.0/img/1546520727643.png differ diff --git a/docs/zh/NULS1.0/img/1546586728639.png b/docs/zh/NULS1.0/img/1546586728639.png new file mode 100644 index 00000000..92909f3a Binary files /dev/null and b/docs/zh/NULS1.0/img/1546586728639.png differ diff --git a/docs/zh/NULS1.0/pluginImages/1536204986(1).jpg b/docs/zh/NULS1.0/pluginImages/1536204986(1).jpg new file mode 100644 index 00000000..883d2208 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/1536204986(1).jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Add.jpg b/docs/zh/NULS1.0/pluginImages/Add.jpg new file mode 100644 index 00000000..553c9214 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Add.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Add3.jpg b/docs/zh/NULS1.0/pluginImages/Add3.jpg new file mode 100644 index 00000000..350a0607 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Add3.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Add5.jpg b/docs/zh/NULS1.0/pluginImages/Add5.jpg new file mode 100644 index 00000000..e792346e Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Add5.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy.jpg b/docs/zh/NULS1.0/pluginImages/Deploy.jpg new file mode 100644 index 00000000..785777cc Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy2.jpg b/docs/zh/NULS1.0/pluginImages/Deploy2.jpg new file mode 100644 index 00000000..f6940952 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy2.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy3.jpg b/docs/zh/NULS1.0/pluginImages/Deploy3.jpg new file mode 100644 index 00000000..e36e5cdf Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy3.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy4.jpg b/docs/zh/NULS1.0/pluginImages/Deploy4.jpg new file mode 100644 index 00000000..b2dfa5bb Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy4.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy5.jpg b/docs/zh/NULS1.0/pluginImages/Deploy5.jpg new file mode 100644 index 00000000..54c8794a Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy5.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy6.jpg b/docs/zh/NULS1.0/pluginImages/Deploy6.jpg new file mode 100644 index 00000000..408490e8 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy6.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Deploy7.jpg b/docs/zh/NULS1.0/pluginImages/Deploy7.jpg new file mode 100644 index 00000000..ffbaa9f7 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Deploy7.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Install.jpg b/docs/zh/NULS1.0/pluginImages/Install.jpg new file mode 100644 index 00000000..f4a00a94 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Install.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Install2.jpg b/docs/zh/NULS1.0/pluginImages/Install2.jpg new file mode 100644 index 00000000..f413512b Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Install2.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/Install3.jpg b/docs/zh/NULS1.0/pluginImages/Install3.jpg new file mode 100644 index 00000000..fd11c850 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/Install3.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/code.jpg b/docs/zh/NULS1.0/pluginImages/code.jpg new file mode 100644 index 00000000..9f40aca1 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/code.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/createProject.jpg b/docs/zh/NULS1.0/pluginImages/createProject.jpg new file mode 100644 index 00000000..a7c0a6c3 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/createProject.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/createProject2.jpg b/docs/zh/NULS1.0/pluginImages/createProject2.jpg new file mode 100644 index 00000000..494ea971 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/createProject2.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/package.jpg b/docs/zh/NULS1.0/pluginImages/package.jpg new file mode 100644 index 00000000..2353f253 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/package.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/package1.jpg b/docs/zh/NULS1.0/pluginImages/package1.jpg new file mode 100644 index 00000000..19073268 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/package1.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/package2.jpg b/docs/zh/NULS1.0/pluginImages/package2.jpg new file mode 100644 index 00000000..eabd322b Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/package2.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/package3.jpg b/docs/zh/NULS1.0/pluginImages/package3.jpg new file mode 100644 index 00000000..bdbf4eeb Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/package3.jpg differ diff --git a/docs/zh/NULS1.0/pluginImages/package4.jpg b/docs/zh/NULS1.0/pluginImages/package4.jpg new file mode 100644 index 00000000..34fc4242 Binary files /dev/null and b/docs/zh/NULS1.0/pluginImages/package4.jpg differ diff --git a/docs/zh/NULS1.0/randomImplementations.md b/docs/zh/NULS1.0/randomImplementations.md new file mode 100644 index 00000000..c91e8fcf --- /dev/null +++ b/docs/zh/NULS1.0/randomImplementations.md @@ -0,0 +1,70 @@ +## 随机数的几种实现方式 + +> 参考资料: +> +> [Solidity Pitfalls: Random Number Generation for Ethereum](https://www.sitepoint.com/solidity-pitfalls-random-number-generation-for-ethereum/) +> +> [Predicting Random Numbers in Ethereum Smart Contracts](https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620) + +### 1. `线性同余发生器(LCG)`算法获取伪随机数 + +NULS智能合约的SDK中提供了一种获取随机数的方式,它采用当前块的矿工地址、合约地址、合约调用者地址、当前块的时间戳作为随机因子,使用`线性同余发生器(LCG)`算法获取伪随机数 + +调用方式如下: + +```java +io.nuls.contract.sdk.Utils.pseudoRandom(); +/** + * 增加一个随机因子 + */ +io.nuls.contract.sdk.Utils.pseudoRandom(long seed); +``` + +-- + +### 2. 使用未来块的`BlockHash` + +以彩票为例,抽奖需要调用两次合约交易,第一次,结束彩票,第二次,抽奖 + +第一次结束彩票后,记录当前块高度H1,并生成一个数字N,在未来区块高度达到`H1+N`的时候,才能抽奖 + +第二次抽奖时,根据第一次记录的块高度H1再加上(0~80]个块(待定)得到块高度H2,获取H2这个块的`BlockHash`,以它作为随机种子 + +ETH不能使用这种方式的原因如下: +![](https://cdn-images-1.medium.com/max/1600/1*eyNTfWTkmM-3YuMca-1H0A.png) + +-- + +### 3. 随机种子限定在参与者内 + +以彩票为例,我们需要更多任意数据来挑选我们的赢家。当我们开奖时,我们可以使用已经进入我们的彩票智能合约的玩家的地址作为随机因子,以此产生随机数。 + +-- + +### 4. commit-reveal + +同样以彩票为例 + +* 合约为随机数留出奖励。 + +* 每个用户生成他们自己的秘密随机数 N。 + +* 用户通过散列他们N和地址来创建他们的秘密随机数的哈希值:String hash = sha3(N + Msg.sender())。 + + 注意:步骤2和3应在本地秘密进行,例如用户把N提交到彩票应用中,彩票应用完成hash运算 + +* 用户将其哈希值发送给智能合约。 + +* 提交的内容将持续一定数量的块,或者直到有足够的参与者加入。 + +* 一旦提交轮次结束,揭幕轮开始。 + +* 每个用户将其随机数提交N给智能合约。 + +* 合约验证sha3(N + Msg.sender())匹配原始提交。 + +* 如果用户未及时提交有效N,则他的存款将被没收。 + +* 把所有验证过的N 进行 XOR 异或运算得到随机数。 + +* 该数字用于确定哪些参与者获得奖励 --->(N % numUsers)。 diff --git a/docs/zh/NULS1.0/randomRPC.md b/docs/zh/NULS1.0/randomRPC.md new file mode 100644 index 00000000..3c0ee145 --- /dev/null +++ b/docs/zh/NULS1.0/randomRPC.md @@ -0,0 +1,353 @@ +# 钱包增加随机种子 +## 一 、钱包增加随机种子RPC接口 + +获取的随机种子是大数字,注意,它可能是负数 + +### 根据高度区间获取随机种子列表: + +URL:/random/seeds/height + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| ----------- | ---- | -------- | -------------------------------------- | +| startHeight | Long | True | 区间起始高度 | +| endHeight | Long | True | 区间截止高度,不能超过startHeight+1000 | + +Returns: + +| field | type | Remark | +| ------- | ------- | -------- | +| success | boolean | 是否成功 | +| data | array | 种子数组 | + +Example: + +Request: + +``` +curl -X GET "http://127.0.0.1:8001/api/random/seeds/height?startHeight=500&endHeight=510" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": [ + "8486473738212806059384942122915964966516544811115122625378589706648696927875", + "5763677830362183770819418466587054532227472729077319516033962399030101482330", + "-21576822359476915572374120992682286995340746526938743512234391635989859550499", + "21657748356022199241379814087980601843534504184851063250908405386419429001546", + "-31320197741848993348465901825403870475226356831977749494101003161293910010564", + "16054257794265746474880657765642725318937086559191102027715411501558318980478", + "39222628335763902261547055653161137231901517785016195993008289217415793052023", + "28759812140738813907858073405869390691919557824743093132519210315994120629868", + "26779511442264535228335930919961858598639368721086477781863239801135250744386", + "-23481782415506504277094909296039579696138464413290902597168011374639343982630" + ] +} +``` + +### 根据高度区间获取随机种子列表: + +URL:/random/seeds/count + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| --------- | ---- | -------- | ------------------------- | +| height | Long | True | 获取种子列表的最高高度 | +| count | Long | True | 随机种子数量,不能超过128 | + +Returns: + +| field | type | Remark | +| ------- | ------- | -------- | +| success | boolean | 是否成功 | +| data | array | 种子数组 | + +Example: + +Request: + +``` +curl -X GET "http://127.0.0.1:8001/api/random/seeds/count?height=500&count=10" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": [ + "8486473738212806059384942122915964966516544811115122625378589706648696927875", + "5763677830362183770819418466587054532227472729077319516033962399030101482330", + "-21576822359476915572374120992682286995340746526938743512234391635989859550499", + "21657748356022199241379814087980601843534504184851063250908405386419429001546", + "-31320197741848993348465901825403870475226356831977749494101003161293910010564", + "16054257794265746474880657765642725318937086559191102027715411501558318980478", + "39222628335763902261547055653161137231901517785016195993008289217415793052023", + "28759812140738813907858073405869390691919557824743093132519210315994120629868", + "26779511442264535228335930919961858598639368721086477781863239801135250744386", + "-23481782415506504277094909296039579696138464413290902597168011374639343982630" + ] +} +``` + +### 根据算法计算通过高度区间获取的随机种子列表为一个随机种子,并返回: + +URL:/random/seed/height + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| ----------- | ------ | -------- | -------------------------------------------- | +| startHeight | Long | True | 区间起始高度 | +| endHeight | Long | True | 区间截止高度,endHeight-startHeight<=1000 | +| algorithm | String | false | 默认为sha3算法,支持sha3、KECCAK、merkle算法 | + +Returns: + +| field | type | Remark | +| --------- | ------- | ------------------ | +| success | boolean | 是否成功 | +| data | Object | 结果对象 | +| seed | String | 计算的随机种子结果 | +| algorithm | String | 计算的 算法 | +| count | int | 原始随机种子个数 | + +Example: + +Request: + +``` +curl -X GET "http://192.168.1.123:8001/api/random/seed/height?startHeight=600&endHeight=610&algorithm=sha3" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": { + "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457", + "algorithm": "sha3", + "count": 10 + } +} +``` + +### 根据算法计算通过高度和数量获取的随机种子列表为一个随机种子,并返回: + +URL:/random/seed/count + +Method:GET + +Prams: + +| parameter | type | Required | remark | +| --------- | ------ | -------- | -------------------------------------------- | +| height | Long | True | 获取种子列表的最高高度 | +| count | Long | True | 随机种子数量,不能超过128 | +| algorithm | String | false | 默认为sha3算法,支持sha3、KECCAK、merkle算法 | + +Returns: + +| field | type | Remark | +| --------- | ------- | ------------------ | +| success | boolean | 是否成功 | +| data | Object | 结果对象 | +| seed | String | 计算的随机种子结果 | +| algorithm | String | 计算的 算法 | +| count | int | 原始随机种子个数 | + +Example: + +Request: + +``` +curl -X GET "http://192.168.1.123:8001/api/random/seed/count?height=600&count=10&algorithm=merkle" -H "accept: application/json" +``` + +Response: + +``` +{ + "success": true, + "data": { + "seed": "49349273589710891971526183625401126395677304794754035539210022261211357904457", + "algorithm": "merkle", + "count": 10 + } +} +``` + +## 二、智能合约支持底层链随机数 + +与以上RPC接口相同,在智能合约SDK中支持了相同的方法来获取底层区块链提供的随机数种子,如以下代码。 +后面将以其中一个方法`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)`为例,展示如何使用随机数种子产生随机数。 + +### 1) io.nuls.contract.sdk.Utils + +```java +/** + * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ +public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + +/** + * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ +public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); +} + +/** + * [Testnet]根据高度范围,用特定的算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ +public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + +/** + * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ +public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); +} + +/** + * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ +public static native List getRandomSeedList(long endHeight, int seedCount); + +/** + * [Testnet]根据高度范围,获取原始种子的集合 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ +public static native List getRandomSeedList(long startHeight, long endHeight); +``` + +### 2) 例子`同时摇N一个骰子` + +#### 2.1) 计算方式一 + +- 获取原始种子`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)` +- 根据骰子范围求模得到第一个随机数 +- 下一个随机数的计算方式 + - 原始种子乘以投掷次数,得到的结果转换成字节数组 + - 把字节数组进行SHA3-256得到32位字节数组的Hash + - 把此Hash的字节数组转换为BigInteger大数字 + - 将此BigInteger大数字根据骰子范围求模得到下一个随机数 + - 以此类推 + +**参考以下代码** + +```java +public List dice(long endHeight, int count, int range, int times) { + BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3"); + if (orginSeed.equals(BigInteger.ZERO)) { + return null; + } + BigInteger wrapperRange = BigInteger.valueOf((long) range); + List resultList = new ArrayList(times); + for (int i = 0; i < times; i++) { + if(i == 0) { + BigInteger mod = orginSeed.mod(wrapperRange); + resultList.add(mod.intValue()); + } else { + BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(i + 1)); + String s = sha3(multiply.toByteArray()); + byte[] decode = decode(s); + BigInteger bigInteger = new BigInteger(decode); + BigInteger mod = bigInteger.mod(wrapperRange); + resultList.add(mod.intValue()); + } + } + return resultList; +} + +public byte[] decode(String hexString) { + byte[] bts = new byte[hexString.length() / 2]; + for (int i = 0; i < bts.length; i++) { + bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16); + } + return bts; +} +``` + +#### 2.2) 计算方式二 + +- 获取原始种子`Utils.getRandomSeed(long endHeight, int seedCount, String algorithm)` +- 根据骰子范围求模得到第一个随机数 +- 下一个随机数的计算方式 + - 获取原始种子大数字的末位数字(根据投掷次数获取倒数第几位),将此末位数字乘以原始种子,得到的结果转换成字节数组 + - 把字节数组进行SHA3-256得到32位字节数组的Hash + - 把此Hash的字节数组转换为BigInteger大数字 + - 将此BigInteger大数字根据骰子范围求模得到下一个随机数 + - 以此类推 + +**参考以下代码** + +```java +public List diceAnother(long endHeight, int count, int range, int times) { + BigInteger orginSeed = getRandomSeed(endHeight, count, "sha3"); + if (orginSeed.equals(BigInteger.ZERO)) { + return null; + } + BigInteger wrapperRange = BigInteger.valueOf((long) range); + List resultList = new ArrayList(times); + BigInteger mod = orginSeed.mod(wrapperRange); + resultList.add(mod.intValue()); + String orginStr = orginSeed.toString(); + int length = orginStr.length(); + for (int i = 1; i < times; i++) { + int c = orginStr.charAt(length - i); + BigInteger multiply = orginSeed.multiply(BigInteger.valueOf(c)); + String s = sha3(multiply.toByteArray()); + byte[] decode = decode(s); + BigInteger bigInteger = new BigInteger(decode); + mod = bigInteger.mod(wrapperRange); + resultList.add(mod.intValue()); + } + return resultList; +} + +public byte[] decode(String hexString) { + byte[] bts = new byte[hexString.length() / 2]; + for (int i = 0; i < bts.length; i++) { + bts[i] = (byte) Integer.parseInt(hexString.substring(2 * i, 2 * i + 2), 16); + } + return bts; +} +``` \ No newline at end of file diff --git a/docs/zh/NULS1.0/sdk.md b/docs/zh/NULS1.0/sdk.md new file mode 100644 index 00000000..2d3dc2a8 --- /dev/null +++ b/docs/zh/NULS1.0/sdk.md @@ -0,0 +1,2800 @@ + +# SDK + +## 介绍 +本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。 +### 约定 +- 所有SDK接口统一返回Result(说明见文末附件数据解释) +- 每个接口描述的返回对象是指Result中data属性的内容 +- 除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na +- 运行SDK前,需要确认NULS节点服务已经启动并工作正常 +- 推荐使用JDK1.8+ + +### 版本更新记录 + + + +| 版本 | 更新日期 | 更新内容 | +| :-------: | :--------: | :----------------------------------------------------------: | +| v0.9.11.0 | 2018-06-19 | 对接NULS服务各项基础功能的接口 | +| v0.9.11.1 | 2018-06-22 | 新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1 | +| v0.9.14 | 2018-07-04 | 修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等) | +| v0.9.15 | 2018-07-07 | 新增4个共识接口,4.1——4.4 | +| v0.9.16 | 2018-07-11 | 新增接口4.5 | +| v1.0.1 | 2018-07-13 | 新增错误码 | +| v1.1.0 | 2018-09-28 | 新增多账户转账接口 | + + + +## 快速入门 +### 1.引入文件 +使用构建工具导入jar包 + +- maven方式 + +```xml + + io.nuls.sdk + sdk-all + 1.0.1 + +``` + +### 2.创建SDK实例 +首先添加SDK命名空间 + +```java +//SDK启动类命名空间 +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +//引入SDK调用工具的命名空间 +import io.nuls.sdk.tool.NulsSDKTool; +``` + +引入后 使用下列代码生成一个实例client + +- 初始化SDK +- 初始化方法不传参数时,默认PRC ip和端口分别为`127.0.0.1`,`8001` + +```java +//默认 +SDKBootstrap.init(); +//传入NULS服务的ip,port +SDKBootstrap.init("192.168.1.88", "8001"); +``` + +- 使用工具类调用接口方法 + + +```java +Result result = NulsSDKTool.createAccount("nuls123456"); +``` + *e.g 创建一个带密码的账户的完整示例* + +```java +import io.nuls.sdk.SDKBootstrap; +import io.nuls.sdk.model.Result; +//根据需求引入对应模块的命名空间 +import io.nuls.sdk.tool.NulsSDKTool; + +public static void main(String[] args) { + SDKBootstrap.init(); + Result result = NulsSDKTool.createAccount("nuls123456"); +} +``` +-- +### 账户 AccountService +#### 1.1 创建账户 +接口 + +**`Result createAccount(int count, String password);`** + +说明 +> 创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户; +> 成功创建的账户信息将被持久化至NULS服务本地数据库中。 +> +> 返回成功创建的账户地址集合 + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data":{ + "list": [ //返回创建账户的地址集合 + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv", + "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv" + ] + } +} +``` + + +*e.g 示例代码* + +```java +//创建一个没有密码的账户 +createAccount(); +//创建一个有密码的账户 +createAccount("nuls123456"); +//创建3个没有密码的账户 +createAccount(3); +//创建3个有密码的账户 +createAccount(3, "nuls123456"); +``` +--- + +#### 1.2 创建离线账户 +接口 + +**`Result createOfflineAccount(int count, String password)`** + +说明 + +> 直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作 +> Create encrypted off-line accounts (Not saved to the database) +> +> Result.data `List` + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "list":[ + { + "address": String, 账户地址 + "alias": String, 账户别名 + "pubKey": String, 公钥 + "extend": String, 扩展 + "createTime": Long, 创建时间 + "encrypted": boolean, 是否加密 + "priKey": String, 私钥(创建无密码离线账户时才会有值) + "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) + }, + { + "address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD", + "alias": null, + "pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb", + "extend": null, + "createTime": 1529314943624, + "encrypted": true, + "priKey": "", + "encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0" + } + ] + } +} +``` + +*e.g 示例代码* + +```java +//创建一个没有密码的离线账户 +createOfflineAccount(); +//创建一个有密码的离线账户 +createOfflineAccount("nuls123456"); +//创建3个没有密码的离线账户 +createOfflineAccount(3); +//创建3个有密码的离线账户 +createOfflineAccount(3, "nuls123456"); +``` + +--- + +#### 1.3 获取账户 + +接口 + +**`Result getAccount(String address)`** + +说明 + +> 根据账户地址获取一个账户的信息 +> +> Result.data `AccountInfo` + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户的地址
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "address": String, 账户地址 + "alias": String, 账户别名 + "pubKey": String, 公钥 + "extend": String, 扩展 + "createTime": Long, 创建时间 + "encrypted": boolean, 是否加密 + "priKey": String, 私钥(创建无密码离线账户时才会有值) + "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) + } +} +``` + +*e.g 示例代码* + +```java +getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.4 获取设置别名的手续费 +接口 + +**`Result getAliasFee(String address, String alias)`** + +说明 + +> 根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费) +> +> Result.data `double`, unit is `NULS` + +**注意!** 此接口返回的手续费单位为`NULS` + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data":{ + "value": 0.01 //(单位为NULS) + } +} +``` + +*e.g 示例代码* + +```java +getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666"); +``` +--- + +#### 1.5 获取账户列表 +接口 + +**`Result getAccountList(int pageNumber, int pageSize)`** + +说明 + +> 根据分页参数获取账户列表 +> +> Result.data Page `List` + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
pageNumberint必填页码,必须大于0
pageSizeint必填每页返回数据记录数量, 取值范围1~100
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "pageNumber": 1, + "pageSize": 10, + "total": 100, + "pages": 10, + "list": [ + { + "address": String, 账户地址 + "alias": String, 账户别名 + "pubKey": String, 公钥 + "extend": String, 扩展 + "createTime": Long, 创建时间 + "encrypted": boolean, 是否加密 + "priKey": String, 私钥(创建无密码离线账户时才会有值) + "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) + }, + { + "address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP", + "alias": null, + "pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184", + "extend": null, + "createTime": 1529311250627, + "encrypted": true, + "priKey": null, + "encryptedPriKey": null + } + ... + + ] + } +} +``` + +*e.g 示例代码* + +```java +getAccountList(1, 10); +``` +--- + +#### 1.6 根据账户别名获取账户地址 +接口 + +**`Result getAddressByAlias(String alias)`** + +说明 +> 根据账户别名获取账户地址字符串 +> +> Result.data `String` + + + + + + + + + + + + + + +
参数类型是否必填说明
aliasString必填账户别名
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g 示例代码* + +```java + getAddressByAlias("factory666"); +``` +--- + +#### 1.7 获取账户私钥 +接口 + +**`Result getPrikey(String address, String password)`** + +说明 +> 根据账户地址和密码获取账户私钥,返回私钥字符串 +> +> Result.data `String` + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24" + } +} +``` +*e.g 示例代码* + +```java +//有密码的账户调用方式 +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +//无密码的账户调用方式 +getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.8 验证别名是否可以使用 +接口 + +**`Result isAliasUsable(String alias)`** + +说明 +> 根据别名名称验证别名是否可用(是否没有被使用) +> +> Result + + + + + + + + + + + + + + +
参数类型是否必填说明
aliasString必填别名名称
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ //表示别名可以使用 + "success": true, + "data": { + "value":true + } +} +``` +- 返回 别名不可用的情况 + +```json +{ //表示别名不可以使用 + "success": true, + "data":{ + "value": false + } +} +``` +- 返回错误的情况,例如参数错误 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g 示例代码* + +```java +isAliasUsable("factory666"); +``` +--- + +#### 1.9 备份账户 +接口 + +**`Result backupAccount(String address, String path, String password)`** + +说明 + +> 根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码 +> +> Result 返回生成的文件地址 + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户的地址
pathString必填将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录
passwordString非必填账户密码,如果账户没有加密则不填
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore" + } +} +``` +*e.g 示例代码* + +```java +//备份一个没有密码的账户至当前目录 +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null); +//备份一个有密码的账户至/backup目录 +backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456"); +``` +--- + +#### 1.10 导入账户 +接口 + +**`Result importAccountByKeystore`** + +说明 + +> 根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。 +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
path/fileReaderString/FileReader必填待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象
passwordString非必填.keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS" + } +} +``` +*e.g 示例代码* + +```java +//导入一个有密码的账户 +importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true); +importAccountByKeystore(fileReader, "nuls123456", true); +//导入一个没有密码的账户 +importAccountByKeystore("/backup/XXXXXX.keystore", false); +importAccountByKeystore(fileReader, false); +``` +--- + +#### 1.11 导入账户(私钥) +接口 + +**`Result importAccountByPriKey(String privateKey, String password, boolean overwrite)`** + +说明 + +> 根据私钥导入账户 +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
privateKeyString必填账户私钥
passwordString非必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS" + } +} +``` +*e.g 示例代码* + +```java +//导入账户时设置密码 +importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true); +//导入账户时不设置密码 +importAccountByPriKey("1f9d3ad044e0e120......", true); +``` +--- + +#### 1.12 验证账户是否加密 +接口 + +**`Result isEncrypted(String address)`** + +说明 + +> 验证账户是否加密 +> +> Result + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ //表示已加密 + "success": true, + "data": { + "value":true + } +} +``` +- 返回 未加密 + +```json +{ + "success": true, + "data":{ + "value": false + } +} +``` +- 返回错误的情况,例如参数错误 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +*e.g 示例代码* + +```java +isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +``` +--- + +#### 1.13 移除账户 +接口 + +**`Result removeAccount(String address, String password)`** + +说明 + +> 移除账户 +> +> Result + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ //表示成功 + "success": true, + "data": { + "value":true + } +} +``` + +- 返回不成功 以及错误的情况,例如参数错误 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g 示例代码* + +```java +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); +removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.13 设置密码 +接口 + +**`Result setPassword(String address, String password)`** + +说明 + +> 为未加密的账户设置密码,已加密账户不能调用此接口 +> +> Result + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
passwordString必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ //表示成功 + "success": true, + "data": { + "value":true + } +} +``` + +- 返回不成功 以及错误的情况,例如参数错误 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g 示例代码* + +```java +setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); +``` +--- + +#### 1.14 修改密码 +接口 + +**`Result resetPassword(String address, String password, String newPassword)`** + +说明 + +> 为已加密的账户修改密码,未加密账户不能调用此接口 +> +> Result + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
passwordString必填账户当前密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ //表示成功 + "success": true, + "data": { + "value":true + } +} +``` + +- 返回不成功 以及错误的情况,例如参数错误 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` +*e.g 示例代码* + +```java +resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111"); +``` +--- + +#### 1.15 设置别名 +接口 + +**`Result setAlias(String address, String alias, String password)`** + +说明 + +> 为账户设置一个别名 +> +> Result 返回设置别名的交易hash + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
passwordString密码账户密码,如果账户没有加密则不填
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data":{ + "value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6" + } +} +``` +- 错误示例 + +```json +{ + "success": false, + "data":{ + "code": "ACT007", + "msg": "The account already set an alias" + } +} +``` +*e.g 示例代码* + +```java +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111"); +setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666"); +``` +--- + +#### 1.16 设置离线账户密码 +接口 + +**`Result setPasswordOffline(String address, String priKey, String password)`** + +说明 + +> 设置离线账户密码, sdk中独立加密,不与NULS服务交互 +> +> Result 返回加密后的私钥(encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
priKeyString必填账户的私钥
passwordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g 示例代码* + +```java +setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456"); +``` +--- + +#### 1.17 修改离线账户密码 +接口 + +**`Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)`** + +接口 + +> 修改离线账户密码, sdk中独立修改, 不与NULS服务交互 +> +> Result 返回新密码生成的加密后的私钥(encryptedPriKey) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户的地址
encryptedPriKeyString必填加密后的私钥
passwordString必填原密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" + } +} +``` +*e.g 示例代码* + +```java +resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456"); +``` +--- + +### 交易 AccountLedgerService + +#### 2.1 创建转账交易 +接口 + +**`Result createTransaction(List inputs, List outputs, String remark)`** + +说明 + +> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
remarkString非必填交易备注
+ +*e.g 示例代码* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); + +//组装交易的inputs,示例中的input属性均必填 +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +//组装交易的outputs,示例中的output属性均必填 +Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createTransaction(inputs, outputs, remark); +``` +--- + + +> **交易手续费的计算**:手续费单价 \* 交易大小 +> +> **手续费单价(min)**:100000 NA/1KB +> +> **交易大小的计算**:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 + + + +#### 2.2 交易签名 + +接口 + +**`Result signTransaction(String txHex, String priKey, String address, String password)`** + +说明 + +> 通过私钥,给交易签名 +> +> Result.data `String` 签名后的交易,16进制后的序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
priKeyString必填交易的私钥
addressString必填私钥对应的地址,用于验证私钥合法性
passwordString非必填私钥的密码,如果私钥未加密可不传
+ +*e.g 示例代码* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"; +String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"; +String password = "NULS6352s!f"; +Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password); +``` + +> + +--- + +#### 2.3 根据交易hash查询交易详情 +接口 + +**`Result getTxByHash(String hash)`** + +说明 + +> 根据交易hash查询交易详情 +> +> Result.data `Transaction` + + + + + + + + + + + + + + +
参数类型是否必填说明
hashString必填交易的hash值
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 99900000000, + "remark": "转账", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 1, + "confirmCount": 14, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9999899000000 + } + ], + "outputs": [ + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 0, + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0, + "status": 0 + }, + { + "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "index": 1, + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0, + "status": 0 + } + ] + } +} +``` +*e.g 示例代码* + +```java +getTxByHash("041f3d2ceed........"); +``` +--- + +#### 2.4 转账 +接口 + +**`Result transfer(String address, String toAddress, String password, long amount, String remark)`** + +说明 + +> 发起转账交易 +> +> Result 返回交易hash + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填转出者账户的地址
toAddressString必填接收者账户的地址
passwordString非必填转出者账户的密码,如果账户没有加密则不填
amountlong必填转账金额(单位:Na)
remarkString必填备注
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2" + } +} +``` +*e.g 示例代码* + +```java + //账户有密码 +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "备注1NULS=10000000Na"); +//账户没有密码 +transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, "备注1NULS=10000000Na"); +``` +--- + +#### 2.5 查询账户余额 +接口 + +**`Result getBalance(String address)`** + +说明 + +> 获取账户余额 +> +> Result.data `BalanceInfo ` + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填账户地址
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "balance": 1009899998900000, + "usable": 1009899998900000, + "locked": 0 + } +} +``` +*e.g 示例代码* + +```java +getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS"); +``` +--- + +#### 2.6 广播交易 +接口 + +**`Result broadcastTransaction(String txHex);`** + +说明 + +> 广播交易 +> +> Result.data String 返回交易hash + + + + + + + + + + + + + + +
参数类型是否必填说明
txHexString必填十六进制交易序列化数据
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85" + } +} + +``` +*e.g 示例代码* + +```java +String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"; +Result result = service.broadcastTransaction(txHex); +if(result.isSuccess()) { + String txHash = (String)result.getData(); +} +``` +--- + +#### 2.7 创建多地址转账交易 + +接口 + +**`Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)`** + +说明 + +> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
nInputAccountint必填输入账户数
remarkString非必填交易备注
+ +*e.g 示例代码* + +```java +String remark = "create transaction demo"; +long fee = 100000; +List inputs = new ArrayList<>(); +List outputs = new ArrayList<>(); +int nInputAccount = 2; + +//组装交易的inputs,示例中的input属性均必填 +Input input = new Input(); +input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); +input.setFromIndex(1); +input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") +input.setValue(1000000000L); +input.setLockTime(0); +inputs.add(input); + +//组装交易的outputs,示例中的output属性均必填 +Output output = new Output(); +output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); +output.setValue(1000000L); +output.setLockTime(0L); +outputs.add(output); + +output = new Output(); +output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); +output.setValue(1000000000L - 1000000 - fee); +output.setLockTime(0L); +outputs.add(output); + +Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark); +``` + +------ + +> **交易手续费的计算**:手续费单价 \* 交易大小 +> +> **手续费单价(min)**:100000 NA/1KB +> +> **交易大小的计算**:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 +> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 + + + +#### 2.8 多地址转账交易签名 + +接口 + +**`Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)`** + +说明 + +> 通过私钥,给交易签名 +> +> Result.data `String` 签名后的交易,16进制后的序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
privKeysList必填交易的私钥
passwordsList必填私钥对应的密码(多个账户密码必须一样)
+ +*e.g 示例代码* + +```java +String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; +List priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"); +List passwords = Arrays.asList("123456","123456"); +Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords); +``` + +> + +### 区块 BlockService + +#### 3.1 根据区块高度获取区块头 +接口 + +**`Result getblockHeader(int height)`** + +说明 + +> 根据区块高度获取区块头信息 +> +> Result.data `BlockHeader ` + + + + + + + + + + + + + + +
参数类型是否必填说明
heightint必填区块高度
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g 示例代码* + +```java +getblockHeader(10); +``` +--- + +#### 3.2 根据区块hash获取区块头 +接口 + +**`Result getblockHeader(String hash)`** + +说明 + +> 根据区块hash获取区块头 +> +> Result.data `BlockHeader` + + + + + + + + + + + + + + +
参数类型是否必填说明
hashString必填区块hash值
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} +``` +*e.g 示例代码* + +```java +getblockHeader("041f3d2ceed........"); +``` +--- + +#### 3.3 根据区块高度获取区块 +接口 + +**`Result getBlock(int height)`** + +说明 + +> 根据区块高度获取区块 +> +> Result.data `Block ` + + + + + + + + + + + + + + +
参数类型是否必填说明
heightint必填区块高度
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "转账", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g 示例代码* + +```java +getBlock(10); +``` +--- + +#### 3.4 根据区块hash获取区块 +接口 + +**`Result getBlock(String hash)`** + +说明 + +> 根据区块hash获取区块 +> +> Result.data `Block ` + + + + + + + + + + + + + + +
参数类型是否必填说明
hashString必填区块hash值
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", + "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", + "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", + "time": 1529323210000, + "height": 1884, + "txCount": 1884, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", + "roundIndex": 420416, + "consensusMemberCount": 5, + "roundStartTime": 1529323170000, + "packingIndexOfRound": 4, + "confirmCount": 33, + "reward": 100000, + "fee": 100000, + "size": 5, + "txList": [ + { + "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", + "type": 1, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 54, + "inputs": [], + "outputs": [ + { + "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "value": 100000, + "lockTime": 2884 + } + ] + }, + { + "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", + "type": 2, + "time": 1529323198461, + "blockHeight": 1884, + "fee": 100000, + "value": 0, + "remark": "转账", + "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", + "status": 0, + "confirmCount": 33, + "size": 255, + "inputs": [ + { + "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", + "fromIndex": 0, + "address": null, + "value": 9999899000000 + } + ], + "outputs": [ + { + "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", + "value": 99900000000, + "lockTime": 0 + }, + { + "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", + "value": 9899998900000, + "lockTime": 0 + } + ] + }, + { + "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", + "type": 7, + "time": 1529323210000, + "blockHeight": 1884, + "fee": 0, + "value": 0, + "remark": null, + "scriptSig": null, + "status": 0, + "confirmCount": 33, + "size": 38, + "inputs": [], + "outputs": [] + } + ] + } +} +``` +*e.g 示例代码* + +```java +getBlock("041f3d2ceed........"); +``` +--- + +#### 3.5 获取最新区块头 +接口 + +**`Result getNewestBlockHash()`** + +说明 + +> 获取最新的区块头 +> +> Result.data `BlockHeader` + + +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", + "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", + "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", + "time": 1529299160000, + "height": 4, + "txCount": 4, + "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", + "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", + "roundIndex": 419517, + "consensusMemberCount": 1, + "roundStartTime": 1529299150000, + "packingIndexOfRound": 1, + "confirmCount": 1909, + "reward": 0, + "fee": 0, + "size": 1 + } +} + +``` +*e.g 示例代码* + +```java +getNewestBlockHash(); +``` +--- + +#### 3.6 获取最新区块的高度 +接口 + +**`Result getNewestBlockHight()`** + +说明 + +> 获取最新区块的高度 +> +> Result.data 高度(Long) + +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value": 5210 + } +}} + +``` +*e.g 示例代码* + +```java +getNewestBlockHight(); +``` +--- + +#### 3.7 获取最新区块的块Hash +接口 + +**`Result getNewestBlockHash()`** + +说明 + +> 获取最新区块的块Hash +> +> Result.data Hash值(String) + +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success": true, + "data": { + "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b" + } +}} + +``` +*e.g 示例代码* + +```java +getNewestBlockHash(); +``` +--- + + + +### 共识 ConsensusService + +#### 4.1 离线组装创建节点交易 + +接口 + +**` Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee) `** + +说明 + +> 离线组装创建节点交易 +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
agentInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
+ +*e.g 示例代码* + +```java +//组装交易的inputs,示例中的input属性均必填 +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +//创建节点信息,示例总AgentInfo的属性均必填 +AgentInfo info = new AgentInfo(); +info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //申请共识节点的地址 +info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"); //实际打包区块的地址 +info.setDeposit(200000 * 100000000L);//创建节点的保证金, 最低20000NULS,最高200000NULS +info.setCommissionRate(10.0); //佣金比例 1-100 + +//创建节点的手续费 +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ + +> **创建共识节点交易手续费的计算**:手续费单价 \* 交易大小 +> +> **手续费单价(min)**:1000000 NA/1KB +> +> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , +> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 + + + +#### 4.2 离线组装委托共识交易 + +接口 + +**` Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee) `** + +说明 + +> 离线组装委托共识交易 +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
depositInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
+ +*e.g 示例代码* + +```java +//组装交易的inputs,示例中的input属性均必填 +List inputs = new ArrayList<>(); +Input input = new Input(); +input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +input.setFromIndex(1); +input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +input.setValue(999998760000000L); +inputs.add(input); + +//委托共识信息,示例中DepositInfo的属性均必填 +DepositInfo info = new DepositInfo(); +info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //委托共识的地址 +info.setDeposit(300000 * 100000000L);//委托代币数量:2000NULS —— 500000NULS +info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");//创建共识节点的交易id + +//创建节点的手续费 +Na fee = Na.valueOf(1000000L); + +Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + +------ + +> **创建委托交易手续费的计算**:手续费单价 \* 交易大小 +> +> **手续费单价(min)**:1000000 NA/1KB +> +> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , +> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 +> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 + + + +#### 4.3 离线组装退出委托共识交易 + +接口 + +**` Result createCancelDepositTransaction(Output output) `** + +说明 + +> 离线组装退出委托共识交易 +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + +
参数类型是否必填说明
outputObject必填参与共识时被锁定的那条output
+ +*e.g 示例代码* + +```java +//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额, +//将output作为参数,生成退出委托共识交易 +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setValue(20000000000000L); +output.setLockTime(-1); + +Result result = NulsSDKTool.createCancelDepositTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.4 离线组装删除共识节点交易 + +接口 + +**` Result createStopAgentTransaction(Output output) `** + +说明 + +> 离线组装删除共识节点交易 +> +> Result.data `String` 16进制后的交易序列化字符串 + + + + + + + + + + + + + + +
参数类型是否必填说明
outputObject必填创建节点时被锁定的那条output
+ +*e.g 示例代码* + +```java +//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金, +//将output作为参数,生成退出委托共识交易 +Output output = new Output(); +output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); +output.setIndex(0); +output.setValue(20000000000000L); +output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); +output.setLockTime(-1); + +Result result = NulsSDKTool.createStopAgentTransaction(output); +Map map = (Map) result.getData(); +String txHex = (String) map.get("value"); +``` + + + +#### 4.5 获取委托共识列表 + +接口 + +**` Result getDeposits(String address, int pageNumber, int pageSize) `** + +说明 + +> 获取地址的委托共识列表 +> +> Result.data List委托列表信息 + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填说明
addressString必填委托地址
pageNumberInt必填页码
pageSizeInt必填每页显示条数,1-100之间
+ +返回结果 + +- 返回结果为`Result`对象,格式如下: + +```json +{ + "success":true, + "data":{ + "pageNumber":1, + "pageSize":10, + "total":1, + "pages":1, + "list":[ + { + "deposit":20000010000000, + "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c", + "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA", + "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e", + "blockHeight":98, + "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA" + } + ] + } +} +``` + +*e.g 示例代码* + +```java +Result result = NulsSDKTool.getDeposits(address, 1, 10); +``` + + + + + +### 附录 + +#### 接口返回Result示例 +##### Result + +- 表示接口访问正常,业务返回具体的数据 + +```json +{ + "success": true,//接口执行的正确性 + "data": data +} +``` +- 表示接口访问正常,业务返回true + +```json +{ //表示接口访问正常,业务返回true + "success": true,//接口执行的正确性 + "data": { + "value":true //接口业务功能的返回结果 + } +} +``` +- 表示接口访问正常,业务返回false + +```json +{ + "success": true, //接口执行的正确性 + "data":{ + "value": false //接口业务功能的返回结果 + } +} +``` +- 返回错误的情况,例如参数错误,异常等 + +```json +{ //表示错误的情况 + "success": false, + "data":{ + "code": "ACT005", + "msg": "xxxxxx...." + } +} +``` + +- 这是创建一个带密码的离线账户的完整返回结果 + +```json +{ + "success": true, + //data为List + "data": { + "list":[ + { + "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr", + "alias": null, + "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0", + "extend": null, + "createTime": 1529041525794, + "encrypted": false, + "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a", + "encryptedPriKey": "" + } + ] + } +} +``` +--- + +##### Account +```json +{ + "address": String, 账户地址 + "alias": String, 账户别名 + "pubKey": String, 公钥 + "extend": String, 扩展 + "createTime": Long, 创建时间 + "encrypted": boolean, 是否加密 + "priKey": String, 私钥(创建无密码离线账户时才会有值) + "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) +} +``` +--- + +##### Input +```json + { + "fromHash": String, 来源output的txHash + "fromIndex": Integer, 来源output的outIndex + "address": String, 转入地址 + "value": Long 转入金额 + "lockTime": Long 锁定时间 +} +``` +--- + +##### Output +```json + { + "txHash": String, 交易hash + "index": Integer, 索引 + "address": String, 地址 + "value": Long, 数量 + "lockTime": Long, 锁定时间 + "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) +} +``` +--- + +##### Transaction + +```json +{ + "hash": String, 交易的hash值 + "type": Integer, 交易类型 + "time": Long, 交易发起时间 + "blockHeight": Long, 区块高度 + "fee": Long, 交易手续费 + "value": Long, 交易金额 + "remark": String, 备注 + "scriptSig": String, 签名 + "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) + "confirmCount": Long, 确认次数 + "size": int, 大小 + "inputs": [ + { + "fromHash": String, 来源output的txHash + "fromIndex": Integer, 来源output的outIndex + "address": String, 转入地址 + "value": Long 转入金额 + } + ], + "outputs": [ + { + "txHash": String, 交易hash + "index": Integer, 索引 + "address": String, 地址 + "value": Long, 数量 + "lockTime": Long, 锁定时间 + "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) + } + ] +} +``` +--- + +##### BalanceInfo +```json +{ + "balance": long, 余额 + "usable": long, 可用余额 + locked": long 锁定余额 +} +``` +--- + +##### BlockHeader + +```json +{ + "hash": String, 区块的hash值 + "preHash": String, 上一个区块的hash值 + "merkleHash": String, 梅克尔hash + "time": Long, 区块生成时间 + "height": Long, 区块高度 + "txCount": Long, 区块打包交易数量 + "packingAddress": String, 打包地址 + "scriptSig": String, 签名 + "roundIndex": Long, 共识轮次 + "consensusMemberCount": Integer, 参与共识成员数量 + "roundStartTime": Long, 当前共识轮开始时间 + "packingIndexOfRound": Integer, 当前轮次打包出块的名次 + "confirmCount": Long, 确认次数 + "reward": Long, 共识奖励 + "fee": Long, 获取的打包手续费 + "size": int, 大小 +} +``` +--- + +##### Block + +```json +{ + "hash": String, 区块的hash值 + "preHash": String, 上一个区块的hash值 + "merkleHash": String, 梅克尔hash + "time": Long, 区块生成时间 + "height": Long, 区块高度 + "txCount": Long, 区块打包交易数量 + "packingAddress": String, 打包地址 + "scriptSig": String, 签名 + "roundIndex": Long, 共识轮次 + "consensusMemberCount": Integer, 参与共识成员数量 + "roundStartTime": Long, 当前共识轮开始时间 + "packingIndexOfRound": Integer, 当前轮次打包出块的名次 + "confirmCount": Long, 确认次数 + "reward": Long, 共识奖励 + "fee": Long, 获取的打包手续费 + "size": int, 大小 + "txList": [ + { + "hash": String, 交易的hash值 + "type": Integer, 交易类型 + "time": Long, 交易发起时间 + "blockHeight": Long, 区块高度 + "fee": Long, 交易手续费 + "value": Long, 交易金额 + "remark": String, 备注 + "scriptSig": String, 签名 + "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) + "confirmCount": Long, 确认次数 + "size": int, 大小 + "inputs": [ 输入 + { + "fromHash": String, 来源output的txHash + "fromIndex": Integer, 来源output的outIndex + "address": String, 转入地址 + "value": Long 转入金额 + } + ], + "outputs": [ 输出 + { + "address": String, 地址 + "value": Long, 数量 + "lockTime": Long, 锁定时间 + } + ] + } + ] +} +``` diff --git a/docs/zh/NULS1.0/smartContractDemo.md b/docs/zh/NULS1.0/smartContractDemo.md new file mode 100644 index 00000000..063792cd --- /dev/null +++ b/docs/zh/NULS1.0/smartContractDemo.md @@ -0,0 +1 @@ +# 示例 \ No newline at end of file diff --git a/docs/zh/NULS1.0/smartContractFee.md b/docs/zh/NULS1.0/smartContractFee.md new file mode 100644 index 00000000..fe2e30ed --- /dev/null +++ b/docs/zh/NULS1.0/smartContractFee.md @@ -0,0 +1,54 @@ +# 手续费 + +### 1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用? + +> `背景:`由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一 + +在主链上,多出三个类型的交易,`创建智能合约`, `调用智能合约`, `删除智能合约` + +三个交易与其他交易如`转账`不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一 + +* 智能合约收费计算方式 + +```java +public static final int COMPARISON = 1;//比较字节码 +public static final int CONSTANT = 1;//简单数值类型字节码 +public static final int LDC = 1;//数值常量,字符串常量(长度 * LDC) +public static final int CONTROL = 5;//控制字节码 +public static final int TABLESWITCH = 2;//switch字节码(大小 * TABLESWITCH) +public static final int LOOKUPSWITCH = 2;//switch字节码(大小 * LOOKUPSWITCH) +public static final int CONVERSION = 1;//数值转换 +public static final int EXTENDED = 1;//null判断 +public static final int MULTIANEWARRAY = 1;//多维数组(大小 * MULTIANEWARRAY) +public static final int LOAD = 1;//把本地变量送到栈顶 +public static final int ARRAYLOAD = 5;//把数组的某项送到栈顶 +public static final int MATH = 1;//数学操作及移位操作 +public static final int REFERENCE = 10;//对象相关操作 +public static final int NEWARRAY = 1;//一维数组(大小 * NEWARRAY) +public static final int STACK = 2;//栈操作 +public static final int STORE = 1;//把栈顶的值存入本地变量 +public static final int ARRAYSTORE = 5;//把栈项的值存到数组里 +public static final int TRANSFER = 1000;//转账交易 + +``` + +* 一次智能合约总手续费 + + 一次合约交易的总手续费由三部分构成 + - 第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费 + + - 第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na + > 举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是`20000 * 20 = 400000`,既是0.004NULS + + - 第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还 + > 举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是`10000 * 20 = 200000`,既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方 + +* 合约调用方付多少钱? + + 在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方 + +* 由谁收到了这些费用? + + > `前提:`这部分费用都体现在区块的CoinBase交易(共识奖励)中 + + 区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用 \ No newline at end of file diff --git a/source/zh-cn/contract/smartContractImages/Assets5.jpg b/docs/zh/NULS1.0/smartContractImages/Assets5.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/Assets5.jpg rename to docs/zh/NULS1.0/smartContractImages/Assets5.jpg diff --git a/source/zh-cn/contract/smartContractImages/Deploy5.jpg b/docs/zh/NULS1.0/smartContractImages/Deploy5.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/Deploy5.jpg rename to docs/zh/NULS1.0/smartContractImages/Deploy5.jpg diff --git a/source/zh-cn/contract/smartContractImages/Deploy7.jpg b/docs/zh/NULS1.0/smartContractImages/Deploy7.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/Deploy7.jpg rename to docs/zh/NULS1.0/smartContractImages/Deploy7.jpg diff --git a/source/zh-cn/contract/smartContractImages/Deploy8.jpg b/docs/zh/NULS1.0/smartContractImages/Deploy8.jpg similarity index 100% rename from source/zh-cn/contract/smartContractImages/Deploy8.jpg rename to docs/zh/NULS1.0/smartContractImages/Deploy8.jpg diff --git a/docs/zh/NULS1.0/smartContractImages/access1.jpg b/docs/zh/NULS1.0/smartContractImages/access1.jpg new file mode 100644 index 00000000..bc0cedb4 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access1.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access2.jpg b/docs/zh/NULS1.0/smartContractImages/access2.jpg new file mode 100644 index 00000000..3863d1c1 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access2.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access3.jpg b/docs/zh/NULS1.0/smartContractImages/access3.jpg new file mode 100644 index 00000000..e67d3f12 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access3.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access4.jpg b/docs/zh/NULS1.0/smartContractImages/access4.jpg new file mode 100644 index 00000000..5c598c17 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access4.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access5.jpg b/docs/zh/NULS1.0/smartContractImages/access5.jpg new file mode 100644 index 00000000..26cc3df8 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access5.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access6.jpg b/docs/zh/NULS1.0/smartContractImages/access6.jpg new file mode 100644 index 00000000..9dc0eb49 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access6.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/access7.jpg b/docs/zh/NULS1.0/smartContractImages/access7.jpg new file mode 100644 index 00000000..94da1704 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/access7.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/assets1.jpg b/docs/zh/NULS1.0/smartContractImages/assets1.jpg new file mode 100644 index 00000000..fc7cb2e5 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/assets1.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/assets2.jpg b/docs/zh/NULS1.0/smartContractImages/assets2.jpg new file mode 100644 index 00000000..73182c31 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/assets2.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/assets3.jpg b/docs/zh/NULS1.0/smartContractImages/assets3.jpg new file mode 100644 index 00000000..0c804776 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/assets3.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/assets4.jpg b/docs/zh/NULS1.0/smartContractImages/assets4.jpg new file mode 100644 index 00000000..74c97344 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/assets4.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/deploy1.jpg b/docs/zh/NULS1.0/smartContractImages/deploy1.jpg new file mode 100644 index 00000000..38ae4135 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/deploy1.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/deploy2.jpg b/docs/zh/NULS1.0/smartContractImages/deploy2.jpg new file mode 100644 index 00000000..544357ce Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/deploy2.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/deploy3.jpg b/docs/zh/NULS1.0/smartContractImages/deploy3.jpg new file mode 100644 index 00000000..c6c3b7d0 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/deploy3.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/deploy4.jpg b/docs/zh/NULS1.0/smartContractImages/deploy4.jpg new file mode 100644 index 00000000..43bd79ee Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/deploy4.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/deploy6.jpg b/docs/zh/NULS1.0/smartContractImages/deploy6.jpg new file mode 100644 index 00000000..b2c60074 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/deploy6.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract1.jpg b/docs/zh/NULS1.0/smartContractImages/myContract1.jpg new file mode 100644 index 00000000..6d535da3 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract1.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract2.jpg b/docs/zh/NULS1.0/smartContractImages/myContract2.jpg new file mode 100644 index 00000000..14ac28cf Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract2.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract3.jpg b/docs/zh/NULS1.0/smartContractImages/myContract3.jpg new file mode 100644 index 00000000..5dad91c6 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract3.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract4.jpg b/docs/zh/NULS1.0/smartContractImages/myContract4.jpg new file mode 100644 index 00000000..546ef895 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract4.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract5.jpg b/docs/zh/NULS1.0/smartContractImages/myContract5.jpg new file mode 100644 index 00000000..cfc0da34 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract5.jpg differ diff --git a/docs/zh/NULS1.0/smartContractImages/myContract6.jpg b/docs/zh/NULS1.0/smartContractImages/myContract6.jpg new file mode 100644 index 00000000..d3f36a68 Binary files /dev/null and b/docs/zh/NULS1.0/smartContractImages/myContract6.jpg differ diff --git a/docs/zh/NULS1.0/sourceCodeStartNULS.md b/docs/zh/NULS1.0/sourceCodeStartNULS.md new file mode 100644 index 00000000..da961c2f --- /dev/null +++ b/docs/zh/NULS1.0/sourceCodeStartNULS.md @@ -0,0 +1,41 @@ +# 源码启动NULS + +## 下载源码 + +访问NULS项目github地址:https://github.com/nuls-io/nuls + +方式一:直接下载源代码 + +​ 进入github地址后,点击"Clone or download" 按钮,选择Download ZIP 下载源码包。 + +方式二:通过git命令克隆NULS仓库 + +​ `$ git clone https://github.com/nuls-io/nuls.git` + +方式三(推荐):通过开发工具,例如IntelliJ IDEA,克隆NULS仓库。 + +## 环境说明 + +​ 操作系统:macOS、Windows + +​ 构建工具:maven + +​ 开发工具:IntelliJ IDEA + +​ 开发语言:Java (JDK1.8) + +## NULS启动基本介绍 + +​ 由于区块链是去中心化网络,是由多个节点组成,所以单独用NULS源代码启动一个节点是没有意义的,也是不可行的。本文假定一个已经存在的利用NULS源码运行的自定义测试网络,并且搭建该网络时没有修改除网络参数以外的源代码,我们该如何启动NULS源代码,并加入该网络。 + +1. 首先安装jdk1.8和maven构建工具。 + + 2. 运行IntelliJ IDEA + - 如果下载的源码包,则先解压然后通过IntelliJ IDEA导入NULS项目 + - 如果通过git命令克隆NULS仓库下载的源代码,再通过IntelliJ IDEA导入NULS项目 + - 通过IntelliJ IDEA的Git插件克隆NULS仓库。 + 3. 配置与已存在网络一致的网络环境参数 + - 打开client-module项目中module.ini配置文件文件 + - 建议用已知自定义测试网络中其他节点的module.ini配置文件来将此module.ini文件替换掉,来保证网络环境参数一致。 + 4. 运行client-module项目中NULS启动类Bootstrap.java。位置:`io.nuls.client` 包中。 + 5. 启动过程中将打开NULS网钱包界面,并开始同步该自定义测试网高度,表示启动成功。 \ No newline at end of file diff --git a/docs/zh/NULS1.0/startSmartContract.md b/docs/zh/NULS1.0/startSmartContract.md new file mode 100644 index 00000000..53967756 --- /dev/null +++ b/docs/zh/NULS1.0/startSmartContract.md @@ -0,0 +1,92 @@ +# 快速入门 + +## 一、运行公测环境,创建账户,领取测试币 + +[为部署、调用智能合约做准备](/zh/NULS1.0/connectTestnet.html) + + +## 二、安装JDK8、IntelliJ IDEA、NULS智能合约插件 + +为开发智能合约代码做准备 + +[下载JDK8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)(安装略) + +[下载IntelliJ IDEA](https://www.jetbrains.com/idea/download/)(安装略) + +[下载NULS智能合约插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) + +[安装NULS智能合约插件](/zh/NULS1.0/ideaPlugin.html) + +## 三、智能合约代码示例 + +**_用示例快速编译、部署一个智能合约_** + +* 简单示例 + +```java + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.Msg; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigDecimal; +import java.math.BigInteger; + +public class SimpleContract implements Contract { + + private String sayContent; + + @Override + @Payable + public void _payable() { + // 覆写这个方法并标记@Payable注解,这个智能合约可以接收全节点钱包NULS资产的直接转账 + // you can do something else + // ... + } + + public String sayContent(@Required String content) { + this.sayContent = content; + return "you want say " + content; + } + + @Payable + public String transferToContract() { + // 标记@Payable注解,调用这个方法时,智能合约可接受NULS转入 + BigInteger value = Msg.value(); + BigDecimal nuls = new BigDecimal(value).movePointLeft(8); + // you can do something else + // ... + + return "I received your transfer amount: " + nuls.toPlainString(); + } + + @View + public String sayWhat() { + if(sayContent != null) { + return "you want say " + sayContent; + } + return "you want say nothing."; + } +} + +``` + +## 四、智能合约代码仓库 + +[NULS官方收集的智能合约代码仓库](https://github.com/nuls-io/contracts) + +[社区成员Angelillou的智能合约-合作委托挖矿](https://github.com/amalcaraz/nuls-partnership-smartcontract) + +[社区成员Angelillou的智能合约-彩票](https://github.com/amalcaraz/nuls-lottery-smartcontract) + +[社区成员Naveen的智能合约-评论](https://github.com/naveen7252/ProductReviewContract) + +## 五、智能合约部署与调用 + +[全节点钱包智能合约部署与调用方式](/zh/NULS1.0/GUIForSmartContract.html) + +## 六、智能合约代码规范与语法 + +[智能合约代码规范与语法说明](/zh/NULS1.0/developerManual.html) \ No newline at end of file diff --git a/docs/zh/NULS2.0/MailModuleDesign .md b/docs/zh/NULS2.0/MailModuleDesign .md new file mode 100644 index 00000000..864d91f9 --- /dev/null +++ b/docs/zh/NULS2.0/MailModuleDesign .md @@ -0,0 +1,245 @@ +# 点对点加密邮件模块设计文档 +## 功能设计 +模块实现的核心业务是两个地址直接进行文本消息的收发,将会把加密后的消息内容存储在链上和节点文件系统中。 +### 核心功能点 +1. 为地址绑定全链唯一的邮箱地址。 +2. 给指定邮箱地址发送邮件。 +3. 接收邮件。 +5. 查看邮件详情。 + +### 次要功能点 +1. 查看收件箱和发件箱邮件列表。 +2. 绑定邮箱地址和发送邮件额外支付手续费 + +## 概要设计 +### 绑定邮箱地址 +创建申请邮箱地址交易类型(type_200),业务数据(txData)包括申请地址、邮箱地址、地址公钥。验证交易时,需要验证邮箱地址是否已经被占用、申请地址是否已经绑定或邮箱、申请地址的账户余额是否足够支付申请手续费和交易手续费。当交易确认后,节点将把申请地址、邮箱地址、公钥3个数据建立联系并存储到文件系统中。 + +绑定邮箱地址功能的作用有两点 +1. 提供比账户地址更利于人类记忆和书写的格式。 +2. 通过账户发生交易获取到账户地址的公钥,在发送邮件时需要通过公钥对邮件内容进行非对称加密。 + +### 发送邮件 +创建发送邮件交易类型(type_201),业务数据(txData)中存储发件人地址(非邮箱地址)、收件人地址(非邮箱地址)、发送时间、加密后的邮件标题、加密后的邮件内容、发件人阅读权限key,收件人阅读权限key。 +#### 组装交易 +发送邮件的参数为发件人账户地址、账户密码、收件人邮箱地址、邮件标题、邮件内容。处理步骤如下: +1. 通过收件人邮箱地址查询到收件人邮箱信息,获取到收件人账户地址、收件人账户公钥。 +2. 生成一对加密邮件的钥匙对(KEY),通过公钥对邮件标题和邮件内容进行加密处理;通过收件人和发件人的公钥对KEY的私钥进行加密分别获得收件人阅读权限key和发件人阅读权限key。在查看邮件内容时首先通过自己的私钥解密对应的阅读权限key,然后用阅读权限key解密邮件标题和邮件内容。从而达到数据公开存储,但只能发件人和收件人才能查看内容的目的。 + +#### 验证交易 +1. 验证发件人账户地址绑定邮箱地址。 +2. 验证收件邮箱地址是否有效。 +3. 验证是否转入指定数量资产到手续费账户。 + +#### 保存邮件数据 +因为是演示模块,避免不必要的复杂度,存储没有采用数据库存储,而使用文件系统存储。邮件存储主要存储邮件与收件人、发件人的关系,以及邮件内容。 +1. 创建sender和recipient两个文件夹存储账户地址与邮件所在交易hash的关系。文件夹中以地址为文件名创建文件,文件中每一行存储一条此账户地址有关的邮件交易hash。sender文件夹存储发件人与邮件交易hash的关系,recipient文件夹存储收件人与邮件交易hash的关系。 +2. 创建mail-data文件夹存储邮件,使用邮件交易hash值作为文件名创建存储文件,文件内容为邮件内容byte数组的16进制字符串。 + +### 读取邮件 +#### 解密邮件信息 +邮件内容是加密后存储,读取时需要进行解密操作。解密失败抛出异常。解密流程如下: +1. 通过邮件hash值获取邮件内容。 +2. 反序列化邮件内容,首先将16进制转换成byte数组,然后按照以下顺序规则解析byte数组 +> 1. 变长类型存储收件人账户地址 +> 2. 变成类型存储发件人账户地址 +> 3. 变长类型存储收件人阅读权限key +> 4. 变长类型存储发件人阅读权限key +> 5. 变长类型存储邮件标题 +> 6. 变长类型存储邮件内容 +> 7. 4个byte存储64位int时间戳(1970年1月1日到当前毫秒数) + +1. 通过地址比较判断当前账户是收件人还是发件人,通过私钥解密对应的阅读权限key。 +2. 通过解密后的阅读权限key解密邮件标题和邮件内容。 + +#### 读取收件列表或发件列表 +在sender和recipient文件夹下找到账户地址同名的文件,按行读取hash值,然后使用hash值通过[解密邮件信息](#解密邮件信息)获取邮件详情,最后组装成列表。 +### 收取手续费 +通过验证绑定邮箱交易和发送邮件交易的CoinData里是否包含向指定的黑洞地址(手续费地址)转入指定数量资产来实现手续费收取。 + +## 详细设计 +### 源代码包结构 +``` +. +└── io + └── nuls + ├── Config.java + ├── Constant.java + ├── MyModule.java + ├── NulsModuleBootstrap.java + ├── Utils.java + ├── controller + │   ├── CreateMailAddressController.java + │   ├── GetMailController.java + │   ├── SendMailController.java + │   ├── core + │   │   ├── BaseController.java + │   │   ├── NulsResourceConfig.java + │   │   ├── Result.java + │   │   └── WebServerManager.java + │   └── vo + │   ├── CreateMailAddressReq.java + │   ├── GetMailListReq.java + │   ├── MailAddressData.java + │   ├── MailContentData.java + │   ├── SendMailReq.java + │   └── ViewMailReq.java + ├── rpc + │   ├── AccountTools.java + │   ├── CallRpc.java + │   ├── LegderTools.java + │   ├── TransactionTools.java + │   └── vo + │   ├── Account.java + │   ├── AccountBalance.java + │   └── TxRegisterDetail.java + ├── service + │   ├── MailAddressService.java + │   ├── SendMailService.java + │   └── dto + │   ├── MailAddress.java + │   └── MailContent.java + └── txhander + ├── MailAddressProcessor.java + ├── SendMailProcessor.java + ├── TransactionDispatcher.java + └── TransactionProcessor.java +``` +#### Config.java +配置文件,通过nuls-core包的配置文件系统将外部NULS2.0通用配置读取到类中,本模块中需要使用chainId(链id)、assetId(资产id)、dataPath(数据存储路径),这3个配置属于全局通用配置,直接读取即可。另外定义了mailAddressFee(绑定邮箱手续费)、sendMailFee(发送邮件手续费)两个业务配置项,需要在module.ncf中配置。 + +#### Constant.java +常量定义类,定义了绑定邮箱交易类型(200)、发送邮件交易类型(201)、手续费黑洞地址。 + +#### MyModule.java +模块启动类,申明当前模块依赖account(账户)、ledger(账本)、transaction(交易)3个模块。nuls-core-rpc程序包将自动与这3个模块建立websocket长连接。 +完成模块初始化工作: +1. 创建存储数据的文件夹。 +2. 向交易模块注册交易类型。 +3. 初始化Restful WebServer服务(用户操作接口使用http协议提供)。 + +#### controller包 +controller包提供用户操作接口 +##### CreateMailAddressController.java +绑定账户邮箱地址相关接口。 +##### GetMailController.java +获取邮箱信息相关接口。 +##### SendMailController.java +发送邮件相关接口 +##### core和vo包 +HTTP接口框架及接口协议相关。 +#### rpc包 +访问其他模块的RPC接口相关工具类。 +#### service包 +数据存储逻辑相关包。 +##### MailAddressService.java +存储账户绑定的邮箱地址信息相关服务。 +##### SendMailService.java +发送邮件及查询邮件信息相关服务。 +#### dto包 +定义数据存储对象 +#### txhander包 +交易回调函数包 +##### TransactionDispatcher.java +定义回调函数的RPC接口,根据交易类型分发到具体的处理类。 +##### MailAddressProcessor.java +定义处理绑定邮箱地址交易类型(type_200)的回调函数。 +##### SendMailProcessor.java +定义处理发送邮件交易类型(type_201)的回调函数。 + +### 用户操作接口列表 +用户操作接口使用http方式提供,Request和Response的Content type为application/json,端口为9999。 +#### 返回值通用协议 + +``` +{ + "success": true, //成功状态 + "data": null, //返回的数据 + "msg": null //失败的原因 +} +``` +#### 绑定邮箱地址 +##### 访问路径:/mail/createMailAddress +##### 请求方式: POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 申请账户地址 | +| mailAddress | string | 申请绑定的邮箱地址 | +| password | string | 账户密码 | +##### 返回值 string +交易的txHash值。 +#### 查询指定账户地址绑定的邮箱地址 +##### 访问路径:/mail/getMailAddress/{address} +##### 请求方式:GET +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +##### 返回值 string +邮箱地址 +#### 发送邮件 +##### 访问路径:/mail/sendMail +##### 请求方式:POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| mailAddress | string | 收件人邮箱地址 | +| senderAddress | string | 发件人账户地址 | +| password | string | 发件人账户密码 | +| title | string | 邮件标题 | +| content | string | 邮件内容 | +##### 返回值 string +交易txHash +#### 获取指定邮件详情 +##### 访问路径:/mail/viewMail +##### 请求方式:POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +| password | string | 账户密码 | +| hash | string | 邮件交易hash| + +##### 返回值 object + +| 参数名 | 说明 | +| --- | --- | +| hash | 邮件交易hash | +| senderMailAddress | 发件人邮箱地址 | +| receiverMailAddress | 收件人邮箱地址 | +| title | 邮件标题 | +| content | 邮件内容 | +| sender | 发件人账户地址 | +| date | 发件日期 | + + +#### 获取收件箱列表、获取发件箱列表 + +##### 访问路径:/mail/getSendList、/mail/getReceiveList + +##### 请求方式:POST + +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +| password | string | 账户密码 | + +##### 返回值 list + +| 参数名 | 说明 | +| --- | --- | +| hash | 邮件交易hash | +| senderMailAddress | 发件人邮箱地址 | +| receiverMailAddress | 收件人邮箱地址 | +| title | 邮件标题 | +| content | 邮件内容 | +| sender | 发件人账户地址 | +| date | 发件日期 | + diff --git a/docs/zh/NULS2.0/NRC-20TokenStandard.md b/docs/zh/NULS2.0/NRC-20TokenStandard.md new file mode 100644 index 00000000..6ccb7659 --- /dev/null +++ b/docs/zh/NULS2.0/NRC-20TokenStandard.md @@ -0,0 +1,153 @@ +# NRC-20 + + +## 简述 + +token的接口标准 + + +## 摘要 + +以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。 + +## 动机 + +标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。 + +## 规则 + +## Token +### 方法 + +**注意**: 调用者必须处理返回`false`的`return boolean`.调用者绝对不能假设返回`false`的情况不存在。 + + +#### name + +返回令牌的名称 - 例如 `"MyToken"`. + +``` java +@View +public String name(); +``` + + +#### symbol + +返回令牌的符号 - 例如 "MT". + +``` java +@View +public String symbol(); +``` + +#### decimals + +返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。 + +``` java +@View +public int decimals(); +``` + + +#### totalSupply + +返回总令牌供应量。 + +``` js +@View +public BigInteger totalSupply(); +``` + + + +#### balanceOf + +返回地址为“owner”的帐户余额。 + +``` java +@View +public BigInteger balanceOf(@Required Address owner); +``` + + + +#### transfer + +转移`value`的token数量到的地址`to`,并且必须触发`TransferEvent`事件。 如果`from`帐户余额没有足够的令牌来支出,该函数应该被revert。 + +创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 + +注意 0值的传输必须被视为正常传输并触发`TransferEvent`事件。 + +``` java +public boolean transfer(@Required Address to, @Required BigInteger value); +``` + + + +#### transferFrom + +从地址`from`发送数量为`value`的token到地址`to`,必须触发`TransferEvent`事件。 + +`transferFrom`方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了`from`帐户已经通过某种机制(比如调用`approve(@Required Address spender, @Required BigInteger value)`)故意地授权消息的发送者之外,否则该函数应该`revert`。 + +注意 0值的传输必须被视为正常传输并触发传输事件。 + +``` java +public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value); +``` + + + +#### approve + +允许`spender`多次支配您的帐户,最高达`value`金额。 如果再次调用此函数,它将以`value`覆盖当前的余量。 + +``` java +public boolean approve(@Required Address spender, @Required BigInteger value); +``` + + +#### allowance + +返回`spender`仍然被允许从`owner`提取的金额。 +Returns the amount which `spender` is still allowed to withdraw from `owner`. + +``` java +@View +public BigInteger allowance(@Required Address owner, @Required Address spender); +``` + + + +### Events + + +#### TransferEvent + +当token被转移(包括0值),必须被触发。 + +创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 + +``` java +public TransferEvent(Address from, @Required Address to, @Required BigInteger value) +``` + + + +#### ApprovalEvent + +当任何成功调用`approve(@Required Address spender, @Required BigInteger value)`后,必须被触发。 + +``` java +public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value) +``` + + + +## Implementation + +#### Example implementations are available at +- https://github.com/nuls-io/nuls-contracts/tree/master/nrc20 diff --git a/docs/zh/NULS2.0/NRC-721.md b/docs/zh/NULS2.0/NRC-721.md new file mode 100644 index 00000000..4233f1bc --- /dev/null +++ b/docs/zh/NULS2.0/NRC-721.md @@ -0,0 +1,523 @@ +# NRC-721非同质资产标准 + +## 简单摘要 + +用于不可替代的令牌的标准接口,也称为行为。 + +## 抽象 + +以下标准允许在智能合约中实施NFT的标准API。该标准提供了跟踪和传输NFT的基本功能。 + +我们认为NFT的使用案例由个人拥有和交易,以及托运给第三方经纪人/钱包/拍卖商(“运营商”)。NFT可以代表对数字或实物资产的所有权。我们考虑了各种各样的资产,我们知道你会想到更多: + +- 物理财产 - 房屋,独特的艺术品 +- 虚拟收藏品 - 小猫,可收集卡片的独特图片 +- “负值”资产 - 贷款,负担和其他责任 + +一般来说,所有房屋都是独特的,没有两只小猫是相同的。NFT是*可区分的*,您必须分别跟踪每个NFT 的所有权。 + +## 规格 + +**每个符合NRC-721标准的合同都必须实施NRC721和NRC165接口**(以下“注意事项”): + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.Event; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721 { + /** + * Count all NFTs assigned to an owner + * @param owner An address for whom to query the balance + * @return The number of NFTs owned by `owner`, possibly zero + */ + @View + int balanceOf(Address owner); + + /** + * Find the owner of an NFT + * @param tokenId The identifier for an NFT + * @return The address of the owner of the NFT + */ + @View + Address ownerOf(BigInteger tokenId); + + /** + * Transfers the ownership of an NFT from one address to another address. + * When transfer is complete, this function checks if `to` is a smart contract. + * If so, it calls `onNRC721Received` on `to` and throws if the return value is `false`. + * @throws revert unless `Msg.sender()` is the current owner, an authorized + * operator, or the approved address for this NFT. + * @throws revert if `from` is not the current owner. + * @throws revert if `tokenId` is not a valid NFT. + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + * @param data Additional data with no specified format, sent in call to `to` + */ + void safeTransferFrom(Address from, Address to, BigInteger tokenId, String data); + + /** + * Transfers the ownership of an NFT from one address to another address. + * This works identically to the other function with an extra data parameter, + * except this function just sets data to "". + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + */ + void safeTransferFrom(Address from, Address to, BigInteger tokenId); + + /** + * Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE + * TO CONFIRM THAT `to` IS CAPABLE OF RECEIVING NFTS OR ELSE + * THEY MAY BE PERMANENTLY LOST + * @throws Revert unless `Msg.sender()` is the current owner, an authorized + * operator, or the approved address for this NFT. + * @throws Revert if `from` is not the current owner. + * @throws Revert if `tokenId` is not a valid NFT. + * @param from The current owner of the NFT + * @param to The new owner + * @param tokenId The NFT to transfer + */ + void transferFrom(Address from, Address to, BigInteger tokenId); + + /** + * Change or reaffirm the approved address for an NFT + * @throws revert unless `Msg.sender()` is the current NFT owner, or an authorized + * operator of the current owner. + * @param approved The new approved NFT controller + * @param tokenId The NFT to approve + */ + void approve(Address to, BigInteger tokenId); + + /** + * Enable or disable approval for a third party ("operator") to manage + * all of `Msg.sender()`'s assets. + * Emits the ApprovalForAll event. The contract MUST allow multiple operators per owner. + * @param operator Address to add to the set of authorized operators + * @param approved True if the operator is approved, false to revoke approval + */ + void setApprovalForAll(Address operator, boolean approved); + + /** + * Get the approved address for a single NFT. + * @throws revert if there is none or if `tokenId` is not a valid NFT. + * @param tokenId The NFT to find the approved address for + * @return The approved address for this NFT. + */ + Address getApproved(BigInteger tokenId); + + /** + * Query if an address is an authorized operator for another address + * @param owner The address that owns the NFTs + * @param operator The address that acts on behalf of the owner + * @return True if `operator` is an approved operator for `owner`, false otherwise + */ + @View + boolean isApprovedForAll(Address owner, Address operator); + + /** + * This emits when ownership of any NFT changes by any mechanism. + * This event emits when NFTs are created (`from` is NULL) and destroyed. + * At the time of any transfer, the approved address for that NFT (if any) is reset to none. + *

Exception: during contract creation, any number of NFTs may be created and assigned without emitting Transfer.

+ */ + class Transfer implements Event { + private Address from; + private Address to; + private BigInteger tokenId; + + public Transfer(Address from, Address to, BigInteger tokenId) { + this.from = from; + this.to = to; + this.tokenId = tokenId; + } + + public Address getFrom() { + return from; + } + + public void setFrom(Address from) { + this.from = from; + } + + public Address getTo() { + return to; + } + + public void setTo(Address to) { + this.to = to; + } + + public BigInteger getTokenId() { + return tokenId; + } + + public void setTokenId(BigInteger tokenId) { + this.tokenId = tokenId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Transfer that = (Transfer) o; + + if (from != null ? !from.equals(that.from) : that.from != null) return false; + if (to != null ? !to.equals(that.to) : that.to != null) return false; + return tokenId != null ? tokenId.equals(that.tokenId) : that.tokenId == null; + } + + @Override + public int hashCode() { + int result = from != null ? from.hashCode() : 0; + result = 31 * result + (to != null ? to.hashCode() : 0); + result = 31 * result + (tokenId != null ? tokenId.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"from\":") + .append('\"').append(from).append('\"'); + sb.append(",\"to\":") + .append('\"').append(to).append('\"'); + sb.append(",\"tokenId\":") + .append('\"').append(tokenId).append('\"'); + sb.append('}'); + return sb.toString(); + } + } + + /** + * This emits when the approved address for an NFT is changed or reaffirmed. + * When a Transfer event emits, this also indicates that the approved address for that NFT (if any) is reset to none. + */ + class Approval implements Event { + private Address owner; + private Address approved; + private BigInteger tokenId; + + public Approval(Address owner, Address approved, BigInteger tokenId) { + this.owner = owner; + this.approved = approved; + this.tokenId = tokenId; + } + + public Address getOwner() { + return owner; + } + + public void setOwner(Address owner) { + this.owner = owner; + } + + public Address getApproved() { + return approved; + } + + public void setApproved(Address approved) { + this.approved = approved; + } + + public BigInteger getTokenId() { + return tokenId; + } + + public void setTokenId(BigInteger tokenId) { + this.tokenId = tokenId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Approval approval = (Approval) o; + + if (owner != null ? !owner.equals(approval.owner) : approval.owner != null) return false; + if (approved != null ? !approved.equals(approval.approved) : approval.approved != null) return false; + if (tokenId != null ? !tokenId.equals(approval.tokenId) : approval.tokenId != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = owner != null ? owner.hashCode() : 0; + result = 31 * result + (approved != null ? approved.hashCode() : 0); + result = 31 * result + (tokenId != null ? tokenId.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"owner\":") + .append('\"').append(owner).append('\"'); + sb.append(",\"approved\":") + .append('\"').append(approved).append('\"'); + sb.append(",\"tokenId\":") + .append('\"').append(tokenId).append('\"'); + sb.append('}'); + return sb.toString(); + } + } + + /** + * This emits when an operator is enabled or disabled for an owner. + * The operator can manage all NFTs of the owner. + */ + class ApprovalForAll implements Event { + private Address owner; + private Address operator; + private Boolean approved; + + public ApprovalForAll(Address owner, Address operator, Boolean approved) { + this.owner = owner; + this.operator = operator; + this.approved = approved; + } + + public Address getOwner() { + return owner; + } + + public void setOwner(Address owner) { + this.owner = owner; + } + + public Address getOperator() { + return operator; + } + + public void setOperator(Address operator) { + this.operator = operator; + } + + public Boolean getApproved() { + return approved; + } + + public void setApproved(Boolean approved) { + this.approved = approved; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ApprovalForAll that = (ApprovalForAll) o; + + if (owner != null ? !owner.equals(that.owner) : that.owner != null) return false; + if (operator != null ? !operator.equals(that.operator) : that.operator != null) return false; + if (approved != null ? !approved.equals(that.approved) : that.approved != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = owner != null ? owner.hashCode() : 0; + result = 31 * result + (operator != null ? operator.hashCode() : 0); + result = 31 * result + (approved != null ? approved.hashCode() : 0); + return result; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("{"); + sb.append("\"owner\":") + .append('\"').append(owner).append('\"'); + sb.append(",\"operator\":") + .append('\"').append(operator).append('\"'); + sb.append(",\"approved\":") + .append(approved); + sb.append('}'); + return sb.toString(); + } + } +} + +``` +```java +package io.nuls.token.interfaces; + + +public interface INRC165 { + /** + * Query if a contract implements an interface + * @param interfaceName The interface name, as specified in the implementation class of NRC-165. + * eg. interfaceName: ['INRC165', 'INRC721', 'INRC721Enumerable', 'INRC721Metadata'] + * @return `true` if the contract implements `interfaceName`, `false` otherwise + */ + boolean supportsInterface(String interfaceName); +} +``` + + +钱包/经纪/拍卖应用程序必须实现**钱包接口,** 如果它将接受安全转移。 + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; + +import java.math.BigInteger; + + +public interface INRC721TokenReceiver { + + /** + * Handle the receipt of an NFT. + * The NRC721 smart contract calls this function on the recipient + * after a `transfer`. This function MAY revert and reject the + * transfer. + * Note: the contract address is always the message sender. + * @param operator The address which called `safeTransferFrom` function + * @param from The address which previously owned the token + * @param tokenId The NFT identifier which is being transferred + * @param data Additional data with no specified format + * @return `true` if it accepts NFTs from other contracts, otherwise `false` + */ + boolean onNRC721Received(Address operator, Address from, BigInteger tokenId, String data); +} +``` + +对于NRC-721智能合约,**元数据扩展**是可选的(参见下面的“警告”)。这样可以查询您的智能合约的名称以及您的NFT所代表的资产的详细信息。 + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721Metadata { + /** + * @return A descriptive name for a collection of NFTs in this contract + */ + @View + String name() ; + + /** + * @return An abbreviated name for NFTs in this contract + */ + @View + String symbol() ; + + /** + * @return A distinct Uniform Resource Identifier (URI) for a given asset. + * NULL if `tokenId` is not a valid NFT. + */ + @View + String tokenURI(BigInteger tokenId) ; +} +``` + +对于NRC-721智能合约,**枚举扩展**是可选的(参见下面的“警告”)。这允许您的合同发布其完整的NFT列表并使其可被发现。 + +```java +package io.nuls.token.interfaces; + +import io.nuls.contract.sdk.Address; +import io.nuls.contract.sdk.annotation.View; + +import java.math.BigInteger; + + +public interface INRC721Enumerable { + /** + * Count NFTs tracked by this contract + * @return A count of valid NFTs tracked by this contract, where each one of + * them has an assigned and queryable owner + */ + @View + int totalSupply(); + + /** + * Enumerate valid NFTs + * @param index A counter less than `totalSupply()` + * @return The token identifier for the `index` NFT, + * (sort order not specified), NULL if `index` >= `totalSupply()`. + */ + @View + BigInteger tokenByIndex(int index); + + /** + * Enumerate NFTs assigned to an owner + * @param owner An address where we are interested in NFTs owned by them + * @param index A counter less than `balanceOf(_owner)` + * @return The token identifier for the `index` NFT assigned to `owner`, + * (sort order not specified), NULL if `index` >= `balanceOf(owner)` or invalid NFTs. + */ + @View + BigInteger tokenOfOwnerByIndex(Address owner, int index); +} +``` + +## 合理性 + +此智能合约的许多建议用途依赖于跟踪可区分的资产。现有或计划的NFT的示例是Decentraland中的LAND,CryptoPunks中的同名朋友,以及使用DMarket或EnjinCoin等系统的游戏内物品。未来的用途包括跟踪现实世界的资产,如房地产(如Ubitquity或Propy等公司所设想的那样。在这些情况中,这些项目在分类账中不是“集中在一起”,而是每个资产,这一点至关重要。必须拥有单独和原子跟踪的所有权。无论这些资产的性质如何,如果我们拥有允许跨功能资产管理和销售平台的标准化界面,生态系统将更加强大。 + + +**NFT标识符** + +每个NFT都由`BigInteger`NRC-721智能合约中的唯一ID标识。该识别号码在合同期限内不得更改。该对`(Address contractAddress, BigInteger tokenId)`然后将用于在链上特定资产的全局唯一和完全合格的标识符。虽然一些NRC-721智能合约可能会发现从ID 0开始并且每个新NFT只增加一个是方便的,但是呼叫者不应该假设ID号具有任何特定模式,并且必须将ID视为“黑匣子” ”。另请注意,NFT可能无效(被销毁)。请参阅支持的枚举接口的枚举函数。 + + +**转移机制** + +NRC-721标准化了安全传递函数`safeTransferFrom`(带有和不带`String`参数的重载方法)和不安全的功能`transferFrom`。转移可以通过以下方式启动: + +- NFT的所有者 +- NFT当前经批准的地址 +- NFT当前所有者的授权操作者 + +另外,授权操作者可以设置NFT的批准地址。这为钱包,经纪人和拍卖应用程序提供了一套强大的工具,可以快速使用*大量*的NFT。 + +创建NFT(“铸造”)和销毁NFT(“燃烧”)不包括在规范中。您的合同可以通过其他方式实现。 + +**NRC-165接口** + +我们选择标准接口检测(NRC-165)来公开NRC-721智能合约支持的接口。 + + +**气体和复杂性**(关于枚举扩展) + +该规范设想了管理少量和*任意大量* NFT的实现。如果您的应用程序能够增长,那么请避免在代码中使用for / while循环。这些表明您的合同可能无法扩展,燃气成本将随着时间的推移不断增加。 + +**隐私** + +在激励部分中确定的钱包/经纪人/拍卖者非常需要确定所有者拥有哪些NFT。 + +考虑一个NFT不可枚举的用例可能很有意思,例如财产所有权的私人注册表或部分私有注册表。但是,无法获得隐私,因为攻击者可以为所有可能的`tokenId`简单地调用`ownerOf`。 + +**元数据选择**(元数据扩展) + +我们在元数据扩展中需要`name`和`symbol`功能。 +我们提醒实现作者,空字符串是一个有效的响应`name`,`symbol`,如果你抗议使用这种机制。我们也提醒大家,任何智能合同可以使用相同的名称和符号作为*你的*合同。客户如何确定哪些NRC-721智能合约是众所周知的(规范的)超出了本标准的范围。 + +提供了一种将NFT与URI相关联的机制。我们希望许多实现将利用此功能为每个NFT提供元数据,URI可能是可变的(即它会不时变化)。我们考虑了代表房屋所有权的NFT,在这种情况下,关于房屋的元数据(图像,居住者等)可以自然地改变。 + +元数据作为字符串值返回。 + +*考虑的替代方案:将每个资产的所有元数据放在区块链上(太贵),使用URL模板查询元数据部分* + + +## NFT实现 + +1. 最基本实现 https://github.com/MIMIEYES/NULS-NRC721-baselib +2. NRC721Metadata基本功能实现 https://github.com/MIMIEYES/NRC721Metadata +3. NRC721Enumerable基本功能实现 https://github.com/MIMIEYES/NRC721Enumerable +4. NRC721Full基本功能实现 https://github.com/MIMIEYES/NRC721Full +5. NRC721Receiver基本功能实现 https://github.com/MIMIEYES/NRC721Receiver \ No newline at end of file diff --git a/docs/zh/NULS2.0/NULS2.0Introduction.md b/docs/zh/NULS2.0/NULS2.0Introduction.md new file mode 100644 index 00000000..47a6fedc --- /dev/null +++ b/docs/zh/NULS2.0/NULS2.0Introduction.md @@ -0,0 +1,20 @@ +# NULS 2.0 介绍 + +## 为什么要做NULS2.0 + +NULS创立的目的就是为了让区块链更简单,所以在2017年9月的时候,核心团队就定义了NULS 的基本架构为模块化,就是为了让更多开发者和用户能更容易的使用和编写模块。NULS目前完成了编码层的模块化,但存在模块之间耦合度较高的问题,开发者想使用某个模块或参与某个模块的开发,需要同时了解与其相关联的其他模块的设计,并且只能用特定的语言进行开发,这对NULS技术社区深度参与NULS架构的设计和开发,以及用户简单低成本的运用模块不够友好。 + +NULS在创立之初,就致力于成为一个由全球社区驱动的开源项目。我们认为,能不断催生创新思维的社区发展路线,才是区块链项目区别于其他商业项目的一大特点。不断的迭代与创新是开源项目发展过程中必然会产生的现象,也是区块链的魅力所在。为了让开源技术社区可以无任何障碍的融入NULS底层设计和开发中,以及为了革命性产品“链工厂”中的重要组成部分“模块仓库”的搭建和易用,有以下几个难点必须克服: + +1、模块的耦合度降低,模块之间不在编写和使用上彼此依赖 ; + +2、 模块可扩展、修改、替换,每一个模块都是简单的、纯粹的,不受到区块链程序整体复杂度的影响; + +3、 彻底打破编程语言障碍。 + +核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。 + +## NULS2.0的设计思维 + + +NULS2.0的微服务架构是逐渐演化而成,想深入了解其是如何形成的,可阅读文档[NULS2.0设计思维](http://nuls.io/wp-content/uploads/2019/07/NULS-2.0的设计思维-V0.1-Chi_Final.pdf),文档中详细阐述了NULS2.0的演化之路。 \ No newline at end of file diff --git a/docs/zh/NULS2.0/README.md b/docs/zh/NULS2.0/README.md new file mode 100644 index 00000000..d9872a63 --- /dev/null +++ b/docs/zh/NULS2.0/README.md @@ -0,0 +1,48 @@ +# 欢迎来到NULS + + +> NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动 + +NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等 + +## NULS2.0 Beta版本已发布 + +亲爱的用户: + +很荣幸的宣布,NULS2.0 Beta版本已于北京时间:2019-07-08日发布,诚邀您参与公测。 + +NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。 + +此次Beta版本测试内容主要包含: +- [使用ChainBox搭建区块链](/zh/NULS2.0/chainBoxGuide.html) +- [开发业务模块](/zh/NULS2.0/developeModule.html) +- [网页钱包](http://beta.wallet.nuls.io/) +- [节点钱包和轻钱包](https://github.com/nuls-io/nuls-v2/releases) +- [区块链浏览器](http://Beta.nulscan.io/) + + +### 如何参与测试: + +1 [下载钱包](https://github.com/nuls-io/nuls-v2/releases)或直接访问[网页钱包](http://beta.wallet.nuls.io/) + +2 如果使用linux节点钱包,则需查看[linux钱包使用教程](/zh/NULS2.0/linuxTutorial.html) + +3 [申请测试币](https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141)并在帖子中回复:beta+地址 + +4 [访问区块链浏览器](http://Beta.nulscan.io/) + +5 [使用ChainBox搭建区块链](/zh/NULS2.0/chainBoxGuide.html) + +6 [提交bug](https://github.com/nuls-io/nuls_2.0/issues) + + +### 相关链接 + +- Github:[https://github.com/nuls-io/nuls_2.0](https://github.com/nuls-io/nuls_2.0) +- 论坛:[https://nuls.community](https://nuls.community) +- 技术社区Telegram:[https://t.me/nulstest](https://t.me/nulstest) + + +想了解更多与NULS相关的信息,可以访问我们的[官网](https://nuls.io) + + diff --git a/docs/zh/NULS2.0/assetsOff.md b/docs/zh/NULS2.0/assetsOff.md new file mode 100644 index 00000000..6ff48aa9 --- /dev/null +++ b/docs/zh/NULS2.0/assetsOff.md @@ -0,0 +1,90 @@ +# 合约NULS资产转出的交易说明 + +如果从合约地址转走NULS,那么会在合约的执行结果中体现,结果中的`transfers`数组对象中展示了每一笔合约转账,这里展示的数据仅是合约转账交易的概要信息。 + +`block`中不会包含这类交易,因为它不在节点网络上广播,它是vm生成的数据,每一个得到智能合约交易的节点去执行,把执行结果保存在自己的节点上,当一个区块中所有的合约交易执行完后,会产生一个`stateRoot`,这个`stateRoot`会在`block`里广播出来。 + +合约NULS资产转出交易没有签名,由每个节点验证区块时生成这类交易,另外,这类交易也不在广播数据的范围内,需要从另外的接口调取,详细数据请通过 **以下接口** 来得到交易的_序列化字符串_数据。 + +以下是包含合约NULS资产转出交易的执行结果 + +> 通过`RESTFUL`接口`/api/contract/result/{hash}` +> +> 或者 +> +> 通过`JSONRPC`接口`getContractTxResult `, 请求数据: + +```json +{ +"jsonrpc":"2.0", +"method":"getContractTxResult", +"params":[chainId, hash], +"id":1234 +} +``` +> +> 获取合约的执行结果 + +以下结果中,`contractTxList`即是本次合约执行后生成的交易,注意:这个结构里不限于合约NULS资产转出交易,根据业务的不同会生成不同的合约NULS资产转出交易,比如合约共识交易 --> [智能合约共识交易说明](./consensusTransaction.html) + +```json +{ + "success": true, + "data": { + "flag": true, + "data": { + "success": true, + "errorMessage": null, + "contractAddress": "tNULSeBaN1rhd9k9eqNkvwC9HXBWLQ79dRuy81", + "result": "multyForAddress: 888634777633", + "gasLimit": 200000, + "gasUsed": 20038, + "price": 25, + "totalFee": "5100000", + "txSizeFee": "100000", + "actualContractFee": "500950", + "refundFee": "4499050", + "value": "0", + "stackTrace": null, + "transfers": [ + { + "txHash": "4877f6a865dea5b4ac82a8370d73e62da15bc7acb2145a03822dddfdab329d2b", + "from": "tNULSeBaN1rhd9k9eqNkvwC9HXBWLQ79dRuy81", + "value": "200000000", + "outputs": [ + { + "to": "tNULSeBaMp9wC9PcWEcfesY7YmWrPfeQzkN1xL", + "value": "100000000" + }, + { + "to": "tNULSeBaMshNPEnuqiDhMdSA4iNs6LMgjY6tcL", + "value": "100000000" + } + ], + "orginTxHash": "b5473eefecd1c70ac4276f70062a92bdbfe8f779cbe48de2d0315686cc7e6789" + } + ], + "events": [], + "tokenTransfers": [], + "invokeRegisterCmds": [], + "contractTxList": [ + "12002fbb225d0037b5473eefecd1c70ac4276f70062a92bdbfe8f779cbe48de2d0315686cc7e678902000253472f4702eb83b71871a4c4e0c71526bb86b8afd0011702000253472f4702eb83b71871a4c4e0c71526bb86b8af0200010000c2eb0b0000000000000000000000000000000000000000000000000000000008000000000000000000021702000194f6239c075d184e265eaea97a67eeced51725160200010000e1f50500000000000000000000000000000000000000000000000000000000000000000000000017020001ce8ffa95606f0bfd2778cff2eff8fe8999e20c440200010000e1f50500000000000000000000000000000000000000000000000000000000000000000000000000" + ], + "remark": "call" + } + } +} +``` + + + + + + + + + + + + + diff --git a/docs/zh/NULS2.0/chainBoxGuide.md b/docs/zh/NULS2.0/chainBoxGuide.md new file mode 100644 index 00000000..2d397343 --- /dev/null +++ b/docs/zh/NULS2.0/chainBoxGuide.md @@ -0,0 +1,701 @@ +# NULS ChainBox +## NULS ChainBox是什么 + +ChainBox是一个快速搭建区块链的工具,封装了账本,账户,交易,区块,共识,网络六个底层模块,屏蔽了分布式数据存储、点对点传输、共识机制、加密算法等复杂区块链技术,开发者可使用它实现分钟级搭建TPS达1000的基础链,或根据标准通信协议开发业务模块,然后通过chainbox驱动组成一条全新的应用链 + +## 为什么需要ChainBox + NULS ChainBox设计的初衷是帮助企业或应用开发者在区块链上能快速构建应用,并专注自己的业务实现,无需关心晦涩、复杂的区块链底层技术。 + + +## 特点 +NULS ChainBox本质上是NULS2.0的一个扩展应用,它的定位是一站式区块链开发平台,它有3个核心特点: + +- 快速搭建开发环境 + +- 通过模板降低应用开发门槛 + +- 通过约定和脚本降低模板集成的难度,实现一键生成可运行程序 + +## 快速体验 +在下面这个case中,你将体验到如何使用NULS ChainBox快速构建一套提供加密信息服务的区块链应用 + +### 1 环境准备 + +- linux内核的操作系统 +- 安装 Git +- 安装Maven +- 安装JDK11 + +### 2 获取NULS ChainBox + +打开终端,执行以下命令 + +``` +git clone https://github.com/nuls-io/nuls-chainbox.git chainbox +``` +### 3 构建加密信息模块 +执行命令进入example目录 + +``` +cd example #进入示例文件夹 +``` +执行命令构建模块 + +``` +./package #执行构建脚本(模板提供) +``` + +看到以下输出后,说明构建完成 + +``` +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` + +构建成功后会在example中生成outer文件夹 + + +> PS:如果你想知道该模块是如何设计的,请查看[加密信息模块设计文档]([/zh/NULS2.0/javaModuleTemplate.html](https://github.com/CQBeer/nuls-chainbox/blob/master/example/%E6%A8%A1%E5%9D%97%E8%AE%BE%E8%AE%A1%E6%96%87%E6%A1%A3.md)) + +### 4 集成加密信息模块 +回到chainbox根目录 + +``` +cd .. +``` + +执行命令,集成加密模块到NULS2.0运行环境中 + +``` +./tools -p example +``` +看到以下输出后,说明集成成功 + +``` +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` + +完成后在chainbox目录下会生成NULS-WALLET文件夹,此文件夹包含了集成了加密信息模块的NULS2.0运行程序 + +若在不同机器部署了多个节点,建议修改NULS-WALLET/.default-config.ncf配置文件中的以下两个参数 + +``` +#最小链接节点数,当链接到的网络节点低于此参数时,会持续等待 +minNodeAmount=0 +#种子节点出块地址 +seedNodes=tNULSeBaMkrt4z9FYEkkR9D6choPVvQr94oYZp +``` + +### 5 启动节点程序 +配置完成后,在NULS-WALLET目录执行以下命令 + +``` +./start-dev +``` +看到以下内容说明模块正在启动中 + +``` +LOG PATH : ~/NULS-WALLET/Logs +DATA PATH : ~/NULS-WALLET/data +CONFIG FILE : ~/NULS-WALLET/nuls.ncf +DEBUG : 0 +JAVA_HOME : /Library/java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home +java version "11.0.2" 2019-01-15 LTS +Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) +Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) + +==================== +NULS-WALLET STARING +==================== +``` + +可通过以下命令检查模块启动情况 + +``` +./check-status +``` +看到以下内容表示节点模块已全部启动成功 + +``` +==================MODULE PROCESS==================== +account PROCESS IS START +block PROCESS IS START +consensus PROCESS IS START +ledger PROCESS IS START +network PROCESS IS START +transaction PROCESS IS START +==================RPC REDAY MODULE================== +account RPC READY +block RPC READY +consensus RPC READY +ledger RPC READY +network RPC READY +transaction RPC READY +======================REDAY MODULE================== +account STATE IS READY +block STATE IS READY +consensus STATE IS READY +ledger STATE IS READY +network STATE IS READY +transaction STATE IS READY +================TRY RUNNING MODULE================== +account TRY RUNNING +block TRY RUNNING +consensus TRY RUNNING +ledger TRY RUNNING +network TRY RUNNING +transaction TRY RUNNING +===================RUNNING MODULE=================== +account STATE IS RUNNING +block STATE IS RUNNING +consensus STATE IS RUNNING +ledger STATE IS RUNNING +network STATE IS RUNNING +transaction STATE IS RUNNING +==================NULS WALLET STATE================= +========================== +NULS WALLET IS RUNNING +========================== +``` + +### 7 导入种子节点出块地址 +现在种子节点已经启动,我们需进入命令行导入默认的种子出块地址,让节点开始出块 + +首先进入命令行 + +``` +./cmd +``` +导入出块地址 + +``` +nuls>>> import b54db432bba7e13a6c4a28f65b925b18e63bcb79143f7b894fa735d5d3d09db5 #通过私钥导入种子节点地址,此私钥生成的地址必须与第5步第2条的地址相同 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:********** #设置导入地址的密码,此密码与第4步第3条记录的密码必须一致 +Please confirm new password:********** #重复上一步输入的密码 +tNULSeBaMkrt4z9FYEkkR9D6choPVvQr94oYZp #导入地址成功,验证此地址是否与第4步第2条的配置项完全一致 +``` + +### 8 使用加密信息 + +- 准备2个账户,用于发送和接收信息,下方两个地址是测试环境创世块中定义的地址,账户中有一定数量的资产供测试使用。 + + ``` + nuls>>> import 477059f40708313626cccd26f276646e4466032cabceccbf571a7c46f954eb75 + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********** + Please confirm new password:********** + tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD + + nuls>>> import 8212e7ba23c8b52790c45b0514490356cd819db15d364cbe08659b5888339e78 + Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. + Enter your password:********** + Please confirm new password:********** + tNULSeBaMrbMRiFAUeeAt6swb4xVBNyi81YL24 + ``` + + + +- 进入NULS-WELLET/Modules/Nuls/mail-example/1.0.0目录,用浏览器打开mail-test.html(这是一个简单的测试页面,可以测试绑定昵称、收信息等功能),首先给账户绑定昵称 + + 给两个测试账户分别设置昵称地址,输入刚才设置的测试账户密码。提交成功后将返回此交易的hash值。此处我们申请昵称地址分别为asd@nuls.io和l24@nuls.io。设置完成后需要等待10秒左右确认区块。 + +- 现在我们测试用asd@nuls.io向l24@nuls.io发送信息。输入收件人昵称地址、发件人账户地址、发件人账户密码。提交成功后将返回此交易的hash值。 + + +- 等待大约10秒钟后(确保交易已经确认),通过发送信息的hash值查看信息内容,只有发件人和收件人才能查看。 + + + ``` + { + "senderMailAddress": "asd@nuls.io", //发件人昵称地址 + "receiverMailAddress": "24@nuls.io", //收件人昵称地址 + "title": "this is title", //信息标题 + "content": "NULS 666.", //信息内容 + "sender": "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", //发件人账户地址 + "date": 1561365228904 //发件时间戳(1970年1月1日到当前的毫秒数) + } + ``` + +## ChainBox使用指南 +### 目录结构 +#### tools +ChainBox使用入口,提供获取程序、集成打包等操作。[命令参数文档](#cmd-doc)。 +#### document +文档列表。 +#### example +基于java模块模板开发的一个加密信息的示例模块程序源码。 +#### rpc-debug-tool +基础模块rpc接口调试工具。 + +### 获取NULS2.0运行环境 +NULS2.0运行环境包含一套最基础的区块链程序,里面包含了账户、账本、区块、网络、交易、共识(poc)6大核心模块。运行NULS2.0基础运行环境你可以得到包含账户模型、转账交易、POC共识激励等区块链底层的核心功能。如果只想发一条简单的转账交易的链,通过修改配置文件就可以完成([完整的配置列表](https://github.com/nuls-io/nuls-v2/blob/develop/useguide.md#nulsncf-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6))。你可以在基础环境中集成自己的业务模块,通过扩展一个新的交易类型的方式完成自己的业务,在下面一个段落中我会详细介绍如何构建自己的业务。 + +使用tools脚本获取NULS2.0运行环境 + +``` +./tools -n +``` +脚本会首先检查当前环境,然后从拉取NULS2.0在github仓库里的代码,执行package完成NULS2.0编译打包,将可运行程序输出到./NULS-WALLET-RUNTIME目录中。 +当看到以下内容时表示打包完成。 + +``` +============ ~/nuls-engine/NULS-WALLET-RUNTIME PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` +#### NULS-WALLET-RUNTIME目录结构 +##### start-dev +启动节点 +##### stop-dev +停止节点 +##### check-status +检查各个模块运行状态 +##### cmd +命令行启动脚本 +##### create-address +创建地址工具 +##### nuls.ncf +配置文件(首次运行start-dev脚本后创建) +##### 更多使用方法参考([NULS2.0钱包使用手册](https://github.com/nuls-io/nuls-v2/blob/develop/useguide.md)) +### 如何开发自己的模块 +NULS2.0是用JAVA语言编写的分布式微服务架构的程序,整个节点程序由多个模块组成,每个模块之间通过websocket协议通信。NULS2.0定义了一套标准的[模块通信协议](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md),可以通过各种开发语言实现此标准协议与其他模块通信,进而实现自己的业务逻辑。扩展自己的业务逻辑主要是通过扩展新的交易类型实现,在交易的txData中存储自己的业务数据,txData将跟随交易存储在链上。 +#### 创建交易流程 +![节点创建交易](./chainbox/createtx.png) +#### 处理网络交易流程 +![处理网络广播交易](./chainbox/handnetworktx.png) + +从图中可以看出扩展一个新的业务模块主要需要做4件事 +1. 在交易模块注册自己的交易类型。 +2. 组装交易数据,调用交易模块创建新的交易。 +3. 验证交易中的业务数据是否合法。 +4. 将交易中的业务数据保存到节点数据库中。 + +当然除了上面4步,还需要根据具体的业务需求对业务数据进行使用。下面我就对以上4步进行详细介绍。 + +在系统中每种交易都需要定义一个整数类型的唯一的交易类型(扩展的交易通常用200以上的值),用于区分处理的交易的回调函数。通常应该在模块启动的时候调用交易模块提供的注册交易接口(请查看交易模块的RPC接口文档)。当交易模块拿到一条待处理的交易时,会根据交易类型路由到注册的验证函数对交易业务数据的合法性进行校验。除了验证以外还有commitTx(保存交易业务数据)、rollbackTx(回滚交易的业务数据)两个函数。 + +通常由业务模块组装自己扩展的交易类型,一条合法的交易中包括交易类型、时间戳、CoinData、txData、备注、签名几个部分。其中CoinData中包含了转账数据,转出账户、转入账户、转账金额、资产信息等。而txData中主要用了保存业务数据,底层不会对txData字段进行验证和处理,业务模块根据业务设计在txData中存储自己的业务数据。签名字段通过椭圆形曲线算法对所有交易数据进行签名,确保在传输过程中数据不被串改。组装完成后,调用交易模块接口创建交易。 + +交易模块会通过当前节点自己创建获得交易,也会通过网络模块接收其他节点广播过来的交易。交易模块拿到交易后,首先会对交易数据的参数是否合法,然后检查账户余额是否足够支付交易手续费,然后验证账户的nonce值(通过控制交易顺序来保证余额不被重复使用的一种算法)是否合法。验证通过后根据交易类型找到业务验证的回调函数,对交易进行业务验证。 + +最后当交易打入区块,并且区块已经确认后,将在通过交易类型找到存储业务数据的回调函数,通知业务模块可以保持业务数据导节点本地。有些情况可能会出现区块回滚。当区块发生回滚时,也会通过交易类型匹配到对应的交易回滚回调函数,对业务数据进行回滚处理。 + +以上就是扩展一种交易类型需要完成的几个核心步骤。验证交易、保存业务数据、回滚业务数据3个接口由业务模块实现,查看具体[接口协议](#registerTx)。 +### 与其他模块通信 +NULS2.0采用微服务架构,模块之间使用[websocket](https://zh.wikipedia.org/wiki/WebSocket)通信。所有模块的链接通过Nulstar治理,流程如下: + +![](./chainbox/pic01.jpeg) + +所有模块由ServiceManager启动,启动后主动与ServiceManager模块建立连接,按协议约定完成握手,握手成功后向ServiceManager注册,注册的目的主要是告诉ServiceManager自己的连接方式、提供的接口协议、需要依赖哪些模块。 +#### 建立连接 +使用标准的websocket协议建立连接,连接方式在此不再赘述。连接建立完成后,就可以向对方发送数据包(接口请求)和接收对方的数据包。注意:所有的请求都是异步请求,非同步阻塞。 +#### 与ServiceManager握手 +与ServiceManager建立连接后,需要首先发送一个NegotiateConnection对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。 +它由两个字段组成: + +- CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。 +- CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩 + +示例: + +```json + { + "MessageID": "15622130397455", + "Timestamp": "1562213039745", + "TimeZone": "9", + "MessageType": "NegotiateConnection", + "MessageData": { + "Abbreviation": "ledger", #模块name + "ProtocolVersion": "0.1", #协议版本号 + "CompressionAlgorithm": "zlib", + "CompressionRate": "0" + } + } +``` +握手成功后,ServiceManager发送NegotiateConnectionResponse对象给业务模块。它由两个字段组成: + +- NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1 +- NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。 + +示例: + +```json +{ + "MessageID": "156221303974612033", + "Timestamp": "1562213039759", + "TimeZone": "9", + "MessageType": "NegotiateConnectionResponse", + "MessageData": { + "RequestID": "15622130397455", + "NegotiationStatus": "1", + "NegotiationComment": "Connection true!" + } +} +``` +#### registerAPI(注册模块) +与ServiceManager握手成功后,向ServiceManager发送RegisterAPI请求,完成注册。ServiceManager将通过此次请求获取模块的连接信息和接口方法,并通过分析此模块的依赖模块是否存在来决定此模块是否满足正常工作的条件。 +示例: + +``` +{ + "MessageID": "15622130392482", + "Timestamp": "1562213039248", + "TimeZone": "9", + "MessageType": "Request", + "MessageData": { + "RequestAck": "0", + "SubscriptionEventCounter": "0", + "SubscriptionPeriod": "0", + "SubscriptionRange": "0", + "ResponseMaxSize": "0", + "RequestMethods": { + "RegisterAPI": { + "Methods": [ + { + "MethodName": "getAssetsById", + "MethodDescription": "清除所有账户未确认交易", + "MethodMinEvent": "0", + "MethodMinPeriod": "0", + "MethodScope": "public", + "Parameters": [ + { + "ParameterName": "chainId", + "ParameterType": "", + "ParameterValidRange": "[1-65535]", + "ParameterValidRegExp": "" + }, + { + "ParameterName": "assetIds", + "ParameterType": "", + "ParameterValidRange": "", + "ParameterValidRegExp": "" + } + ] + } + ], + "Dependencies": { + "block": "1.0", + "network": "1.0" + }, + "ConnectionInformation": { + "IP": "192.168.0.197", + "Port": "17880" + }, + "ModuleDomain": "Nuls", + "ModuleRoles": { + "ledger": [ + "1.0" + ] + }, + "ModuleVersion": "1.0", + "Abbreviation": "ledger", + "ModuleName": "ledger" + } + } + } +} +``` +ServiceManager判断依赖都已启动后,会返回一个Response,数据中包含了依赖的模块的链接方式。 +示例: + +``` +{ + "MessageID": "1562213039283455", + "Timestamp": "1562213039283", + "TimeZone": "9", + "MessageType": "Response", + "MessageData": { + "RequestID": "15622130392482", + "ResponseProcessingTime": "2", + "ResponseStatus": 0, + "ResponseComment": "success", + "ResponseMaxSize": "0", + "ResponseData": { + "RegisterAPI": { + "Dependencies": { + "consensus": { + "IP": "192.168.0.197", + "Port": "18735" + }, + "ledger": { + "IP": "192.168.0.197", + "Port": "17880" + }, + "nuls-module-explorer": { + "IP": "192.168.0.197", + "Port": "10130" + }, + "kernel": { + "IP": "0.0.0.0", + "Port": "7771" + }, + "block": { + "IP": "192.168.0.197", + "Port": "13437" + }, + "transaction": { + "IP": "192.168.0.197", + "Port": "14026" + }, + "account": { + "IP": "192.168.0.197", + "Port": "15121" + }, + "network": { + "IP": "192.168.0.197", + "Port": "15481" + } + } + } + }, + "ResponseErrorCode": null + } +} +``` +模块获取到依赖模块的链接方式后就可以与此其他模块建立连接发送接口请求。 +#### 调用其他模块接口 +在调用其他模块的接口前也需要完成建立websocket连接、与模块握手的操作,握手完成后就可以向模块发送Request对象。 +示例: + +``` +{ + "MessageID": "156222086356134", + "Timestamp": "1562220863561", + "TimeZone": "9", + "MessageType": "Request", + "MessageData": { + "RequestAck": "0", + "SubscriptionEventCounter": "0", + "SubscriptionPeriod": "0", + "SubscriptionRange": "0", + "ResponseMaxSize": "0", + "RequestMethods": { + "ac_createAccount": { + "chainId": 2, + "count": 1, + "password": "nuls123456" + } + } + } +} +``` +其中RequestMethods的内容为请求的参数,外层数据为协议层。业务模块处理完成后,会发送Response对象,返回处理结果和结果数据。 +示例: + +``` +{ + "MessageID": "156222086367037", + "Timestamp": "1562220863664", + "TimeZone": "9", + "MessageType": "Response", + "MessageData": { + "RequestID": "156222086356134", + "ResponseProcessingTime": "107", + "ResponseStatus": 0, + "ResponseComment": "success", + "ResponseMaxSize": "0", + "ResponseData": { + "ac_createAccount": { + "list": [ + "tNULSeBaMkef3L6EsMcigwT1C1uebzfsj63jd3" + ] + } + }, + "ResponseErrorCode": null + } +} +``` +#### 参考文档: +* [Websocket-Tool设计文档](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md) +* [Nulstar Module Specification](https://github.com/nuls-io/Nulstar/blob/master/Documents/Nulstar%20-%20Documentation%20-%20Module%20Specification.pdf) +* [基础模块接口文档](#doclist) + +### 获取各种开发语言的模块开发模板 +理论上只要通过websocket与模块建立连接,然后按照约定的协议与模块进行信息交换就可以实现业务模块的扩展。但是这样从头造轮子的方式效率比较低,门槛也比较高,为了降低模块开发的难度,我们将为各种语言提供快速开始的模板(目前只提供了java),开发人员只需要在模板中的指定位置插入具体的业务逻辑代码就可以完成扩展模块的开发。 + +通过tools脚本可以非常简单的获取到指定的语言的模块开发模板。 + +``` +tools -t java +``` +执行完成后,会在当前目录创建一个nuls-module-java的文件夹,导入常用的开发工具就可以开始开发业务了。每个模板里都会有对应的使用文档。 +### 模块调试方法 +在模块开发过程中需要与基础模块进行联调,获取到NULS2.0运行环境后,执行start-mykernel脚本启动NULS2.0基础模块,然后在业务模块中向ws://127.0.0.1:7771地址进行注册,注册协议。完成注册后,就可以获取到所依赖的各个模块的通信地址,调用模块的接口。 +### 将业务模块集成到NULS2.0运行环境中 +业务模块开发完成后,需要将业务模块集成到NULS2.0运行环境中,然后将输出的程序部署到生产环境中或输出到外部节点运行。使用tools脚本完成集成需要满足以下几个约定。 +1. 打包好的可运行程序应该放在模块开发目录下的outer目录下。 +2. outer目录中必须有一个文件名为Module.ncf的配置文件(注意M大写)。文件内容如下(以java为例) + + ``` + [Core] + Language=JAVA # 注明开发语言 + Managed=1 # 1表示模块跟随节点程序一起启动,0表示手动启动 + + [Libraries] + JRE=11.0.2 # 模块运营环境版本 + + [Script] + Scripted=1 # 是否使用脚本启动 1表示是 + StartScript=start # 启动模块脚本(start必须在outer目录下) + StopScript=stop # 停止模块脚本(stop必须在outer目录下) + + ``` +3. 可以通过2中配置的脚本启动模块和停止模块。 +#### 模块开发模板中已完成以上约定。 + +## 附录 +### tools脚本使用手册 +### 获取NULS2.0运行环境 +#### 命令:tools -n +#### 参数列表 +无 +#### 示例 +``` +tools -n +``` +### 获取指定语言模块开发模板 +#### 命令:tools -t <language> [out folder] +#### 参数列表 +| 参数 | 说明 | +| --- | --- | +| <language> | 语言模板名称 | +| [out folder] | 输出的文件夹名 | +#### 示例 +``` +tools -t java demo +``` +### 查看可用模板列表 +#### 命令:tools -l +#### 参数列表 +无 +##### 示例 + +``` +doto +``` +### 将模块集成到NULS2.0运行环境 +#### 命令:tools -p <module folder> +#### 参数列表 +| 参数 | 说明 | +| --- | --- | +| <out folder> | 模块的文件夹名 | +#### 示例 +``` +./tools -p demo +``` +### 业务模块相关接口协议 +业务模块需要给交易模块提供3个回调函数,交易模块会通过websocket调用这3个函数,3个函数的参数相同,命名不同。 +#### 验证交易 +cmd名称:txValidator + +用于业务模块验证txData数据是否合法,同时也可以验证coinData等数据是否符合业务要求。如果验证不通过,交易模块将丢弃此笔交易。 +#### 保存交易业务数据 +cmd名称:txCommit + +用于将交易中的业务数据保存到节点本地数据库,或做相应的业务逻辑处理。到达此步的交易都是达成共识的数据。 +#### 回滚交易业务数据 +cmd名称:txRollback + +当区块发生回滚时,会触发回调此函数,业务模块应该在函数中清除掉此笔交易相关的业务数据,或做相应的逆向处理。 +#### 回调函数参数列表 +| 参数名称 | 类型 | 参数说明 | +| --- | --- | --- | +| chainId | int | 链id(节点运行多链时区分数据来源) | +| txList | list | 交易列表 | +| blockHeader | object | 区块头 | + +#### 反序列化,[通用协议](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/h.%E9%80%9A%E7%94%A8%E5%8D%8F%E8%AE%AE%E8%AE%BE%E8%AE%A1v1.3.md) +txList和blockHeader两个参数的数据是通过16进制数据的形式传输,首先需要将16进制转换成byte数组,然后再根据不同的规则反序列化成结构化数据。 +##### [Transaction](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/Transaction.java) +txList存储的是一个Transaction对象的列表,每一个item里面是Transaction对象序列化成16进制的字符串。反序列化txList首先从[通用协议](https://github.com/nuls-io/nuls-v2-docs/blob/master/design-zh-CHS/r.rpc-tool-websocket%E8%AE%BE%E8%AE%A1v1.3.md)中取出txList参数的值,是一个json的字符串数组,然后遍历数组取得单个Transaction对象的序列化值。将序列化值转换成byte数组。再从byte数组中逐个取出对应的数据值。 +byte数组中读取数据的规则如下: +1. 2个byte存储无符号的16位int保存交易类型。 +2. 4个byte存储无符号的32位int保存交易时间戳(1970年1月1日到当前的秒数) +3. 变长类型存储remark字符串,见[变长类型读取方式](#变长类型存储结构) +4. 变成类型存储txData字符串,业务自定义,但任然需要先转换成byte数组。 +5. 变长类型存储coinData字符串,为coinData对象序列化后的16进制的字符串。见[CoinData反序列化方法](#CoinData) +6. 变长类型存储交易签名字符串,为TransactionSignature对象序列化后的16进制的字符串。 + +##### [CoinData](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinData.java) +CoinData对象存储了一笔交易中出入金关系,一笔交易出金账户和入金账户支持多对多的关系,只要出金总额大于等于入金总额加手续费交易就可以成立。 +1. [varint](https://learnmeabitcoin.com/glossary/varint)类型存储出金账户信息的列表个数。 +2. 按顺序存储出金账户信息列表,出金账户信息为CoinFrom对象,注意此处并没有对CoinFrom对象进行16进制字符串处理。 +3. [varint](https://learnmeabitcoin.com/glossary/varint)类型存储入金账户信息的列表个数。 +4. 按顺序存储入金账户信息列表,入金账户信息为CoinTo对象,注意此处并没有对CoinTo对象进行16进制字符串处理。 + +##### [CoinFrom](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinFrom.java) +1. 变长类型存储账户地址。[Address序列化代码](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/basic/AddressTool.java) +2. 2个byte存储无符号16位int保存资产链id。 +3. 2个byte存储无符号16位int保存资产id。 +4. 32个byte存储BigInteger类型的数值数据保存出金资产数量。 +5. 变长类型存储账户nonce值。 +6. 1个byte存储锁定状态(共识用) + +##### [CoinTo](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/CoinTo.java) +1. 变长类型存储账户地址。[Address序列化代码](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/basic/AddressTool.java) +2. 2个byte存储无符号16位int保存资产链id。 +3. 2个byte存储无符号16位int保存资产id。 +4. 32个byte存储BigInteger类型的数值数据保存出金资产数量。 +5. 8个byte存储带符号的64位long保存锁定时间(锁定资产的时间) + +##### [TransactionSignature](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/signture/TransactionSignature.java) +交易前面会存在多人签名的情况,所以TransactionSignature里面存储的实际上是签名数据列表。byte数组中按顺序依次存储多个签名。反序列化时依次轮训。 +1. 1个byte存储公钥长度。 +2. 公钥数据(长度根据1中获取) +3. 变长类型存储签名数据。 + +##### [BlockHeader](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/data/BlockHeader.java) +BlockHeader为区块头对象,主要存储前一块的hash值、[merkle tree](https://en.wikipedia.org/wiki/Merkle_tree)的根hash值、出块时间戳、区块高度、块中的交易总数、区块签名、扩展数据。 +序列化规则: +1. 32个byte存储前一个块的hash值。 +2. 32个byte存储merkle根的hash值。 +3. 4个byte存储无符号的32位int保存出块时间戳(1970年1月1日到当前的秒数)。 +4. 4个byte存储无符号的32位int保存区块高度。 +5. 4个byte存储无符号的32位int保存当前块中的交易总数。 +6. 变长类型存储扩展数据。 +7. 变长类型存储交易签名字符串,为BlockSignature对象序列化后的16进制的字符串。 + +##### [BlockSignature](https://github.com/nuls-io/nuls-v2/blob/master/common/nuls-base/src/main/java/io/nuls/base/signture/BlockSignature.java) +1. 1个byte存储公钥长度。 +2. 公钥数据(长度根据1中获取) +3. 变长类型存储签名数据。 + +##### 变长类型存储结构 +变长类型由2部分组成,第一部分为varint类型存储数据所占byte位的长度,第二部分为数据部分。读取变长类型结构的方式是先读取varint数据,冉读取对应长度的业务数据。 +1. [varint](https://learnmeabitcoin.com/glossary/varint)类型存储数据byte数组长度。 +2. 将业务数据转换成byte数组存储进去。 + + + + +### 模块模板列表 +* [java模块开发模板](https://github.com/nuls-io/nuls-module-template-java) +* [区块链浏览器模板](https://github.com/nuls-io/nuls-module-explorer) + +### 文档列表 +* [Java模块开发模板使用文档](https://github.com/nuls-io/nuls-module-template-java) +* [加密信息示例模块设计文档](./example/模块设计文档.md) +* [账户模块RPC接口文档](./document/account.md) +* [账本模块RPC接口文档](./document/ledger.md) +* [交易模块RPC接口文档](./document/transaction.md) +* [区块模块RPC接口文档](./document/block.md) +* [共识模块RPC接口文档](./document/consensus.md) +* [网络模块RPC接口文档](./document/netwrok.md) + +### Contribution + +Contributions to NULS are welcomed! We sincerely invite developers who experienced in blockchain field to join in NULS technology community. Details: s: https://nuls.communimunity/d/9-recruitment-of-community-developers To be a great community, Nuls needs to welcome developers from all walks of life, with different backgrounds, and with a wide range of experience. + +### License + +Nuls is released under the [MIT](http://opensource.org/licenses/MIT) license. +Modules added in the future may be release under different license, will specified in the module library path. + +### Community + +- [nuls.io](https://nuls.io/) +- [@twitter](https://twitter.com/nulsservice) +- [facebook](https://www.facebook.com/nulscommunity/) +- [YouTube channel](https://www.youtube.com/channel/UC8FkLeF4QW6Undm4B3InN1Q?view_as=subscriber) +- Telegram [NULS Community](https://t.me/Nulsio) +- Telegram [NULS 中文社区](https://t.me/Nulscn) + +#### diff --git a/docs/zh/NULS2.0/chainbox/createtx.png b/docs/zh/NULS2.0/chainbox/createtx.png new file mode 100644 index 00000000..1f8f3461 Binary files /dev/null and b/docs/zh/NULS2.0/chainbox/createtx.png differ diff --git a/docs/zh/NULS2.0/chainbox/handnetworktx.png b/docs/zh/NULS2.0/chainbox/handnetworktx.png new file mode 100644 index 00000000..1e1a8f6f Binary files /dev/null and b/docs/zh/NULS2.0/chainbox/handnetworktx.png differ diff --git a/docs/zh/NULS2.0/chainbox/pic01.jpeg b/docs/zh/NULS2.0/chainbox/pic01.jpeg new file mode 100644 index 00000000..f68b29c4 Binary files /dev/null and b/docs/zh/NULS2.0/chainbox/pic01.jpeg differ diff --git a/docs/zh/NULS2.0/consensusTransaction.md b/docs/zh/NULS2.0/consensusTransaction.md new file mode 100644 index 00000000..59065151 --- /dev/null +++ b/docs/zh/NULS2.0/consensusTransaction.md @@ -0,0 +1,310 @@ +# 合约共识交易说明 + +共识模块提供了四种与合约相关的共识交易,在模块启动时向合约模块注册创建四种合约共识交易的命令,使合约模块能够调用,使之可以创建与注销共识节点、委托与取消委托共识节点 + +## 1. 生成合约共识交易 + +### 1.1 创建共识节点 + +- 原始参数表 + + > **`创建共识节点的地址`、`共识奖励地址`固定为`当前合约地址`** + + + |名称 |描述 |类型 |是否可选 |备注 | + |:--:|:--:|:--:|:--:|:--:| + |packingAddress |打包地址 |byte[] |是 |方法调用必填| + |deposit |保证金 |BigInteger |是 |方法调用必填| + |commissionRate |佣金比例 |byte |是 |方法调用必填 - 范围[10,100]| + |agentAddress |创建节点地址 |byte[] |**否** |底层默认为**`当前合约地址`**| + |rewardAddress |奖励地址 |byte[] |**否** |底层默认为**`当前合约地址`**| + +- 注册信息 + + > **共识模块向智能合约模块注册的创建合约共识节点的交易命令信息** + + |模块代码 |cmd名称 |注册类型 |参数名称列表 |返回值类型 |备注 | + |:--:|:--:|:--:|:--:|:--:|:--:| + |consensus | cs_createContractAgent |0(NEW_TX)|List.of("packingAddress","deposit","commissionRate")|1(STRING_ARRAY) |创建共识节点| + +- 交易类型 + + **txType = `20`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + > + > 调用此方法时,共识模块此命令将收到以下参数 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |packingAddress |打包地址 |String |AddressTool.getStringAddressByBytes(byte[])|略| + |deposit |保证金 |String |BigInteger - toString|略| + |commissionRate |佣金比例 |String |Byte - toString|范围[10,100]| + |chainId |当前链ID |int |-|底层提供参数| + |contractAddress |合约地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractSender |合约调用者地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractBalance |合约地址的当前余额 |String |BigInteger -toString|底层提供参数 - 生成交易时使用此值校验余额| + |contractNonce |合约地址的当前nonce值 |String |RPCUtil.encode(byte[])|底层提供参数 - 生成交易时使用此nonce组装交易| + |blockTime |当前打包的区块时间 |long |-|底层提供参数 - 生成交易时用此作为交易时间| + +- 返回值说明 + + - 智能合约虚拟机收到的是**`String[]`** 字符串数组类型 + + |index |描述 |字符串转换逻辑 | + |:--:|:--:|:--:| + |0 |交易hash |略| + |1 |交易序列化字符串 |RPCUtil.encode(byte[])| + + - 调用者收到的是**`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +### 1.2 合约委托共识节点 + +- 原始参数 + + > **`委托地址`固定为`当前合约地址`** + + |名称 |描述 |类型 |是否可选 |备注 | + |:--:|:--:|:--:|:--:|:--:| + |agentHash |创建合约共识节点交易hash |String |是 |方法调用必填| + |deposit |委托金额 |BigInteger |是 |方法调用必填| + |address |委托地址 |byte[] |**否** |底层默认为**`当前合约地址`**| + +- 注册信息 + + > **共识模块向智能合约模块注册的创建合约委托共识节点的交易命令信息** + + |模块代码 |cmd名称 |注册类型 |参数名称列表 |返回值类型 |备注 | + |:--:|:--:|:--:|:--:|:--:|:--:| + |consensus | cs_contractDeposit |0(NEW_TX)|List.of("agentHash","deposit")|1(STRING_ARRAY) |委托共识节点| + +- 交易类型 + + **txType = `21`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + > + > 调用此方法时,共识模块此命令将收到以下参数 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |agentHash |创建合约共识节点交易hash |String |略|略| + |deposit |委托金额 |String |BigInteger - toString|略| + |chainId |当前链ID |int |-|底层提供参数| + |contractAddress |合约地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractSender |合约调用者地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractBalance |合约地址的当前余额 |String |BigInteger - toString|底层提供参数 - 生成交易时使用此值校验余额| + |contractNonce |合约地址的当前nonce值 |String |RPCUtil.encode(byte[])|底层提供参数 - 生成交易时使用此nonce组装交易| + |blockTime |当前打包的区块时间 |long |-|底层提供参数 - 生成交易时用此作为交易时间| + +- 返回值说明 + + - 智能合约虚拟机收到的是**`String[]`** 字符串数组类型 + + |index |描述 |字符串转换逻辑 | + |:--:|:--:|:--:| + |0 |交易hash |略| + |1 |交易序列化字符串 |RPCUtil.encode(byte[])| + + - 调用者收到的是**`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +### 1.3 合约退出共识节点 + +- 原始参数 + + > **`创建节点的地址`固定为`当前合约地址`** + + |名称 |描述 |类型 |是否可选 |备注 | + |:--:|:--:|:--:|:--:|:--:| + |joinAgentHash |加入共识时的交易hash |String |是 |方法调用必填| + |agentAddress |创建节点的地址 |byte[] |**否** |底层默认为**`当前合约地址`**| + +- 注册信息 + + > **共识模块向智能合约模块注册的创建合约退出共识节点的交易命令信息** + + |模块代码 |cmd名称 |注册类型 |参数名称列表 |返回值类型 |备注 | + |:--:|:--:|:--:|:--:|:--:|:--:| + |consensus | cs_contractWithdraw |0(NEW_TX)|List.of("joinAgentHash")|1(STRING_ARRAY) |退出委托共识节点| + +- 交易类型 + + **txType = `22`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + > + > 调用此方法时,共识模块此命令将收到以下参数 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |joinAgentHash |加入共识时的交易hash |String |略|略| + |chainId |当前链ID |int |-|底层提供参数| + |contractAddress |合约地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractSender |合约调用者地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |blockTime |当前打包的区块时间 |long |-|底层提供参数 - 生成交易时用此作为交易时间| + +- 返回值说明 + + - 智能合约虚拟机收到的是**`String[]`** 字符串数组类型 + + |index |描述 |字符串转换逻辑 | + |:--:|:--:|:--:| + |0 |交易hash |略| + |1 |交易序列化字符串 |RPCUtil.encode(byte[])| + + - 调用者收到的是**`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + + +### 1.4 合约注销共识节点 + +- 原始参数 + + > **`创建节点的地址`固定为`当前合约地址`** + + |名称 |描述 |类型 |是否可选 |备注 | + |:--:|:--:|:--:|:--:|:--:| + |agentAddress |创建节点的地址 |byte[] |**否** |底层默认为**`当前合约地址`**| + +- 注册信息 + + > **共识模块向智能合约模块注册的创建合约注销共识节点的交易命令信息** + + |模块代码 |cmd名称 |注册类型 |参数名称列表 |返回值类型 |备注 | + |:--:|:--:|:--:|:--:|:--:|:--:| + |consensus |cs_stopContractAgent |0(NEW_TX)|`empty list`|1(STRING_ARRAY) |注销共识节点| + +- 交易类型 + + **txType = `23`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + > + > 调用此方法时,共识模块此命令将收到以下参数 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |chainId |当前链ID |int |-|底层提供参数| + |contractAddress |合约地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |contractSender |合约调用者地址 |String |AddressTool.getStringAddressByBytes(byte[])|底层提供参数| + |blockTime |当前打包的区块时间 |long |-|底层提供参数 - 生成交易时用此作为交易时间| + +- 返回值说明 + + - 智能合约虚拟机收到的是**`String[]`** 字符串数组类型 + + |index |描述 |字符串转换逻辑 | + |:--:|:--:|:--:| + |0 |交易hash |略| + |1 |交易序列化字符串 |RPCUtil.encode(byte[])| + + - 调用者收到的是**`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + + +## 2. 合约共识交易数据获取方式 + +合约共识交易没有签名,由每个节点验证区块时生成这类交易,另外,这类交易也不在广播数据的范围内,需要从另外的接口调取,详细数据请通过 **以下接口** 来得到交易的_序列化字符串_数据。 + +以下是包含合约内部转账交易的执行结果 + +> 通过`RESTFUL`接口`/api/contract/result/{hash}` +> +> 或者 +> +> 通过`JSONRPC`接口`getContractTxResult `, 请求数据: + +```json +{ +"jsonrpc":"2.0", +"method":"getContractTxResult", +"params":[chainId, hash], +"id":1234 +} +``` +> +> 获取合约的执行结果 + +以下结果中,`contractTxList`即是本次合约执行后生成的交易,注意:这个结构里不限于合约共识交易,根据业务的不同会生成不同的合约内部交易,比如合约NULS资产转出交易 --> [智能合约NULS资产转出交易说明](./assetsOff.html) + +```json +{ + "success": true, + "data": { + "flag": true, + "data": { + "success" : true, + "errorMessage" : null, + "contractAddress" : "tNULSeBaNBdmatSnyhbgwm2gdkJHzKtpR2nGbQ", + "result" : null, + "gasLimit" : 200000, + "gasUsed" : 13766, + "price" : 25, + "totalFee" : "5100000", + "txSizeFee" : "100000", + "actualContractFee" : "344150", + "refundFee" : "4655850", + "value" : "2000000000000", + "stackTrace" : null, + "transfers" : [ ], + "events" : [ ], + "tokenTransfers" : [ ], + "invokeRegisterCmds" : [ { + "cmdName" : "cs_createContractAgent", + "args" : { + "contractBalance" : "2000000000000", + "commissionRate" : "100", + "chainId" : 2, + "deposit" : "2000000000000", + "contractAddress" : "tNULSeBaNBdmatSnyhbgwm2gdkJHzKtpR2nGbQ", + "contractNonce" : "0000000000000000", + "blockTime" : 1562930111, + "packingAddress" : "tNULSeBaMtEPLXxUgyfnBt9bpb5Xv84dyJV98p", + "contractSender" : "tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG" + }, + "cmdRegisterMode" : "NEW_TX", + "newTxHash" : "6278df86951ef140b98a57a27ff764453ae437d8aea2888ded886eb70ee11348" + } ], + "contractTxList" : [ + "1400bf6b285d006600204aa9d1010000000000000000000000000000000000000000000000000000020002f246b18e8c697f00ed9bd22696998e469d3f824b020001d7424d91c83566eb94233b5416f2aa77709c03e1020002f246b18e8c697f00ed9bd22696998e469d3f824b648c0117020002f246b18e8c697f00ed9bd22696998e469d3f824b0200010000204aa9d1010000000000000000000000000000000000000000000000000000080000000000000000000117020002f246b18e8c697f00ed9bd22696998e469d3f824b0200010000204aa9d1010000000000000000000000000000000000000000000000000000ffffffffffffffff00" + ], + "remark" : "call" + } + } +} +``` + + + + + + + + + + + + + diff --git a/docs/zh/NULS2.0/developModule/11.png b/docs/zh/NULS2.0/developModule/11.png new file mode 100755 index 00000000..830865d8 Binary files /dev/null and b/docs/zh/NULS2.0/developModule/11.png differ diff --git a/docs/zh/NULS2.0/developeModule.md b/docs/zh/NULS2.0/developeModule.md new file mode 100644 index 00000000..7041d1b5 --- /dev/null +++ b/docs/zh/NULS2.0/developeModule.md @@ -0,0 +1,64 @@ +# 开发业务模块 +> 该文档为Java版本的业务模块开发指南 + + +nuls-module-java-template可配合NULS ChainBox帮助你快速构建基于java实现的区块链业务模块。模板中引用了io.nuls.v2下nuls-core-rpc、nuls-base两个核心程序包,前者实现了与模块的基础通信协议,后者包含了区块的基础数据结构及工具类。 +## 文件结构 + +``` +. +├── README.md +├── build # 构建相关脚本 +├── init.sh # 初始化项目脚本 +├── module.ncf # 模块配置文件 +├── package # 构建脚本 +├── pom.xml # maven pom.xml +└── src # java源代码 +``` +## 使用模板 +使用NULS ChainBox项目tools脚本下载此模板。 + +``` +tools -t java demo #demo为自定义的模块名称 +``` +下载完成后,tools将自动将pom.xml、module.ncf里面定义的模块名称替换成demo,使用常用的java开发工具通过导入maven工程的方式导入项目。 + +## 源码结构 + +``` +. +└── io + └── nuls + ├── MyModule.java #需要实现的模块启动类,在类中实现模块准备工作,包括注册交易、初始化数据表、web服务等。 + ├── NulsModuleBootstrap.java #模块启动类,通常不用修改 + ├── Utils.java #工具类,实现了交易签名功能 + ├── rpctools #rpc工具包 + │   ├── AccountTools.java #账户模块相关工具函数 + │   ├── CallRpc.java + │   ├── LegderTools.java #账本模块相关工具函数 + │   ├── TransactionTools.java #交易模块相关工具函数 + │   └── vo #数据对象包 + │   ├── Account.java + │   ├── AccountBalance.java + │   └── TxRegisterDetail.java + └── txhandler #交易回调函数包 + ├── TransactionDispatcher.java #交易回调函数分发器 + ├── TransactionProcessor.java #交易回调函数接口定义 + └── TxProcessorImpl.java #交易回调函数接口实现,需要开发人员实现 +``` +## 实现业务模块 +1. 定义交易类型,在模块启动时(MyModule.startModule)调用TransactionTools.registerTx方法完成交易注册。 +2. 实现创建交易入口,组装交易,并在txData中存储业务数据,调用TransactionTools.registerTx.newTx方法在交易模块创建交易。 +3. 实现TxProcessorImpl.validate方法,完成交易业务验证代码。 +4. 实现TxProcessorImpl.commit方法,完成交易业务数据保存代码。 +5. 实现TxProcessorImpl.rollback方法,完成交易业务数据回滚代码。 +6. 实现业务数据消费场景代码。 + +## 构建模块 +执行package脚本,会把模块按照NULS2.0的运行要求进行构建,将把打包好的jar包、启动脚本、停止脚本、Module.ncf构建到outer文件夹下。 + +``` +./package +============ PACKAGE FINISH 🍺🍺🍺🎉🎉🎉 =============== +``` + diff --git a/docs/zh/NULS2.0/encryptedMessageDesign.md b/docs/zh/NULS2.0/encryptedMessageDesign.md new file mode 100644 index 00000000..21a4c484 --- /dev/null +++ b/docs/zh/NULS2.0/encryptedMessageDesign.md @@ -0,0 +1,245 @@ +# 加密信息模块示例 +## 功能设计 +模块实现的核心业务是两个地址直接进行文本消息的收发,将会把加密后的消息内容存储在链上和节点文件系统中。 +### 核心功能点 +1. 为地址绑定全链唯一的昵称地址。 +2. 给指定昵称地址发送信息。 +3. 接收信息。 +4. 查看信息详情。 + +### 次要功能点 +1. 查看收件箱和发件箱信息列表。 +2. 绑定昵称地址和发送信息额外支付手续费 + +## 概要设计 +### 绑定昵称地址 +创建申请昵称地址交易类型(type_200),业务数据(txData)包括申请地址、昵称地址、地址公钥。验证交易时,需要验证昵称地址是否已经被占用、申请地址是否已经绑定或昵称、申请地址的账户余额是否足够支付申请手续费和交易手续费。当交易确认后,节点将把申请地址、昵称地址、公钥3个数据建立联系并存储到文件系统中。 + +绑定昵称地址功能的作用有两点 +1. 提供比账户地址更利于人类记忆和书写的格式。 +2. 通过账户发生交易获取到账户地址的公钥,在发送信息时需要通过公钥对信息内容进行非对称加密。 + +### 发送信息 +创建发送信息交易类型(type_201),业务数据(txData)中存储发件人地址(非昵称地址)、收件人地址(非昵称地址)、发送时间、加密后的信息标题、加密后的信息内容、发件人阅读权限key,收件人阅读权限key。 +#### 组装交易 +发送信息的参数为发件人昵称地址、账户密码、收件人昵称地址、信息标题、信息内容。处理步骤如下: +1. 通过收件人昵称地址查询到收件人昵称信息,获取到收件人账户地址、收件人账户公钥。 +2. 生成一对加密信息的钥匙对(KEY),通过公钥对信息标题和信息内容进行加密处理;通过收件人和发件人的公钥对KEY的私钥进行加密分别获得收件人阅读权限key和发件人阅读权限key。在查看信息内容时首先通过自己的私钥解密对应的阅读权限key,然后用阅读权限key解密信息标题和信息内容。从而达到数据公开存储,但只能发件人和收件人才能查看内容的目的。 + +#### 验证交易 +1. 验证发件人账户地址绑定昵称地址。 +2. 验证收件昵称地址是否有效。 +3. 验证是否转入指定数量资产到手续费账户。 + +#### 保存信息数据 +因为是演示模块,避免不必要的复杂度,存储没有采用数据库存储,而使用文件系统存储。信息存储主要存储信息与收件人、发件人的关系,以及信息内容。 +1. 创建sender和recipient两个文件夹存储账户地址与信息所在交易hash的关系。文件夹中以地址为文件名创建文件,文件中每一行存储一条此账户地址有关的信息交易hash。sender文件夹存储发件人与信息交易hash的关系,recipient文件夹存储收件人与信息交易hash的关系。 +2. 创建mail-data文件夹存储信息,使用信息交易hash值作为文件名创建存储文件,文件内容为信息内容byte数组的16进制字符串。 + +### 读取信息 +#### 解密信息信息 +信息内容是加密后存储,读取时需要进行解密操作。解密失败抛出异常。解密流程如下: +1. 通过信息hash值获取信息内容。 +2. 反序列化信息内容,首先将16进制转换成byte数组,然后按照以下顺序规则解析byte数组 + + > 1. 变长类型存储收件人账户地址 + > 2. 变成类型存储发件人账户地址 + > 3. 变长类型存储收件人阅读权限key + > 4. 变长类型存储发件人阅读权限key + > 5. 变长类型存储信息标题 + > 6. 变长类型存储信息内容 + > 7. 4个byte存储64位int时间戳(1970年1月1日到当前毫秒数) +1. 通过地址比较判断当前账户是收件人还是发件人,通过私钥解密对应的阅读权限key。 +2. 通过解密后的阅读权限key解密信息标题和信息内容。 + +#### 读取收件列表或发件列表 +在sender和recipient文件夹下找到账户地址同名的文件,按行读取hash值,然后使用hash值通过[解密信息信息](#解密信息信息)获取信息详情,最后组装成列表。 +### 收取手续费 +通过验证绑定昵称交易和发送信息交易的CoinData里是否包含向指定的黑洞地址(手续费地址)转入指定数量资产来实现手续费收取。 + +## 详细设计 +### 源代码包结构 +``` +. +└── io + └── nuls + ├── Config.java + ├── Constant.java + ├── MyModule.java + ├── NulsModuleBootstrap.java + ├── Utils.java + ├── controller + │   ├── CreateMailAddressController.java + │   ├── GetMailController.java + │   ├── SendMailController.java + │   ├── core + │   │   ├── BaseController.java + │   │   ├── NulsResourceConfig.java + │   │   ├── Result.java + │   │   └── WebServerManager.java + │   └── vo + │   ├── CreateMailAddressReq.java + │   ├── GetMailListReq.java + │   ├── MailAddressData.java + │   ├── MailContentData.java + │   ├── SendMailReq.java + │   └── ViewMailReq.java + ├── rpc + │   ├── AccountTools.java + │   ├── CallRpc.java + │   ├── LegderTools.java + │   ├── TransactionTools.java + │   └── vo + │   ├── Account.java + │   ├── AccountBalance.java + │   └── TxRegisterDetail.java + ├── service + │   ├── MailAddressService.java + │   ├── SendMailService.java + │   └── dto + │   ├── MailAddress.java + │   └── MailContent.java + └── txhander + ├── MailAddressProcessor.java + ├── SendMailProcessor.java + ├── TransactionDispatcher.java + └── TransactionProcessor.java +``` +#### Config.java +配置文件,通过nuls-core包的配置文件系统将外部NULS2.0通用配置读取到类中,本模块中需要使用chainId(链id)、assetId(资产id)、dataPath(数据存储路径),这3个配置属于全局通用配置,直接读取即可。另外定义了mailAddressFee(绑定昵称手续费)、sendMailFee(发送信息手续费)两个业务配置项,需要在module.ncf中配置。 + +#### Constant.java +常量定义类,定义了绑定昵称交易类型(200)、发送信息交易类型(201)、手续费黑洞地址。 + +#### MyModule.java +模块启动类,申明当前模块依赖account(账户)、ledger(账本)、transaction(交易)3个模块。nuls-core-rpc程序包将自动与这3个模块建立websocket长连接。 +完成模块初始化工作: +1. 创建存储数据的文件夹。 +2. 向交易模块注册交易类型。 +3. 初始化Restful WebServer服务(用户操作接口使用http协议提供)。 + +#### controller包 +controller包提供用户操作接口 +##### CreateMailAddressController.java +绑定账户昵称地址相关接口。 +##### GetMailController.java +获取昵称信息相关接口。 +##### SendMailController.java +发送信息相关接口 +##### core和vo包 +HTTP接口框架及接口协议相关。 +#### rpc包 +访问其他模块的RPC接口相关工具类。 +#### service包 +数据存储逻辑相关包。 +##### MailAddressService.java +存储账户绑定的昵称地址信息相关服务。 +##### SendMailService.java +发送信息及查询信息信息相关服务。 +#### dto包 +定义数据存储对象 +#### txhander包 +交易回调函数包 +##### TransactionDispatcher.java +定义回调函数的RPC接口,根据交易类型分发到具体的处理类。 +##### MailAddressProcessor.java +定义处理绑定昵称地址交易类型(type_200)的回调函数。 +##### SendMailProcessor.java +定义处理发送信息交易类型(type_201)的回调函数。 + +### 用户操作接口列表 +用户操作接口使用http方式提供,Request和Response的Content type为application/json,端口为9999。 +#### 返回值通用协议 + +``` +{ + "success": true, //成功状态 + "data": null, //返回的数据 + "msg": null //失败的原因 +} +``` +#### 绑定昵称地址 +##### 访问路径:/mail/createMailAddress +##### 请求方式: POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 申请账户地址 | +| mailAddress | string | 申请绑定的昵称地址 | +| password | string | 账户密码 | +##### 返回值 string +交易的txHash值。 +#### 查询指定账户地址绑定的昵称地址 +##### 访问路径:/mail/getMailAddress/{address} +##### 请求方式:GET +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +##### 返回值 string +昵称地址 +#### 发送信息 +##### 访问路径:/mail/sendMail +##### 请求方式:POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| mailAddress | string | 收件人昵称地址 | +| senderAddress | string | 发件人账户地址 | +| password | string | 发件人账户密码 | +| title | string | 信息标题 | +| content | string | 信息内容 | +##### 返回值 string +交易txHash +#### 获取指定信息详情 +##### 访问路径:/mail/viewMail +##### 请求方式:POST +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +| password | string | 账户密码 | +| hash | string | 信息交易hash| + +##### 返回值 object + +| 参数名 | 说明 | +| --- | --- | +| hash | 信息交易hash | +| senderMailAddress | 发件人昵称地址 | +| receiverMailAddress | 收件人昵称地址 | +| title | 信息标题 | +| content | 信息内容 | +| sender | 发件人账户地址 | +| date | 发件日期 | + + +#### 获取收件箱列表、获取发件箱列表 + +##### 访问路径:/mail/getSendList、/mail/getReceiveList + +##### 请求方式:POST + +##### 参数列表 + +| 参数名 | 参数类型 | 说明 | +| --- | --- | --- | +| address | string | 账户地址 | +| password | string | 账户密码 | + +##### 返回值 list + +| 参数名 | 说明 | +| --- | --- | +| hash | 信息交易hash | +| senderMailAddress | 发件人昵称地址 | +| receiverMailAddress | 收件人昵称地址 | +| title | 信息标题 | +| content | 信息内容 | +| sender | 发件人账户地址 | +| date | 发件日期 | + diff --git a/docs/zh/NULS2.0/excuteResult.md b/docs/zh/NULS2.0/excuteResult.md new file mode 100644 index 00000000..ef895398 --- /dev/null +++ b/docs/zh/NULS2.0/excuteResult.md @@ -0,0 +1,85 @@ +# 执行结果说明 + +## 执行结果说明 + +```json +{ + "success": true, `合约执行是否成功`, + "errorMessage": null, `失败原因 - string, eg. not enough gas`, + "contractAddress": "tNULSeBaN1rhd9k9eqNkvwC9HXBWLQ79dRuy81", + "result": "multyForAddress: 888634777633", + "gasLimit": 200000, + "gasUsed": 20038, + "price": 25, + "totalFee": "5100000", + "txSizeFee": "100000", + "actualContractFee": "500950", + "refundFee": "4499050", + "value": 10000000000, `合约调用者向合约地址转入的NULS,没有此业务时是0` + "stackTrace": null, `失败的异常堆栈信息 - string, 执行失败也不一定有`, + "transfers": [ + `这是是指合约地址转出主网币(NULS)的交易信息,与token无关,与token无关,与token无关,正常情况下,token转账的合约交易不会有此类交易,以下是示例` + { + "txHash": "4877f6a865dea5b4ac82a8370d73e62da15bc7acb2145a03822dddfdab329d2b", + "from": "tNULSeBaN1rhd9k9eqNkvwC9HXBWLQ79dRuy81", + "value": "200000000", + "outputs": [ + { + "to": "tNULSeBaMp9wC9PcWEcfesY7YmWrPfeQzkN1xL", + "value": "100000000" + }, + { + "to": "tNULSeBaMshNPEnuqiDhMdSA4iNs6LMgjY6tcL", + "value": "100000000" + } + ], + "orginTxHash": "b5473eefecd1c70ac4276f70062a92bdbfe8f779cbe48de2d0315686cc7e6789" + } + ], + "events": [ + `合约内发送的事件信息 - 按token合约标准来说,一笔合约token转账会发送相应的一笔名为TransferEvent的事件信息,支持一次合约调用交易内进行多笔token转账` + `返回的事件内容结构是JSON结构` + "{\"contractAddress\":\"TTb1LZLo6izPGmXa9dGPmb5D2vpLpNqA\",\"blockNumber\":1343847,\"event\":\"TransferEvent\",\"payload\":{\"from\":\"TTasNs8MGGGaFT9hd9DLmkammYYv69vs\",\"to\":\"TTau7kAxyhc4yMomVJ2QkMVECKKZK1uG\",\"value\":\"1000\"}}" + ], + "tokenTransfers": [ + `针对以上token转账事件(TransferEvent)进行的数据加工,补充了发生token转账的合约的基本信息 - name, symbol, decimals` + `注意1:这里的value是合约token数值转换后的去小数化存储值,同以太坊token方式` + `注意2: 产生的token转账的合约地址不一定是当前调用的合约,所以在这个数据结构里有contractAddress属性,它不是冗余字段` + { + "contractAddress": "TTb1LZLo6izPGmXa9dGPmb5D2vpLpNqA", + "from": "TTasNs8MGGGaFT9hd9DLmkammYYv69vs", + "to": "TTau7kAxyhc4yMomVJ2QkMVECKKZK1uG", + "value": "1000", + "name": "a", + "symbol": "a", + "decimals": 8 + } + ], + "invokeRegisterCmds": [ + `合约创建共识,调用的外部命令记录` + { + "cmdName": "cs_createContractAgent", + "args": { + "contractBalance": "2030000000000", + "commissionRate": "100", + "chainId": 2, + "deposit": "2000000000000", + "contractAddress": "tNULSeBaMzZedU4D3xym1JcyNa5sqtuFku8AKm", + "contractNonce": "0000000000000000", + "blockTime": 1562564381, + "packingAddress": "tNULSeBaMtEPLXxUgyfnBt9bpb5Xv84dyJV98p", + "contractSender": "tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG" + }, + "cmdRegisterMode": "NEW_TX", + "newTxHash": "a8eae11b52990e39c9d3233ba1d2c8827336d261c0f14aca43dd4f06435dfaba" + } + ], + "contractTxList": [ + `当前执行智能合约后生成的交易` + "12002fbb225d0037b5473eefecd1c70ac4276f70062a92bdbfe8f779cbe48de2d0315686cc7e678902000253472f4702eb83b71871a4c4e0c71526bb86b8afd0011702000253472f4702eb83b71871a4c4e0c71526bb86b8af0200010000c2eb0b0000000000000000000000000000000000000000000000000000000008000000000000000000021702000194f6239c075d184e265eaea97a67eeced51725160200010000e1f50500000000000000000000000000000000000000000000000000000000000000000000000017020001ce8ffa95606f0bfd2778cff2eff8fe8999e20c440200010000e1f50500000000000000000000000000000000000000000000000000000000000000000000000000", + "1400bf6b285d006600204aa9d1010000000000000000000000000000000000000000000000000000020002f246b18e8c697f00ed9bd22696998e469d3f824b020001d7424d91c83566eb94233b5416f2aa77709c03e1020002f246b18e8c697f00ed9bd22696998e469d3f824b648c0117020002f246b18e8c697f00ed9bd22696998e469d3f824b0200010000204aa9d1010000000000000000000000000000000000000000000000000000080000000000000000000117020002f246b18e8c697f00ed9bd22696998e469d3f824b0200010000204aa9d1010000000000000000000000000000000000000000000000000000ffffffffffffffff00" + ], + "remark": "call" +} +``` + diff --git a/docs/zh/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg b/docs/zh/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg new file mode 100644 index 00000000..04a251a1 Binary files /dev/null and b/docs/zh/NULS2.0/howToUseNulsBuildChain/clip_image002.jpg differ diff --git a/docs/zh/NULS2.0/ideaPlugin.md b/docs/zh/NULS2.0/ideaPlugin.md new file mode 100644 index 00000000..3e19384c --- /dev/null +++ b/docs/zh/NULS2.0/ideaPlugin.md @@ -0,0 +1,99 @@ +# IDEA插件 + +#### 1 在IDEA安装NULS插件 +- [获取NULS插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip)ZIP包,存放在磁盘 +点击File->Settings->Plugin->Install plugin from disk + +![Install](./pluginImages/Install.jpg) + +- 选择之前获取到的ZIP包,然后点击OK + +![Install](./pluginImages/Install2.jpg) + +- 勾选上NULS插件,点击Apply + +![Install](./pluginImages/Install3.jpg) + +#### 2 创建一个NULS项目 + +![create](./pluginImages/createProject.jpg) + +输入Project名,点击finish + + +![create](./pluginImages/createProject2.jpg) + +#### 3 编写智能合约 + +智能合约代码编写可查看[开发者文档](http://dev.nuls.io/contract/) + +![code](./pluginImages/code.jpg) + +#### 4 设置部署合约的节点和账户 + +- 点击右方的NULS插件,调出NULS插件面板 + + ![code](./pluginImages/Deploy.jpg) + +- 插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址 + + 点击面板左上角的+号,选择Add Node + + ![code](./pluginImages/Add.jpg) + +- 输入Node地址,点击OK + + ![code](./pluginImages/Add3.jpg) + +- 点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK + + ![code](./pluginImages/Add5.jpg) + +#### 5 打包合约 + +- 点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码 + + ![code](./pluginImages/package.jpg) + +- 可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤) + + ![code](./pluginImages/package1.jpg) + +- 点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面 + + ![code](./pluginImages/package3.jpg) + + ![code](./pluginImages/package2.jpg) + +#### 6 部署合约 + +- 在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径 + + ![code](./pluginImages/package4.jpg) + +- 紧接JarFilePath的参数为该合约构造函数的参数 + + ![code](./pluginImages/Deploy2.jpg) + +- 点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败 + + ![code](./pluginImages/Deploy3.jpg) + +- 点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息 + + ![code](./pluginImages/Deploy4.jpg) + +- 若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功 + + ![code](./pluginImages/Deploy5.jpg) + +- 可在面板上方查看已部署的合约 + + ![code](./pluginImages/Deploy6.jpg) + +- 点击部署成功的合约,可查看该合约的所有方法 + + ![code](./pluginImages/Deploy7.jpg) + + + diff --git a/docs/zh/NULS2.0/image/account-module/account-context.png b/docs/zh/NULS2.0/image/account-module/account-context.png new file mode 100644 index 00000000..b084438c Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-context.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-create-address.png b/docs/zh/NULS2.0/image/account-module/account-create-address.png new file mode 100644 index 00000000..7e50869f Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-create-address.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-create-offline.png b/docs/zh/NULS2.0/image/account-module/account-create-offline.png new file mode 100644 index 00000000..d4c178be Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-create-offline.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-export-keystore.png b/docs/zh/NULS2.0/image/account-module/account-export-keystore.png new file mode 100644 index 00000000..67ebbec3 Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-export-keystore.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-export-prikey.png b/docs/zh/NULS2.0/image/account-module/account-export-prikey.png new file mode 100644 index 00000000..532c06ef Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-export-prikey.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-functions.png b/docs/zh/NULS2.0/image/account-module/account-functions.png new file mode 100644 index 00000000..71eea643 Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-functions.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-import-keystore.png b/docs/zh/NULS2.0/image/account-module/account-import-keystore.png new file mode 100644 index 00000000..4871cf7d Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-import-keystore.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-import-prikey.png b/docs/zh/NULS2.0/image/account-module/account-import-prikey.png new file mode 100644 index 00000000..b631b421 Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-import-prikey.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-module.png b/docs/zh/NULS2.0/image/account-module/account-module.png new file mode 100644 index 00000000..39b3fb20 Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-module.png differ diff --git a/docs/zh/NULS2.0/image/account-module/account-remove-address.png b/docs/zh/NULS2.0/image/account-module/account-remove-address.png new file mode 100644 index 00000000..b0f59aa1 Binary files /dev/null and b/docs/zh/NULS2.0/image/account-module/account-remove-address.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-basic-validation.png b/docs/zh/NULS2.0/image/block-module/block-basic-validation.png new file mode 100644 index 00000000..2f07385c Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-basic-validation.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-basic-validation1.png b/docs/zh/NULS2.0/image/block-module/block-basic-validation1.png new file mode 100644 index 00000000..98b0f55c Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-basic-validation1.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-basic-validation2.png b/docs/zh/NULS2.0/image/block-module/block-basic-validation2.png new file mode 100644 index 00000000..04b3eaeb Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-basic-validation2.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-context.png b/docs/zh/NULS2.0/image/block-module/block-context.png new file mode 100644 index 00000000..ad652a32 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-context.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-fork-chain.png b/docs/zh/NULS2.0/image/block-module/block-fork-chain.png new file mode 100644 index 00000000..6eaf2d28 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-fork-chain.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-fork.png b/docs/zh/NULS2.0/image/block-module/block-fork.png new file mode 100644 index 00000000..498d28a0 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-fork.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-functions.png b/docs/zh/NULS2.0/image/block-module/block-functions.png new file mode 100644 index 00000000..8b4f4af9 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-functions.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-module-boot.png b/docs/zh/NULS2.0/image/block-module/block-module-boot.png new file mode 100644 index 00000000..e684d7a8 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-module-boot.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-module.png b/docs/zh/NULS2.0/image/block-module/block-module.png new file mode 100644 index 00000000..103b533f Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-module.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-monitoring.png b/docs/zh/NULS2.0/image/block-module/block-monitoring.png new file mode 100644 index 00000000..ac9b2180 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-monitoring.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-synchronization.png b/docs/zh/NULS2.0/image/block-module/block-synchronization.png new file mode 100644 index 00000000..f020b1a3 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-synchronization.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-synchronization2.png b/docs/zh/NULS2.0/image/block-module/block-synchronization2.png new file mode 100644 index 00000000..06a8ac7e Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-synchronization2.png differ diff --git a/docs/zh/NULS2.0/image/block-module/block-synchronization3.png b/docs/zh/NULS2.0/image/block-module/block-synchronization3.png new file mode 100644 index 00000000..4c65b9f0 Binary files /dev/null and b/docs/zh/NULS2.0/image/block-module/block-synchronization3.png differ diff --git a/docs/zh/NULS2.0/image/bridge-layer.png b/docs/zh/NULS2.0/image/bridge-layer.png new file mode 100644 index 00000000..3f182dc1 Binary files /dev/null and b/docs/zh/NULS2.0/image/bridge-layer.png differ diff --git a/docs/zh/NULS2.0/image/bridge.png b/docs/zh/NULS2.0/image/bridge.png new file mode 100644 index 00000000..387960f7 Binary files /dev/null and b/docs/zh/NULS2.0/image/bridge.png differ diff --git a/docs/zh/NULS2.0/image/cg-module/cg-functions.png b/docs/zh/NULS2.0/image/cg-module/cg-functions.png new file mode 100644 index 00000000..210d34e2 Binary files /dev/null and b/docs/zh/NULS2.0/image/cg-module/cg-functions.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/architecture.png b/docs/zh/NULS2.0/image/chainModule/architecture.png new file mode 100644 index 00000000..02e2a508 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/architecture.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/assetDestroy.png b/docs/zh/NULS2.0/image/chainModule/assetDestroy.png new file mode 100644 index 00000000..c3fa81f9 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/assetDestroy.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/assetDestroy0.png b/docs/zh/NULS2.0/image/chainModule/assetDestroy0.png new file mode 100644 index 00000000..cf698bf8 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/assetDestroy0.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/assetRegister.png b/docs/zh/NULS2.0/image/chainModule/assetRegister.png new file mode 100644 index 00000000..18a33fbe Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/assetRegister.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/assetRegister0.png b/docs/zh/NULS2.0/image/chainModule/assetRegister0.png new file mode 100644 index 00000000..bf0b642c Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/assetRegister0.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chain-context.png b/docs/zh/NULS2.0/image/chainModule/chain-context.png new file mode 100644 index 00000000..303cfeec Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chain-context.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chain-functions.png b/docs/zh/NULS2.0/image/chainModule/chain-functions.png new file mode 100644 index 00000000..3fdac67d Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chain-functions.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chain-module.png b/docs/zh/NULS2.0/image/chainModule/chain-module.png new file mode 100644 index 00000000..e17267b3 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chain-module.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chain-off.png b/docs/zh/NULS2.0/image/chainModule/chain-off.png new file mode 100644 index 00000000..775483b9 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chain-off.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chain-register.png b/docs/zh/NULS2.0/image/chainModule/chain-register.png new file mode 100644 index 00000000..e0de5300 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chain-register.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chainDestroy.png b/docs/zh/NULS2.0/image/chainModule/chainDestroy.png new file mode 100644 index 00000000..53fd4382 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chainDestroy.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chainDestroy0.png b/docs/zh/NULS2.0/image/chainModule/chainDestroy0.png new file mode 100644 index 00000000..6566d8e8 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chainDestroy0.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chainOff.png b/docs/zh/NULS2.0/image/chainModule/chainOff.png new file mode 100644 index 00000000..c7c5648b Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chainOff.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chainRegister.png b/docs/zh/NULS2.0/image/chainModule/chainRegister.png new file mode 100644 index 00000000..36d852a4 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chainRegister.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/chainRegister0.png b/docs/zh/NULS2.0/image/chainModule/chainRegister0.png new file mode 100644 index 00000000..6c88b25d Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/chainRegister0.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/structure.png b/docs/zh/NULS2.0/image/chainModule/structure.png new file mode 100644 index 00000000..4cb62f4f Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/structure.png differ diff --git a/docs/zh/NULS2.0/image/chainModule/structure1.png b/docs/zh/NULS2.0/image/chainModule/structure1.png new file mode 100644 index 00000000..6d467e80 Binary files /dev/null and b/docs/zh/NULS2.0/image/chainModule/structure1.png differ diff --git "a/docs/zh/NULS2.0/image/chainModule/~$$\344\270\273\350\246\201\347\273\223\346\236\204.~vsdx" "b/docs/zh/NULS2.0/image/chainModule/~$$\344\270\273\350\246\201\347\273\223\346\236\204.~vsdx" new file mode 100644 index 00000000..20303a0a Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/~$$\344\270\273\350\246\201\347\273\223\346\236\204.~vsdx" differ diff --git "a/docs/zh/NULS2.0/image/chainModule/\344\270\273\350\246\201\347\273\223\346\236\204.vsdx" "b/docs/zh/NULS2.0/image/chainModule/\344\270\273\350\246\201\347\273\223\346\236\204.vsdx" new file mode 100644 index 00000000..7646dbab Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/\344\270\273\350\246\201\347\273\223\346\236\204.vsdx" differ diff --git "a/docs/zh/NULS2.0/image/chainModule/\345\242\236\345\212\240\350\265\204\344\272\247.vsdx" "b/docs/zh/NULS2.0/image/chainModule/\345\242\236\345\212\240\350\265\204\344\272\247.vsdx" new file mode 100644 index 00000000..485b7dcd Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/\345\242\236\345\212\240\350\265\204\344\272\247.vsdx" differ diff --git "a/docs/zh/NULS2.0/image/chainModule/\346\263\250\345\206\214\351\223\276.vsdx" "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\345\206\214\351\223\276.vsdx" new file mode 100644 index 00000000..ce37624c Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\345\206\214\351\223\276.vsdx" differ diff --git "a/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\350\265\204\344\272\247.vsdx" "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\350\265\204\344\272\247.vsdx" new file mode 100644 index 00000000..fe38f259 Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\350\265\204\344\272\247.vsdx" differ diff --git "a/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\351\223\276.vsdx" "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\351\223\276.vsdx" new file mode 100644 index 00000000..0be3f398 Binary files /dev/null and "b/docs/zh/NULS2.0/image/chainModule/\346\263\250\351\224\200\351\223\276.vsdx" differ diff --git a/docs/zh/NULS2.0/image/consensus-module/coinbase.png b/docs/zh/NULS2.0/image/consensus-module/coinbase.png new file mode 100644 index 00000000..1dc629b7 Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/coinbase.png differ diff --git a/docs/zh/NULS2.0/image/consensus-module/consensus-constants.jpg b/docs/zh/NULS2.0/image/consensus-module/consensus-constants.jpg new file mode 100644 index 00000000..318bc5bf Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/consensus-constants.jpg differ diff --git a/docs/zh/NULS2.0/image/consensus-module/consensus-flow-5.png b/docs/zh/NULS2.0/image/consensus-module/consensus-flow-5.png new file mode 100644 index 00000000..060bf880 Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/consensus-flow-5.png differ diff --git a/docs/zh/NULS2.0/image/consensus-module/consensus-func.png b/docs/zh/NULS2.0/image/consensus-module/consensus-func.png new file mode 100644 index 00000000..4e2021d9 Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/consensus-func.png differ diff --git a/docs/zh/NULS2.0/image/consensus-module/consensus-staticsReward.jpg b/docs/zh/NULS2.0/image/consensus-module/consensus-staticsReward.jpg new file mode 100644 index 00000000..7189b4a7 Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/consensus-staticsReward.jpg differ diff --git a/docs/zh/NULS2.0/image/consensus-module/statics_en.png b/docs/zh/NULS2.0/image/consensus-module/statics_en.png new file mode 100644 index 00000000..3bf93c55 Binary files /dev/null and b/docs/zh/NULS2.0/image/consensus-module/statics_en.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-content.png b/docs/zh/NULS2.0/image/eventbus/event-bus-content.png new file mode 100644 index 00000000..1d14e3d6 Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-content.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-function.png b/docs/zh/NULS2.0/image/eventbus/event-bus-function.png new file mode 100644 index 00000000..60db2b70 Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-function.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-main-flow.png b/docs/zh/NULS2.0/image/eventbus/event-bus-main-flow.png new file mode 100644 index 00000000..6bca6665 Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-main-flow.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-model.png b/docs/zh/NULS2.0/image/eventbus/event-bus-model.png new file mode 100644 index 00000000..b611d9bb Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-model.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-module.png b/docs/zh/NULS2.0/image/eventbus/event-bus-module.png new file mode 100644 index 00000000..2c0563ae Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-module.png differ diff --git a/docs/zh/NULS2.0/image/eventbus/event-bus-seq-flow.png b/docs/zh/NULS2.0/image/eventbus/event-bus-seq-flow.png new file mode 100644 index 00000000..f4444063 Binary files /dev/null and b/docs/zh/NULS2.0/image/eventbus/event-bus-seq-flow.png differ diff --git a/docs/zh/NULS2.0/image/introduction/introduction-1.jpg b/docs/zh/NULS2.0/image/introduction/introduction-1.jpg new file mode 100644 index 00000000..104f1fa9 Binary files /dev/null and b/docs/zh/NULS2.0/image/introduction/introduction-1.jpg differ diff --git a/docs/zh/NULS2.0/image/introduction/introduction-2.jpg b/docs/zh/NULS2.0/image/introduction/introduction-2.jpg new file mode 100644 index 00000000..27c80a81 Binary files /dev/null and b/docs/zh/NULS2.0/image/introduction/introduction-2.jpg differ diff --git a/docs/zh/NULS2.0/image/kernel/OOD.png b/docs/zh/NULS2.0/image/kernel/OOD.png new file mode 100644 index 00000000..c9450bd2 Binary files /dev/null and b/docs/zh/NULS2.0/image/kernel/OOD.png differ diff --git a/docs/zh/NULS2.0/image/kernel/structure.png b/docs/zh/NULS2.0/image/kernel/structure.png new file mode 100644 index 00000000..59001387 Binary files /dev/null and b/docs/zh/NULS2.0/image/kernel/structure.png differ diff --git a/docs/zh/NULS2.0/image/ledger/eth-transaction-flow.png b/docs/zh/NULS2.0/image/ledger/eth-transaction-flow.png new file mode 100644 index 00000000..a8e8c033 Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/eth-transaction-flow.png differ diff --git a/docs/zh/NULS2.0/image/ledger/ledger-arch.png b/docs/zh/NULS2.0/image/ledger/ledger-arch.png new file mode 100644 index 00000000..b444b87e Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/ledger-arch.png differ diff --git a/docs/zh/NULS2.0/image/ledger/ledger-flow-01.png b/docs/zh/NULS2.0/image/ledger/ledger-flow-01.png new file mode 100644 index 00000000..cf8e19f8 Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/ledger-flow-01.png differ diff --git a/docs/zh/NULS2.0/image/ledger/ledger-functions.png b/docs/zh/NULS2.0/image/ledger/ledger-functions.png new file mode 100644 index 00000000..c6a145eb Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/ledger-functions.png differ diff --git a/docs/zh/NULS2.0/image/ledger/ledger-service.png b/docs/zh/NULS2.0/image/ledger/ledger-service.png new file mode 100644 index 00000000..edf61aa2 Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/ledger-service.png differ diff --git a/docs/zh/NULS2.0/image/ledger/trx-validate-flow.png b/docs/zh/NULS2.0/image/ledger/trx-validate-flow.png new file mode 100644 index 00000000..66dae2d9 Binary files /dev/null and b/docs/zh/NULS2.0/image/ledger/trx-validate-flow.png differ diff --git a/docs/zh/NULS2.0/image/modules.png b/docs/zh/NULS2.0/image/modules.png new file mode 100644 index 00000000..ade836f2 Binary files /dev/null and b/docs/zh/NULS2.0/image/modules.png differ diff --git a/docs/zh/NULS2.0/image/network-module/connectSelf-recieve.png b/docs/zh/NULS2.0/image/network-module/connectSelf-recieve.png new file mode 100644 index 00000000..798680b5 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/connectSelf-recieve.png differ diff --git a/docs/zh/NULS2.0/image/network-module/connectSelf.png b/docs/zh/NULS2.0/image/network-module/connectSelf.png new file mode 100644 index 00000000..896e2df5 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/connectSelf.png differ diff --git a/docs/zh/NULS2.0/image/network-module/connection.png b/docs/zh/NULS2.0/image/network-module/connection.png new file mode 100644 index 00000000..c190e7ef Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/connection.png differ diff --git a/docs/zh/NULS2.0/image/network-module/connet-add.png b/docs/zh/NULS2.0/image/network-module/connet-add.png new file mode 100644 index 00000000..fcc892f7 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/connet-add.png differ diff --git a/docs/zh/NULS2.0/image/network-module/connet-validate.png b/docs/zh/NULS2.0/image/network-module/connet-validate.png new file mode 100644 index 00000000..fcc892f7 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/connet-validate.png differ diff --git a/docs/zh/NULS2.0/image/network-module/createNodeGroup.png b/docs/zh/NULS2.0/image/network-module/createNodeGroup.png new file mode 100644 index 00000000..d6793395 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/createNodeGroup.png differ diff --git a/docs/zh/NULS2.0/image/network-module/createNodeGroup0.png b/docs/zh/NULS2.0/image/network-module/createNodeGroup0.png new file mode 100644 index 00000000..e31fbed0 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/createNodeGroup0.png differ diff --git a/docs/zh/NULS2.0/image/network-module/crossPortDeliver.png b/docs/zh/NULS2.0/image/network-module/crossPortDeliver.png new file mode 100644 index 00000000..9190ef56 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/crossPortDeliver.png differ diff --git a/docs/zh/NULS2.0/image/network-module/deleteNodeGroup.png b/docs/zh/NULS2.0/image/network-module/deleteNodeGroup.png new file mode 100644 index 00000000..d883df6f Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/deleteNodeGroup.png differ diff --git a/docs/zh/NULS2.0/image/network-module/deleteNodeGroup2.png b/docs/zh/NULS2.0/image/network-module/deleteNodeGroup2.png new file mode 100644 index 00000000..8649b4ce Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/deleteNodeGroup2.png differ diff --git a/docs/zh/NULS2.0/image/network-module/discoverPeer.png b/docs/zh/NULS2.0/image/network-module/discoverPeer.png new file mode 100644 index 00000000..5ce58e78 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/discoverPeer.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-client-connection-heartbeats.png b/docs/zh/NULS2.0/image/network-module/network-client-connection-heartbeats.png new file mode 100644 index 00000000..931406c3 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-client-connection-heartbeats.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-client-connection-management.png b/docs/zh/NULS2.0/image/network-module/network-client-connection-management.png new file mode 100644 index 00000000..504c3dac Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-client-connection-management.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-client-connection.png b/docs/zh/NULS2.0/image/network-module/network-client-connection.png new file mode 100644 index 00000000..ab03c967 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-client-connection.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-context.png b/docs/zh/NULS2.0/image/network-module/network-context.png new file mode 100644 index 00000000..49bc9c79 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-context.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-functions.png b/docs/zh/NULS2.0/image/network-module/network-functions.png new file mode 100644 index 00000000..f4c9c8be Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-functions.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-module.png b/docs/zh/NULS2.0/image/network-module/network-module.png new file mode 100644 index 00000000..ca81f7e0 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-module.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-node-mode.png b/docs/zh/NULS2.0/image/network-module/network-node-mode.png new file mode 100644 index 00000000..49bd70f2 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-node-mode.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-node-start.png b/docs/zh/NULS2.0/image/network-module/network-node-start.png new file mode 100644 index 00000000..cd702814 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-node-start.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-normal-start.png b/docs/zh/NULS2.0/image/network-module/network-normal-start.png new file mode 100644 index 00000000..dd543e10 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-normal-start.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-seed-client-connection.png b/docs/zh/NULS2.0/image/network-module/network-seed-client-connection.png new file mode 100644 index 00000000..4aa760ba Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-seed-client-connection.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-seed-start.png b/docs/zh/NULS2.0/image/network-module/network-seed-start.png new file mode 100644 index 00000000..7b35e767 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-seed-start.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-server-connection-heartbeats.png b/docs/zh/NULS2.0/image/network-module/network-server-connection-heartbeats.png new file mode 100644 index 00000000..75b7552f Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-server-connection-heartbeats.png differ diff --git a/docs/zh/NULS2.0/image/network-module/network-server-connection-management.png b/docs/zh/NULS2.0/image/network-module/network-server-connection-management.png new file mode 100644 index 00000000..82d69afe Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/network-server-connection-management.png differ diff --git a/docs/zh/NULS2.0/image/network-module/nodeManage.png b/docs/zh/NULS2.0/image/network-module/nodeManage.png new file mode 100644 index 00000000..3a550386 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/nodeManage.png differ diff --git a/docs/zh/NULS2.0/image/network-module/pingpong.png b/docs/zh/NULS2.0/image/network-module/pingpong.png new file mode 100644 index 00000000..d751ec58 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/pingpong.png differ diff --git a/docs/zh/NULS2.0/image/network-module/recMessage.png b/docs/zh/NULS2.0/image/network-module/recMessage.png new file mode 100644 index 00000000..6b65d741 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/recMessage.png differ diff --git a/docs/zh/NULS2.0/image/network-module/recMessage2.png b/docs/zh/NULS2.0/image/network-module/recMessage2.png new file mode 100644 index 00000000..294b5b0e Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/recMessage2.png differ diff --git a/docs/zh/NULS2.0/image/network-module/saveNodeIp.png b/docs/zh/NULS2.0/image/network-module/saveNodeIp.png new file mode 100644 index 00000000..ce87bdc1 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/saveNodeIp.png differ diff --git a/docs/zh/NULS2.0/image/network-module/sendMsg1.png b/docs/zh/NULS2.0/image/network-module/sendMsg1.png new file mode 100644 index 00000000..4d48f1f3 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/sendMsg1.png differ diff --git a/docs/zh/NULS2.0/image/network-module/sendMsg2.png b/docs/zh/NULS2.0/image/network-module/sendMsg2.png new file mode 100644 index 00000000..379fff27 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/sendMsg2.png differ diff --git a/docs/zh/NULS2.0/image/network-module/shutdown.png b/docs/zh/NULS2.0/image/network-module/shutdown.png new file mode 100644 index 00000000..6686e9a0 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/shutdown.png differ diff --git a/docs/zh/NULS2.0/image/network-module/start.png b/docs/zh/NULS2.0/image/network-module/start.png new file mode 100644 index 00000000..f302eb60 Binary files /dev/null and b/docs/zh/NULS2.0/image/network-module/start.png differ diff --git a/docs/zh/NULS2.0/image/tools-rpc/Websocket-Tool-package.png b/docs/zh/NULS2.0/image/tools-rpc/Websocket-Tool-package.png new file mode 100644 index 00000000..3091630c Binary files /dev/null and b/docs/zh/NULS2.0/image/tools-rpc/Websocket-Tool-package.png differ diff --git a/docs/zh/NULS2.0/image/tools-rpc/rpc-heart-beat.png b/docs/zh/NULS2.0/image/tools-rpc/rpc-heart-beat.png new file mode 100644 index 00000000..14adeabe Binary files /dev/null and b/docs/zh/NULS2.0/image/tools-rpc/rpc-heart-beat.png differ diff --git a/docs/zh/NULS2.0/image/tools-rpc/rpc-interface-list.png b/docs/zh/NULS2.0/image/tools-rpc/rpc-interface-list.png new file mode 100644 index 00000000..d3d9c50d Binary files /dev/null and b/docs/zh/NULS2.0/image/tools-rpc/rpc-interface-list.png differ diff --git a/docs/zh/NULS2.0/image/tools-rpc/rpc-server-start.png b/docs/zh/NULS2.0/image/tools-rpc/rpc-server-start.png new file mode 100644 index 00000000..e02620c5 Binary files /dev/null and b/docs/zh/NULS2.0/image/tools-rpc/rpc-server-start.png differ diff --git a/docs/zh/NULS2.0/image/tools-rpc/rpc-struts.png b/docs/zh/NULS2.0/image/tools-rpc/rpc-struts.png new file mode 100644 index 00000000..f00f1f1d Binary files /dev/null and b/docs/zh/NULS2.0/image/tools-rpc/rpc-struts.png differ diff --git a/docs/zh/NULS2.0/image/tools/db-tools-functions.png b/docs/zh/NULS2.0/image/tools/db-tools-functions.png new file mode 100644 index 00000000..fc3affea Binary files /dev/null and b/docs/zh/NULS2.0/image/tools/db-tools-functions.png differ diff --git a/docs/zh/NULS2.0/image/tools/java-tools-content.png b/docs/zh/NULS2.0/image/tools/java-tools-content.png new file mode 100644 index 00000000..9540b201 Binary files /dev/null and b/docs/zh/NULS2.0/image/tools/java-tools-content.png differ diff --git a/docs/zh/NULS2.0/image/tools/java-tools-functions.png b/docs/zh/NULS2.0/image/tools/java-tools-functions.png new file mode 100644 index 00000000..56e0105f Binary files /dev/null and b/docs/zh/NULS2.0/image/tools/java-tools-functions.png differ diff --git a/docs/zh/NULS2.0/image/tools/java-tools-module.png b/docs/zh/NULS2.0/image/tools/java-tools-module.png new file mode 100644 index 00000000..a3e6a8bb Binary files /dev/null and b/docs/zh/NULS2.0/image/tools/java-tools-module.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-architecture.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-architecture.png new file mode 100644 index 00000000..504d6652 Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-architecture.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-context.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-context.png new file mode 100644 index 00000000..2aeb75e1 Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-context.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctos.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctos.png new file mode 100644 index 00000000..ac547e58 Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctos.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctosatellite.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctosatellite.png new file mode 100644 index 00000000..500b047e Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-ctosatellite.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-functional-architecture.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-functional-architecture.png new file mode 100644 index 00000000..1d6ec6a9 Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-functional-architecture.png differ diff --git a/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-satellitetoc.png b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-satellitetoc.png new file mode 100644 index 00000000..529021fb Binary files /dev/null and b/docs/zh/NULS2.0/image/tx-manager-module/tx-manager-satellitetoc.png differ diff --git a/docs/zh/NULS2.0/introduction/intro1.jpg b/docs/zh/NULS2.0/introduction/intro1.jpg new file mode 100644 index 00000000..104f1fa9 Binary files /dev/null and b/docs/zh/NULS2.0/introduction/intro1.jpg differ diff --git a/docs/zh/NULS2.0/introduction/intro2.jpg b/docs/zh/NULS2.0/introduction/intro2.jpg new file mode 100644 index 00000000..27c80a81 Binary files /dev/null and b/docs/zh/NULS2.0/introduction/intro2.jpg differ diff --git a/docs/zh/NULS2.0/linuxTutorial.md b/docs/zh/NULS2.0/linuxTutorial.md new file mode 100644 index 00000000..b3246add --- /dev/null +++ b/docs/zh/NULS2.0/linuxTutorial.md @@ -0,0 +1,1660 @@ +# 节点程序手册 +## 介绍 + +本文档为NULS2.0 beta1版本测试网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。 + +## 版本更新记录 + +| 版本 | 更新日期 | 内容 | +| :----: | :--------: | :----------------: | +| V1.0.0 | 2019-07-11 | beta1版功能 | + +## 准备 + +### 服务器硬件配置 + + +**建立NULS节点的服务器不低于如下配置:** + +| CPU | 内存 | 硬盘 | 宽带 | +| :---------: | :---: | :------: | :-----: | +| 四核 3.0GHz | 16G | 128G硬盘 | 20M上行 | + + +**推荐配置:** + +| CPU | 内存 | 硬盘 | 宽带 | +| :---------: | :---: | :------: | :------: | +| 八核 3.0GHz | 32G | 256G硬盘 | 100M上行 | + + + +### 系统及内核版本 + +**Linux系统** + +- CentOS 6,7 +- Ubuntu 14 + + +Linux内核版本推荐使用 2.6.32及以上 + +## 开始 + +### 下载 + +- NULS2.0 beta1版本GitHub地址: + +- Linux系统中下载beta1版的钱包可以使用如下命令: + + ```shell + $ wget http://nuls-usa-west.oss-us-west-1.aliyuncs.com/2.0/NULS-Wallet-linux64-beta1-main.tar.gz + ``` + + 注:如果后续有其他版本,下载地址可能会不同。 + +### 安装 + +- 在Linux中解压已下载的文件 + + ```shell + $ tar -zxf NULS-Wallet-linux64-beta1-main.tar.gz + ``` + +### 运行 + +- 进入解压后的目录,并运行启动脚本,启动节点钱包 + + ```shell + $ cd NULS-Wallet-linux64-beta1 + $ ./start + ``` + +## 使用钱包 + +### 快速入门 + +- 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。 + + 进入钱包根目录,执行如下命令: + + ```shell + $ ./cmd + ``` + + 将会出现NULS命名输入提示符`nuls>>> ` ,然后可直接输入NULS钱包操作命令,来进行操作。 + + 例如,创建账户的示例如下: + + ```shell + nuls>>> create + Please enter the new password(8-20 characters, the combination of letters and numbers). + Enter your new password:******** + Please confirm new password:******** + [ "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" ] + ``` + + 执行`create`命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。 + + + +## 约定 + +- 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。 +- 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。 + +## 钱包命令 + +### 帮助命令 + +输出打印所有的命令, + +- **命令: help [-a]|[group]|[command]** + +| 参数 | 说明 | +| :--- | :------------------- | +| -a | 格式化打印命令,选填 | +| command|查看指定命令使用说明| +| group|查看指定命令组的所有命令使用说明| + +返回信息 help + +```json +getaccount
--get account information +``` + +返回信息 help -a + +```json +getaccount
--get account information + OPTIONS: +
the account address - Required +``` + +示例 + +```shell +nuls>>> help +nuls>>> help -a +nuls>>> help account +nuls>>> help create +``` + + + +### 创建账户 + +创建账户,返回账户地址集合 + +- **命令: create [number]** + +| 参数 | 说明 | +| :------- | :------------------- | +| [number] | 创建账户的数量,选填 | + +创建账户时,将会提示输入密码,为了保证资产安全,必须给账户设置密码; + +返回账户集合 + +```json +[ "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", "tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs", "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4" ] +``` + +示例 + +创建1个账户 + + +```shell +nuls>>> create +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:******** +Please confirm new password:******** +[ "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" ] +``` +一次创建多个账户 + +``` +nuls>>> create 3 +Please enter the new password(8-20 characters, the combination of letters and numbers). +Enter your new password:******** +Please confirm new password:******** +[ "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", "tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs", "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4" ] +``` + + + + +### 备份账户 + +备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件 + +- **命令:backup <address> [path]** + +| 参数 | 说明 | +| --------------- | ---------------------------------------------------- | +| <address> | 账户地址,必填 | +| [path] | 文件生成备份文件的目标文件夹,默认为当前文件夹,选填 | + +返回信息 + +```shell +The path to the backup file is /home/nuls2/nuls-v2/tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm.keystore +``` + +示例 备份一个有密码的账户 + +```shell +nuls>>> backup tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm /home/nuls2/nuls-v2/NULS-Wallet-linux64-beta1 +Please enter the password. +Enter your password:******** +The path to the backup file is /home/nuls2/nuls-v2/tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm.keystore +``` + +### 移除账户 + +根据账户地址移除本地账户,需要输入密码 + +- **命令:remove <address>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 + +```json +Success +``` + +示例 + +```shell +nuls>>> remove tNULSeBaMhUKHmueWB1h87vpWr62vrAjPshwTs +Please enter the password. +Enter your password:******** +Success +``` + + +### 修改账户密码 + +根据账户地址和账户密码重新设置新密码。 + +- **命令:resetpwd <address>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 + +```json +Success +``` + +示例 + +```shell +nuls>>> resetpwd tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4 +Enter your old password:******** +Enter new password********* +Please confirm new password:********* +Success +``` + + + +### 设置别名 + +给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示 + +- **命令:setalias <address> <alias>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | +| <alias> | 别名名称,必填 | + +返回信息 交易hash + +```json +txHash:0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" +``` + +示例 + +```shell +nuls>>> setalias tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 nuls +Enter your account password********** +txHash:0020830971e02527f18f8f9e32f974d8c73ce6bd249de859cae170476b87d0ec9582 +``` + + + +### 导入账户keystore + +导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。 + +- **命令:importkeystore <path>** + +| 参数 | 说明 | +| ------------ | ------------------------------ | +| <path> | 待导入的keystore文件地址,必填 | + +注意:导入keystore文件生成账户时,需要原始密码 + +返回信息 导入的账户地址 + +```json +"tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" +``` + +示例 + +```shell +nuls>>> importkeystore /home/nuls2/nuls-v2/tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8.keystore +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:******** +tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +``` + + + +### 导入账户私钥 + +导入账户私钥,生成本地账户,如果本地已有该账户将覆盖,导入时需要给账户设置密码。此功能可以用于忘记账户密码后,通过私钥重新找回账户。 + +- **命令:import <privatekey>** + +| 参数 | 说明 | +| ------------------ | ---------------- | +| <privatekey> | 账户的私钥,必填 | + + +```json +"tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8" +``` + +示例 + +```shell +nuls>>> import 74ca3facb66e5e9f2b78e86507d1f36cf601bc3de1d5f5e5b515c4f995d53873 +Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. +Enter your password:******** +Please confirm new password:******** +tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +``` + +### 查询账户信息 + +根据账户地址查询账户信息 + +- **命令:getaccount <address>** + +| 参数 | 说明 | +| --------------- | :------------- | +| <address> | 账户地址,必填 | + +返回信息 + +```json +{ + "encryptedPrikeyHex" : "4026dc6c3b92fb18b4e87c8aac1efedf1bb6a1cd8f623d163f45209b07911dcf6cbd4141f5294035b8f6739a3dce299c", //加密后私钥 + "alias" : null,//别名 + "baglance" : { + "available" : "5000000",//可用资产数量 + "total" : "5000000",//总资产数量 + "freeze" : "0"//冻结的资产数量 + }, + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8",//地址 + "pubkeyHex" : "02f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de" //加密后公钥 +} +``` + +示例 + +```shell +nuls>>> getaccount tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +{ + "encryptedPrikeyHex" : "4026dc6c3b92fb18b4e87c8aac1efedf1bb6a1cd8f623d163f45209b07911dcf6cbd4141f5294035b8f6739a3dce299c", //加密后私钥 + "alias" : null,//别名 + "baglance" : { + "available" : "5000000",//可用资产数量 + "total" : "5000000",//总资产数量 + "freeze" : "0"//冻结的资产数量 + }, + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8",//地址 + "pubkeyHex" : "02f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de" //加密后公钥 +} + +``` + + + +### 查询账户列表 + +根据分页参数查询账户列表,所有账户以创建时间倒序输出。 + +- **命令:getaccounts <pageNumber> <pageSize>** + +| 参数 | 说明 | +| ------------------ | -------------------------------- | +| <pageNumber> | 页数,需要获取第几页的数据,必填 | +| <pageSize> | 每一页显示的数据条数,必填 | + +返回信息,将输出账户集合 + +```json +[ { + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "alias" : null, + "pubkeyHex" : "02f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de", + "encryptedPrikeyHex" : "4026dc6c3b92fb18b4e87c8aac1efedf1bb6a1cd8f623d163f45209b07911dcf6cbd4141f5294035b8f6739a3dce299c" +}, { + "address" : "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4", + "alias" : null, + "pubkeyHex" : "03ad08ca4f73178c4e3e6d7126cb61e3a4c9b4dec95e4077112f085797eadc808a", + "encryptedPrikeyHex" : "e97dedb7697a6d37a8dfe9e2aa41543161f63d0740c4b5a72a0e1df2cc85ef99949e6f8ce41667587225df8cff0aae17" +}, { + "address" : "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", + "alias" : null, + "pubkeyHex" : "039abe58d5a20bac72ebb1fd80cac6a1012d17ad04a131a8a2350ea4df9ea4416e", + "encryptedPrikeyHex" : "fee6f590fc900aee4f3aa84437701d406d00c3045b1d0ce074efa1b42a6db8d5925e3a10272041b5f3c0c2d2572c0f42" +}, { + "address" : "tNULSeBaMt7c7sybfvP7iAC2p9d1ickHZvH9Sc", + "alias" : null, + "pubkeyHex" : "023b8834bceb1228711ed6301322f5617e1b2d2e5197bc9832744af41191096c39", + "encryptedPrikeyHex" : "d9b4704c5b6470b51ca09c8cca888a4c9e7abea32aad17cc91f1c20c74a30632cb38d759129abea1d3c3f8080fc11f01" +} ] +``` + + + +示例 获取账户列表 + +```shell +nuls>>> getaccounts +[ { + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "alias" : null, + "pubkeyHex" : "02f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de", + "encryptedPrikeyHex" : "4026dc6c3b92fb18b4e87c8aac1efedf1bb6a1cd8f623d163f45209b07911dcf6cbd4141f5294035b8f6739a3dce299c" +}, { + "address" : "tNULSeBaMvXiStrcQc4SF3rWGS8fyPqhUQXoS4", + "alias" : null, + "pubkeyHex" : "03ad08ca4f73178c4e3e6d7126cb61e3a4c9b4dec95e4077112f085797eadc808a", + "encryptedPrikeyHex" : "e97dedb7697a6d37a8dfe9e2aa41543161f63d0740c4b5a72a0e1df2cc85ef99949e6f8ce41667587225df8cff0aae17" +}, { + "address" : "tNULSeBaMmhBVJnJqcB7S7gKsPEoikZo2W89pm", + "alias" : null, + "pubkeyHex" : "039abe58d5a20bac72ebb1fd80cac6a1012d17ad04a131a8a2350ea4df9ea4416e", + "encryptedPrikeyHex" : "fee6f590fc900aee4f3aa84437701d406d00c3045b1d0ce074efa1b42a6db8d5925e3a10272041b5f3c0c2d2572c0f42" +}, { + "address" : "tNULSeBaMt7c7sybfvP7iAC2p9d1ickHZvH9Sc", + "alias" : null, + "pubkeyHex" : "023b8834bceb1228711ed6301322f5617e1b2d2e5197bc9832744af41191096c39", + "encryptedPrikeyHex" : "d9b4704c5b6470b51ca09c8cca888a4c9e7abea32aad17cc91f1c20c74a30632cb38d759129abea1d3c3f8080fc11f01" +} ] +``` + + + +### 查询账户私钥 + +根据账户地址个密码查询账户私钥 + +- **命令:getprikey <address>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 导入的账户的私钥(未加密) + +```json +74ca3facb66e5e9f2b78e86507d1f36cf601bc3de1d5f5e5b515c4f995d53873 +``` + +示例 + +```shell +nuls>>> getprikey tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +Enter your account password******** +74ca3facb66e5e9f2b78e86507d1f36cf601bc3de1d5f5e5b515c4f995d53873 +``` + + + +### 查询账户余额 + +根据账户地址查询账户余额 + +- **命令:getbalance <address>** + +| 参数 | 说明 | +| --------------- | ---------------- | +| <address> | 账户的地址,必填 | + +返回信息 导入的账户地址 + +```json +nuls>>> getbalance tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +{ + "available" : "4999998.999", + "total" : "4999998.999", + "freeze" : "0" +} +``` + +示例 + +```shell +nuls>>> getbalance tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 +{ + "available" : "4999998.999", + "total" : "4999998.999", + "freeze" : "0" +} +``` + + + +### 转账 + +根据账户地址或别名将NULS转入另一账户地址或别名中 + +- **命令:transfer <fromAddress>|<fromAlias> <toAddress>|<toAlias> <amount> [remark] ** + +| 参数 | 说明 | +| ----------------- | ----------------------------------------------- | +| <fromAddress> | 转出地址(与fromAlias任选一项) | +|<fromAlias>|转出地址别名(与fromAddress任选一项)| +| <toAddress> | 接收地址(与toAlias任选一项) | +|<toAlias>|接收地址别名(与toAddress任选一项)| +| <amount> | 转账数量,必填 | +| [remark] | 备注信息,选填 | + +返回信息 转账交易hash + +```json +"41d8b78214ad9e34beba420248dfc4f282d5d46166fe6d67e3c7006f2990de0e" +``` + +示例 + +```shell +nuls>>> transfer tNULSeBaMoodYW7AqyJrgYdWiJ6nfwfVHHHyXm tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 5000000 +Enter your account password******** +41d8b78214ad9e34beba420248dfc4f282d5d46166fe6d67e3c7006f2990de0e +``` + + + +### 查询交易详情 + +根据交易hash查询交易详细信息 + +- **命令:gettx <hash>** + +| 参数 | 说明 | +| ------------ | -------------- | +| <hash> | 交易hash,必填 | + +返回信息 交易详细信息 + +```json +{ + "type" : 3,//交易类型(枚举说明见下表【type 枚举类型说明】) + "time" : "2019-07-11 11:34:24.024", + "transactionSignature" : "2102f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de4730450221008def105209cf7b32da777686a98a06359f80baf2887e8b1c2d5258feac3a70880220538e9fc2fc2a239d1fdced4de3239b762a1decf67f026fc5a93f59d6e281c5c8", + "remark" : null, + "hash" : "1a12a2499ec805956ce074e42ce29c64ea1194addc65a68cb186d519d3ed4f43", + "blockHeight" : 3806, //交易高度 + "status" : "CONFIRMED", //确认状态 + "size" : 285, + "inBlockIndex" : 0, + "form" : [ { + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "assetsChainId" : 2, + "assetsId" : 1, + "amount" : 100100000, + "nonce" : "0000000000000000" + } ], + "to" : [ { + "address" : "tNULSeBaMtx5Dex2BNURMXdA2HkMZy9uXNf5cZ", + "assetsChainId" : 2, + "assetsId" : 1, + "amount" : 100000000, + "nonce" : null + } ] +} +``` + +示例 查询转账交易 + +```shell +nuls>>> gettx 1a12a2499ec805956ce074e42ce29c64ea1194addc65a68cb186d519d3ed4f43 +{ + "type" : 3,//交易类型(枚举说明见下表【type 枚举类型说明】) + "time" : "2019-07-11 11:34:24.024", + "transactionSignature" : "2102f2df94a1197f7bce4ea78f28fa7be8e8067377fcd13daef9c548e1a0402fb4de4730450221008def105209cf7b32da777686a98a06359f80baf2887e8b1c2d5258feac3a70880220538e9fc2fc2a239d1fdced4de3239b762a1decf67f026fc5a93f59d6e281c5c8", + "remark" : null, + "hash" : "1a12a2499ec805956ce074e42ce29c64ea1194addc65a68cb186d519d3ed4f43", + "blockHeight" : 3806, //交易高度 + "status" : "CONFIRMED", //确认状态 + "size" : 285, + "inBlockIndex" : 0, + "form" : [ { + "address" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "assetsChainId" : 2, + "assetsId" : 1, + "amount" : 100100000, + "nonce" : "0000000000000000" + } ], + "to" : [ { + "address" : "tNULSeBaMtx5Dex2BNURMXdA2HkMZy9uXNf5cZ", + "assetsChainId" : 2, + "assetsId" : 1, + "amount" : 100000000, + "nonce" : null + } ] +} +``` +#### type 枚举类型说明 + +| 交易类型 | 枚举值 | +| ------------------ | ------ | +| 全部交易 | 0 | +| 共识奖励 | 1 | +| 转账交易 | 2 | +| 设置别名 | 3 | +| 创建节点 | 4 | +| 加入共识 | 5 | +| 退出共识 | 6 | +| 黄牌 | 7 | +| 红牌 | 8 | +| 注销节点 | 9 | +| 跨链 | 10 | +| 注册跨链 | 11 | +| 注销链 | 12 | +| 为链新增资产 | 13 | +| 删除链资产 | 14 | +| 创建合约 | 15 | +| 调用合约 | 16 | +| 删除合约 | 17 | +| 合约内部转账 | 18 | +| 合约执行手续费返还 | 19 | +| 合约创建共识节点 | 20 | +| 合约加入共识 | 21 | +| 合约退出共识 | 22 | +| 合约注销节点 | 23 | + +### 创建节点 + +根据账户地址创建节点,创建节点时需要提供两个地址,第一个地址为节点地址,需要输入节点地址账户密码。同时需要至少20000NULS的保证金。 + +- **命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit>** [RewardAddress] + +| 参数 | 说明 | +| ---------------------- | ------------------------------------------------------------ | +| <agentAddress> | 创建节点的账户地址,必填 | +| <packingAddress> | 节点打包账户地址,必填(注:该账户默认密码:nuls123456,可以通过配置文件设置,否则节点不能打包出块) | +| <commissionRate> | 代理佣金比例,范围:10~100之间的整数,必填 | +| <deposit> | 创建节点的保证金,不能低于20000NULS,必填 | +| [RewardAddress] | 奖励地址,默认为节点创建地址(选填) | + +返回信息 返回节点的agent hash + +```json +"33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35" +``` + +示例 创建一个节点,佣金比例为10%,押金20000NULS。 + +```shell +nuls>>> createagent tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 tNULSeBaMotNcjQ8E72uh6XituC8CFV2UBBAHo 10 20000 +Enter agent address password******** +"33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35" +``` +### 查询共识节点信息 +根据agentHash查询指定节点信息 + +-**命令:getagent <agentHash>** +| 参数 | 说明 | +| ----------------- | -------------------------------------- | +| <agentHash> | 节点hash | +返回值 + +``` +略 见示例 +``` +示例 + +``` +nuls>>> getagent 33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35 +{ + "agentAddress" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "agentId" : "D1308A35", + "commissionRate" : 10.0, + "delHeight" : -1, + "agentHash" : "33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35", + "totalDeposit" : "0", + "memberCount" : 0, + "agentName" : null, + "packingAddress" : "tNULSeBaMotNcjQ8E72uh6XituC8CFV2UBBAHo", + "version" : null, + "blockHeight" : 4262, + "rewardAddress" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "deposit" : "20000", + "time" : "1970-01-19 10:07:05.005", + "creditVal" : 0.0, + "txHash" : "33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35", + "status" : "unconsensus" +} +``` + +### 查询共识节点列表 +查询共识节点列表 +-**命令:getagents [pageNumber] [pageSize] [keyWord]** +| 参数 | 说明 | +| ----------------- | -------------------------------------- | +| [pageNumber]; | 列表页号位置 | +| [pageSize]; | 每页显示条数 | +| [keyWord]; | 匹配节点别名关键字 | +返回值 + +``` +略 见示例 +``` +示例 获取第1页,共10条的节点列表 +``` +nuls>>> getagents 1 10 +[ { + "agentAddress" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "agentId" : "D1308A35", + "commissionRate" : 10.0, + "delHeight" : -1, + "agentHash" : "33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35", + "totalDeposit" : "0", + "memberCount" : 0, + "agentName" : null, + "packingAddress" : "tNULSeBaMotNcjQ8E72uh6XituC8CFV2UBBAHo", + "version" : null, + "blockHeight" : 4262, + "rewardAddress" : "tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8", + "deposit" : "20000", + "time" : "1970-01-19 10:07:05.005", + "creditVal" : 0.0, + "txHash" : "33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35", + "status" : "unconsensus" +} ] +``` + + + +### 加入共识(委托节点) + +根据账户地址和节点agentHash,加入共识,至少需要2000NULS + +- **命令:deposit <address> <agentHash> <deposit>** + +| 参数 | 说明 | +| ----------------- | -------------------------------------- | +| <address> | 账户地址,必填 | +| <agentHash> | 节点的agentHash,必填 | +| <deposit> | 加入共识保证金,不能低于2000NULS,必填 | + +返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。 + +```json +"f5b2622a2ca23710a0a1f28bd0cb9c054220ba0719275abca5e4a7750dcf933a" +``` + +示例 + +```shell +nuls>>> deposit tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 33aeffd4e55203d91183939ad35a9f0a2b0dc80cf1d63c93d4237102d1308a35 200000 +Please enter the password. +Enter your password:******** +"f5b2622a2ca23710a0a1f28bd0cb9c054220ba0719275abca5e4a7750dcf933a" +``` + + + +### 退出共识(退出委托) + +根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。 + +- **命令:withdraw <address> <txHash>** + +| 参数 | 说明 | +| --------------- | ---------------------- | +| <address> | 账户地址,必填 | +| <txHash> | 委托时的交易hash,必填 | + +返回信息 退出共识交易hash + +```json +"d8e1784239d73e064e83e448adcf0feec9ba8e56a4b55280d7a0a8149d9da545" +``` + +示例 + +```shell +nuls>>> withdraw tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 f5b2622a2ca23710a0a1f28bd0cb9c054220ba0719275abca5e4a7750dcf933a +Please enter the password. +Enter your password:******** +"d8e1784239d73e064e83e448adcf0feec9ba8e56a4b55280d7a0a8149d9da545" +``` + + + +### 停止节点 + +停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。 + +- **命令:stopagent <address>** + +| 参数 | 说明 | +| --------------- | -------------- | +| <address> | 账户地址,必填 | + +返回信息 停止节点交易hash + +```json +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + +示例 + +```shell +nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT +Please enter the password. +Enter your password:********** +"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" +``` + + +### 获取最新的区块头信息 + +获取最新的区块头信息 + +- **命令:getlatestblockheader** + +返回信息 + +```json +{ + "hash" : "c244a7936821a58eff6daf117a6acf398d1c959c1b11edbb2abf01d753f01a45",//区块hash + "preHash" : "3c775846e93468119aa73c9a84b712875d0730f8e9579cc2535be4662d415b46",//上一个区块hash + "merkleHash" : "00edec12b2382d47829e3685b04c109aeac651ee7d2dbda40c1ea1245b8bb953",//merkle hash + "time" : "1970-01-19 10:07:05.005", //打包时间 + "height" : 4295,//区块高度 + "txCount" : 1, //包含的交易数 + "blockSignature" : "463044022027db8f20882d0b37be2981587213f15fdd49110ad9e80c15b90485ad487372c902201e3eae9eca8fb6fde7424ab656300c42185923f0bae10120b58019e3bfb79456", //区块签名 + "size" : 246, //区块大小 + "packingAddress" : "tNULSeBaMt7c7sybfvP7iAC2p9d1ickHZvH9Sc",//打包地址 + "roundIndex" : 78141245, + "consensusMemberCount" : 2, + "roundStartTime" : "1970-01-19 10:07:05.005", + "packingIndexOfRound" : 2, + "mainVersion" : 1, + "blockVersion" : 1, + "stateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" +} +``` + +示例 + +```shell +nuls>>> getlatestblockheader +{ + "hash" : "c244a7936821a58eff6daf117a6acf398d1c959c1b11edbb2abf01d753f01a45",//区块hash + "preHash" : "3c775846e93468119aa73c9a84b712875d0730f8e9579cc2535be4662d415b46",//上一个区块hash + "merkleHash" : "00edec12b2382d47829e3685b04c109aeac651ee7d2dbda40c1ea1245b8bb953",//merkle hash + "time" : "1970-01-19 10:07:05.005", //打包时间 + "height" : 4295,//区块高度 + "txCount" : 1, //包含的交易数 + "blockSignature" : "463044022027db8f20882d0b37be2981587213f15fdd49110ad9e80c15b90485ad487372c902201e3eae9eca8fb6fde7424ab656300c42185923f0bae10120b58019e3bfb79456", //区块签名 + "size" : 246, //区块大小 + "packingAddress" : "tNULSeBaMt7c7sybfvP7iAC2p9d1ickHZvH9Sc",//打包地址 + "roundIndex" : 78141245, + "consensusMemberCount" : 2, + "roundStartTime" : "1970-01-19 10:07:05.005", + "packingIndexOfRound" : 2, + "mainVersion" : 1, + "blockVersion" : 1, + "stateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" +} +``` + + + + + +### 查询区块头信息 + +根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。 + +- **命令:getblockheader <hash> | <height>** + +| 参数 | 说明 | +| -------------- | ------------ | +| <hash> | 区块的hash值 | +| <height> | 区块的高度 | + +返回信息 + +```json +见示例 +``` + +示例 根据高度获取区块头 + +```shell +nuls>>> getblockheader 28115 +{ + "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", + "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", + "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", + "time" : "2018-07-16 16:29:30", + "height" : 28115, + "txCount" : 2, + "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", + "roundIndex" : 662578, + "consensusMemberCount" : 1, + "roundStartTime" : "2018-07-16 16:29:20", + "packingIndexOfRound" : 1, + "reward" : "0.001", + "fee" : "0.001", + "confirmCount" : 6280, + "size" : 204, + "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" +} +``` + +### 创建智能合约 +调用此接口在链上创建一个智能合约 + +- **命令:createcontract <sender> <gaslimt> <price> <contractCode><alias> [remark]** + +| 参数 | 说明 | +| -------------- | ------------ | +| <sender> | 创建智能合约的账户地址 | +| <gaslimt> | 本次创建合约最大消耗的Gas | +| <price> | 单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas | +| <contractCode< | 合约代码的hex编码 | +| <alias< | 合约别名 | +| [remark]|备注| + + +返回信息 创建合约的交易hash和合约的地址 + +``` +{ + "txHash" : "00205fb44fd0924a57857e71d06ec0549366b5d879b2cbd68488ed88a2dbf96c130f", //交易hash + "contractAddress" : "tNULSeBaN6ofkEqsPJmWVaeMpENTgmC5ifWtz9" //合约地址 +} +``` +示例 创建一个合约(contractCode 省略中间部分) + +``` +nuls>>> createcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 504b03040a........000000800080051020000b31600000000 remarkdemo +The arguments structure: +[ { + "type" : "String", + "name" : "name", + "required" : true +}, { + "type" : "String", + "name" : "symbol", + "required" : true +}, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true +}, { + "type" : "int", + "name" : "decimals", + "required" : true +} ] +Please enter the arguments you want to fill in according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"). +Enter the arguments:"KQB","KQB",10000,2 +{ + "txHash" : "0020ec1d68eaed63e2db8649b0a39f16b7c5af24f86b787233f6ba6d577d7d090587", + "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK" +} +``` +### 获取合约基本信息 +获取智能合约的描述信息以及构造函数、调用方法的参数列表 + +- **命令:getcontractinfo <contract address>** + +| 参数 | 说明 | +| -------------- | ------------ | +| <contract address> | 合约地址 | + + +返回信息 + +``` +略 ,见示例 +``` +示例 + +``` + +nuls>>> getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +getcontractinfo tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +{ + "createTxHash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f", + "address" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "creater" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "createTime" : 1553563706022, + "blockHeight" : 46, + "isNrc20" : true, + "nrc20TokenName" : "QKB", + "nrc20TokenSymbol" : "QKB", + "decimals" : 2, + "totalSupply" : "200000000", + "status" : "normal", + "method" : [ { + "name" : "", + "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void", + "args" : [ { + "type" : "String", + "name" : "name", + "required" : true + }, { + "type" : "String", + "name" : "symbol", + "required" : true + }, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true + }, { + "type" : "int", + "name" : "decimals", + "required" : true + } ], + "returnArg" : "void", + "view" : false, + "event" : false, + "payable" : false + },{ + "name" : "transfer", + "desc" : "(Address to, BigInteger value) return boolean", + "args" : [ { + "type" : "Address", + "name" : "to", + "required" : true + }, { + "type" : "BigInteger", + "name" : "value", + "required" : true + } ], + "returnArg" : "boolean", + "view" : false, + "event" : false, + "payable" : false + }] +} + +``` + +### 调用智能合约 +调用智能合约提供的函数 + +- **命令:callcontract <sender> <gasLimit> <price> <contractAddress> <methodName> <value> [-d methodDesc] [-r remark]** + +| 参数 | 说明 | +| -------------- | ------------ | +|<senderAddress> | 调动合约的账户地址 | +|<gasLimit>|本次合约执行最大消耗的Gas| +|<price>|单价,每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na,系统最小单价是25Na/Gas| +|<contractAddress|调用的合约地址| +|<methodName>|合约的方法名| +|<value>|如果要向合约转账,转账的数量| +|[-d methodDesc]|如果合约中有同名方法时,使用此方法来描述参数列表| +|[-r remark]|备注信息| + +返回信息 本次调用的交易hash + +``` +"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" //交易hash +``` +示例 调用一个指定合约的NRC20-Token转账函数, 示例中`tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L`为NRC20合约地址,输入的参数为 接收地址和转账数量 + +``` +nuls>>> callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call +callcontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 200000 25 tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L transfer 0 -r call +Please Enter your account passwordzhoujun172 +********** +Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"), +If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly. +Enter the arguments:"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",2 +"0020c9079e0f0454103adceed798d40171c41a8db04586dba966fbe7f2ab722583ad" +``` + +### 删除智能合约 +停止一个可用的智能合约 + +- **命令:deletecontract <senderAddress> <contractAddress>** + +| 参数 | 说明 | +| -------------- | ------------ | +| <senderAddress> | 调用合约的账户地址 | +| <contractAddress>|调用的合约地址| +返回值 交易hash + +``` +"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" //交易hash +``` +示例 + +``` +nuls>>> deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +deletecontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L +Please enter your account passwordzhoujun172 +********** +"0020c55e885dd910dad0b2c49f5b71b62691b57884ca21fd47668f1f5cadc84daad6" +``` + +### 调用合约视图方法 +调用合约的视图方法,会立即返回结果,不会产生交易 + +- **命令:deletecontractviewcontract <contractAddress> <methodName> [-d methodDesc] --view contract** + +| 参数 | 说明 | +| -------------- | ------------ | +|<contractAddress>|调用的合约地址| +|<methodName>|调用的方法| +|[-d methodDesc]|如果合约中有同名方法时,使用此方法来描述参数列表| +返回值 + +``` +根据具体调用函数返回值不同 +``` +示例 调用NRC20-Token合约的查询Token余额函数查询指定地址的Token余额 + +``` +nuls>>> viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf +viewcontract tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc balanceOf +Please enter the arguments according to the arguments structure(eg. "a",2,["c",4],"","e" or "'a',2,['c',4],'','e'"), +If this method has no arguments(Refer to the command named "getcontractinfo" for the arguments structure of the method.), return directly. +Enter the arguments:"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD" +"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD" +{ + "result" : "20000000" +} +``` + +### 向合约地址转账 + +向指定的合约地址转入主网币 + +- **命令:transfertocontract <senderAddress> <contractAddress> <amount> [remark]** + +| 参数 | 说明 | +| -------------- | ------------ | +|<senderAddress>|转出账户地址| +|<contractAddress|转入的合约地址| +|<amount>|转入数量| +|[remark]|备注| +返回值 交易hash + +``` +"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979" +``` +示例 向指定合约转入2个NULS + +``` +nuls>>> transfertocontract tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaN1NRtaj1ZPAmEmTqcpkyCLqv64PR7U 2 remark +Please enter your account password +********** +"0020f5d6b87c246595d1b060a3fa8bac6a2992490e38fdfcad40db2a3908297e7979" +``` + +### token转账 + +NRC20 token转账 + +- **命令:tokentransfer <fromAddress> <toAddress> <contractAddress> <amount> [remark]** + +| 参数 | 说明 | +| -------------- | ------------ | +|<fromAddress>|转出账户地址| +|<toAddress|转入的账户地址| +|<contractAddress>|合约地址| +|<amount>|转入数量| +|[remark]|备注| +返回值 交易hash + +``` +"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8" +``` +示例 token转账: + +``` +nuls>>> tokentransfer tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD tNULSeBaNBh9RUsVrVmMy8NHcZJ2BhNVsM1Vta tNULSeBaN6pwyVwXjfpm5BMH5eiirvthoZDVEc 200000 25 10000 +Please enter your account password +********** +"002022dffd96026b493945d2cf9ad276c4bc9655c735b72e6fcc85a2d19f6cbe25e8" +``` + + +### 获取合约交易 + +获取合约的交易信息, 包含交易详情,合约调用参数,合约执行结果 + +- **命令:getcontracttx <hash>** + +| 参数 | 说明 | +| -------------- | ------------ | +| <hash>|交易hash| + +返回值 + +``` +略 见示例 +``` +示例 + +``` +nuls>>> getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +getcontracttx 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +{ + "hash" : "00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f", + "type" : "100", + "time" : "2019-03-26 09:28:26", + "blockHeight" : 46, + "fee" : 0.0, + "value" : 0.0, + "remark" : null, + "scriptSig" : "210318f683066b45e7a5225779061512e270044cc40a45c924afcf78bb7587758ca0004630440220112a446b2a684510b4016fa97b92d2f3fead03128f0f658c99a6a8d230d05d4e02201e23a2f6e68aacdff2d117bd5bbe7ce2440babfe4211168eafbae41acad5d505", + "status" : "confirm", + "confirmCount" : 0, + "size" : 6686, + "inputs" : [ { + "address" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "assetsChainId" : 2, + "assetId" : 1, + "amount" : "5700000", + "nonce" : "ffffffff", + "locked" : 0, + "value" : 0.0 + } ], + "outputs" : [ ], + "txData" : { + "data" : { + "sender" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "value" : 0.0, + "hexCode" : "504b03040a0000080...........31600000000", + "gasLimit" : 200000, + "price" : "0.00000025", + "args" : [ [ "QKB" ], [ "QKB" ], [ "2000000" ], [ "2" ] ] + } + }, + "contractResult" : { + "success" : true, + "errorMessage" : null, + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "result" : null, + "gasLimit" : 200000, + "gasUsed" : 14029, + "price" : "0.00000025", + "totalFee" : 0.0, + "txSizeFee" : 0.0, + "actualContractFee" : 0.0, + "refundFee" : 0.0, + "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba", + "value" : 0.0, + "stackTrace" : null, + "balance" : 0.0, + "transfers" : [ ], + "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ], + "tokenTransfers" : [ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "from" : null, + "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "value" : "200000000", + "name" : "QKB", + "symbol" : "QKB", + "decimals" : 2 + } ], + "remark" : "create" + } +} + + +``` + + +### 获取合约执行结果 + +获取一个合约的执行结果 + +- **命令:getcontractresult <hash>** + +| 参数 | 说明 | +| -------------- | ------------ | +|<hash>|交易hash| + +返回值 + +``` +略 见示例 +``` +示例 + +``` +nuls>>> getcontractresult 00203a48dcfc26426152805be49830c72005b4648d0182bbf6c2e8980380364eb59f +{ + "success" : true, + "errorMessage" : null, + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "result" : null, + "gasLimit" : 200000, + "gasUsed" : 14029, + "price" : "0.00000025", + "totalFee" : 0.0, + "txSizeFee" : 0.0, + "actualContractFee" : 0.0, + "refundFee" : 0.0, + "stateRoot" : "be76399c41a8cb4be5ecf80e04dab36830b124cb1c43fea6ca69ae62259899ba", + "value" : 0.0, + "stackTrace" : null, + "balance" : 0.0, + "transfers" : [ ], + "events" : [ "{\"contractAddress\":\"tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L\",\"blockNumber\":46,\"event\":\"TransferEvent\",\"payload\":{\"from\":null,\"to\":\"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD\",\"value\":\"200000000\"}}" ], + "tokenTransfers" : [ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "from" : null, + "to" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "value" : "200000000", + "name" : "QKB", + "symbol" : "QKB", + "decimals" : 2 + } ], + "remark" : "create" +} + +``` + + +### 获取合约构造函数 + +获取创建指定合约时需要传入的参数列表 + +- **命令:getcontractcontructor <contractCode>** + +| 参数 | 说明 | +| -------------- | ------------ | +|<contractCode>|合约代码的hex编码| + +返回值 + +``` +略 见示例 +``` +示例 + +``` +nuls>>> getcontractcontructor 504b03040a000008000.........20000b31600000000 +{ + "constructor" : { + "name" : "", + "desc" : "(String name, String symbol, BigInteger initialAmount, int decimals) return void", + "args" : [ { + "type" : "String", + "name" : "name", + "required" : true + }, { + "type" : "String", + "name" : "symbol", + "required" : true + }, { + "type" : "BigInteger", + "name" : "initialAmount", + "required" : true + }, { + "type" : "int", + "name" : "decimals", + "required" : true + } ], + "returnArg" : "void", + "view" : false, + "event" : false, + "payable" : false + }, + "isNrc20" : true +} + +``` + + +### 获取指定账户创建的合约列表 + +获取指定账户地址所创建的合约列表 + +- **命令:getaccountcontracts <createAddress>** + +| 参数 | 说明 | +| -------------- | ------------ | +|<createAddress>|账户地址| + +返回值 + +``` +{ + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "createTime" : "2019-03-26 09:28:26.026", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 2, + "msg" : null, + "create" : true +} +``` +示例 + +``` +nuls>>> getaccountcontracts tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD +[ { + "contractAddress" : "tNULSeBaMz7vkyhgqLXVdcT75dC5udULVs1D2L", + "createTime" : "2019-03-26 09:28:26.026", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 2, + "msg" : null, + "create" : true +}, { + "contractAddress" : "tNULSeBaMzsHrbMy2VK23RzwjkXS1qo2ycG5Cg", + "createTime" : "2019-03-25 16:08:25.025", + "height" : 253, + "confirmCount" : 195, + "remarkName" : null, + "status" : 0, + "msg" : null, + "create" : true +}, { + "contractAddress" : "tNULSeBaNBYK9MQcWWbfgFTHj2U4j8KQGDzzuK", + "createTime" : "2019-03-25 15:33:54.054", + "height" : 46, + "confirmCount" : 402, + "remarkName" : null, + "status" : 0, + "msg" : null, + "create" : true +} ] +``` + +### 查询网络信息 + +查询网络基本信息 + +- **命令:network info** + +返回信息 + +```json +{ + "localBestHeight" : 35317,//本地最新区块高度 + "netBestHeight" : 35317,//网络最新区块高度 + "timeOffset" : "0ms",//网络时间偏移值 + "inCount" : 0,//被动连接节点数量 + "outCount" : 1//主动连接节点数量 +} +``` + +示例 + +```shell +nuls>>> network info +{ + "localBestHeight" : 35317, + "netBestHeight" : 35317, + "timeOffset" : "0ms", + "inCount" : 0, + "outCount" : 1 +} +``` + + + +### 查询网络节点IP + +查询网络节点IP + +- **命令:network nodes** + +返回信息 + +```json +见示例 +``` + +示例 根据高度获取区块 + +```shell +nuls>>> network nodes +[ { + "blockHash" : "8c3a57eeda7ed74926eba6e007b11fca9363dc22019da19415e0a7731a9b1bdf", + "blockHeight" : 4401, + "peer" : "192.168.1.191:18001" +}, { + "blockHash" : "8c3a57eeda7ed74926eba6e007b11fca9363dc22019da19415e0a7731a9b1bdf", + "blockHeight" : 4401, + "peer" : "192.168.1.143:18001" +} ] +``` + +### 在主链注册侧链 +侧链需要进行跨链交易,需要先在主链完成注册,此命令需要在主网节点运行 +- **命令: registercrosschain <address> <chainId> <chainName> <magicNumber> <assetId> <symbol> <assetName> <initNumber> [decimalPlaces] [minAvailableNodeNum] [txConfirmedBlockNum]** + +| 参数 | 说明 | +| -------------- | ------------ | +|<address>|注册跨链费用支付账户| +|<chainId>|注册的链id| +|<chainName>|注册的链名称| +|<magicNumber>|注册链的运行的网络魔法参数| +|<assetId>|注册的资产id| +|<symbol>|资产简称 e.g. BTC| +|<assetName>|资产名称| +|<initNumber>|资产发现总量| +|[decimalPlaces]|资产小数位数 默认8| +|[minAvailableNodeNum]|跨链交易可用条件:最小可用节点数量,默认5| +|[txConfirmedBlockNum]|注册交易的确认块数,默认30| +返回值 + +``` +6e7397753d93742586c4b73a2785efc0e848a5cdb220e33eac3cd470ee57e210 #注册交易hash +``` +示例 + +```nuls>>> registercrosschain tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD 3 testchain 123456 10 TB tb 1000 +nuls>>> registercrosschain tNULSeBaMjxVA6QijNXjEf3RYxwTbTLSqXvpa8 10 bitcoin 20191919 1 BTC btc 1000000 8 1 10 +Please enter the password. +Enter your password:******** +6e7397753d93742586c4b73a2785efc0e848a5cdb220e33eac3cd470ee57e210 +``` +### 查询侧链注册信息 +在主网查询某条测试的注册信息 +- **命令:crosschaininfo <chainId>** + +| 参数 | 说明 | +| -------------- | ------------ | +|<chainId>|注册链的id| +返回值 + +```{ + "chainId" : 3, + "chainName" : "testchain", + "addressType" : "1", + "magicNumber" : 123456, + "minAvailableNodeNum" : 5, + "txConfirmedBlockNum" : 0, + "regAddress" : "tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", + "regTxHash" : "6c29d99c2b02cfc766ef25bee2ea619610a5fce1d778c3038885111f590ae312", + "createTime" : 1557739548367, + "seeds" : "192.168.1.192:8088", + "selfAssetKeyList" : [ "3-10" ], + "totalAssetKeyList" : [ "3-10" ] +} +``` +返回参数说明 + +|parameter|required|type|description| +|------------------|-------|-----|-------------------------------------------| +|chainId|true|int|链标识| +|assetId|true|int|资产id| +|chainName|true|string|链名称| +|addressType|true|int|链上创建的账户的地址类型:1生态内2非生态内| +|magicNumber|true|string|网络魔法参数| +|minAvailableNodeNum|true|int|最小可用节点数量| +|txConfirmBlockNum|true|int|交易确认块数| +|symbol|true|string|资产符号| +|assetName|true|string|资产名称| +|initNumber|true|string|资产初始值| +|decimalPlaces|true|int|最小资产可分割位数| +|address|true|string|创建链的主网地址| +|password|true|string|私钥对应的密码| +示例 + +``` +nuls>>> crosschaininfo 11 +{ + "chainId" : 11, + "chainName" : "Neth", + "addressType" : "1", + "magicNumber" : 20190303, + "minAvailableNodeNum" : 5, + "txConfirmedBlockNum" : 0, + "regAddress" : "tNULSeBaMgDEcAUhPSdF3D3C6mT54HPUt81cQ4", + "regTxHash" : "7a672b093b274b93bc145dda0e598eddf1f1cf0ccb9aba3e67b3899a5b4ad7a1", + "createTime" : 1557921296460, + "seeds" : "192.168.1.192:8088", + "selfAssetKeyList" : [ "11-1" ], + "totalAssetKeyList" : [ "11-1", "2-1" ] +} +``` +### 创建跨链交易 +- **命令:createcrosstx <fromAddress> <toAddress> <assetChainId> <assetId> <amount> [remark]** + + +| 参数 | 说明 | +| -------------- | ------------ | +|<fromAddress>|转出地址| +|<toAddress>|转入地址| +|<assetChainId>|转账资产的chainId| +|<assetId>|转账资产id| +|<amount>|转账资产数量| +|<remark>|转账备注| +返回值:交易hash +``` +529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 +``` +示例 + +``` +nuls>>> createcrosstx tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD M9busmFhQeu1Efn6rDyeQkFjHxv2dSzkuH8 2 1 1 +Please enter the password. +Enter your password:********** +529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 +``` +### 查询跨链交易确认状态 +- **命令:getcrosstxstate <txHash>** + +| 参数 | 说明 | +| -------------- | ------------ | +|<txHash>|交易hash| + +返回值 + +``` +Confirmed | Unconfirmed +``` +示例 + +``` +nuls>>> getcrosstxstate 529bb34c0f4760fa55dd98b92d3e913ed2306b7ac1f93c4491007e266bb04ef5 +Unconfirmed +``` + + +### 退出钱包命令程序 + +退出操作钱包的命令行程序,不会退出已启动的钱包节点。 + +- **命令:exit** + +示例 + +```shell +nuls>>> exit +``` diff --git a/docs/zh/NULS2.0/mavenPackage.md b/docs/zh/NULS2.0/mavenPackage.md new file mode 100644 index 00000000..d37e3b14 --- /dev/null +++ b/docs/zh/NULS2.0/mavenPackage.md @@ -0,0 +1,87 @@ +# 开发工具 + +## NULS智能合约Maven-archetype使用文档 + +### NULS智能合约Maven-archetype介绍 + +NULS智能合约Maven-archetype是为开发者定义的智能合约Maven项目模板,在IntelliJ IDEA添加该Maven archetype,并选择此archetype可以快速地生成NULS智能合约开发项目工程。该智能合约项目为maven项目,其中自带样本合约类,并且所有必需的NULS智能合约依赖项都自动添加到项目中,开发者只需关注智能合约业务逻辑的代码开发。 + +该maven archetype还集成了离线智能合约客户端,在通过maven打包智能合约之后,会自动启动该离线智能合约客户端,开发者在此客户端上进行智能合约的部署和合约方法调用。 + + +### 新建NULS智能合约Maven工程 + +1、为了解决Intellij IDEA 通过archetype创建Maven项目缓慢的问题,增加maven运行参数: -DarchetypeCatalog=internal,操作步骤如下图: + +![](../../NULS2.0/mavenPackage/jG8M6dR.png) + +![](../../NULS2.0/mavenPackage/axexko4.png) + +2、在IntelliJ IDEA中选择新建maven项目,然后按下图(图1)的操作顺序将NULS智能合约Maven archetype添加到IDEA中。在添加archetype时参数如下: + + GroupId:io.nuls.v2 + ArtifactId: nuls-smartcontract-archetype + Version: 0.10 + +![图1](../../NULS2.0/mavenPackage/jFTBDBh.png) + +3、选择“io.nuls.v2:nuls-smartcontract-archetype”,然后点击下一步,如下图所示(图2),创建Maven工程。 + +> 第一次创建时,可能会等待2~3分钟,请耐心等待 + +![图2](../../NULS2.0/mavenPackage/roCyIZD.png) + +4、最后生成的maven工程如下图(图3)所示,其中pom.xml文件已经加入NULS智能合约所需的依赖jar,开发者无需修改此文件。 + +![图3](../../NULS2.0/mavenPackage/nw87nAh.png) + +5、开始NULS智能合约的业务代码开发,示例见https://github.com/CCC-NULS/pocm-contract + +### 打包NULS智能合约 + +完成智能合约的开发之后,通过“mvn clean pakcage”命令或者IDEA的maven插件对智能合约进行打包,打包完成后会启动离线智能合约客户端,开发者可在此客户端进行智能合约的部署和调用工作。 + +### 部署合约 + +在“部署合约”页面,自动加载当前智能合约项目target目录下面的jar包,即maven打包的默认路径。若开发者需要部署其他jar包,可选择其他jar包上传并部署。 + +![](./mavenPackage/CDH844z.png) + +### 调用合约 + +当合约部署成功之后,在“我的合约”页面的列表中展示,开发者点击相应合约的“调用”按钮即可进入调用合约页面,选择调用的合约方法,填写合约方法相关的参数,点击“调用”即可完成合约方法的调用。如下图所示。 + +![](./mavenPackage/VjyGwcR.png) + +### 离线智能合约客户端介绍 + +离线智能合约客户端的主要功能是进行智能合约的部署和发布,同时还提供了账户创建和导入、NULS API module服务节点地址的维护等功能。客户端的主要页面包括我的合约、部署合约、账户管理、服务节点。 + +离线智能合约客户端的主要优势是,开发者无需在本地部署NULS钱包,仅运行该客户端即可进行智能合约的部署和合法方法调用工作。 + +#### 我的合约 + +在“我的合约”页面可以查看选中的账户地址下已经部署的合约列表,点击“调用”按钮可以进入合约方法的调用页面。 + +![](./mavenPackage/POkgE3L.png) + +#### 部署合约 + +在“部署合约”页面进行合约的部署,可以选中“jar包”或“HEX码”两种方式部署合约。 + +![](./mavenPackage/ctTcYdM.png) + + +#### 账户管理 + +在进行智能合约部署和发布之前,必须通过“进入”按钮选择账户地址,若无账户信息则可以通过创建账户或者导入账户两种方式实现。操作页面如下图所示。 + +![](./mavenPackage/hMJECqh.png) + +#### 服务节点 + +服务节点是指NULS API模块的URL地址,当不选择服务地址时,默认使用http://apitn1.nulscan.io,操作页面如下图所示。 + +![](./mavenPackage/P3rRa4L.png) + +![](./mavenPackage/rRUWyI3.png) \ No newline at end of file diff --git a/docs/zh/NULS2.0/mavenPackage/CDH844z.png b/docs/zh/NULS2.0/mavenPackage/CDH844z.png new file mode 100644 index 00000000..7ccd004a Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/CDH844z.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/P3rRa4L.png b/docs/zh/NULS2.0/mavenPackage/P3rRa4L.png new file mode 100644 index 00000000..c4c30334 Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/P3rRa4L.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/POkgE3L.png b/docs/zh/NULS2.0/mavenPackage/POkgE3L.png new file mode 100644 index 00000000..491faf48 Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/POkgE3L.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/VjyGwcR.png b/docs/zh/NULS2.0/mavenPackage/VjyGwcR.png new file mode 100644 index 00000000..6027d5cf Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/VjyGwcR.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/ctTcYdM.png b/docs/zh/NULS2.0/mavenPackage/ctTcYdM.png new file mode 100644 index 00000000..7ccd004a Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/ctTcYdM.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/hMJECqh.png b/docs/zh/NULS2.0/mavenPackage/hMJECqh.png new file mode 100644 index 00000000..ffabd85e Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/hMJECqh.png differ diff --git a/docs/zh/NULS2.0/mavenPackage/rRUWyI3.png b/docs/zh/NULS2.0/mavenPackage/rRUWyI3.png new file mode 100644 index 00000000..448910b1 Binary files /dev/null and b/docs/zh/NULS2.0/mavenPackage/rRUWyI3.png differ diff --git a/docs/zh/NULS2.0/multiSignAccount.md b/docs/zh/NULS2.0/multiSignAccount.md new file mode 100644 index 00000000..7698de91 --- /dev/null +++ b/docs/zh/NULS2.0/multiSignAccount.md @@ -0,0 +1,223 @@ +# 多重签名账户 + +## 介绍 + +多重签名账户,是相对于单签名账户来讲的,我们日常使用的普通账户地址就是单签名账户在创建交易时需要用我们账户私钥签名,来保证我们的交易是安全的不被串改的。多重签名账户地址是有由多个普通账户的公钥,经过一定的计算生成的。在创建交易时,需要由创建这个多签账户的多个公钥所对应的私钥来签名,才能保证多签账户交易的安全。 + +在生成多签账户时是由N个普通地址的公钥,来生成一个需要M个签名才能创建合法交易的多签账户,N≥M。因此这个账户一般是需要多个人来签名,并且达到最小签名数(M)才能动用账户的token。 + +## 功能 + +在NULS2.0中多重签名账户可以做一些与普通账户相同的操作: + +- 创建多签转账交易,包含多资产转账 +- 为多签账户设置别名 +- 创建共识节点 +- 参与共识 + +## 使用方法 + +我们会介绍多重签名账户各个功能的使用方式,可能会遇到的问题,以及开发者们在组装多签交易时需要注意的问题。开发者在阅读本文之前可能需要用户对NULS2.0普通交易有一定的了解。本文包含部分接口说明,更完整的说明请参考模块说明文档。 + +**生成多重签名账户** + +多重签名账户是由多个普通地址生成的,目的是为了满足让多人控制一个账户的资产交易的功能场景。因此在创建多签账户时,既不会生成公钥也不会生成私钥,而是生成的多签账户信息包含产生这个账户时所有参与人的公钥、最小签名数,多签账户地址等信息。 +值得注意的是参与人公钥列表是一个具有兼容性的字符串列表参数,该列表里面可以传入参与创建的普通账户公钥的字符串或者账户地址的字符串,且可以混合传入,例如有A、B、C三个普通账户,需要创建多重签名账户,那么公钥列表可以如下: +``` +pubKeys = [A账户的公钥,B账户的地址,C账户的公钥] +``` +注意 +* 如果要传入账户地址,那么需要该地址账户存在于调用接口的节点中,传公钥字符串没有此限制。 +* pubKeys公钥列表中各个公钥的传入顺序,不会对最终生成的账户产生影响。 +* 公钥字符串可以调用账户模块的接口`ac_getPubKey`得到。 + +**创建多签转账交易** + +在NULS2.0中多重签名地址转账交易,与普通地址转账交易的协议是一致的,具有相同的交易类型(type值)。但是多签转账交易仍然具有特殊性,组装和验证交易的规则与普通交易有一定的区别,需要注意的有: + +- 交易from中不能混合多个不同的地址,多签转账交易如果组装了多个from,那么所有from中的地址都只能是同一个多签地址,from中的资产可以是不同的,交易to中没有该限制。 +- 组装新交易的时候可以签名也可以不签名。 +- 签名后达到最小签名数则自动发送广播交易。 +- 无需对已达最小签名数的交易继续签名,那只会增大交易数据,不会为交易验证以及安全性带来更多的便利。 + +**签名** + +多签交易组装完成后,一般还需要将交易数据交给各个多签账户控制者单独为交易进行签名,以致满足多签账户最小签名数,最终得到完整合法的交易数据。NULS2.0的多签交易签名接口,每次执行完签名后会自动验证交易是否达到最小签名数,来决定是否发送并广播交易,无需用户自己单独广播交易。 +- 多人签名时,下一个签名者只需要得到返回值中的tx的值即可。 + +**设置别名**、**创建节点**、**委托**、**退出委托**、**停止节点**的交易与普通账户的交易基本一致,只是签名方式不同而已。 + +## 接口 +### ac_createMultiSignAccount +创建多签账户/create a multi sign account + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| -------- | :-------------: | ------------------------------------------------------------ | :------: | +| chainId | int | 链id | 是 | +| pubKeys | list<string> | 公钥集合(任意普通地址的公钥或存在于当前节点中的普通账户地址) | 是 | +| minSigns | int | 最小签名数 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| ------- | :------: | ------------ | +| address | string | 多签账户地址 | + + +### ac_createMultiSignTransfer +创建多签地址转账交易/create multi sign transfer + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ------------------------------------------------------------ | :--------: | ------------------------------------------ | :------: | +| chainId | int | 链id | 是 | +| inputs | list | 交易支付方数据 | 是 | +|         address | string | 账户地址 | 是 | +|         assetsChainId | integer | 资产的链ID | 是 | +|         assetsId | integer | 资产ID | 是 | +|         amount | biginteger | 数量 | 是 | +| outputs | list | 交易接受方数据 | 是 | +|         address | string | 账户地址 | 是 | +|         assetsChainId | integer | 资产的链ID | 是 | +|         assetsId | integer | 资产ID | 是 | +|         amount | biginteger | 数量 | 是 | +|         lockTime | long | 解锁时间, -1为一直锁定, 0为不锁定(默认) | 否 | +| remark | string | 交易备注 | 是 | +| signAddress | string | 第一个签名账户地址(不填则只创建交易不签名) | 否 | +| signPassword | string | 第一个签名账户密码(不填则只创建交易不签名) | 否 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + + +### ac_signMultiSignTransaction +多签交易签名/sign MultiSign Transaction + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ------------ | :------: | -------------- | :------: | +| chainId | int | 链id | 是 | +| tx | string | 交易数据字符串 | 是 | +| signAddress | string | 签名账户地址 | 是 | +| signPassword | string | 签名账户密码 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + +### ac_setMultiSignAlias +设置别名/set the alias of multi sign account + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ------------ | :------: | ------------------------------------------ | :------: | +| chainId | int | 链id | 是 | +| address | string | 多签账户地址 | 是 | +| alias | string | 别名 | 是 | +| signAddress | string | 第一个签名账户地址(不填则只创建交易不签名) | 否 | +| signPassword | string | 第一个签名账户密码(不填则只创建交易不签名) | 否 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + + + +### cs_createMultiAgent + +多签账户创建节点/Multi-Sign Account create agent transaction + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| -------------- | :------: | --------------------- | :------: | +| chainId | int | 链id | 是 | +| agentAddress | string | 节点地址(多签地址) | 是 | +| packingAddress | string | 节点出块地址 | 是 | +| rewardAddress | string | 奖励地址,默认节点地址 | 否 | +| commissionRate | int | 佣金比例 | 是 | +| deposit | string | 抵押金额 | 是 | +| password | string | 签名账户密码 | 是 | +| signAddress | string | 签名账户地址 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + + + +### cs_multiDeposit + +多签账户委托共识/Multi-Sign Account deposit agent transaction + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ----------- | :------: | ------------ | :------: | +| chainId | int | 链id | 是 | +| address | string | 多签账户地址 | 是 | +| agentHash | string | 节点HASH | 是 | +| deposit | string | 委托金额 | 是 | +| password | string | 签名账户密码 | 是 | +| signAddress | string | 签名账户地址 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + + + +### cs_multiWithdraw + +多签账户退出共识/Multi-Sign Account withdraw deposit agent transaction + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ----------- | :------: | ---------------- | :------: | +| chainId | int | 链id | 是 | +| address | string | 多签账户地址 | 是 | +| txHash | string | 加入共识交易HASH | 是 | +| password | string | 签名账户密码 | 是 | +| signAddress | string | 签名账户地址 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | + + + +### cs_stopMultiAgent + +多签账户注销节点/Multi-Sign Account stop agent + +| 参数名 | 参数类型 | 参数描述 | 是否非空 | +| ----------- | :------: | ------------------ | :------: | +| chainId | int | 链id | 是 | +| address | string | 节点地址(多签地址) | 是 | +| password | string | 签名账户密码 | 是 | +| signAddress | string | 签名账户地址 | 是 | + +返回值 + +| 字段名 | 字段类型 | 参数描述 | +| --------- | :------: | ----------------------------------------------------------- | +| tx | string | 完整交易序列化字符串,如果交易没达到最小签名数可继续签名 | +| txHash | string | 交易hash | +| completed | boolean | true:交易已完成(已广播),false:交易没完成,没有达到最小签名数 | diff --git a/docs/zh/NULS2.0/nodeGuide.md b/docs/zh/NULS2.0/nodeGuide.md new file mode 100644 index 00000000..6ec4fa2a --- /dev/null +++ b/docs/zh/NULS2.0/nodeGuide.md @@ -0,0 +1,234 @@ +# 节点程序配置说明 +## 配置文件 +nuls.ncf是节点钱包核心配置文件,可在此文件中完成所有模块的配置。 +### 配置文件结构 +配置文件格式采用类window系统配置文件结构,分为组和参数。 + +``` +[network] #组 +port=18001 #参数key和值 +``` +nuls.ncf内部结构 + +``` +[global] +encoding=UTF-8 +language=en +... +[account] +keystoreFolder=/keystore/backup + +[network] +port=10081 +... +``` +- [global]是一个特殊的组,所有的模块都会继承这个组里的配置项。全局通用配置可以配置在这个组下面。 +- [account]、[network]这两个是账户模块和网络模块的专有配置。名称对应模块Module.ncf里面的APP_NAME配置项。 +- [global]和模块组下面有相同配置项时,模块组下面的配置优先级更高,覆盖global里的配置。 +### 各个配置文件的关系 +在模块内部(比如Modules/Nuls/account/1.0.0)目录下,有一个Module.ncf的配置文件,外部nuls.ncf的优先级高于模块内部的Module.ncf,当出现同名配置项时,nuls.ncf里的配置项将覆盖模块内部的同名配置项。 + +### 生成配置文件 +当首次下载或打包好钱包程序时,是不存在nuls.ncf这个配置文件的,首次执行start或start-dev时,会自动生成nuls.ncf。 + +[nuls.ncf配置说明列表](#nuls.ncf) + +## 基础命令 +### start +钱包启动脚本,生产环境使用此脚本启动钱包 + +``` +./start +``` +### shop +钱包停止脚本,生产环境使用此脚本停止钱包 + +``` +./stop +``` +### start-dev +启动NULS2.0开发环境(兼容macOS系统) + +``` +./start-dev +``` +### stop-dev +停止NULS2.0开发环境 + +``` +./stop-dev +``` +### cmd +启动命令行,进入钱包进行操作 + +``` +./cmd +``` +指定日志级别,默认日志级别是ERROR,可选日志级别:DEBUG、INFO、WARN、ERROR + +``` +./cmd -l DEBUG #设置日志级别为DEBUG +``` +指定配置文件路径,默认配置文件为同目录nuls.ncf + +``` +./cmd -c /home/my.ncf +``` +### check-status +检查模块的启动状态,通过此功能可以快速检查各个基础模块是否启动成功,该脚本运行原理是读取日志文件里面的日志标志位。 + +``` +./check-status +``` +执行结果 + +``` +==================MODULE PROCESS==================== +account PROCESS IS START +block PROCESS IS START +consensus PROCESS IS START +ledger PROCESS IS START +network PROCESS IS START +transaction PROCESS IS START +==================RPC REDAY MODULE================== +account RPC READY +block RPC READY +consensus RPC READY +ledger RPC READY +network RPC READY +transaction RPC READY +======================REDAY MODULE================== +account STATE IS READY +block STATE IS READY +consensus STATE IS READY +ledger STATE IS READY +network STATE IS READY +transaction STATE IS READY +================TRY RUNNING MODULE================== +account TRY RUNNING +block TRY RUNNING +consensus TRY RUNNING +ledger TRY RUNNING +network TRY RUNNING +transaction TRY RUNNING +===================RUNNING MODULE=================== +account STATE IS RUNNING +block STATE IS RUNNING +consensus STATE IS RUNNING +ledger STATE IS RUNNING +network STATE IS RUNNING +transaction STATE IS RUNNING +==================NULS WALLET STATE================= +========================== +NULS WALLET IS RUNNING +========================== +``` +当看到NULS WALLET IS RUNNING时表示启动成功。 +### create-address +生成账户地址和私钥。不依赖钱包,可独立运行生成地址。 +``` +./create-address +chainId:2 +number:1 +==================================================================================================== +address :tNULSeBaMi3UWVb1hMrsoEmv4XPPLW7CKmBVgn +privateKey:e27e3961384bc4749cb5bd535b16c90c4430d4da2cd34e1edd10b50b0d01fa1d +==================================================================================================== +``` +指定生成地址的chainId + +``` +./create-address -c 1 #指定chainId为1 ,(默认从nuls.ncf从读取chainId) +``` +生成指定数量的地址 + +``` +./create-address -n 100 #批量生成100个地址,(默认1) +``` +## 附录 +### nuls.ncf 配置文件 +#### 全局配置:group +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| encoding | 字符集 | 默认UTF-8,不建议修改 | +| language | en/zh_CHS | 语言包。 | +| logPath | 文件夹相对路径 | 日志文件存储路径,配置文件上下文相对路径 | +| logLevel | DEBUG,INFO,WARN,ERROR | 日志级别 | +| dataPath | 文件夹相对路径 | 数据文件存储路径,配置文件上下文相对路径 | +| chainId | 正整数 | 默认运行的链的链id | +| assetId | 正整数 | 默认运行链的主资产id | +| chainName | 字符串 | 默认运行链的链名称 | +| symbol | 字符串 | 默认运行链的主资产符号 | +| decimals | 正整数 | 默认资产的小数点右侧的位数 | +| blackHolePublicKey | 字符串 | 黑洞地址公钥 | + +#### 网络模块配置:network + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| port | 正整数 | 网络通信端口 | +| crossPort | 正整数 | 跨链交易通信端口 | +| packetMagic | 正整数 | 网络魔法参数,魔法参数相同才会组网 | +| selfSeedIps | 字符串 | 默认连接的网络节点ip,多个用英文逗号隔开 | +| maxInCount | 正整数 | 允许外部节点与当前节点建立连接的总数量 | +| maxOutCount | 正整数 | 允许当前节点与外部节点建立连接的总数量 | + +#### 账户模块配置:account + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| keystoreFolder | 文件夹路径 | 存储账户keystore文件的路径,此路径为在dataPath路径里的路径值 | + +#### 区块模块配置:block + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| blockMaxSize | 正整数 | 一个区块可存储的最大字节数 | +| extendMaxSize | 正整数 | 区块扩展字段可存储的最大字节数 | +| chainSwtichThreshold | 正整数 | 引发分叉链切换的高度差阈值 | +| maxRollback | 正整数 | 本地区块与网络区块不一致时,本地最大回滚数 | +| consistencyNodePercent | 正整数 | 统计网络上的节点最新区块高度、hash一致的百分比阈值 | +| minNodeAmount | 正整数 | 最小链接节点数,当链接到的网络节点低于此参数时,会持续等待 | +| downloadNumber | 正整数 | 区块同步过程中,每次从网络上节点下载的区块数量 | +| singleDownloadTimeout | 正整数 | 从网络节点下载单个区块的超时时间 | +| batchDownloadTimeout | 正整数 | 从网络节点下载多个区块的超时时间 | +| cachedBlockSizeLimit | 正整数 | 区块同步过程中缓存的区块字节数上限 | + +#### poc共识模块配置:consensus + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| seedNodes | 地址列表 | 种子节点出块地址列表,多个地址用英文逗号隔开 | +| password | 字符串 | 种子节点出块地址的默认密码,导入地址时设置的密码必须和这个配置项一致 | +| packingInterval | 正整数 | 出块间隔,单位秒,配置为10,代表每10秒出一个块 | +| agentAssetId | 正整数 | 允许参与共识的资产id | +| agentChainId | 正整数 | 允许参与共识的资产的链id | +| awardAssetId | 正整数 | 共识奖励的资产id(必须在共识的资产所在的链,既资产链id相同) | +| feeUnit | 正整数 | 手续费单价 | + +#### 智能合约配置:smart_contract + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| maxViewGas | 正整数 | 合约视图方法调用最大消耗的Gas | + +#### api接口模块配置:api-module + +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| rpcPort | 端口号 | http接口使用的端口号 | +| databaseUrl | ip地址 | mongodb数据库ip地址 | +| databasePort | 端口号 | mongodb数据库端口号 | +| maxAliveConnect | 正整数 | 数据库连接池最大连接数 | +| maxWaitTime | 正整数 | 从数据库获取连接的最长等待时间(毫秒) | +| connectTimeOut | 正整数| 数据库连接超时时间(毫秒)| + +#### 跨链模块:cross-chain +| 配置项 | 取值范围 | 说明 | +| --- | --- | --- | +| minNodeAmount | 正整数 | 跨链节点链接的最小值 | +| maxNodeAmount | 正整数 | 跨链节点链接的最大值 | +| sendHeight | 正整数 | 跨链交易在本链内确认块数 | +| byzantineRatio | 正整数 | 跨链交易拜占庭比例 | +| crossSeedIps | ip地址列表 | 主网跨链种子节点列表 | + diff --git a/docs/zh/NULS2.0/nodeWalletGuide/20190327144549.png b/docs/zh/NULS2.0/nodeWalletGuide/20190327144549.png new file mode 100755 index 00000000..7fff2ad7 Binary files /dev/null and b/docs/zh/NULS2.0/nodeWalletGuide/20190327144549.png differ diff --git a/docs/zh/NULS2.0/nodeWalletGuide/20190327150757.png b/docs/zh/NULS2.0/nodeWalletGuide/20190327150757.png new file mode 100755 index 00000000..a5aeffdc Binary files /dev/null and b/docs/zh/NULS2.0/nodeWalletGuide/20190327150757.png differ diff --git a/docs/zh/NULS2.0/nodeWalletGuide/20190327223858.png b/docs/zh/NULS2.0/nodeWalletGuide/20190327223858.png new file mode 100755 index 00000000..7bf326a3 Binary files /dev/null and b/docs/zh/NULS2.0/nodeWalletGuide/20190327223858.png differ diff --git a/docs/zh/NULS2.0/nodeWalletGuide/20190709172800.png b/docs/zh/NULS2.0/nodeWalletGuide/20190709172800.png new file mode 100755 index 00000000..a604d324 Binary files /dev/null and b/docs/zh/NULS2.0/nodeWalletGuide/20190709172800.png differ diff --git a/docs/zh/NULS2.0/offlineAssembly.md b/docs/zh/NULS2.0/offlineAssembly.md new file mode 100644 index 00000000..00ef3a42 --- /dev/null +++ b/docs/zh/NULS2.0/offlineAssembly.md @@ -0,0 +1,982 @@ +# 合约交易离线组装 + +**智能合约有三种要组装的交易,分别是`发布合约`、`调用合约`、`删除合约`,下面将使用`Java`语言和`JavaScript`语言分别介绍这三种交易的离线组装方式** + +> 文档中使用 **`NRC20合约代码`** 作为示例 + +## 1. Java + +```java +// 主链的ID,示例中使用2 +int chainId = 2; +// 主链的资产ID,示例中使用1 +int assetsId = 1; +``` + +### 1.1 发布合约的交易 + +组装发布合约的交易需要与apiModule交互四次 + +- 获取构造函数 +- 验证发布合约的执行合法性 +- 预估发布合约需要的GAS +- 获取交易创建者的余额和nonce + +**最初数据: `交易创建者地址`, `合约代码字节码的Hex字符串`, `合约别名`, `交易备注`** + +#### 1.1.1) 调用接口获取合约代码构造函数 + +- 接口: getContractConstructor +- 参数: chainId, contractCode + + chainId : int //链ID + + contractCode: String // 文件字节流转换Hex编码字符串 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"getContractConstructor", + "params":[2,"504b03040...00000000"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "constructor": { + "name": "", + "desc": "(String name, String symbol, BigInteger initialAmount, int decimals) return void", + "args": [ + { + "type": "String", + "name": "name", + "required": true + }, + { + "type": "String", + "name": "symbol", + "required": true + }, + { + "type": "BigInteger", + "name": "initialAmount", + "required": true + }, + { + "type": "int", + "name": "decimals", + "required": true + } + ], + "returnArg": "void", + "view": false, + "event": false, + "payable": false + }, + "isNrc20": true + } +} +``` + +#### 1.1.2) 根据构造函数参数组装参数数据**(若是无参函数,则跳过此步)** + +- 把构造函数的参数类型组装成一个字符串数组 + + > 从`getContractConstructor`接口中得到此类数据 + + ```java + Map constructor = (Map) result.get("constructor"); + List args = (List) constructor.get("args"); + int size = args.size(); + String[] argTypes = new String[size]; + int i = 0; + for (Map arg : args) { + argTypes[i++] = arg.get("type").toString(); + } + + // 此例中 argTypes 包含四个元素 {"String", "String", "BigInteger", "int"} + ``` + +- 使用一维Object数组,按顺序,把参数添加到数组中 + + ```java + Object args = new Object[]{"nulsIsEverything", "NULS", 100000000, 8}; + ``` + +- 把参数一维数组转换为二维数组(由于链上合约方法参数接受的是二维数组,故有此步) + + > 复制这个方法`io.nuls.contract.util.ContractUtil#twoDimensionalArray(Object[], String[])`到离线交易组装工具程序(eg. SDK)中 + + ```java + String[][] finalArgs = ContractUtil.twoDimensionalArray(args, argTypes); + ``` + +#### 1.1.3) 调用接口验证发布合约的合法性 + +- 接口: validateContractCreate +- 参数: chainId, sender, gasLimit, price, contractCode, args + + chainId : int //链ID + + sender: String // 调用者地址 + + gasLimit: long // gas限制 + + price: long // gas单价 + + contractCode: String // 文件字节流转换Hex编码字符串 + + args: Object[] // 构造方法参数 + +eg. + +_**Request:**_ + +> gasLimit和price使用默认值: gasLimit = 10000000; price = 25; + +```json +{ + "jsonrpc":"2.0", + "method":"validateContractCreate", + "params":[2,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG", 10000000, 25, "504b03040...00000000", ["name","symbol",100000000,8]], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "msg": "", + "success": true + } +} +``` + +> `success`是`true`时,表示验证通过,否则,`success`是`false`, `msg`是错误信息 + +#### 1.1.4) 调用接口预估发布合约需要的GAS + +- 接口: imputedContractCreateGas +- 参数: chainId, sender, contractCode, args + + chainId : int //链ID + + sender: String // 调用者地址 + + contractCode: String // 文件字节流转换Hex编码字符串 + + args: Object[] // 构造方法参数 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"imputedContractCreateGas", + "params":[2,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG", "504b03040...00000000", ["name","symbol",100000000,8]], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "gasLimit": 22363 + } +} +``` + +_**需要的数据:**_ + +```java +Long gasLimit = (Long) result.get("gasLimit"); +``` + + + +#### 1.1.5) 随机生成一个智能合约地址 + +```java +Address contract = AccountTool.createContractAddress(chainId); +byte[] contractAddressBytes = contract.getAddressBytes(); +// String contractAddress = contract.toString(); +``` + +#### 1.1.6) 通过以上5步获取的数据,组装交易的txData + +```java +// 交易创建者的地址 +String sender = "tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"; +byte[] senderBytes = AddressTool.getAddress(sender); +// gasLimit 从第4步接口中得到 +long gasLimit = 22363; +// 默认GAS单价, 系统最小单价 +long defaultPrice = 25; +CreateContractData createContractData = new CreateContractData(); +createContractData.setSender(senderBytes); +createContractData.setContractAddress(contractAddressBytes); +createContractData.setAlias(alias); +createContractData.setGasLimit(gasLimit); +createContractData.setPrice(defaultPrice); +createContractData.setCode(contractCode); +if (finalArgs != null) { + createContractData.setArgsCount((byte) finalArgs.length); + createContractData.setArgs(finalArgs); +} +``` + +#### 1.1.7) 调用接口获取交易创建者的nonce值 + +- 接口: getAccountBalance +- 参数: chainId, assetChainId, assetId, address + + chainId: int //链id + + assetChainId: int //资产对应的链id + + assetId : int //资产id + + address : String //账户地址 + +eg. + +_**Request:**_ + + +```json +{ + "jsonrpc":"2.0", + "method":"getAccountBalance", + "params":[2,2,1,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "totalBalance": 991002297558150, + "balance": 988700097558150, + "timeLock": 2302200000000, + "consensusLock": 0, + "freeze": 2302200000000, + "nonce": "a34b2183d44a110a", + "nonceType": 1 + } +} +``` + +_**需要的数据:**_ + +```java +BigInteger senderBalance = new BigInteger(result.get("balance").toString()); +String nonce = result.get("nonce").toString(); +``` + +#### 1.1.8) 通过以上7步获取的数据,组装发布合约的交易对象 + +```java +public CreateContractTransaction newCreateTx(int chainId, int assetsId, BigInteger senderBalance, String nonce, CreateContractData createContractData, String remark) { + try { + CreateContractTransaction tx = new CreateContractTransaction(); + if (StringUtils.isNotBlank(remark)) { + tx.setRemark(remark.getBytes(StandardCharsets.UTF_8)); + } + tx.setTime(System.currentTimeMillis() / 1000); + // 计算CoinData + CoinData coinData = makeCoinData(chainId, assetsId, senderBalance, nonce, createContractData, tx.size(), calcSize(createContractData)); + tx.setTxDataObj(createContractData); + tx.setCoinDataObj(coinData); + tx.serializeData(); + return tx; + } catch (IOException e) { + Log.error(e); + throw new RuntimeException(e.getMessage()); + } +} + +private CoinData makeCoinData(int chainId, int assetsId, BigInteger senderBalance, String nonce, ContractData contractData, int txSize, int txDataSize) { + CoinData coinData = new CoinData(); + long gasUsed = contractData.getGasLimit(); + BigInteger imputedValue = BigInteger.valueOf(LongUtils.mul(gasUsed, contractData.getPrice())); + // 总花费 + BigInteger value = contractData.getValue(); + BigInteger totalValue = imputedValue.add(value); + + CoinFrom coinFrom = new CoinFrom(contractData.getSender(), chainId, assetsId, totalValue, RPCUtil.decode(nonce), (byte) 0); + coinData.addFrom(coinFrom); + + if (value.compareTo(BigInteger.ZERO) > 0) { + CoinTo coinTo = new CoinTo(contractData.getContractAddress(), chainId, assetsId, value); + coinData.addTo(coinTo); + } + + BigInteger fee = TransactionFeeCalculator.getNormalUnsignedTxFee(txSize + txDataSize + calcSize(coinData)); + totalValue = totalValue.add(fee); + if (senderBalance.compareTo(totalValue) < 0) { + // Insufficient balance + throw new RuntimeException("Insufficient balance"); + } + coinFrom.setAmount(totalValue); + return coinData; +} + + +private int calcSize(NulsData nulsData) { + if (nulsData == null) { + return 0; + } + int size = nulsData.size(); + // 计算tx.size()时,当coinData和txData为空时,计算了1个长度,若此时nulsData不为空,则要扣减这1个长度 + return VarInt.sizeOf(size) + size - 1; +} + +``` + +#### 1.1.9) 签名交易、广播交易(略) + + + +--- + + + +### 1.2 调用合约的交易 + +组装调用合约的交易需要与apiModule交互三`or`四次 + +- 获取合约方法的详细信息(若缓存了合约所有方法的详情,则跳过此步) +- 验证调用合约的执行合法性 +- 预估调用合约需要的GAS +- 获取交易创建者的余额和nonce + +**最初数据: `交易创建者地址`,`合约地址`,`调用者向合约地址转入的主网资产金额`,`调用方法名`,`调用方法的描述`, `调用方法的参数`, `交易备注`** + +#### 1.2.1) 调用接口获取合约方法的参数类型列表**(若缓存了合约所有方法的详情,可从缓存的方法中提取方法的参数类型列表,则跳过此步)** + +> 这一步的作用是得到方法的参数类型数组,具体筛选的数据请查看`1.2.2` + +- 接口: getContractMethodArgsTypes +- 参数: chainId, contractAddress, methodName, methodDesc + + chainId : int //链ID + + contractAddress: String //合约地址 + + methodName: String // 合约方法 + + methodDesc: String // 合约方法描述 (非必填),若合约内方法没有重载,则此参数可以为空 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"getContractMethodArgsTypes", + "params":[2,"tNULSeBaMwQPRn1yQEyd74CuD9uJqYVipgRtwi", "transfer", "(Address to, BigInteger value) return boolean"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": [ + "Address", + "BigInteger" + ] +} +``` + +#### 1.2.2) 根据函数参数组装参数数据**(若是无参函数,则跳过此步)** + +- 把函数的参数类型组装成一个字符串数组 + + > 从`1.2.1`接口中得到此类数据 或者 从缓存的方法详情中获取 + + ```java + List list = (List) result; + int size = list.size(); + String[] argTypes = new String[size]; + argTypes = list.toArray(argTypes); + + // 此例中 argTypes 包含两个元素 {"Address", "BigInteger"} + ``` + +- 使用一维Object数组,按顺序,把参数添加到数组中 + + ```java + Object args = new Object[]{"tNULSeBaMnrs6JKrCy6TQdzYJZkMZJDng7QAsD", 100000000}; + ``` + +- 把参数一维数组转换为二维数组(由于链上合约方法参数接受的是二维数组,故有此步) + + > 复制这个方法`io.nuls.contract.util.ContractUtil#twoDimensionalArray(Object[], String[])`到离线交易组装工具程序(eg. SDK)中 + + ```java + String[][] finalArgs = ContractUtil.twoDimensionalArray(args, argTypes); + ``` + +#### 1.2.3) 调用接口验证调用合约的合法性 + +- 接口: validateContractCall +- 参数: chainId, sender, value, gasLimit, price, contractAddress, methodName, methodDesc, args + + chainId : int //链ID + + sender: String // 调用者地址 + + value: BigInteger // 调用者向合约地址转入的主网资产金额,没有此业务时填BigInteger.ZERO + + gasLimit: long // gas限制 + + price: long // gas单价 + + contractAddress: String // 合约地址 + + methodName: String // 合约方法 + + methodDesc: String // 合约方法描述,若合约内方法没有重载,则此参数可以为空 + + args: Object[] // 构造方法参数 + +eg. + +_**Request:**_ + +> gasLimit和price使用默认值: gasLimit = 10000000; price = 25; + +```json +{ + "jsonrpc":"2.0", + "method":"validateContractCall", + "params":[2,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG", 0, 10000000, 25, "tNULSeBaMwQPRn1yQEyd74CuD9uJqYVipgRtwi", "approve", "", ["tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",100000000]], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "msg": "", + "success": true + } +} +``` + +> `success`是`true`时,表示验证通过,否则,`success`是`false`, `msg`是错误信息 + +#### 1.2.4) 调用接口预估调用合约需要的GAS + +- 接口: imputedContractCallGas +- 参数: chainId, sender, value, contractAddress, methodName, methodDesc, args + + chainId : int //链ID + + sender: String // 调用者地址 + + value: BigInteger // 调用者向合约地址转入的主网资产金额,没有此业务时填BigInteger.ZERO + + contractAddress: String // 合约地址 + + methodName: String // 合约方法 + + methodDesc: String // 合约方法描述,若合约内方法没有重载,则此参数可以为空 + + args: Object[] // 方法参数 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"imputedContractCallGas", + "params":[2,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG", 0, "tNULSeBaMwQPRn1yQEyd74CuD9uJqYVipgRtwi", "approve", "", ["tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG",100000000]], + "id":1234 +} + +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "gasLimit": 10333 + } +} + +``` + +#### 1.2.5) 通过以上4步获取的数据,组装交易的txData + +```java +// 交易创建者的地址 +String sender = "tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"; +byte[] senderBytes = AddressTool.getAddress(sender); +// gasLimit 从第4步接口中得到 +long gasLimit = 10333; +// 默认GAS单价, 系统最小单价 +long defaultPrice = 25; +// value - 交易创建者转入合约地址的主链资产金额,没有此业务时填BigInteger.ZERO +// methodName - 交易创建者选择要调用的合约方法 +// methodDesc - 通过contractInfo获取,若合约内方法没有重载,则此参数可以为空 +CallContractData callContractData = new CallContractData(); +callContractData.setContractAddress(contractAddressBytes); +callContractData.setSender(senderBytes); +callContractData.setValue(value); +callContractData.setPrice(defaultPrice); +callContractData.setGasLimit(gasLimit); +callContractData.setMethodName(methodName); +callContractData.setMethodDesc(methodDesc); +if (finalArgs != null) { + callContractData.setArgsCount((byte) finalArgs.length); + callContractData.setArgs(finalArgs); +} + +``` + +#### 1.2.6) 调用接口获取交易创建者的nonce值 + +- 接口: getAccountBalance +- 参数: chainId, assetChainId, assetId, address + + chainId: int //链id + + assetChainId: int //资产对应的链id + + assetId : int //资产id + + address : String //账户地址 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"getAccountBalance", + "params":[2,2,1,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "totalBalance": 991002297558150, + "balance": 988700097558150, + "timeLock": 2302200000000, + "consensusLock": 0, + "freeze": 2302200000000, + "nonce": "a34b2183d44a110a", + "nonceType": 1 + } +} +``` + +_**需要的数据:**_ + +```java +BigInteger senderBalance = new BigInteger(result.get("balance").toString()); +String nonce = result.get("nonce").toString(); +``` + +#### 1.2.7) 通过以上6步获取的数据,组装发布合约的交易对象 + +```java +public CallContractTransaction newCallTx(int chainId, int assetsId, BigInteger senderBalance, String nonce, CallContractData callContractData, String remark) { + try { + CallContractTransaction tx = new CallContractTransaction(); + if (StringUtils.isNotBlank(remark)) { + tx.setRemark(remark.getBytes(StandardCharsets.UTF_8)); + } + tx.setTime(System.currentTimeMillis() / 1000); + // 计算CoinData + CoinData coinData = makeCoinData(chainId, assetsId, senderBalance, nonce, callContractData, tx.size(), calcSize(callContractData)); + tx.setTxDataObj(callContractData); + tx.setCoinDataObj(coinData); + tx.serializeData(); + return tx; + } catch (IOException e) { + Log.error(e); + throw new RuntimeException(e.getMessage()); + } +} + +``` + +#### 1.2.8) 签名交易、广播交易(略) + + + +--- + + + + +### 1.3 删除合约的交易 + +组装删除合约的交易需要与apiModule交互两次 + +- 验证调用合约的执行合法性 +- 获取交易创建者的余额和nonce + +**最初数据: `交易创建者地址`,`合约地址`** + +#### 1.3.1) 调用接口验证删除合约的合法性 + +- 接口: validateContractDelete +- 参数: chainId, sender, contractAddress + + chainId : int //链ID + + sender: String // 调用者地址 + + contractAddress: String // 合约地址 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"validateContractDelete", + "params":[2,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG", "tNULSeBaMwQPRn1yQEyd74CuD9uJqYVipgRtwi"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "msg": "", + "success": true + } +} +``` + +> `success`是`true`时,表示验证通过,否则,`success`是`false`, `msg`是错误信息 + + +#### 1.3.2) 组装交易的txData + +```java +// 交易创建者的地址 +String sender = "tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"; +byte[] senderBytes = AddressTool.getAddress(sender); +DeleteContractData deleteContractData = new DeleteContractData(); +deleteContractData.setContractAddress(contractAddressBytes); +deleteContractData.setSender(senderBytes); + +``` + +#### 1.3.3) 调用接口获取交易创建者的nonce值 + +- 接口: getAccountBalance +- 参数: chainId, assetChainId, assetId, address + + chainId: int //链id + + assetChainId: int //资产对应的链id + + assetId : int //资产id + + address : String //账户地址 + +eg. + +_**Request:**_ + +```json +{ + "jsonrpc":"2.0", + "method":"getAccountBalance", + "params":[2,2,1,"tNULSeBaMvEtDfvZuukDf2mVyfGo3DdiN8KLRG"], + "id":1234 +} +``` + +_**Response:**_ + +```json +{ + "jsonrpc": "2.0", + "id": 1234, + "result": { + "totalBalance": 991002297558150, + "balance": 988700097558150, + "timeLock": 2302200000000, + "consensusLock": 0, + "freeze": 2302200000000, + "nonce": "a34b2183d44a110a", + "nonceType": 1 + } +} +``` + +_**需要的数据:**_ + +```java +BigInteger senderBalance = new BigInteger(result.get("balance").toString()); +String nonce = result.get("nonce").toString(); +``` + +#### 1.3.4) 通过以上3步获取的数据,组装发布合约的交易对象 + +```java +public DeleteContractTransaction newDeleteTx(int chainId, int assetsId, BigInteger senderBalance, String nonce, DeleteContractData deleteContractData, String remark) { + try { + DeleteContractTransaction tx = new DeleteContractTransaction(); + if (StringUtils.isNotBlank(remark)) { + tx.setRemark(remark.getBytes(StandardCharsets.UTF_8)); + } + tx.setTime(System.currentTimeMillis() / 1000); + // 计算CoinData + CoinData coinData = makeCoinData(chainId, assetsId, senderBalance, nonce, deleteContractData, tx.size(), calcSize(deleteContractData)); + tx.setTxDataObj(deleteContractData); + tx.setCoinDataObj(coinData); + tx.serializeData(); + return tx; + } catch (IOException e) { + Log.error(e); + throw new RuntimeException(e.getMessage()); + } +} + +``` + +#### 1.3.5) 签名交易、广播交易(略) + + + +## 2. JavaScript + +> 本语言里,我们已经开发了JS-SDK,内部已经实现离线组装智能合约交易 + +**GitHub地址:** [NULS-v2-JS-SDK](https://github.com/nuls-io/nuls-v2-js-sdk) + +### 2.1 创建合约 + +请参考`https://github.com/nuls-io/nuls-v2-js-sdk/blob/master/src/test/contractCreate.js#L77` + +_**核心代码片段:**_ + +```javascript +async function createContract(pri, pub, createAddress, assetsChainId, assetsId) { + //1、通过接口获取合约的参数 args + let hex = '504b03040a0000080000aa7b564e00000000000000000000000003000400696f2ffeca0000504b03040a0000080000aa7b564e00000000000000000000000008000000696f2f6e756c732f504b03040a0000080000aa7b564e00000000000000000000000011000000696f2f6e756c732f636f6e74726163742f504b03040a0000080000aa7b564e00000000000000000000000017000000696f2f6e756c732f636f6e74726163742f746f6b656e2f504b0304140008080800aa7b564e00000000000000000000000028000000696f2f6e756c732f636f6e74726163742f746f6b656e2f53696d706c65546f6b656e2e636c617373b558f97754e5197eeecc90990c972d9090059209a498cc9291a58a8152020d35ca5602b1605bbd99b9492ecc12670922b46ead4babd56aeb5ad1565bd4aa2c020169d59ed353cfe93fd17f84d3d3e7fdee9d3b37612639d5d31ff2ddf77ecbfb3eeff67c77f2afff7cf639804df87b23a23825c323329c96e14c1831fcb411cdf859108f86119497281e93e171997e22cce149197e1ec62ff0d462acc2d3413c13c672fc2a8ce7f0bcccfc3a8817827831cc53bf91e125195e96e5df8af4bb205e09a3430e44f19a0cafcbf086a87d5386df87f096cc9c9597b7457a27843fc8f38f21bc2b7ade0be24f41fc39887341bcaf219033b2a686a6bdc78d692399317213c99152c1ca4d6cd3d0503c951dcb673484d266caca1a99a2066d58c3e252be646446ca535399531a5aeca359a33499dc654d0ce74ae68459e0f1d098417d2993a796d97bca252b93dc674c71b171c49ac819a57281c68766af6edf6be593b972a6984ce573a582912a258be913c9c174ba60168bdb6a9bdb419d412393c99f34d31a4a5f43e337342f0056f5f6d58a6360773e6d4a10ac9cb9bf9c1d330b878db18c8a7a3e6564468d8225efce64a0346931643db7c228e54f98b9e488959de26691a9bbed503957b2b2e6a855b4787c3097636e4a563e47151b6a7b62b87b92a39679924afcbd7d4c6b6b05fdada96cd86ee5acd20e0d3b7a6f75b0decc5c35c37da31a968822cbc80c66f304ae61dd6cfc078d02ebb164166639125dd09143e64365ab60a6a5b2541548e16938dcbb4032e75dad1b8e45f99339b3a0a173fef3acc8e294994bcb565d1d19ac14e8a269235336a5796655c0a9a94a152c192919a9132c47f56eb302b5d048ae386e16f614f2590d47be917bb5bdeb3bc6121c57ea7da53cc3e974f181710d772c60af6ec0828e129242c5030d772e84be2ebea0313555c84f53dd722b972a9846d11c543306c92a6ca4d3667ad48eef7232d79cf565c5f29832e66e0ae53315510ebb49fabf84973d1032ec2d1babe2260f2ed77eb868565f96550e559739b3ab12d7af19cc5109a6bdc583c0d5ba283569a64e90657aeb9f4fd659ab7fa24115ffc68a40df63f3eaf0528b9cf7678b131a06ff27bbb5358547f2e542cadc6349cb2df7306bbf6cd7d18fa48edb65d8884d3a36638b8e217ca0e3436cd1b0a27a6fdc6d1427d9ac3abe8d3b74dc25c35f64f347f858c727381fc4051d177149c7a7b84c42abc3edca76cf61a74586a64da1c82573def5e11ca96477c62816cda2e0213d5cd17115333aaee13a0fccbacf782dd58a888e49983a72c8e83821c367b8a1c382b910ba4a2755d0cd7ad79116adf7e05e1d79301e7fc5df747c8ef31a3a8673c5f2f8b895b2b82fe274703aa254cbe6691d5fe0bc8ea36087270e4f9a11551d916cb9588a8c999109f6312f864869d2c845f2850819dfc8f078e4f67e394e289db32c389413c98fdb36fac5c52f79e32c7cafb216aae57260ecb899a2f6b535fb6bb7f3a261cd7c5153772c0b2e706ce8d001be1c1edacf712a7f527a6bb82e6f86b2e54cc9529f59fdf55ab0ded9d69a78f749eb34149d5b29c22b7f812bcc3f55a6735bbdf7be1d916db7cef4dd3aa5a1bda68123ac4e524ec0cc5a54df5587bd544dd93d3f6172df861a306a1a0d16ec0f025ae83d26e71b53f9ec9451607ee761337e04f9c9868c7b85097943f71eabc51de8e637750c3ec49140039a842af8e3a049d8423d49187cfa8433d493c400d2b492b7f2ef2ecffb003fd699616ca3bc9d3349be697c2e8a5e8676416df90ec70635b9163b38eaf6067c173bf91c745677f1a911422d45beb98ad62fa8682376d750e4ff688ea2be05156dc6f76a280acc45945c50d110f6388afecd1d8bf834a3335476090d571088de40f0e80c4257d05815c3d1d81568d1f815f8a2cd812bf0471397b0b8397015fa552c915397d1780d4b05d0752cf3e3be1b587e54736666b0e21a9a2eba40fbb158fd060c30658bb11a2d6865296cc606a639c6246f645a0799d6434c729a491687b6d8401d8744ea57711049cac5a7a4ef739f5f491b95febb29b705b86d58797eeb4892e50189c51754212692441c8e5dc74a1fbec4aafd89af1064602e24e2ce54f340a02df015429c1449c21f505e75f2f72a887529313611650bc3bd8ec9bf8d798b33e4552f92ae1749ecc53e276dfb29f978ba1b07e8bf9f6797e0204f04f00327a1f6da56ae1de2cc52f86ea22588919b680ee2f0ac248bdf4b7c737c3d825127ef670823c0674f34c6142566d0128d715c1d8d736c95d4c54492ac05aa85daa2c0df8b46825e46b0cd84bc8e80c4b1a8adcf75ac07f7398ef5e087ca31910eaaf408b895fe9ae9e0bde5a4e3491e914cf6c4fe8960e01c02fe6b68932aaba4a6795fdc4ecdbeb8e4c0ef817884d11a453b2174d2f83aea1488115b9f07a21dfb7684713f81f9545417c31fdaa9dd446bad90063517e98ff0632798166d8ae6ae2863199728c6e24e143921f29c3836a9583d80101e64120d92d1980760970bb04b454e53d24105b0665a7fe22279d041d21e750cb7df404705c49ad92096aa9d134ce624bbcff200687701b4ab9ad494340f80075c00136c0151d15d01b0b602404d5c45671d1c59e2c8d1cdbc0747b78ba3dbc5d14d1febe2305c1c978943623c142586ae8aedfdf1c45544ce62859a60e53040e7a057b0b6cc83d5efe9f022a35c22ee32ab6d9a55f4302faf47d8e7a73d8d30e4621f72b10f31cd5b5487df89946a04a9b746e9e21e165ba896533ef914a42c4e3de1907584f545740381685b40bc4bc8108bb705e85d375daaf2acdd0d8fb2d01ea3d5c7b1923abad85955268ab83823187770469846bb61234ec3865821f72826f2c907af83e78c83a7d38327d1b46e06eb2b687a66a1b1cbfe296a7b1a2bf00ccbfe590f924e1749a78ba4d345d2e922697191582e927f7045740cd8b1f0f2b74dd66dce453610508b6dce1dd51688276c49507a59fc39ea7b5efe958836bc40067991fcfc126fa2973d88075cc4032ee20117f1808378156fb5e3e4f32a8bdb335b3923f90f816493248bf3147f42381e9de6aa448ba1bc8a6fed8fc69b36cce0b68a7b8db10423de5d85ee4df72b64ac577975bcc680bf4ee86f78ca72bd0b793d5b6e9ff30563b776031372bf82ec931f340e90a203a4cb01928837f54a862b207ae682b0b3fc16d59d65cdbdcd78bee301e025b7ec1c726b60ac2b00f8b3c701708c6f12cfd5bc075648d3b285dfacde0817dde60cab6def320aef29832df631d7e06a654653415f045fd34e4dd979c8b133e5dc371dd19804597843cabab62ddbc973d4f33eed7e407afcd0435c1daecd0e14944d918aee1543eb2d8ef59263dd74acb7d6f0327e0d7d73ddfc98ee7ce231d9ea9a6c75dc14a9acbe8be6383ced96984f79b1a68ec38959666d8f2f52d12542f894fe5cf6a4758d6b7e8debf11ac7639104887fb6ef2755c53c8c5f2ae53e2c278b3e4b36ece0f35534fe17504b0708ec308779cb09000028180000504b0304140008080800aa7b564e00000000000000000000000022000000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e2e636c617373a552d14e1341143d03b5cb16aa28a8a0284a08697970131ff481a76a24694282a19507dfa6bb431d989da933b325fc9a0f7e801f65bc534ba5b6a5896eb23b3be79e7bcebd33f7c7cf6fdf01bcc64e84e711b623bc60a8367a3d6bfa5c7de80bed19569a5a0bfb5e71e7848bf092186dcbb53b1376c828699e0b86f55afde89cf779a2b8ee262d6fa5ee1e306c9e14dacb5c9c4a273b4a34b4369e7b69b463d83b9226d18572496ab4b73cf589cb2e123ee224a7525c9248d95de51da318963291ca9c2b4a5eacd59b0ccb9ea8aa55f47aea8a61e3ba869cfb2fc93bd96d6a2fbac29244dce154582a8ecf18ded4a61b37b2cc0ae70e668aec8c37f3915b6add0b3bd6d5fedcae4ec4d7425a9191e2921f1e26c3db39554d2faafe99eee85ae4d09a9ce1d33ca17fb489f86034e8ae63ae94b90cc7c9d0fe2fb799475d6999c2a6e2502af2a8b4cd85d0af0295616b42d0876832e030acfe19c2e3ceb9486942f76fcbd8fd6be06f278fcd7e99816101e1894b749788695fa15d99d66580b0952958157727b07b589dc0eee301a9dfc0b0466f144cd70784877844ff01ac2efc0647a1c7d81886d6166f864684cdd9b94ff0748aef388d085b83ef33dca135141a7c4ad46e488a10ff02504b070868fe421cca0100005e040000504b0304140008080800aa7b564e00000000000000000000000030000000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e24417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b46929e05b6a2ee19a4b73218140d2943835b4406163af926d9cdd74771d90a0129540ea033c801020242e2f252f790089b80824c45390f82ffc03049c995dbb89e3243cf8ccd93367e67cdf7c6746fef39f5f7e03f018ae6988e34213148c7333c1cd248f4da998d63083e735bcc0cd0c66b937abe2450d2770218697f838c7cd7c0c176358e0ee256e5e56b1a822c71075deb64d97e1d49ce564ed72c9cb161cdb778d829ff58a6bd98962d1353d6f9841f5364cbbc853a39b46a96c3274cd5d37368decbae1af6627ad9559db37574c97529511cbb6fc3186cb89a3773d66b6e1f6c93c833ce5140940eb9c659b17cbebcba6bb642c9728d231e7148c52de702dfe1d06657fd5f2189a2736365c87b04f6f9ab6cfa0cfdac47caa64789e49d39983607c67cdb4b34bdc9edbb798389e5d2cdbbeb56ee62dcfa22a970cd758377dd39db06dc7377ccbb169cf546382462d27bb68de285bae59a41d632ba6bf10883190481e2747ccab659f39e694f98969b479ae2aa0e6edf9e065f381a03d54f6104979b930eb64e2706114a2639488f97d6152c9b057b20bcbd7cd823f9cbccac01c2ed28129219241a234e77ca3b0366f6c08eda8c1a9f4aae1ad06824b89e42c152156e5122533fa88f94ece772d7b85215e852f760ea2b4b39673ca6ec19cb1782f6842cdf33c4d471f967474a15b470f3727d1abe332f22a5e21e9fe7f37a87855c7237854c5151d4fe16986ee7a189365ab244e3bbe6fe5bbe2f28deab88ad7b8799d006606c28b364ae43203e2ae898c37740c6384a1adfef4187a1bea1ff6391d5a3e9059f43a43e7be7312413aa6fea308379aded362c4ab514b9054c60627c330983828cd41b5c2631aaecbaff6cf11f9fd89a9c3a771869ecc38a82b2121c215a78735c2451723e94ea346f37de8a7effbe9ab44a34c633c75172c95de412495d981941adc81fca358758a6c17a2646f50a68b267868818f4e94719aa2a9603d06f000203c5e97098f578e088fd796708efc4e89261f2467bf7d080f93e590b234f2e5d1d44f88fc50c3a088e03ba2a61e248435191248868bc7289b575404977b0c34117d8fd6dc143b74055935d44a889a2e444320523d90f71b0249370622d503f980d67c7808909e104806830d80c8f5406e3704725e2c3a0044ae07f211adf9f810205c335e98ae7cb8d75f9423d1782b95fe1e51793bbd8b965405d134fdee202a6da77f8732cf75dba58ea22143bf0ad4afd0ba45375ec4298b9f679020514cda9b205513e45db4f381627205b12db472ef0fa8f21664699b404882462f01053e818a4fe9e43e23989f13e52ff026be14b40602c0355ab7e89fc6e3824e1143148be009d1a0badac2fe46bf8a2715d6adb0b836cea9d32b1752ff393cc6e9805d734a306be26046da4ef7ad069c78580ac36f55e37210271a5a10efbb07bf43dc9eafe9367d43cdf32da6f0dd1e35a643d89d04fa193c4b5038d84128ede3ec5fbae511824b30c947e84718cbefffa445f49c862caed1b6bc51867ec5892b77a1773457484141a5b5a32df025eeb7073e616e6dbb594147059df58d77674fe30d8540231815760c67c3a746c173f42c35fd07504b0708ea7bbc798f040000e6090000504b0304140008080800aa7b564e00000000000000000000000030000000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e245472616e736665724576656e742e636c6173738d56df531b5514fe6e76b31bb60be19740015b5aab8624b06ad156c36f84160da5051a0bd5da25d9c296b08bbb1b5e1c1ffa6ff8aebcf0a033923a3ae3f88433fe2ffe078e7aeedd854212c0879c7bf6dc73eef9cef9cebd933ffff9e53700efe189864e4c3441c12417535c4c73db8c8a590d73b8a3e12e177398e7dabc8a4f345cc244029ff235cfc54202f71258e4ea7d2e1ea85852b1cc203ff3dc6d862b79db359c4ad9378aae1378663130fcd29631552a7996efe7186281cb10df35cb158ba12bffdcdc358d6d33d834a6ed8d7927b0362c8fbc9451dbb183718687a9f30fbc60b7e1f18305823be3960840326f3bd6bdcaf6bae5ad98eb65b2b4e7dda2592e989ecdbf23a31c6cda3e43f38a673afe33cb9bddb59c80419f771ccb9b299bbe6fd176b61e4ce06e598eb1c2e58d53c154e3f5a58a13d8db56c1f66dca72dff4cc6d2bb0bc29c7710333b05d87ce4c372ed03cf63196acaf2ab66795e84475c30ae6040d03a9c18b8850fd23e76b17f498f72b4e47af70e6fc704dd0772124b187729d4163c23ff6ba9c3a9b0c854a30cb54ed6b9153d974368cc5f5e75631c80dae3130971353b72588318988e6e5c02c6e2d983b822f1a674abd69fa9b21c9526a709e92502d95323933fa4804ee72e0d9ce0643e7117c717268a593b565b7e215ad399bf3af090687b99b8e3eace8e842b78e1e2e2ea357c74314547c4674fdff0950f148c73b7857c5aa8e5bb8cdd05d0b63ba62974b96c7d0712af26b7ed5c674ace131179f132bd981c01da3b2b203e26689cd2f74e430cad05adb3786de867c47534ded2a84048bc9a6eca73a248cd4a0fef34a6db47d62a4a8eb8d8681483277762ca7c43094aa27a59ea7a841b91affa3c939c7bf3f3573f636aed1d3d8099a47488871aee9018d71bac54a8cd3aad17e1ffae9fb75fa2ad32ad3da997e0996ce1c2096ce1e404a0f1d40fe51445d21d98538c92c790ea109c36881810e1a82ab644d87f118c01b80d0785e26349e3926349e5bc20dd293120986374fc8b7f036490ec7a09587c6d33f21f6c3717e45186f8a7c7ae810e5634861300a1e276f9e4d1175bc42af09eb2d8ab92d4ee80abd8e112b1162ba060d8148b540720d81641a03916a814c50cce419407a2220596a743d10b916c84c4320c322a80e885c0be40ec5dc3d0308e78b27a68b1e9df517f970ea5ea433df232eef670ed192ae229ea1df77884bfb99dfa12c70de0e699a68c9d2af0af55b24f7a065859dbc783f4307896cd24907e9c8413e441b5fc8265791d843926b7f4095f7204bfb04421265f41250200f150bd4b94582f9804a5ec2975816650d84808fcb7a41ff266e8a724a18215b0cef8be1d4d516f637fa557ca0b06e85756a93bc747adba2d27f8eda381b56d79c1695357130a3ad57fb36c39ab8598acc4f8fec7268a732b4d0def70a7ebbb8398fe826add2f0ac119b8f4fb0311bc1ee20d01fe22382c2c10e41699b64ffd20d8f115c82493a223dc658e1f42705d1531a55f1848ee58332f22b2eadbe84dede5c25064529c9f6d65097b8de16ea8439d9fa4d15ed5574d40eded313833712018d614cc8715c8f9e19051fd393d4f41f504b0708826261e37e040000ca090000504b01020a000a0000080000aa7b564e000000000000000000000000030004000000000000000000000000000000696f2ffeca0000504b01020a000a0000080000aa7b564e000000000000000000000000080000000000000000000000000025000000696f2f6e756c732f504b01020a000a0000080000aa7b564e00000000000000000000000011000000000000000000000000004b000000696f2f6e756c732f636f6e74726163742f504b01020a000a0000080000aa7b564e00000000000000000000000017000000000000000000000000007a000000696f2f6e756c732f636f6e74726163742f746f6b656e2f504b01021400140008080800aa7b564eec308779cb090000281800002800000000000000000000000000af000000696f2f6e756c732f636f6e74726163742f746f6b656e2f53696d706c65546f6b656e2e636c617373504b01021400140008080800aa7b564e68fe421cca0100005e0400002200000000000000000000000000d00a0000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e2e636c617373504b01021400140008080800aa7b564eea7bbc798f040000e60900003000000000000000000000000000ea0c0000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e24417070726f76616c4576656e742e636c617373504b01021400140008080800aa7b564e826261e37e040000ca0900003000000000000000000000000000d7110000696f2f6e756c732f636f6e74726163742f746f6b656e2f546f6b656e245472616e736665724576656e742e636c617373504b0506000000000800080051020000b31600000000'; + const constructor = await getContractConstructor(hex); + let args = constructor.data.constructor.args; + //console.log(args); + //2、给每个参数复制 获取contractCreateTxData + let newArgs = ['waves', 'waves', 100000000, 8]; + const contractCreateTxData = await makeCreateData(2, createAddress, 'test_alias', hex, newArgs); + //3、序列化 + + const balanceInfo = await getNulsBalance(createAddress); + let amount = contractCreateTxData.gasLimit * contractCreateTxData.price; + let transferInfo = { + fromAddress: createAddress, + assetsChainId: assetsChainId, + assetsId: assetsId, + amount: amount, + fee: 100000 + }; + + let inOrOutputs = await inputsOrOutputs(transferInfo, balanceInfo, 15); + let tAssemble = await nuls.transactionAssemble(inOrOutputs.data.inputs, inOrOutputs.data.outputs, remark, 15, contractCreateTxData); + let txhex; + //获取手续费 + let newFee = countFee(tAssemble, 1); + //手续费大于0.001的时候重新组装交易及签名 + if (transferInfo.fee !== newFee) { + transferInfo.fee = newFee; + inOrOutputs = await inputsOrOutputs(transferInfo, balanceInfo, 15); + tAssemble = await nuls.transactionAssemble(inOrOutputs.data.inputs, inOrOutputs.data.outputs, remark, 15, contractCreateTxData); + txhex = await nuls.transactionSerialize(pri, pub, tAssemble); + } else { + txhex = await nuls.transactionSerialize(pri, pub, tAssemble); + } + console.log(txhex); + //4、验证交易 + let result = await validateTx(txhex); + if (result) { + //5、广播交易 + let results = await broadcastTx(txhex); + console.log(results); + if (results && results.value) { + console.log("交易完成") + } else { + console.log("广播交易失败") + } + } else { + console.log("验证交易失败") + } +} + +``` + +### 2.2 调用合约 + +请参考`https://github.com/nuls-io/nuls-v2-js-sdk/blob/master/src/test/contractCall.js#L67` + +_**核心代码片段:**_ + +```javascript +async function callContract(pri, pub, fromAddress, assetsChainId, assetsId, contractCall) { + const balanceInfo = await getNulsBalance(fromAddress); + let newTimes = new BigNumber(contractCall.gasLimit); + let amount = Number(newTimes.times(contractCall.price)); + let value = Number(contractCall.value); + let newValue = new BigNumber(contractCall.value); + amount = Number(newValue.plus(amount)); + let transferInfo = { + fromAddress: fromAddress, + assetsChainId: assetsChainId, + assetsId: assetsId, + amount: amount, + fee: 100000 + }; + if (value > 0) { + transferInfo.toAddress = contractCall.contractAddress; + transferInfo.value = value; + } + + let inOrOutputs = await inputsOrOutputs(transferInfo, balanceInfo, 16); + let tAssemble = await nuls.transactionAssemble(inOrOutputs.data.inputs, inOrOutputs.data.outputs, remark, 16, contractCall); + let txhex; + //获取手续费 + let newFee = countFee(tAssemble, 1); + //手续费大于0.001的时候重新组装交易及签名 + if (transferInfo.fee !== newFee) { + transferInfo.fee = newFee; + inOrOutputs = await inputsOrOutputs(transferInfo, balanceInfo, 16); + tAssemble = await nuls.transactionAssemble(inOrOutputs.data.inputs, inOrOutputs.data.outputs, remark, 16, contractCall); + txhex = await nuls.transactionSerialize(pri, pub, tAssemble); + } else { + txhex = await nuls.transactionSerialize(pri, pub, tAssemble); + } + + let result = await validateTx(txhex); + console.log(result); + if (result.success) { + let results = await broadcastTx(txhex); + if (results && results.value) { + console.log("交易完成") + } else { + console.log("广播交易失败") + } + } else { + console.log("验证交易失败") + } +} + +let contractCall = { + chainId: 2, + sender: fromAddress, + contractAddress: "tNULSeBaN1NjSD1qF6Mj6z5XiGLSxaX8fQtg2G", + value: 0,// + gasLimit: 20000, + price: 25, + methodName: "approve", + methodDesc: "", + args: ['tNULSeBaNA1fArRNjbHrDi3ZTdQiM26harbwnD', 88] +}; + +``` + +### 2.3 删除合约 + +请参考`https://github.com/nuls-io/nuls-v2-js-sdk/blob/master/src/test/contractDelete.js#L33` + +_**核心代码片段:**_ + +```javascript +async function deleteContract(pri, pub, fromAddress, assetsChainId, assetsId, contractDelete) { + const balanceInfo = await getNulsBalance(fromAddress); + let amount = 0; + let transferInfo = { + fromAddress: fromAddress, + assetsChainId: assetsChainId, + assetsId: assetsId, + amount: amount, + fee: 100000 + }; + + let deleteValidateResult = await validateContractDelete(assetsChainId, contractDelete.sender, contractDelete.contractAddress); + if (!deleteValidateResult) { + console.log("验证删除合约失败"); + return; + } + let inOrOutputs = await inputsOrOutputs(transferInfo, balanceInfo, 17); + let tAssemble = await nuls.transactionAssemble(inOrOutputs.data.inputs, inOrOutputs.data.outputs, remark, 17, contractDelete); + let txhex = await nuls.transactionSerialize(pri, pub, tAssemble); + let result = await validateTx(txhex); + console.log(result); + if (result) { + let results = await broadcastTx(txhex); + if (results && results.value) { + console.log("交易完成") + } else { + console.log("广播交易失败") + } + } else { + console.log("验证交易失败") + } +} + +let contractDelete = { + chainId: 2, + sender: fromAddress, + contractAddress: "tNULSeBaNA1fArRNjbHrDi3ZTdQiM26harbwnD" +}; + +``` \ No newline at end of file diff --git a/docs/zh/NULS2.0/pluginImages/1536204986(1).jpg b/docs/zh/NULS2.0/pluginImages/1536204986(1).jpg new file mode 100644 index 00000000..883d2208 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/1536204986(1).jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Add.jpg b/docs/zh/NULS2.0/pluginImages/Add.jpg new file mode 100644 index 00000000..553c9214 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Add.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Add3.jpg b/docs/zh/NULS2.0/pluginImages/Add3.jpg new file mode 100644 index 00000000..350a0607 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Add3.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Add5.jpg b/docs/zh/NULS2.0/pluginImages/Add5.jpg new file mode 100644 index 00000000..e792346e Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Add5.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy.jpg b/docs/zh/NULS2.0/pluginImages/Deploy.jpg new file mode 100644 index 00000000..785777cc Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy2.jpg b/docs/zh/NULS2.0/pluginImages/Deploy2.jpg new file mode 100644 index 00000000..f6940952 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy2.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy3.jpg b/docs/zh/NULS2.0/pluginImages/Deploy3.jpg new file mode 100644 index 00000000..e36e5cdf Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy3.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy4.jpg b/docs/zh/NULS2.0/pluginImages/Deploy4.jpg new file mode 100644 index 00000000..b2dfa5bb Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy4.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy5.jpg b/docs/zh/NULS2.0/pluginImages/Deploy5.jpg new file mode 100644 index 00000000..54c8794a Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy5.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy6.jpg b/docs/zh/NULS2.0/pluginImages/Deploy6.jpg new file mode 100644 index 00000000..408490e8 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy6.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Deploy7.jpg b/docs/zh/NULS2.0/pluginImages/Deploy7.jpg new file mode 100644 index 00000000..ffbaa9f7 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Deploy7.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Install.jpg b/docs/zh/NULS2.0/pluginImages/Install.jpg new file mode 100644 index 00000000..f4a00a94 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Install.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Install2.jpg b/docs/zh/NULS2.0/pluginImages/Install2.jpg new file mode 100644 index 00000000..f413512b Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Install2.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/Install3.jpg b/docs/zh/NULS2.0/pluginImages/Install3.jpg new file mode 100644 index 00000000..fd11c850 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/Install3.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/code.jpg b/docs/zh/NULS2.0/pluginImages/code.jpg new file mode 100644 index 00000000..9f40aca1 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/code.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/createProject.jpg b/docs/zh/NULS2.0/pluginImages/createProject.jpg new file mode 100644 index 00000000..a7c0a6c3 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/createProject.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/createProject2.jpg b/docs/zh/NULS2.0/pluginImages/createProject2.jpg new file mode 100644 index 00000000..494ea971 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/createProject2.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/package.jpg b/docs/zh/NULS2.0/pluginImages/package.jpg new file mode 100644 index 00000000..2353f253 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/package.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/package1.jpg b/docs/zh/NULS2.0/pluginImages/package1.jpg new file mode 100644 index 00000000..19073268 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/package1.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/package2.jpg b/docs/zh/NULS2.0/pluginImages/package2.jpg new file mode 100644 index 00000000..eabd322b Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/package2.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/package3.jpg b/docs/zh/NULS2.0/pluginImages/package3.jpg new file mode 100644 index 00000000..bdbf4eeb Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/package3.jpg differ diff --git a/docs/zh/NULS2.0/pluginImages/package4.jpg b/docs/zh/NULS2.0/pluginImages/package4.jpg new file mode 100644 index 00000000..34fc4242 Binary files /dev/null and b/docs/zh/NULS2.0/pluginImages/package4.jpg differ diff --git a/docs/zh/NULS2.0/quickStart.md b/docs/zh/NULS2.0/quickStart.md new file mode 100755 index 00000000..f7829721 --- /dev/null +++ b/docs/zh/NULS2.0/quickStart.md @@ -0,0 +1,141 @@ +# 快速开始 + +## 安装钱包 + +### 1、下载NULS钱包 + +进入GitHub下载最新版的NULS2.0 beta钱包:[下载地址](https://github.com/nuls-io/nuls-v2/releases)。 + +钱包安装包在打包时已经加入JDK11,不需要安装jdk。 + +### 2、上传至服务器并解压 + +``` +tar -zxvf NULS-Walltet-linux64-beta1.tar.gz +``` + +![20190327144549](./nodeWalletGuide/20190327144549.png) + +## 进入钱包 + +### 1、启动钱包 + +钱包解压之后,进入start文件目录:/home/nuls2/NULS-Wallet-linux64-beta1 + +![20190327150757](./nodeWalletGuide/20190327150757.png) + +执行命令:**./start** + +### 2、检查启动状态 + +钱包启动之后,通过check-status脚本检查钱包启动情况,当显示钱包启动成功之后(如下图),即可进行其他操作。 + +![20190709172800](./nodeWalletGuide/20190709172800.png) + +### 进入命令行 + +钱包启动之后,执行同目录下的cmd(./cmd)进入钱包命令行,将会提示NULS命令输入提示符:`nuls>>> `,输入NULS钱包操作命令,进行操作。 + +![20190327223858](./nodeWalletGuide/20190327223858.png) + +## 基本操作命令 + +### 1、创建账户 + +- 命令:**create** [Number] + +``` +Number:创建账户地址的数量,默认为1,最大为100 +``` +### 2、备份keystore + +- 命令:**backup** <Address> [Path] + +``` +Address:待备份的账户地址(必填) + +Path:生成备份文件的目录,默认为当前目录(可选) +``` + +### 3、获取私钥 + +- 命令:**getprikey** <Address> + +``` +Address:获取私钥的账户地址(必填) +``` + +### 4、移除账户 + +- 命令:**remove** <Address> + +``` +Address:待移除地址(必填) +``` + +### 5、修改账户密码 + +- 命令:**resetpwd** <Address> + +``` +Address:修改密码的账户地址(必填) +``` + +### 6、转账 + +- 命令:**transfer** <FromAddress/FromAlias> <ToAddress/ToAlias> <Amount> [Remark] + +``` +FromAddress/FromAlias:转出地址或转出别名,二者选一(必填) +ToAddress/ToAlias:接收地址或接收别名,二选一(必填) +``` + +### 7、创建共识节点 + +- 命令:**createagent**<AgentAddress> <PackingAddress> <CommissionRate> <Deposit> [RewardAddress] + +``` +AgentAddress:共识节点创建地址(必填) +PackingAddress:共识节点打包地址,密码必须与配置文件中一致,默认为:nuls123456(必填) +CommissionRate:佣金比例,范围:10-100,整数 (必填) +Deposit:保证金,范围:20000-200000,最多小数位8位(必填)RewardAddress:奖励地址,默认为节点创建地址(选填) +``` + +**ps**:保存好创建共识节点的hash(或者在[**浏览器**](http://alpha.nulscan.io)中查询),加入共识和查询共识节点信息需要使用;必须保证共识节点创建地址与打包地址在一个钱包内,一个钱包不能同时创建两个共识节点。 + +### 8、加入共识 + +- 命令:**deposit**<Address><AgentHash><Deposit> + +``` +Address:加入共识的账户地址(必填) +AgentHash:创建共识节点的hash(必填) +Deposit:加入共识保证金,2000-500000,最多8位小数(必填) +``` + +**ps**:保存好加入共识的hash,退出共识需要使用 + +### 9、退出共识 + +- 命令:**withdraw**<Address><TxHash> + +``` +Address:退出共识地址(必填) +TxHash:委托时的交易hash(必填) +``` + +### 10、停止共识节点 + +- 命令:**stopagent**<Address> + +``` +Address:共识节点创建地址(必填) +``` + +### 11、查询共识节点信息 + +- 命令:**getagent**<AgentHash> + +``` +AgentHash:共识节点创建hash(必填) +``` \ No newline at end of file diff --git a/docs/zh/NULS2.0/quickStart/20190327142342.png b/docs/zh/NULS2.0/quickStart/20190327142342.png new file mode 100755 index 00000000..6c0a5468 Binary files /dev/null and b/docs/zh/NULS2.0/quickStart/20190327142342.png differ diff --git a/docs/zh/NULS2.0/quickStart/20190327143435.png b/docs/zh/NULS2.0/quickStart/20190327143435.png new file mode 100755 index 00000000..7320666c Binary files /dev/null and b/docs/zh/NULS2.0/quickStart/20190327143435.png differ diff --git a/docs/zh/NULS2.0/quickStart/20190327144549.png b/docs/zh/NULS2.0/quickStart/20190327144549.png new file mode 100755 index 00000000..0b609bce Binary files /dev/null and b/docs/zh/NULS2.0/quickStart/20190327144549.png differ diff --git a/docs/zh/NULS2.0/quickStart/20190327150757.png b/docs/zh/NULS2.0/quickStart/20190327150757.png new file mode 100755 index 00000000..dcce3d3d Binary files /dev/null and b/docs/zh/NULS2.0/quickStart/20190327150757.png differ diff --git a/docs/zh/NULS2.0/quickStart/20190327223858.png b/docs/zh/NULS2.0/quickStart/20190327223858.png new file mode 100755 index 00000000..49babe23 Binary files /dev/null and b/docs/zh/NULS2.0/quickStart/20190327223858.png differ diff --git a/docs/zh/NULS2.0/rpcToolWebsocketDesign.md b/docs/zh/NULS2.0/rpcToolWebsocketDesign.md new file mode 100644 index 00000000..fa829e34 --- /dev/null +++ b/docs/zh/NULS2.0/rpcToolWebsocketDesign.md @@ -0,0 +1,756 @@ +# RPC-Tool-WebSocket设计 + +# Websocket-Tool设计文档——第四版 + +[TOC] + + + + +## 写在最前的话 +``` +如果想知道websocket的具体设计,请逐步阅读本文档 + +如果只想知道如何使用,请跳转到章节《7.1 如何使用》 +``` + + +## 一、总体描述 + +### 1.1 概述 + +#### 1.1.1 为什么要有《Websocket-Tool》 + +[^说明]: 介绍的存在的原因 + +* NULS 2.0根据功能划分模块,所有模块隔离,可以独立运行。 +* 模块间通过《Websocket-Tool》调用接口 +* 模块只要实现了规定接口,可以用任何语言实现 +* 模块可以分布式部署 +* 《Websocket-Tool》会打包成jar包,供各模块引用 + + + +#### 1.1.2 《Websocket-Tool》要做什么 + +[^说明]: 要做些什么事情,达到什么目的,目标是让非技术人员了解要做什么事情 + +所有模块间的接口调用都通过《Websocket-Tool》进行 + +- 启动Websocket Server +- 注册当前模块的所有cmd命令 +- 把当前模块信息汇报给kernel +- 接收从kernel推送的所有模块信息 +- 启动Websocket Client +- 维护调用过程产生的数据 +- 封装所有数据中间处理过程,各模块只需要关心 + - 输入 + - 输出 +- 各模块通过尽可能简单的方式调用cmd命令 + + + +#### 1.1.3 《Websocket-Tool》在系统中的定位 + +[^说明]: 在系统中的定位,是什么角色,依赖哪些做哪些事情,可以被依赖用于做哪些事情 + +《Websocket-Tool》是底层框架,任何模块都会依赖 + +《Websocket-Tool》维护各模块基础信息,但是不涉及具体业务 + + + +## 二、功能设计 + +### 2.1 架构图 + +[^说明]: 说明的功能设计,可以有层级关系,可以通过图形的形式展示,并用文字进行说明。 + + + +## 三、接口设计 + + + +## 四、事件说明 + + + +## 五、协议 + +### 5.1 通信协议 – Json/WebSockets + +微服务的行为不像标准的客户端 - 服务器基础设施,因为每个微服务同时是客户端和服务器,因此需要全双工通信协议,这允许实现特殊类型的发布 - 订阅模式; 在这个实现中,方法只能被调用一次,然后调用者可以通过两种不同的方式接收不断的更新: + +- 基于事件:当方法在预定义数量的事件之后发送通知时 +- 基于时间:当方法在预定义的秒数后发送通知时 + +WebSocket是一种成熟的选项,可以本机提供全双工连接,其他选项如标准Json-RPC不提供双向通道。 +消息将使用JSon格式进行编码,因为它是最广泛用于消息交换的,并且易于调试。 + +### 5.2 消息结构 + +所有消息都有一个由5个字段组成的公共基础结构: + +- MessageID:这是一个标识请求的字符串。 它的长度不应超过256个字符 +- Timestamp:自纪元以来的秒数(1970年1月1日格林威治标准时间00:00:00) +- TimeZone:发起请求的时区,它应为介于-12和12之间的数字 +- MessageType:消息类型,这些在第3节中指定 +- MessageData:保存消息有效负载的Json对象 + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"NegotiateConnection", + "MessageData":{ + "CompressionRate":"3", + "CompressionAlgorithm":"zlib" + } +} +``` + +### 5.3 Message Types + +目前只定义了9种类型的消息:NegotiateConnection, NegotiateConnectionResponse, Request, Unsubscribe, Response, Ack, Notificatioin, RegisterCompoundMethod, UnregisterCompoundMethod + + + +#### 5.3.1 NegotiateConnection + +这应该是在与微服务建立连接时应该发送的第一个对象,只有在协商成功时,服务才可以处理其他请求,否则应该收到状态设置为0(失败)的NegotiateConnectionResponse对象并立即断开连接。 + +它由两个字段组成: + +- CompressionAlgorithm(默认值:zlib):一个String,表示如果CompressionRate大于0,将用于接收和发送消息的算法。默认为zlib,大多数开发语言中都有支持的库。 +- CompressionRate:0到9之间的一个整数,用于建立应为此连接发送和接收消息的压缩级别。 0表示没有压缩,而9表示最大压缩 + +示例: + +```json +{ + "messageId":"1", + "timestamp":"1543133816985", + "timezone":"9", + "messageType":"NegotiateConnection", + "messageData":{ + "protocolVersion":"1.0", + "compressionAlgorithm":"zlib", + "compressionRate":"0" + } +} +``` + + + +#### 5.3.2 NegotiateConnectionResponse + +仅在响应先前传入的NegotiateConnection消息时发送此类消息。 它由两个字段组成: + +- NegotiationStatus:无符号的小整数值,如果协商失败则为0,如果成功则为1 +- NegotiationComment:一个字符串值,用于描述拒绝连接时出现了什么问题。 + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"NegotiateConnectionReponse", + "MessageData":{ + "NegotiationStatus":"0", + "NegotiationComment":"Incompatible protocol version" + } +} +``` + + + +#### 5.3.3 Request + +调用者服务必须发送一个Request对象来执行Nulstar网络内某些服务提供的方法。 + +如果在单个请求对象中包含两个或更多方法,则应按顺序执行方法,然后发送一个response包喊所有回执信息,如果其中一个请求失败,则整个操作被视为失败。 + +它由六个字段组成: + +- RequestAck(默认值:0):这是一个布尔值 + + - 0:发出的请求只需要一条Response消息,如果它订阅了该函数,那么它可能会有很多响应消息 + - 1:发出的请求需要Ack和Response(译者注:有的请求可能需要一段时间处理,不会立刻返回Response,但是我要确保对方接收到了我的请求),如果它订阅了该函数,那么它可能会有很多响应消息 + +- SubscriptionEventCounter(默认值:0):这是一个无符号整数,指定目标方法发送Response的值的`改变次数`。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每改变两次就发送。以此类推。 + +- SubscriptionPeriod(默认值:0):这是一个无符号整数,指定目标方法发送Response的时间间隔。不管这个值是多少,总会立刻发送一个Response。如果是0,则不再继续发送,如果是2,则每2秒都会检测是否发送。以此类推。 + +- SubscriptionRange:如果请求的事件返回的是一个数字,则定义何时返回这个数字。 + 这是一个字符串,表示将触发响应的条件。 字符串是一对带符号的十进制数,第一个是下限,第二个是上限,如果不可用则为空。 如果该对分别以“(”或“)”开始或结束,则表示该数字不包括在内,如果该对分别以“[”或“]”开始或结束,则表示该数字包括在内。 + + 示例:假设我们只希望仅在余额等于或大于1000时收到通知。然后,getbalance请求应以“[1000,)”字符串作为SubscriptionRange参数发送 + +- ResponseMaxSize(默认值:0):无符号整数,指定方法应返回的最大对象数,值为零(默认值)表示无限制。只针对返回结果为List有效,指定的是返回的记录个数。 + +- RequestMethods:一个数组,包含所请求的所有方法及其各自的参数 + +示例: + +```json +{ + "messageId":"3", + "timestamp":"1543133968578", + "timezone":"9", + "messageType":"Request", + "messageData":{ + "requestAck":"0", + "subscriptionEventCounter":"0", + "subscriptionPeriod":"5", + "subscriptionRange":"0", + "responseMaxSize":"0", + "requestMethods":{ + "getHeight":{ + "paramName":"value", + "version":"1.0" + } + } + } +} +``` + + + +#### 5.3.4 Unsubscribe + +当服务不再希望从其订阅的方法接收响应时,它必须向目标服务发送Unsubscribe消息。 + +它由一个字段组成: + +- UnsubscribeMethods:一个数组,包含调用者想要取消订阅的所有方法 + +示例: + +```json +{ + "messageId":"4", + "timestamp":"1543134296019", + "timezone":"9", + "messageType":"Unsubscribe", + "messageData":{ + "unsubscribeMethods":[ + "getHeight" + ] + } +} +``` + + + +#### 5.3.5 Response + +当目标服务完成处理请求时,应该发送响应以及操作结果。 + +它由六个字段组成: + +- RequestID:这是引用的原始Request消息请求ID +- ResponseProcessingTime:目标服务处理请求所用的时间(以毫秒为单位) +- ResponseStatus:响应状态,如果成功则为1,否则为0 +- ResponseComment:一个字符串,可以提供有关该过程结果的更多说明 +- ResponseMaxSize:响应包含每个请求的最大对象数 +- ResponseData:一个对象数组,包含已处理方法的结果,每个请求一个对象 + +示例: + +```json +{ + "messageId":"9", + "timestamp":"1543134299030", + "timezone":"9", + "messageType":"Response", + "messageData":{ + "requestId":"5", + "responseProcessingTime":"1", + "responseStatus":"1", + "responseComment":"Congratulations! Processing completed!", + "responseMaxSize":"0", + "responseData":{ + "getHeight":"getHeight->1.3" + } + } +} +``` + + + +#### 3.5.6 Ack + +其唯一目的是通知呼叫者已成功接收请求。 + +它由一个字段组成: + +- RequestID:这是引用的原始Request消息请求ID + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"Ack", + "MessageData":{ + "RequestID":"sdj8jcf8899ekffEFefee" + } +} +``` + + + +#### 3.5.7 Notification + +当需要将某些事件通知给连接的组件而不期望响应消息时(例如,即将对服务执行升级时),将发送此消息类型。 通知将信息推送到其他组件,因此通知只应由Manager,Controller和Connector模块使用 + +它由四个字段组成: + +- NotificationAck :(默认值:0):这是一个布尔值 + - 0:发出的通知不期望任何类型的消息作为回执 + - 1:发出的通知需要一条Ack消息 +- NotificationType:通知的类别,每个服务都可以定义自己的类型,因此不需要接收方处理此字段 +- NotificationComment:字符串注释,提供有关通知原因的更多信息 +- NotificationData:与通知相关的数据,接收方不需要处理此字段 + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"Notification", + "MessageData":{ + "NotificationAck":"1", + "NotificationType":"SystemUpgrade", + "NotificationComment":"A system upgrade is about to be performed!", + "NotificationData":{ + "Date":"2018-11-11", + "Time":"23:00:00", + "NewVersion":"1.1.6" + } + } +} +``` + + + +#### 3.5.8 RegisterCompoundMethod + +请求可以由多个方法组成,使用此消息类型,我们注册一个虚拟方法,该方法将按顺序执行其各个实际方法,如果其子方法之一失败,则虚方法返回失败。 + +某些子方法可能共享相同的参数名称,因此可以创建别名,如示例中所示。 + +它由三个字段组成: + +- CompoundMethodName:这是标识虚方法的字符串 +- CompoundMethodDescription:描述方法功能,在查询API以获取帮助时将提供描述 +- CompoundMethods:这是一个数组,包含构成虚方法的各自参数别名的方法 + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"RegisterCompoundMethod", + "MessageData":{ + "CompoundMethodName":"GetMyInfo", + "CompoundMethodDescription":"Get useful information.", + "CompoundMethods":{ + "GetBalance":{ + "Address":"GetBalanceAddress" + }, + "GetHeight":{ + + } + } + } +} +``` + +在该示例中,正在注册一个名为GetMyInfo的虚方法,它由GetBalance和GetHeight方法组成,还为Address参数创建了一个名为GetBalanceAddress的别名。 +GetMyInfo的请求可以作为标准方法发送。 + +(我确实没看懂这个的意义在哪,感觉就是单纯为了多这么个功能,有疑问请直接找Berzeck或者坚哥,哈哈) + + + +#### 3.5.9 UnregisterCompoundMethod + +此消息类型用于取消注册复合(虚拟)方法。 + +它由一个字段组成: + +- UnregisterCompoundMethodName:这是标识虚方法的字符串。 如果它为空,则应取消注册调用者注册的所有虚拟方法 + +示例: + +```json +{ + "MessageID":"45sdj8jcf8899ekffEFefee", + "Timestamp":"1542102459", + "TimeZone":"-4", + "MessageType":"UnregisterCompoundMethod", + "MessageData":{ + "UnregisterCompoundMethodName":"GetMyInfo" + } +} +``` + + + +### 5.4 具体细节 + +- 传输过程的所有属性都是string类型 + +- 如果是boolean类型,"1"代表true,"0"代表false + +- 当调用一个方法的时候,调用者需要知道:提供方法的角色,以及方法的使用方式 + +- 注册的时候,Role1有method1,Role2有method2,如何定义? + 答:不需要定义,这是写在文档中的。 + apiMethods = Role1Methods + Role2Methods。因此注册的时候不需要知道每个Role都包含什么方法,这些应该在文档中体现。 + +- 注册接口的字符串格式 + + ```json + { + "messageId":"2", + "timestamp":"1543204508986", + "timezone":"9", + "messageType":"Request", + "messageData":{ + "requestAck":"0", + "subscriptionEventCounter":"0", + "subscriptionPeriod":"0", + "subscriptionRange":"0", + "responseMaxSize":"0", + "requestMethods":{ + "registerAPI":{ + "apiMethods":[ + { + "methodName":"getHeight", + "methodDescription":"test getHeight 1.1", + "methodMinEvent":"0", + "methodMinPeriod":"0", + "methodScope":"private", + "parameters":[ + { + "parameterName":"aaa", + "parameterType":"int", + "parameterValidRange":"(1,100]", + "parameterValidRegExp":"" + }, + { + "parameterName":"bbb", + "parameterType":"string", + "parameterValidRange":"", + "parameterValidRegExp":"^[A-Za-z0-9\\-]+$" + } + ] + }, + { + "methodName":"getHeight", + "methodDescription":"test getHeight 2.0", + "methodMinEvent":"0", + "methodMinPeriod":"0", + "methodScope":"private", + "parameters":[ + + ] + } + ], + "dependencies":{ + "Role_Ledger":"1.1" + }, + "connectionInformation":{ + "IP":"192.168.1.65", + "Port":"17733" + }, + "moduleDomain":"nuls.io", + "moduleRoles":{ + "cm":[ + "1.1", + "1.2" + ] + }, + "moduleVersion":"1.2", + "moduleAbbreviation":"cm", + "moduleName":"Chain Manager" + } + } + } + } + ``` + +- Manager返回各模块连接信息的字符串格式 + + ```json + { + "messageId":"8", + "timestamp":"1543204714006", + "timezone":"9", + "messageType":"Response", + "messageData":{ + "requestId":"2", + "responseProcessingTime":"1", + "responseStatus":"1", + "responseComment":"Congratulations! Processing completed!", + "responseMaxSize":"0", + "responseData":{ + "registerAPI":{ + "Dependencies":{ + "test":{ + "APIVersion":[ + "1.0" + ], + "IP":"192.168.1.65", + "Port":"14694" + }, + "ke":{ + "APIVersion":null, + "IP":"192.168.1.65", + "Port":"8887" + }, + "cm":{ + "APIVersion":[ + "1.1", + "1.2" + ], + "IP":"192.168.1.65", + "Port":"17733" + } + } + } + } + } + } + ``` + + + + + +## 六、配置 + + + +## 七、Java特有的设计 + +[^说明]: 核心对象类定义,存储数据结构,...... + +### 7.1 设计 + +> io.nuls.rpc +> +> > client +> > +> > > `WsClient`:与其他模块建立连接的对象,完全封装,不需要开发人员关注 +> > > +> > > `ClientRuntime`:客户端运行时需要的数据,方法 +> > > +> > > `CmdDispatcher`:开发人员应该只使用它来调用接口 +> > +> > cmd +> > +> > > cmd_package_1 +> > > +> > > cmd_package_2 +> > > +> > > `BaseCmd`:所有对外提供方法的类的父类,提供success, failed方法返回Response对象 +> > +> > info +> > +> > > `Constants`:常量 +> > > +> > > `HostInfo`:获取IP地址,随机获得端口 +> > +> > model +> > +> > > message +> > > +> > > > `Message`:所有消息都应该用该对象进行传输 +> > > > +> > > > `MessageType`:消息类型(包含以下9种) +> > > > +> > > > `Ack`:确认收到消息 +> > > > +> > > > `NegotiateConnection`:握手 +> > > > +> > > > `NegotiateConnectionResponse`:回复握手 +> > > > +> > > > `Notification`:通知 +> > > > +> > > > `Request`:请求调用远程方法 +> > > > +> > > > `Response`:回复Request +> > > > +> > > > `Unsubscribe`:取消订阅的远程方法 +> > > > +> > > > `RegisterCompoundMethod`:订阅多个远程方法 +> > > > +> > > > `UnregisterCompoundMethod`:取消订阅多个远程方法 +> > > +> > > `CmdAnnotation`:注解类,有该注解的方法可以对外提供接口 +> > > +> > > `Parameter`:注解类,用以描述对外提供接口的参数信息 +> > > +> > > `Parameters`:注解类,Parameter的集合 +> > > +> > > `CmdDetail`:对外提供的方法的具体信息 +> > > +> > > `CmdParameter`:对外提供的方法的参数信息 +> > > +> > > `ModuleE`:枚举类型,NULS2.0基础架构下的模块信息 +> > > +> > > `RegisterApi`:一个模块对外提供的所有方法的合集 +> > +> > server +> > +> > > `CmdHandler`:根据Request消息,调用正确的方法 +> > > +> > > `ServerRuntime`:服务器运行时需要的参数,方法 +> > > +> > > `WsProcessor`:处理收到的消息队列 +> > > +> > > `WsServer`:服务器对象,负责接收消息,然后放入消息队列 + + + +### 7.2 如何使用 + +Websocket-Tool会做成JAR包供各模块引用 + + + +#### 7.2.1 测试专用:模拟kernel + +非常重要! + +各模块接口是在kernel中进行维护,但是kernel由社区成员开发,因此这一部分是内部测试的模拟代码,可以直接复制使用,无需额外操作。 + +(test/java/io.nuls.test.WsKernel) + +```java +@Test +public void kernel() throws Exception { + // url: "ws://127.0.0.1:8887" + WsServer.mockKernel(); +} +``` + + + +#### 7.2.2 自定义cmd + +scope的值:public,private,admin + +- public:暴露出去,第三方应用/平台也能调用的公开接口 +- private:只有模块间内部才能调用的接口 +- admin:专门为管理员设计的特定接口(管理员定义在在Berzeck的connector中,我们并不需要关心) + +```java +/* + * 该类所在的包需要通过7.1.3中的方法进行扫描 + */ +public class MyCmd extends BaseCmd { + + @CmdAnnotation(cmd = "getHeight", version = 1.0, scope = "private", minEvent = 0, minPeriod = 0, + description = "test getHeight 1.0") + @Parameter(parameterName = "aaa", parameterType = "int", parameterValidRange = "(1,100]", parameterValidRegExp = "") + @Parameter(parameterName = "bbb", parameterType = "string") + public Object getHeight1(Map map) { + Log.info("getHeight version 1"); + // success + return success("Here is your real return value"); + // 预定义错误 + return failed(ErrorCode); + // 非预定义错误 + return failed(String) + } +} +``` + + + +#### 7.2.3 启动Server + +```java +// Start server instance +WsServer.getInstance(ModuleE.CM) + .moduleRoles(new String[]{"1.0", "2.4"}) + .moduleVersion("1.2") + .dependencies(ModuleE.LG.abbr, "1.1") + .dependencies(ModuleE.BL.abbr, "2.1") + .scanPackage("io.nuls.rpc.cmd.test") + .connect("ws://127.0.0.1:8887"); + +// Get information from kernel +CmdDispatcher.syncKernel(); +``` + + + +#### 7.2.4 为kernel提供的接口 + +现阶段忽略! + +```java + +``` + + + +#### 7.2.5 调用cmd + +```java +/* + 单元测试专用:单元测试时需要告知内核地址,以及同步接口列表 + 如果不是单元测试,在模块中进行连调测试,下面两句话是不需要的 + */ +WsServer.mockModule(); +/* + 单元测试专用结束 + */ + + +// Build params map +Map params = new HashMap<>(); +// Version information ("1.1" or 1.1 is both available) +params.put(Constants.VERSION_KEY_STR, "1.0"); +params.put("paramName", "value"); + +// 可以看成是一个同步方法,发送Request,获得Response +Response response = CmdDispatcher.requestAndResponse(ModuleE.CM.abbr, "getHeight", params); + +// 发送Request,当有Response的时候会自动调用预设的方法,返回的messageId是为了取消订阅 +String messageId = CmdDispatcher.requestAndInvoke(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2"); + +// 与requestAndInvoke一样,但是必须在收到Ack之后才会返回messageId +String messageId = CmdDispatcher.requestAndInvokeWithAck(ModuleE.CM.abbr, "getHeight", params, "1", InvokeMethod.class, "invokeGetHeight2"); + +// 取消订阅 +CmdDispatcher.unsubscribe(messageId); +System.out.println("我已经取消了订阅"); + +``` + + + + + +## 八、补充内容 + +[^说明]: 上面未涉及的必须的内容 + diff --git a/docs/zh/NULS2.0/smartContractFee.md b/docs/zh/NULS2.0/smartContractFee.md new file mode 100644 index 00000000..0a769203 --- /dev/null +++ b/docs/zh/NULS2.0/smartContractFee.md @@ -0,0 +1,50 @@ +## 智能合约手续费 + +### 1. 智能合约费用收取的规则,如何计费?接口调用者付多少钱?都是由谁收到了这些费用? + +在主链上,多出三个类型的交易,`创建智能合约`, `调用智能合约`, `删除智能合约` + +三个交易与其他交易如`转账`不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一 + +* 智能合约收费计算方式 + +```java +public static final int COMPARISON = 1;//比较字节码 +public static final int CONSTANT = 1;//简单数值类型字节码 +public static final int LDC = 1;//数值常量,字符串常量(长度 * LDC) +public static final int CONTROL = 5;//控制字节码 +public static final int TABLESWITCH = 2;//switch字节码(大小 * TABLESWITCH) +public static final int LOOKUPSWITCH = 2;//switch字节码(大小 * LOOKUPSWITCH) +public static final int CONVERSION = 1;//数值转换 +public static final int EXTENDED = 1;//null判断 +public static final int MULTIANEWARRAY = 1;//多维数组(大小 * MULTIANEWARRAY) +public static final int LOAD = 1;//把本地变量送到栈顶 +public static final int ARRAYLOAD = 5;//把数组的某项送到栈顶 +public static final int MATH = 1;//数学操作及移位操作 +public static final int REFERENCE = 10;//对象相关操作 +public static final int NEWARRAY = 1;//一维数组(大小 * NEWARRAY) +public static final int STACK = 2;//栈操作 +public static final int STORE = 1;//把栈顶的值存入本地变量 +public static final int ARRAYSTORE = 5;//把栈项的值存到数组里 +public static final int TRANSFER = 1000;//转账交易 + +``` + +* 一次智能合约总手续费 + + 一次合约交易的总手续费由三部分构成 + - 第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费 + + - 第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na + > 举例说明,某次合约执行消耗了20000Gas,设定的单价是30Na/Gas, 那么这次消耗的Na就是`20000 * 30 = 600000`,既是0.006NULS + + - 第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以合约GAS返还交易返还 + > 举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是`10000 * 30 = 300000`,既是0.003NULS,那么这0.003NULS会在当前打包区块的合约GAS返还交易中返还给合约调用者 + +* 合约调用者付多少钱? + + 在合约交易中合约调用者付了第一、二、三部分,实际上合约调用者付了第一、二部分,因为第三部分会在当前打包区块的合约GAS返还交易中返还给合约调用者 + +* 谁收到了这些费用? + + 区块打包者收到了第一、二部分费用,合约调用者收到第三部分费用 \ No newline at end of file diff --git a/docs/zh/NULS2.0/smartContractManual.md b/docs/zh/NULS2.0/smartContractManual.md new file mode 100644 index 00000000..f4fedc19 --- /dev/null +++ b/docs/zh/NULS2.0/smartContractManual.md @@ -0,0 +1,854 @@ +# 开发手册 + +## 1. 简介 + +NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。 + +## 2. 开发环境 + +### 2.1 安装NULS钱包 + +### 2.2 安装JDK 8 + +### 2.3 安装IntelliJ IDEA + +Nuls智能合约使用的开发工具为IntelliJ IDEA。 + +### 2.4 NULS智能合约开发工具 + +NULS智能合约开发工具提供的主要功能: + +* 新建NULS智能合约Maven工程 +* 提供可视化页面来编译、打包、部署合约、调用合约、查询合约相关数据 + +> [构建NULS智能合约开发工具的说明文档](/zh/NULS2.0/mavenPackage.html) + +## 3. NULS智能合约规范与语法 + +Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。 + +### 3.1 NULS智能合约规范 + +> **_合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + +### 3.2 关键字 + +下面列出Java关键字,其中将标注NULS智能合约不支持的关键字 + +访问控制 + +* public +* protected +* private + +定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象 + +* class +* interface +* abstract +* implements +* extends +* new + +包的关键字 + +* import +* package + +数据类型的关键字 + +* byte +* char +* boolean +* short +* int +* float +* long +* double +* void +* null +* true +* false + +条件循环(流程控制) + +* if +* else +* while +* for +* switch +* case +* default +* do +* break +* continue +* return +* instanceof + +错误处理 + +* catch +* try +* finally +* throw +* throws + +修饰方法、类、属性和变量 + +* static +* final +* super +* this +* native(不支持) +* strictfp(不支持) +* synchronized(不支持) +* transient(不支持) +* volatile(不支持) + +其他 + +* enum(不支持) +* assert(不支持) + +### 3.3 基本语法 + +下面的语法与Java相同,只是简单列出,具体可参考Java相关文档 + +* 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头 +* 基本数据类型:byte short int long float double char boolean +* 引用数据类型:类、接口、数组 +* 算术运算符:+ - * / % ++ -- +* 关系运算符:> < >= <= == != +* 逻辑运算符:! & | ^ && || +* 位运算符:& | ^ ~ >> << >>> +* 赋值运算符:= +* 拓展赋值运算符:+ = -= *= /= +* 字符串链接运算符:+ +* 三目条件运算符 ? : +* 流程控制语句(if,switch,for,while,do...while) + +### 3.4 支持的类 + +Nuls智能合约只能使用下面的类进行开发 + +* io.nuls.contract.sdk.Address +* io.nuls.contract.sdk.Block +* io.nuls.contract.sdk.BlockHeader +* io.nuls.contract.sdk.Contract +* io.nuls.contract.sdk.Event +* io.nuls.contract.sdk.Msg +* io.nuls.contract.sdk.Utils +* io.nuls.contract.sdk.annotation.View +* io.nuls.contract.sdk.annotation.Required +* io.nuls.contract.sdk.annotation.Payable +* java.lang.Boolean +* java.lang.Byte +* java.lang.Short +* java.lang.Character +* java.lang.Integer +* java.lang.Long +* java.lang.Float +* java.lang.Double +* java.lang.String +* java.lang.StringBuilder +* java.math.BigInteger +* java.math.BigDecimal +* java.util.Collection +* java.util.List +* java.util.ArrayList +* java.util.LinkedList +* java.util.Map +* java.util.HashMap +* java.util.LinkedHashMap +* java.util.Set +* java.util.HashSet + +### 3.5 其他限制 + +* 合约类只能有一个构造方法,其他类不限制 +* 执行一次合约方法最大的Gas消耗是1000万,请保证尽可能的优化合约代码 +* 执行一次`@View`类型的方法调用,最大的Gas消耗是1亿,请保证尽可能的优化合约代码 + +## 4. NULS智能合约简单示例 + +一个简单的合约 + +> **_合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。_** + + +```java +package contracts.examples; + +import io.nuls.contract.sdk.Contract; +import io.nuls.contract.sdk.annotation.Payable; +import io.nuls.contract.sdk.annotation.Required; +import io.nuls.contract.sdk.annotation.View; + +public class SimpleStorage implements Contract { + + private String storedData; + + /** + * 调用后合约状态不会改变,可以通过这种方法查询合约状态 + */ + @View + public String getStoredData() { + return storedData; + } + + /** + * 标记@Payable的方法,才能在调用时候传入NULS金额 + */ + @Payable + public void setStoredData(@Required String storedData) { + this.storedData = storedData; + } + + /** + * 返回值会被VM自动JSON序列化,以JSON字符串的形式返回 + * 注意:对象层级不得超过3层,超过3层的部分会调用对象的toString方法,不会再继续序列化 + */ + @JSONSerializable + public Map vJsonSerializableMap() { + Map map = new HashMap(); + map.put("name", "nuls"); + map.put("url", "https://nuls.io"); + return map; + } + +} +``` + +合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 +合约部署好以后,_**合约类的所有public方法都是能调用的**_,通过调用这些方法读取或修改合约状态。 + +注解说明 + +@JSONSerializable 标记@JSONSerializable的方法,返回值会被VM自动JSON序列化,以JSON字符串的形式返回。 + +注意:对象层级不得超过3层,超过3层的部分会调用对象的toString方法,不会再继续序列化。 + +@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。 + +@Payable 标记@Payable的方法,才能在调用时候传入NULS金额 + +@Required 标记@Required的参数,调用时候必须传入值,_**若不想传递未标记此注解的参数,需要填入0或者null占位**_ + +### Github上里面有一些合约示例。 + +[NULS合约示例收集](https://github.com/nuls-io/nuls-contracts) + +[NULS合约示例 - NRC20](https://github.com/nuls-io/nuls-contracts/tree/master/nrc20) + +[NULS合约示例 - NRC721](https://github.com/MIMIEYES/NULS-NRC721-baselib) + +[NULS合约示例 - POCM](https://github.com/CCC-NULS/pocm-contract) + +## 5. NULS Contract SDK + +合约SDK提供了几个类,方便合约开发: + +### io.nuls.contract.sdk.Address + +```java +public class Address { + + private final String address; + + public Address(String address) { + valid(address); + this.address = address; + } + + /** + * 获取该地址的可用余额 + * + * @return BigInteger + */ + public native BigInteger balance(); + + /** + * 获取该地址的总余额 + * + * @return BigInteger + */ + public native BigInteger totalBalance(); + + /** + * 合约向该地址转账 + * + * @param value 转账金额(多少Na) + */ + public native void transfer(BigInteger value); + + /** + * 调用该地址的合约方法 + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + */ + public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 调用该地址的合约方法并带有返回值(String) + * + * @param methodName 方法名 + * @param methodDesc 方法签名 + * @param args 参数 + * @param value 附带的货币量(多少Na) + * @return 调用合约后的返回值 + */ + public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); + + /** + * 验证地址 + * + * @param address 地址 + */ + private native void valid(String address); + + /** + * 验证地址是否是合约地址 + * + */ + public native boolean isContract(); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Address address1 = (Address) o; + return address != null ? address.equals(address1.address) : address1.address == null; + } + + @Override + public int hashCode() { + return address != null ? address.hashCode() : 0; + } + + @Override + public String toString() { + return address; + } + +} +``` + +### io.nuls.contract.sdk.Block + +```java +public class Block { + + /** + * 给定块的区块头 + * + * @param blockNumber 区块高度 + * @return 给定块的区块头 + */ + public static native BlockHeader getBlockHeader(long blockNumber); + + /** + * 当前块的区块头 + * + * @return 当前块的区块头 + */ + public static native BlockHeader currentBlockHeader(); + + /** + * 最新块的区块头 + * + * @return 最新块的区块头 + */ + public static native BlockHeader newestBlockHeader(); + + /** + * 给定块的哈希值 + * hash of the given block + * + * @param blockNumber + * @return 给定块的哈希值 + */ + public static String blockhash(long blockNumber) { + return getBlockHeader(blockNumber).getHash(); + } + + /** + * 当前块矿工地址 + * current block miner’s address + * + * @return 地址 + */ + public static Address coinbase() { + return currentBlockHeader().getPackingAddress(); + } + + /** + * 当前块编号 + * current block number + * + * @return number + */ + public static long number() { + return currentBlockHeader().getHeight(); + } + + /** + * 当前块时间戳 + * current block timestamp + * + * @return timestamp + */ + public static long timestamp() { + return currentBlockHeader().getTime(); + } + +} +``` + +### io.nuls.contract.sdk.BlockHeader + +```java +public class BlockHeader { + + private String hash; + private long time; + private long height; + private long txCount; + private Address packingAddress; + private String stateRoot; + + public String getHash() { + return hash; + } + + public long getTime() { + return time; + } + + public long getHeight() { + return height; + } + + public long getTxCount() { + return txCount; + } + + public Address getPackingAddress() { + return packingAddress; + } + + public String getStateRoot() { + return stateRoot; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BlockHeader that = (BlockHeader) o; + + if (time != that.time) return false; + if (height != that.height) return false; + if (txCount != that.txCount) return false; + if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; + if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) + return false; + return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; + } + + @Override + public int hashCode() { + int result = hash != null ? hash.hashCode() : 0; + result = 31 * result + (int) (time ^ (time >>> 32)); + result = 31 * result + (int) (height ^ (height >>> 32)); + result = 31 * result + (int) (txCount ^ (txCount >>> 32)); + result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); + result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "BlockHeader{" + + "hash='" + hash + '\'' + + ", time=" + time + + ", height=" + height + + ", txCount=" + txCount + + ", packingAddress=" + packingAddress + + ", stateRoot='" + stateRoot + '\'' + + '}'; + } + +} +``` + +### io.nuls.contract.sdk.Contract + +```java +/** + * 合约接口,合约类实现这个接口 + */ +public interface Contract { + + /** + * 直接向合约转账,会触发这个方法,默认不做任何操作,可以重载这个方法。 + * 前提: 需重载这个方法,并且标记`@Payable`注解 + */ + default void _payable() { + } + + /** + * 1. 当共识节点奖励地址是合约地址时,会触发这个方法,参数是区块奖励地址明细二维数组数据 eg. [[address, amount], [address, amount], ...] + * 2. 当委托节点地址是合约地址时,会触发这个方法,参数是合约地址和奖励金额二维数组数据 eg. [[address, amount]] + * 前提: 需重载这个方法,并且标记`@Payable`注解 + */ + default void _payable(String[][] args) { + } + +} +``` + +### io.nuls.contract.sdk.Event + +```java +/** +* 事件接口,事件类实现这个接口 +*/ +public interface Event { +} +``` + +### io.nuls.contract.sdk.Msg + +```java +public class Msg { + + /** + * 剩余Gas + * remaining gas + * + * @return 剩余gas + */ + public static native long gasleft(); + + /** + * 合约发送者地址 + * sender of the contract + * + * @return 消息发送者地址 + */ + public static native Address sender(); + + /** + * 合约发送者地址公钥 + * sender public key of the contract + * + * @return 消息发送者地址公钥 + */ + public static native String senderPublicKey(); + + /** + * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na + * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na + * + * @return + */ + public static native BigInteger value(); + + /** + * Gas价格 + * gas price + * + * @return Gas价格 + */ + public static native long gasprice(); + + /** + * 合约地址 + * contract address + * + * @return 合约地址 + */ + public static native Address address(); + +} +``` + +### io.nuls.contract.sdk.Utils + +```java +public class Utils { + + private Utils() { + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + */ + public static void require(boolean expression) { + if (!expression) { + revert(); + } + } + + /** + * 检查条件,如果条件不满足则回滚 + * + * @param expression + * @param errorMessage + */ + public static void require(boolean expression, String errorMessage) { + if (!expression) { + revert(errorMessage); + } + } + + /** + * 终止执行并还原改变的状态 + */ + public static void revert() { + revert(null); + } + + /** + * 终止执行并还原改变的状态 + * + * @param errorMessage + */ + public static native void revert(String errorMessage); + + /** + * 发送事件 + * + * @param event + */ + public static native void emit(Event event); + + /** + * @param seed a private seed + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom(long seed) { + int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); + int hash2 = Msg.address().toString().substring(2).hashCode(); + int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; + int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); + + long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; + + seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); + return ((int) (seed >>> 24) / (float) (1 << 24)); + } + + /** + * @return pseudo random number (0 ~ 1) + */ + public static float pseudoRandom() { + return pseudoRandom(0x5DEECE66DL); + } + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param src source string (hex encoding string) + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(String hexString); + + /** + * + * Please note that this is the SHA-3 FIPS 202 standard, not Keccak-256. + * + * @param bytes source byte array + * @return sha3-256 hash (hex encoding string) + */ + public static native String sha3(byte[] bytes); + + /** + * [Testnet]verify signature data(ECDSA) + * + * @param data(hex encoding string) + * @param signature(hex encoding string) + * @param pubkey(hex encoding string) + * @return verify result + */ + public static native boolean verifySignatureData(String data, String signature, String pubkey); + + /** + * [Testnet]根据截止高度和原始种子数量,用特定的算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static native BigInteger getRandomSeed(long endHeight, int seedCount, String algorithm); + + /** + * [Testnet]根据截止高度和原始种子数量,用`SHA3-256`hash算法生成一个随机种子 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static BigInteger getRandomSeed(long endHeight, int seedCount) { + return getRandomSeed(endHeight, seedCount, "SHA3"); + } + + /** + * [Testnet]根据高度范围,用特定的算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @param algorithm hash算法标识 + * @return 原始种子字节数组合并后, 使用hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static native BigInteger getRandomSeed(long startHeight, long endHeight, String algorithm); + + /** + * [Testnet]根据高度范围,用`SHA3-256`hash算法生成一个随机种子 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 原始种子字节数组合并后, 使用`SHA3-256`hash算法得到32位hash字节数组, 再转化为BigInteger(new BigInteger(byte[] bytes)) + */ + public static BigInteger getRandomSeed(long startHeight, long endHeight){ + return getRandomSeed(startHeight, endHeight, "SHA3"); + } + + /** + * [Testnet]根据截止高度和原始种子数量,获取原始种子的集合 + * + * @param endHeight 截止高度 + * @param seedCount 原始种子数量 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ + public static native List getRandomSeedList(long endHeight, int seedCount); + + /** + * [Testnet]根据高度范围,获取原始种子的集合 + * + * @param startHeight 起始高度 + * @param endHeight 截止高度 + * @return 返回原始种子的集合,元素是字节数组转化的BigInteger(new BigInteger(byte[] bytes)) + */ + public static native List getRandomSeedList(long startHeight, long endHeight); + + /** + * 调用链上其他模块的命令 + * + * @see 调用命令详细说明 + * @param cmdName 命令名称 + * @param args 命令参数 + * @return 命令返回值(根据注册命令的返回类型可返回字符串,字符串数组,字符串二维数组) + */ + public static native Object invokeExternalCmd(String cmdName, String[] args); + + /** + * 把对象转换成json字符串 + * 注意:对象内如果包含复杂对象,序列化深度不得超过3级 + * + * @param obj + * @return json字符串 + */ + public static native String obj2Json(Object obj); +} +``` + +### io.nuls.contract.sdk.annotation.Payable + +`@Payable` 标记`@Payable`的方法,才能在调用时候转入NULS金额 + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Payable { +} +``` + +### io.nuls.contract.sdk.annotation.Required + +`@Required` 标记`@Required`的参数,调用时候必须传入值, _**未标记此注解的参数,若不想传递参数,需要填入0或者null占位**_ + +```java +@Target({ElementType.PARAMETER}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface Required { +} +``` + +### io.nuls.contract.sdk.annotation.View + +`@View` 标记`@View`的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态 + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface View { +} +``` + +### io.nuls.contract.sdk.annotation.JSONSerializable + +`@JSONSerializable ` 标记@JSONSerializable的方法,返回值会被VM自动JSON序列化,以JSON字符串的形式返回。 + +注意:对象层级不得超过3层,超过3层的部分会调用对象的toString方法,不会再继续序列化。 + +```java +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface JSONSerializable { +} +``` + +## 6. 智能合约主要的API + +在NULS2.0模块[NULS-SDK-PROVIDER](https://github.com/nuls-io/nuls-sdk-provider/blob/master/README.md)中,我们提供了大部分常用的API,请参考该文档中智能合约部分。 + +## 7. 智能合约方法参数传递的一些说明 + +智能合约的方法中如果有`数组类型`的参数,请使用如下方式传递参数 +> 参考[投票合约](https://github.com/nuls-io/nuls-contracts/blob/master/vote/io/nuls/vote/contract/VoteContract.java#L26)代码中的`create`方法 + +```json +{ + "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", + "password": "", + "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", + "gasLimit": 200000, + "price": 1, + "value": 10000000000, + "methodName": "create", + "methodDesc": "", + "remark": "", + "args": [ + "测试投票1", + "第一个投票合约", + [ + "第一个选项", + "第二个选项", + "第三个选项" + ], + 1536044066056, 1536184066056, false, 300, false + ] +} +``` + + + + + diff --git a/docs/zh/NULS2.0/triggerPayable.md b/docs/zh/NULS2.0/triggerPayable.md new file mode 100644 index 00000000..6e8837eb --- /dev/null +++ b/docs/zh/NULS2.0/triggerPayable.md @@ -0,0 +1,67 @@ +# 触发payable方法的场景 + +在`vm-sdk`中,对于`Contract#payable`有这样的描述 + +```java +package io.nuls.contract.sdk; + +/** + * 合约接口,合约类实现这个接口 + */ +public interface Contract { + + /** + * 直接向合约转账,会触发这个方法,默认不做任何操作,可以重载这个方法。 + * 前提: 需重载这个方法,并且标记`@Payable`注解 + */ + default void _payable() { + } + + /** + * 1. 当共识节点奖励地址是合约地址时,会触发这个方法,参数是区块奖励地址明细 eg. [[address, amount], [address, amount], ...] + * 2. 当委托节点地址是合约地址时,会触发这个方法,参数是合约地址和奖励金额 eg. [[address, amount]] + * 前提: 需重载这个方法,并且标记`@Payable`注解 + */ + default void _payable(String[][] args) { + } +} + +``` + +`vm-sdk`的`maven`依赖如下 + +```xml + + io.nuls.sdk + sdk-contract-vm + 2.0-beta1 + +``` + +## 一、官方钱包转账功能,账户地址向合约地址转账时触发 + +触发`payable()`无参方法 + +**系统底层实现原理:** + +组装成调用合约交易,默认调用合约的`_payable()`方法 + +## 二、共识节点奖励地址是合约地址,当前节点出块时触发 + +触发`_payable(String[][] args)`有参方法,参数是当前区块 _**所有**_ 奖励地址明细 eg. [[address, amount], [address, amount], ...] + +**系统底层实现原理:** + +共识模块判断CoinBase交易中的奖励地址有合约地址时,调用此合约的`_payable(String[][] args)`方法,并把相应的收益金额转向此合约地址 + +## 三、委托地址是合约地址,出块奖励中有当前合约地址时触发 + +触发`_payable(String[][] args)`有参方法,参数 _**是且只是**_ 当前合约地址和奖励金额(只有这一个元素) eg. [[address, amount]] + +**系统底层实现原理:** + +共识模块判断CoinBase交易中的奖励地址有合约地址时,调用此合约的`_payable(String[][] args)`方法,并把相应的收益金额转向此合约地址 + +## 四、用户直接调用合约的`_payable()`方法时触发 + +## 注意: `_payable(String[][] args)`方法是系统调用方法,用户无法调用 diff --git a/docs/zh/NULS2.0/vm-sdk.md b/docs/zh/NULS2.0/vm-sdk.md new file mode 100644 index 00000000..33df41d1 --- /dev/null +++ b/docs/zh/NULS2.0/vm-sdk.md @@ -0,0 +1,241 @@ +# 合约调用外部命令说明 + +```java +public class Utils { + /** + * 调用链上其他模块的命令 + * + * @param cmdName 命令名称 + * @param args 命令参数 + * @return 命令返回值(根据注册命令的返回类型可返回字符串,字符串数组,字符串二维数组) + */ + public static native Object invokeExternalCmd(String cmdName, String[] args); +} +``` + +## 1. 生成合约共识交易的功能 + +### 1.1 创建共识节点 + +- 命令名称 + + **`cs_createContractAgent `** + +- 交易类型 + + **txType = `20`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |packingAddress |打包地址 |String |AddressTool.getStringAddressByBytes(byte[])|略| + |deposit |保证金 |String |BigInteger - toString|略| + |commissionRate |佣金比例 |String |Byte - toString|范围[10,100]| + +- 返回值说明 + + > 返回值类型是 **`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +- 示例 + + ```java + // String packingAddress, BigInteger depositNa, String commissionRate + String[] args = new String[]{packingAddress, depositNa.toString(), commissionRate}; + String txHash = (String) Utils.invokeExternalCmd("cs_createContractAgent", args); + ``` + +### 1.2 合约委托共识节点 + +- 命令名称 + + **`cs_contractDeposit `** + +- 交易类型 + + **txType = `21`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |agentHash |创建合约共识节点交易hash |String |略|略| + |deposit |委托金额 |String |BigInteger - toString|略| + +- 返回值说明 + + > 返回值类型是 **`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +- 示例 + + ```java + // String agentHash, BigInteger depositNa + String[] args = new String[]{agentHash, depositNa.toString()}; + String txHash = (String) Utils.invokeExternalCmd("cs_contractDeposit", args); + ``` + +### 1.3 合约退出共识节点 + +- 命令名称 + + **`cs_contractWithdraw`** + +- 交易类型 + + **txType = `22`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |joinAgentHash |加入共识时的交易hash |String |略|略| + +- 返回值说明 + + > 返回值类型是 **`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +- 示例 + + ```java + // String joinAgentHash + String[] args = new String[]{joinAgentHash}; + String txHash = (String) Utils.invokeExternalCmd("cs_contractWithdraw", args); + ``` + +### 1.4 合约注销共识节点 + +- 命令名称 + + **`cs_stopContractAgent `** + +- 交易类型 + + **txType = `23`** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + 无参数 + +- 返回值说明 + + > 返回值类型是 **`String`** 字符串类型 + + |描述 |字符串转换逻辑 | + |:--:|:--:| + |交易hash |略| + +- 示例 + + ```java + String txHash = (String) Utils.invokeExternalCmd("cs_stopContractAgent", null); + ``` + +## 2. 查询共识数据 + +### 2.1 根据_`加入共识时的交易hash`_查询委托共识信息 + +- 命令名称 + + **`cs_getContractDepositInfo `** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |joinAgentHash |加入共识时的交易hash |String |略|略| + +- 返回值说明 + + > 返回值类型是 **`String[]`** 字符串数组类型 + + |index |描述 |字符串转换逻辑 | + |:--:|:--:|:--:| + |0 | agentHash |略| + |1 | agentAddress |AddressTool.getStringAddressByBytes(byte[])| + |2 | joinAddress |AddressTool.getStringAddressByBytes(byte[])| + |3 | deposit |BigInteger - toString| + |4 | time |Long - toString| + |5 | blockHeight |Long - toString| + |6 | delHeight |Long - toString| + |7 | status(0-待共识 1-共识中) |Integer - toString| + +- 示例 + + ```java + // String joinAgentHash + String[] args = new String[]{joinAgentHash}; + String[] contractDepositInfo = (String[]) Utils.invokeExternalCmd("cs_getContractDepositInfo", args); + + // 委托金额 + BigInteger deposit = new BigInteger(contractDepositInfo[3]); + // 0-待共识 1-共识中 + String status = contractDepositInfo[7]; + ``` + +### 2.2 根据_`创建节点的交易hash`_查询节点信息 + +- 命令名称 + + **`cs_getContractAgentInfo `** + +- 方法参数规范 + + > 合约调用此方法时,传递的参数类型都是`String`类型 + + |名称 |描述 |类型 |合约转换`String`逻辑 |备注| + |:--:|:--:|:--:|:--:|:--:| + |agentHash |创建合约共识节点交易hash |String |略|略| + +- 返回值说明 + + > 返回值类型是 **`String[]`** 字符串数组类型 + + |index |描述 |中文描述 |字符串转换逻辑 | + |:--:|:--:|:--:|:--:| + |0 | agentAddress |创建节点的地址 |AddressTool.getStringAddressByBytes(byte[])| + |1 | packingAddress |打包地址 |AddressTool.getStringAddressByBytes(byte[])| + |2 | rewardAddress |奖励地址 |AddressTool.getStringAddressByBytes(byte[])| + |3 | deposit |保证金 |BigInteger - toString| + |4 | totalDeposit |总委托金额 |BigInteger - toString| + |5 | commissionRate |佣金比例 |Integer - toString| + |6 | time |创建节点时间 |Long - toString| + |7 | blockHeight |创建节点的高度 |Long - toString| + |8 | delHeight |注销节点的高度 |Long - toString| + |9 | status |状态(0-待共识 1-共识中) |Integer - toString| + +- 示例 + + ```java + // String agentHash + String[] args = new String[]{agentHash}; + String[] contractAgentInfo = (String[]) Utils.invokeExternalCmd("cs_getContractAgentInfo", args); + + // 合约节点已委托金额 + BigInteger totalDepositOfContractAgent = new BigInteger(contractAgentInfo[4]); + // 0-待共识 1-共识中 + String statusOfContractAgent = contractAgentInfo[9]; + ``` + + diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 00000000..d9872a63 --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,48 @@ +# 欢迎来到NULS + + +> NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动 + +NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等 + +## NULS2.0 Beta版本已发布 + +亲爱的用户: + +很荣幸的宣布,NULS2.0 Beta版本已于北京时间:2019-07-08日发布,诚邀您参与公测。 + +NULS核心团队革命性的在区块链底层基础设施设计中引入微服务思维,将软件应用程序设计为可独立部署的服务套件,将这种架构设计中最领先的思想引入到模块设计中,让模块像可以独立启动的程序一般灵活。这种不设置任何编程语言门槛,结合微服务的模块化架构,我们称之为NULS 2.0。这种架构下模块之间的耦合度更小,多语言开发让代码的贡献以及用户使用的便利性都得到极大地提升,同时更易于扩展,甚至模块支持分布式部署,模块的插拔也更容易。同时链工厂和跨链模块也会在这个架构上进行设计。 + +此次Beta版本测试内容主要包含: +- [使用ChainBox搭建区块链](/zh/NULS2.0/chainBoxGuide.html) +- [开发业务模块](/zh/NULS2.0/developeModule.html) +- [网页钱包](http://beta.wallet.nuls.io/) +- [节点钱包和轻钱包](https://github.com/nuls-io/nuls-v2/releases) +- [区块链浏览器](http://Beta.nulscan.io/) + + +### 如何参与测试: + +1 [下载钱包](https://github.com/nuls-io/nuls-v2/releases)或直接访问[网页钱包](http://beta.wallet.nuls.io/) + +2 如果使用linux节点钱包,则需查看[linux钱包使用教程](/zh/NULS2.0/linuxTutorial.html) + +3 [申请测试币](https://nuls.community/d/131-get-the-testing-coins-of-the-testnet/141)并在帖子中回复:beta+地址 + +4 [访问区块链浏览器](http://Beta.nulscan.io/) + +5 [使用ChainBox搭建区块链](/zh/NULS2.0/chainBoxGuide.html) + +6 [提交bug](https://github.com/nuls-io/nuls_2.0/issues) + + +### 相关链接 + +- Github:[https://github.com/nuls-io/nuls_2.0](https://github.com/nuls-io/nuls_2.0) +- 论坛:[https://nuls.community](https://nuls.community) +- 技术社区Telegram:[https://t.me/nulstest](https://t.me/nulstest) + + +想了解更多与NULS相关的信息,可以访问我们的[官网](https://nuls.io) + + diff --git a/docs/zh/learn/NIP-1.md b/docs/zh/learn/NIP-1.md new file mode 100644 index 00000000..b1bbfdd4 --- /dev/null +++ b/docs/zh/learn/NIP-1.md @@ -0,0 +1,173 @@ +# NIP-1 NIP的目的和指导 +``` +NIP:1 +标题: NIP的目的和指导 +状态: 公示 +类型: 流程 +作者: 杨霖 +创建日期:2018/12/27 +``` + + +## 什么是NIP? + +NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见. + +## NIP产生的理由 + +- 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录 + +- 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。 + +## NIP的类型 + +NIP当前有六种类型: + +- 核心:NULS核心代码的改善,例如共识机制,网络协议等。 +- 模块:模块的提交和评审要求的改善,例如符合何种标准的模块会被接受并被纳入模块仓库。 +- 接口:NULS客户端API/RPC的规范和标准的改善,例如API名称、方法名称。 +- NRC标准:应用级别的标准的改善,例如合约标准,通证标准等。 +- 信息:描述NULS设计问题,或向NULS社区提供一般性指导或信息,但不提出新功能。 信息NIP不一定代表NULS社区的共识或推荐,因此用户和实施者可以自由选择忽略信息NIP或遵循他们的建议 +- 流程:所有NULS相关的操作流程的改善,例如社区中竞选大使的流程的改善。流程类NIP不仅仅是建议,是社区成员完成某些特定的事需要遵守的规范,但该类NIP不涉及代码层面的规范。 +## NIP的工作流程 + +**涉及流程的各方包括以下部分或全部角色:** + +- 社区的大部分成员 + + 主要职责为参与NIP的讨论和投票,提出建设性意见。 + +- NIP作者 + + 提出和完善NIP,并负责引导社区展开讨论。 + +- NIP编辑 + + 管理和编辑NIP。 + +- NULS理事会 + + 对即将进入接受或完结状态的NIP做最后把关,理事会有权通过内部投票拒绝NIP。 + +- NULS核心开发者 + + 负责核心,模块,NRC标准和接口这四个类型的NIP的审核和代码实现。 + +在开始撰写NIP之前,先审查你的想法,这将帮你节省时间。首先询问社区这个想法之前是否被提出过,可行性如何。以免浪费时间在一些肯定会被拒绝的提案上,并有助于确保该想法适用于整个社区而不仅仅是作者。 某个想法对作者有意义并不意味着它对各个地区使用NULS的人都有意义。我们建议可以通过发起投票的方式在社区收集意见,投票的结果也有助于NIP编辑更快做出判断是否合并该NIP。 + +完成一个最终生效的NIP需要经过以下阶段: + + +``` +[ 草稿 ]->[ 公示 ]->[ 接受 ]->[ 完结 ] +``` + +每次NIP状态的更改都是先由NIP的作者提出Pull Request(合并请求,简称PR),然后NIP的编辑会对该NIP进行审查。提出PR的时候最好包含一个可以持续讨论该NIP的链接。 + +**完整的NIP处理流程如下:** + +- NIP的作者按照规定的格式和样式编写NIP,然后在社区中进行讨论和调研,确定可行性后,则将NIP通过提PR的方式提交到NIP仓库,并在PR中包含社区讨论的链接。NIP编辑会根据实际情况来处理这些请求。 + - **草稿:** 如果同意合并,NIP编辑将为该NIP分配一个编号并合并PR。 NIP编辑不会无理由拒绝某个NIP + - **草稿:** 拒绝合并为草稿的原因包括专注度不够、过于宽泛、重复劳动、技术上不健全、没有提供合理的动机或解决向后兼容性,或者不符合NULS理念。 + +- 合并成为草稿状态后,作者可以继续提PR对草稿做进一步更改,直至认为该NIP已经足够成熟并准备好进入下一个状态为止。 + - **公示:** 如果获得同意,NIP编辑将会把该NIP的状态从草稿更改为公示,并设置公示结束日期,通常为15天后。 + - **公示:** 如果进入公示阶段后,还要对该NIP进行更改,那这个NIP会被退回草稿状态。我们希望一个NIP只进入一次公示状态,避免在社区引起不必要的争论。 + + +- 公示状态的NIP会置顶在https://nuls.community/ + - **接受(核心,模块,NRC标准和接口的NIP才涉及):** 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为接受。 + - **完结(信息和流程才涉及):** 如果没有重大变更或未解决的技术问题,则通过公示期的NIP的状态会被NIP编辑更改为完结。 + - **公示:** 公示期有材料变更或无法解决社区提出的技术问题,则该NIP将会被退回草稿状态。除此之外,如果理事会对该NIP有不同的看法,可以在理事会成员内部发起投票,超过70%的理事会成员否决该NIP(需给出原因)则该NIP将根据实际原因被退回草稿状态或直接改为拒绝状态。 + + + +- 当核心、模块、NRC标准和接口的NIP成为接受状态后,何时能成为完结状态取决于相关的NULS核心开发者,由他们决定如何将该NIP通过编码来实现。 + - **完结(核心,模块,NRC标准和接口的NIP涉及):** NIP已通过编码实现,并在主网稳定运行一段时间或得到了有效验证且改动也得到了社区的认可,则状态可变为完结。 + +其他非常规的状态如下: + +- **延期:** 核心、模块、NRC标准和接口相关的NIP成为接受状态后,开发者未按照预定的时间完成开发。 +- **拒绝:** 某个NIP被核心开发者拒绝实现或被理事会认定为不可实现。 +- **被取代:** NIP以前是完结状态,但不再被认为是最先进的。出现另一个更好的NIP,参考了这个NIP并成为了最终状态。 + +## 一个有效的NIP文档应该包含哪些内容? + +每个NIP应该包含以下部分: + +- **前言:** 与NIP相关的元数据,以RFC 822样式展示。内容包括NIP编号,简短描述性标题(限制为最多44个字符)和作者详细信息。可[参阅下文](#NIP的前言)了解详情。 +- **简单总结:** NIP作者需要给这个NIP提供一个简单且普通人可以理解的总结,如果你不能很简单地解释它,说明你自己对它的理解还不够深入。 +- **摘要 :** 对正在解决的技术问题进行简短(约200字)描述。 +- **动机:** 对于想要改善NULS协议的NIP,动机至关重要。 它应该清楚地解释为什么现有的协议规范存在不足。没有足够动机的NIP可能会被彻底拒绝。 +- **规范:** 技术规范应描述清楚任何新功能的语法和语义。规范应该足够详细,以允许当前任何基于NULS平台的应用拥有竞争性、可互操作性(例如NULS客户端,浏览器)。 +- **论据 :** 论据通过描述什么驱动了这样的设计以及为什么要做出这样的设计决策来充实规范。它应该阐述考虑过的替代性设计和相关工作,例如如何在其他语言中支持该特性。论据也可以提供证据证明社区的意见是一致的,并应讨论提出的重要反对意见或大家关注的事项。 +- **向后兼容性:** 所有引入向后不兼容的NIP必须描述存在哪些不兼容及其严重性。NIP中必须解释作者如何处理这些不兼容性。如果没有足够的向后兼容性论述,提交的NIP可能会被直接拒绝。 +- **测试用例:** 对于影响共识机制的NIP,其实现方法的测试用例是强制性的。 +- **实现 :** 代码的实现必须在任何NIP被赋予完结状态之前完成,但是它不需要在NIP被合并为草稿之前完成。 +- **历史记录:** 历史记录是展示了该NIP从提出到成为完结状态的整个过程,可以通过附加链接形式展示。 + +## NIP的格式和模版 + +NIP应该用markdown的格式编写 + +## NIP的前言 + +每个NIP的必须以RFC 822的样式作为文档的头部前言,头部必须按照以下顺序进行排列,用*标注的头部为可选项,其他项为必填项 + +``` + NIP: + 标题: + 作者: <列出作者的真实名字和电子邮件地址> +*讨论渠道: <指向官方讨论渠道的链接> + 状态: <草稿| 接受 | 完结 | 被取代 | 延期 | 拒绝> + 类型: <核心 | 模块 | 接口 | NRC标准 | 信息 | 流程> + 创建日期: < 用 ISO 8601 (yyyy-mm-dd) 格式> +*取代: +*被取代: +``` + + +## 附件 + +NIPS文档可能包含一些附件,例如流程图。这样的文件必须以NIP-XXXX-Y.ext的格式来命名,“XXXX”指的是NIP的编号,“Y”指的是序列号(从1开始),“ext”指的是文件扩展名(例如:.png) + +## 转移NIP的所有权 + +有时需要将NIPS的所有权转让给新的作者。一般来说,我们希望保留原作者作为要转移的NIP的合著者,但这实际上取决于原作者。转让所有权的一个很好的理由是,原作者不再有时间或兴趣来更新它或跟进NIP的后续过程,或已经脱离了“网络”(即无法联系或没有回复电子邮件)。转让所有权的一个不好的原因是你不同意NIP的方向。我们努力围绕一个NIP去建立共识,如果你认为不可能达成,你可以提交一个更有说服力的NIP。 + +如果您对NIP的所有权感兴趣,请发送一封邮件要求接管,该邮件的收件人是原作者和NIP编辑。如果原作者没有及时回复邮件,NIP的编辑就会做出单方面的决定(这样的决定并不是不能逆转的)。 + +## NIP编辑 + +当前的NIP编辑如下: + +``` +Niels +Pen +``` + + + +## NIP编辑的职责 + +每次收到一个新的NIP, 一个编辑要做如下的事: + +- 阅读NIP来检查它是否较为完备,NIP中的想法必须具有技术意义,即使它们看起来不太可能达到最终状态。 +- 标题和内容要相符。 +- 检查NIP的语言(拼写、语法、句子结构等)、标记(Github风格的标记)、代码风格 。 + +如果NIP不够完备,编辑会把它发回给作者进行修改,并给出具体的说明。一旦NIP做好了合并到仓库的准备,NIP编辑就会这样做: +- 分配一个NIP编号(通常是PR编号) + +- 合并相应的PR + +- 将消息发送回NIP作者 + +许多NIP是由对NULS代码库具有写入权限的开发人员编写和维护的。NIP编辑要关注NIP的变化,并纠正我们看到的任何结构、语法、拼写或标记错误。NIP编辑不会主观地对NIP做出判断,只做管理和编辑这部分工作。 + +## History + +这个文档主要引用了 [Bitcoin's BIP-0001](https://github.com/bitcoin/bips),由 Amir Taaki 所写,同时他所写的文本也主要来源于 [Python's PEP-0001](https://www.python.org/dev/peps/)。NIP根据自身的实际情况,基于他们的文档做了一些修改,例如NIP流程中增加了理事会,修改了NIP类型等。后续与NIP相关的问题请直接联系NULS NIP的编辑。 + + + diff --git a/docs/zh/learn/NIP-2.md b/docs/zh/learn/NIP-2.md new file mode 100644 index 00000000..1c01c0d0 --- /dev/null +++ b/docs/zh/learn/NIP-2.md @@ -0,0 +1,280 @@ +# NIP-2 NULS社区章程 + +``` + NIP: 2 + 标题: NULS社区章程 + 作者: Reaper Ran + 讨论渠道: https://nuls.community/d/251-nuls-community-constitution-discussion-draft-nuls-ncg20181207 + 状态: 公示 + 类型: 流程 + 创建日期: 2018/12/28 +``` + + + +## **前言** + +根据NULS项目的发展需要,为了更好地促进NULS社区良性运转,达成NULS让区块链技术更简单的愿景。NULS社区将不断探索和实施NULS社区自治,实现NULS项目自治和自进化。基于NULS社区文化和社区理念,特此制定社区发展章程。 + +NULS社区文化:开放、自由、自治、进化 + +NULS社区理念:分享、传承、成长、创新 + +**以下规则将会基于NULS开发共识治理模块,在共识治理模块上线前,理事会和大使将由NULS核心团队发起投票来执行。** + + + +NULS基金会 + +2018年12月 + + + +## 摘要 + +NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。 + + + +## 动机 + +为了构建一个良好的社区运行机制,促进社区自治,推动NULS项目能够让社区自主进化和自主驱动。 + + + +## 规范 + +以下内容属于NULS社区章程的规范。 + + + +# NULS社区章程 + +## **一、NULS社区简介** + +NULS是一个面向定制化服务的区块链基础设施,一个全球化的开源社区项目。NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。NULS提出模块化思维与多链并行基本架构,秉承以“链”为核心的发展理念,打造核心产品“链工厂”。基于NULS,用户可以灵活选择核心功能模块创建NULS链网中的区块链,也可以通过很少的编程工作基于NULS来智能合约来定义自己的业务逻辑。 + + + +**NULS社区是对NULS社区文化和理念高度认可的一群人的合集,是本着共同的目标和愿景,一起共同为NULS社区生态发展而努力的组织。**NULS社区成员由NULS基金会、理事会成员、贡献者角色、开源技术社区CODE CRAFT COUNCIL(CCC)和其他所有的NULS Holder构成。 + + + +## **二、NULS基金会** + +NULS基金会是NULS FOUNDATION PTE. LTD.(201729333G)简称, 是设立在新加坡的一家有限责任公司。NULS基金会致力于支持NULS社区生态建设和技术研发,促进NULS社区生态的安全、和谐、发展。主要目标是保证 NULS社区生态的可持续发展。 + + + +### **(一)NULS基金会宗旨** + +以促进NULS社区生态发展为宗旨,根据贡献者角色、CCC成员和其他社区成员对社区的贡献予以激励,对NULS社区的发展作为支持,包括但不限于以下内容的贡献: + +1、代码贡献 + +2、应用开发 + +3、运营推广 + +4、其他有利于NULS社区生态发展的具体事项 + + + +### **(二)NULS社区基金的来源** + +NULS原始分配20000000NULS注入社区基金,贡献者角色委托收益。 + + + +### **(三)NULS社区基金管理** + +根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有激励的提案根据本章程进行管理,通过后方可进行激励支出。账户资金前期将由基金会管理成员管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。 + + + +## **三、理事会** + +### **(一)理事会介绍** + +NULS社区理事会是基金会管理条例下设的成员组织,为以NULS基金会的宗旨负责,为NULS全体社区负责,会逐步将角色添加到NULS自治模型中。 + + + +### **(二)理事会成员产生** + +社区理事会的产生,将会通过社区投票,产生11位理事成员。社区理事会成员为一共11位(后续可提案修改),其中4位须为技术社区开发者**(开发者理事会成员)**,由开发者参与动态投票选出。剩下7位理事通过社区动态投票选出**(常务理事会成员)**。开发者社区中取动态投票前4位,其他理事成员7位来自于动态投票前7位。所以在理事会中相当于至少有4位是核心开发者成员。 + +1、申请。全体社区成员均可参与NULS社区理事会的竞选,参与者需要满足以下条件,在申请地址中不少于5万NULS,并接受系统实时监测,申请需填写相应尽可能详细的个人介绍,且申请地址需要保留不少于5万NULS,开发者理事会成员申请地址需要保留不少于2万NULS。 + +2、投票。申请成功后,所有申请人会按照得票从高到低进行排序,所有NULS Holder可以对竞选进行投票,投票票权按照币权动态分配,精确到小数点后4位,币在票在。投票方式为一票多选,最多可以选择4名开发者投票和7名其他理事会成员投票。 + +3、确定。在理事会成员候选列表中,选择投票数排名的前7位成员,在开发者中选择排名前4名成员,共选择出11名理事会成员,理事会成员的地址将会获得系统的提案权限。 + +4、退出。当候选人地址的NULS持有量少于10万枚时,视为退出社区理事会成员竞选,其历史所得所有票数清零,且不再显示在候选人投票列表中。若候选人自主选择退出社区理事会成员竞选,则其历史所得所有票数也会清零,且也不再显示在候选人投票列表中。退出后,申请地址想再参与理事会成员的动态竞争,需重新申请。 + + + +### **(三) 理事会成员权责** + +1、提案。理事会成员将会获得提案权限,发起提案需要一定的手续费0.1NULS,后期可提案修改。提案主要分为以下类型。 + +(1)提案创建贡献者角色和删除贡献者角色。提案后投票周期为15天,支持率达到70%执行,否则失效。 + +* 竞选角色。理事会提案创建一个竞选角色,提供固定的激励或者委托,这个角色类似理事会成员机制,通过社区投票动态竞选出1人或者多人担任此角色。 + +* 固定角色。提案一个角色固定激励或者委托。社区投票支持或者反对达成角色的担任。 + +(2)提案修改系统参数。提案后投票周期为30天,支持率为90%执行,否则失效。 + +* 节点下限代理手续费佣金调整。 + +* 转账手续费调整。 + +* 合约调用手续费调整。 + +* 理事会发起提案的手续费调整。 + +* 其他系统可调整的系统参数调整。 + +(3)提案执行基金会账户操作。提案后投票周期为15天,为贡献者角色提案投票周期为5天,支持率达到70%执行,否则失效。 + +* 委托。例如理事会成员提案对某个重要角色的节点进行委托,其节点奖励用于支持他的工作开展。 + +* 转账。例如理事会成员提案对于某个社区活动进行资金支持的转账。转账上限初始参数为10,000NULS,此参数可以修改。 + +* 创建节点。例如理事会成员提案为开发者创建节点,并进行一定数量的委托,其节点奖励用于支持开发者的工作开展。 + +* 调用智能合约。目的是调用智能合约进行NRC20代币操作,例如CCC,则需要理事会成员提案调用智能合约。 + +2、发起投票。理事会成员发起投票无需缴纳押金,可以发起其他类型投票。 + +3、理事会成员的责任。 + +* 理事会成员需要能够及时与社区进行沟通。 + +* 严格遵照社区章程。 + +* 与NULS的愿景和目标一致。 + +* 以全体社区成员利益为己任。 + +**注意:所有的提案和投票请全体的社区成员积极参与,因为每一个提案都事关NULS项目未来的发展,作为NULS社区的一员,每一个Holder都有责任参与投票。如果你不参与投票则视为放弃该次提案或者投票的投票权。** + + + +## **四、CODE CRAFT COUNCIL(CCC)** + +### **(一)CCC介绍** + +CCC是由来自NULS全球社区核心的开发者组成,对区块链技术感兴趣并高度认可NULS理念的开发者组成。他们将与核心开发团队一起,参与NULS项目的底层开发并且共同打造技术生态。 + +### **(二)CCC理念** + +在技术社区里我们坚持以下的理念: + +1、平等 (Equal):技术社区与核心团队是平等关系,一起合作开发。 + +2、共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态。 + +3、共享 (Sharing): + +* 社区共享NULS技术成果。 + +* 社区共享NULS发展红利。 + +* 社区共享NULS的影响力和名誉。 + +* 行业共享NULS带来的技术革新。 + +* 行业共享NULS推动行业发展的标准制定。 + +4、公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正。 + +5、创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。 + + + +### **(三)CCC成员产生** + +每一个CCC成员的加入都会由CCC成员投票决定。在那之前,他们需要拿出值得被认可的产出,并且经过一段不短的时间的磨合(通常1-2个月)。 + + + +加入流程如下: + +1、跟社区开发者初步沟通,简要介绍自己的经历、擅长的编程语言等。 + +2、选择感兴趣并胜任的任务。届时,我们会让开发者加入各个开发小组,同其他开发人员一起工作。 + +3、在小组中,各小组Leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的顺利开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。 + +4、技术社区和核心团队经过仔细审核后,如果申请被批准,开发者将成为CCC的一员。 + + + +### **(四)CCC成员权责** + +1、NULS希望建立一个涵盖80%区块链底层技术的模块仓库。通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更好地融入到日常生活中。 + +2、技术社区将会与核心开发团队一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。 + +3、然后,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),这极大地缩短了目前公链开发少则半年多则1年的耗时。 + +4、以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。 + +5、CCC成员与核心团队成员一样,对项目的整体进展有知晓和参与、赞成或反对的权利。 + + + +## **五、贡献者角色** + +### (一)竞选贡献者角色 + +竞选贡献者角色将被视为一个社区岗位,可用于因岗选人,社区监督管理。大使是一个竞选贡献者角色,现阶段的大使竞选规则如下展示**nuls.community**。 + +### (二)固定贡献者角色 + +固定贡献者角色将被视作为一个社区岗位,可用于因人设岗,社区监督管理。 + + + +## **六、项目预算** + +### **(一)对于贡献者角色** + +对于提案按照既定的以通过的贡献者角色提案执行基金会账户操作,由理事会提案进行社区投票,投票期为7天,支持率达到70%,即可快速执行。 + +### **(二)对于其他事务资金** + +理事会对其他预算项目进行提案申请,投票期为15天,根据提案要求支持率达到70%以上,即可按计划执行。 + +## **七、其他投票** + +### **(一)发起投票** + +1、理事会成员发起投票。只收取交易手续费。 + +2、普通成员投票。押金(目前设定是100NULS)+交易手续费。 + +### **(二)代理投票** + +* 任何人都可以将自己的投票权委托给代理人,由代理人代为执行投票。 + +* 任何的NULS用户都可以成为代理人。 + +* 代理只能有一级,不能有第二级,每个NULS用户只能委托自己的票权。 + +* 代理可随时撤销,已投票的票权也随之撤销(进行中的投票)。 + + +## **八、建议反馈** + +如果您对此章程有任何的建议或者意见,均可在社区网站上发表您的建议。 + + + +NULS社区网站:[https://nuls.community](https://nuls.community/) + +建议反馈帖: + + diff --git a/docs/zh/learn/NIP-3.md b/docs/zh/learn/NIP-3.md new file mode 100644 index 00000000..62f901d4 --- /dev/null +++ b/docs/zh/learn/NIP-3.md @@ -0,0 +1,169 @@ +# NIP-3 NULS社区基金管理和使用流程 + +``` + NIP: 3 + 标题: NULS社区基金管理和使用流程 + 作者: Reaper Ran + 讨论渠道: https://nuls.community/d/263-ngc20181221 + 状态: 公示 + 类型: 流程 + 创建日期: 2018/12/28 +``` + + + +## 摘要 + +根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。 + + + +## 动机 + +为了让社区能够有更多的人才加入,所以将社区基金开放给社区来共同管理和使用。 + + + +## 规范 + +以下内容属于NULS社区基金管理和使用流程的规范。 + + + +# NULS社区基金管理和使用流程 + +![img](https://nuls.community/assets/files/2018-12-21/1545375408-182645-20181221145608.png) + +## **一、社区基金管理** + +根据NULS社区生态发展的需要,本着公平、公正、公开的原则对NULS社区基金进行管理和使用。NULS社区基金账户面向社区公开,接受社区成员共同监督,所有关于社区激励的提案根据社区章程进行管理,通过后,方可进行激励支出。账户资金前期将由基金会管理成员进行管理,随着治理机制的逐步上链,后期逐步交由社区上链管理。 + +社区基金账户地址: + +[Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u](https://nulscan.io/accountInfo?address=Nse9U8qaLcV7b6uFy3nr8pD3z7mKgo9u) + +根据社区章程指导思想,提案执行基金会账户操作。 + +该提案由理事会成员发起:提案后投票周期为15天,为贡献者角色提案的投票周期为7天,投票支持率达到70%以上方可执行,否则失效。理事会成员可根据提案内容,增加支持率的标准,但是不得低于70%。 + +**注:理事会前期由核心团队指定成员担任,在治理工具和社区章程完善后,理事会将由全体社区成员投票动态竞选产生。** + +**暂定首批理事会成员:Liesa、Isaac、Omar、Reaper、Emerson、Penny、Berzeck、Moshe、Niels、Lin、Siwei** + +## **二、发起申请的成员** + +### **1、普通成员** + +包含所有NULS Holder、社区志愿者,以及其他想要参与NULS社区贡献的任何成员。 + +注:理事会发起的该部分成员的申请提案投票期为15天。 + + + +### **2、贡献者角色** + +通过社区投票竞选出来的大使和开源技术社区CODE CRAFT COUNCIL(CCC)成员,以及未来在社区章程思想指导下通过社区治理流程产生的其他贡献者角色。**贡献者角色产生流程按照社区章程中的单独提案执行,如需要进行贡献者角色的奖励变更依然遵循本流程。**理事会发起该部分成员申请提案的投票期为7天。 + +## **三、申请类型** + +### **1、提案支付资金** + +申请人已经做了某件事情,需要为这件事情所产生的一些费用进行支付。适用于一次性付款的合作或者具体某项事务的付款。以NULS为基准,单次申请最高不超过10,000NULS。 + +### **2、预算项目提案** + +申请人想要计划做一件事情,需要发起一个预算项目的提案。适用于特定的贡献者角色或者参与贡献的社区成员,提案通过后按进度分期支付。例如社群管理、平台资讯维护等。预算项目以NULS为基准,单次预算申请最高不超过20,000NULS。 + +### **3、提案创建节点** + +申请人可以申请提案通过社区基金来创建一个节点,创建节点可以指定奖励获得地址,创建节点抵押的资金依然归社区基金。这种方式适用于长期合作。例如CCC成员,以及其他有能力的团队、开发者、运营伙伴等。创建节点抵押最低为20,000NULS。 + +### **4、提案委托资金** + +申请人可以申请通过社区基金来委托资金给某个节点,可以是通过提案创建的节点,也可以是申请者自己创建的节点,委托的资金和委托产生的共识奖励归社区基金所有。这种方式可以和提案创建节点结合,适用于长期合作。例如大使、CCC成员,以及其他有能力的团队、开发者、运营伙伴等。申请委托资金最高为500,000NULS。 + +## **四、申请流程** + +### **1、方案公开讨论** + +(1)在社区论坛中展示方案或计划,进行公开讨论,并负责解答社区提出的疑问; + +(2)根据社区提出的建议,使方案或计划更加完善,方案的资金使用需要清晰,并让全体社区充分了解; + +(3)方案中可申请的方式有支付资金、预算项目、创建节点、委托资金; + +(4)提案支付资金,需要明确资金数额、用途和该事项的效果评估; + +(5)提案预算项目,需要详细的计划、资金数额、用途、支付周期和效果预估; + +(6)提案创建节点,需要明确奖励的地址、创建节点的目的、创建节点产生的奖励计算,以及申请方或者合作方未来的计划; + +(7)提案委托资金,需要明确奖励的地址、委托的目的,委托产生的奖励计算,以及申请方或者合作方未来的计划; + +(8)发起的所有提案经过社区的充分讨论(讨论时间不得低于7天),并且让全体社区成员充分了解后,提交给理事会成员进行正式提案; + +### **2、理事会成员提案** + +(1)理事会成员接到社区发起的已经经过充分讨论的提案,然后需要分配一个NCG编号(NCG+日期+次序)并进行正式的提案并发起社区投票; + +(2)理事会和申请人都需要引导社区正确地进行投票; + +(3)投票完成后,根据社区章程支持率大于或者等于提案标准的视为通过,低于提案标准视为无效,需要重新按照流程进行操作; + +(4)理事会成员提交资金申请到基金会,提案申请需要提供讨论的链接、投票的链接、NCG编号,基金会在基金无安全隐患的情况下必须执行社区通过的提案。 + +### **3、基金会执行提案** + +(1)基金会接到理事会成员提交的提案申请,需要在3个工作日内进行相关操作; + +(2)在处理的交易备注中需要填写每一笔交易的NCG编号,如果是多期付款的预算项目需要加上期号(NCG+日期+次序+付款期号)。 + +## **五、流程解释** + +所有的社区讨论建议在[nuls.community](https://nuls.community/)进行。 + +本流程根据社区章程思想进行管理,流程将会对全体社区公开。 + +流程规则的更新也可作为一次提案进行更新,按照社区章程和NIP执行。 + +具体节点产生收益参考NULS POC共识机制。 + +### **附:当前贡献者角色的委托和节点** + +大使的委托 - Nse2uqy7kn2pE3YYSU3971bGTxf8ouNR + +CCC 成员: + +Angel的节点 - Nsdtsg23qs7V7Y8mBi2Ah97FiRmfmu8q + +Angel的委托 - Nse2mbsj7uWnjiQfRpqER8MxSdt171Tx + +Berzeck的节点 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4 + +Berzeck的委托 - Nse9Wvq6g6hGbL8j639y3zmgKoErg6w4 + +Claudio 的节点 - Nse8EbASTcWd5CS6xMbV116VTPMtLwUH + +Claudio 的委托 - Nse4iRsbg4GjyXLieJLXCmtzEdc2cghg + +Edward的节点 -NsdzQguVTwyQKaNCYfhh3sDJNa3BAgNa + +Edward的委托 -Nse69F3cnLdf3pfXbjt8Q6uHS6ywQ33G + +Josh的节点 - Nse7htYjgXcPbvPx5gmny75NK3zkyyhs + +Josh的委托 - NsdxwqYoXBjwbznkUQG4ftHm3D2MNUHR + +Moshe的节点 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW + +Moshe的委托 -Nsdwx3XSJHAc7Y28urTUcM92g5Av87oW + +Naveen的节点 - Nse4KZttUX2wD3YEL95BrU1THf5h1oT4 + +Naveen的委托 - NsdvYw77H9bQLZeKhweZqcfdy9bGrVUN + + + +### + + \ No newline at end of file diff --git a/docs/zh/learn/NIP-4.md b/docs/zh/learn/NIP-4.md new file mode 100644 index 00000000..39f250bd --- /dev/null +++ b/docs/zh/learn/NIP-4.md @@ -0,0 +1,268 @@ +# NIP-4 NULS大使竞选参与规则 + +``` + NIP: 4 + 标题: NULS大使竞选参与规则 + 作者: Reaper Ran + 讨论渠道: https://nuls.community/d/205-ncg-20181114 + 状态: 公示 + 类型: 流程 + 创建日期: 2019/2/15 +``` + + + +## 摘要 + +NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。 + + + +## 动机 + +从9月-10月期间,我们已经有9位大使,大家都在积极的为NULS社区贡献,发展更多的成员,以及做一些力所能及的事情。NULS在主网智能合约上线后,将会开启一个社区投票工具。大使的竞选本身应该由社区来选择,另一方面由于在大使开展工作的过程中,社区的其他伙伴也提供了很多的建议,在广大社区成员的建议下,我们准备更新NULS大使的竞选规则。这将是NULS开启社区自治道路的第一步,NULS社区自治是未来的重要目标,这需要非常多的基础工具和人才支持。 + + + +## 规范 + +以下内容属于NULS大使竞选参与规则的规范。 + + + +# NULS大使竞选参与规则 + + + +## **一、NULS大使介绍** + +NULS大使在各国开展社区建设和社区拓展,NULS大使以国家为分区,每个国家最多选择一名NULS大使。每个国家的大使将通过竞选的形式产生。大使每季度进行竞选,参与竞选的大使提供上月的工作报告和下月的工作计划,工作计划中应该包含费用详细情况。如果是新加入竞选的大使需要先开展一个月的基础工作,在下季度参与竞选投票,参与者在社区论坛上发起竞选申请,根据所参与竞选的成员选出1/3的大使成员(例如有10人参与竞选,那么将选出4位大使),并且大使成员数不能超过活跃节点的1/10(例如,当前所有活跃节点为83个,大使成员不能超过9名),投票时间周期为15天,投票完成后NULS基金会一周内执行20W NULS委托,大使竞选的时间在每季度的最后一月。 + + + +## **二、NULS大使职责和权益** + +1、参与NULS大使的选举需要具有创建NULS节点的基本条件。 + +2、认同NULS的价值理念,了解NULS核心基础知识并尊重NULS社区成员,参选之前请确保能够坚持在任一个季度。 + +3、NULS大使的产生根据社区投票来进行产生,每季度前两个月可以申请大使的竞选,第三个月月初由团队发起大使选举投票,选择的成员数量为候选人的1/3,例如:有10人申请,那么选举4位大使,投票获得票数最多的4位成员将成为大使。 + +4、需要每月月底大使向全社区公开展示工作汇报总结,在论坛展示社区发展情况和下月的发展计划,工作计划中应该包含费用详细情况。 + +5、大使的罢免,任意的节点可以提出罢免投票,投票期为7天,支持罢免的成员超过50%的支持率,则该大使被罢免,被罢免的大使3个月内不能参与大使竞选。 + + 6、NULS大使将会获得NULS基金会社区基金20万NULS节点委托,当选后的NULS大使可以支配使用社区基金委托中的80%的代理节点委托收益用于社区建设和拓展,20%NULS基金会收益注入回到社区基金池。 + +7、以上80%节点费用参数为初始参数,随着市场波动,该参数可由任意节点发起投票修改,投票期为15天,投票量超过500W NULS且支持率达到70%以上,由基金会执行。 + +8、大使获得的节点的所有奖励一半作为大使的报酬(由于大使的节点服务器需要支出和自己抵押的20000NULS也会产生收益),另外一半必须作为大使发展基金,用于社区发展。 + +9、大使的离职,如果大使主动离职或者被罢免,请将剩余的大使发展基金返回到社区基金。 + +10、大使属于社区贡献者角色,如需要发起其他的社区基金申请,按照[社区基金使用和管理流程](https://nuls.community/d/274-nip3-nuls)执行。 + + + +## **三、如何参与竞选** + +* 第一步: + +发布上月的工作情况报告和下月的工作计划: + +请发布到论坛https://community.nuls.world/t/elections + +* 第二步: + +NULS社区会搜集安排发布竞选投票到论坛上,投票时间为15天,请尽量为自己拉票。 + +* 第三步: + +如果你的投票排名是满足条件的,请创建一个节点,并命名为(国家+Ambassador),将代理佣金设置为80%; + +NULS基金会将会委托200000NULS在您的节点上。 + + + +**最后祝愿:** + +* 恭喜您成为NULS大使,任何的困难NULS团队和社区都会协助您。 +* 开始社区建设和拓展工作。 +* 帮助NULS对接更多的DApp接入。 +* 请记得每个月底在论坛中提交本月的社区发展情况和下月的工作计划。 + +所有大使相关的讨论,请全部发布到论坛https://community.nuls.world/t/elections + +欢迎大家加入NULS社区,共同创造NULS美好未来! + + + +## **如果您能够奉献更多,对您的期望:** + +1、在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。 + +2、可以提供任何材料来协助营销团队,例如照片、视频、见面会和商家合作文章等。 + +3、分享NULS的故事给社区。 + +3、分享NULS的故事给社区; + +4、将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。 + +6、如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。 + +7、尝试参加您所在地区的任何可能的加密货币聚会并代表NULS出席。 + +8、帮助NULS的宣传,致力于在您所在地区活动的本地媒体发布。 + + + + + +# **大使指导手册** + + + +## **前言** + +欢迎来到NULS社区,欢迎成为NULS社区的大使,让我们一起从这里开始。NULS社区是一个全球性的开源社区项目。NULS社区以“让区块链技术更简单,打破区块链性能瓶颈,降低区块链的使用成本,让数据更可信安全”为愿景,本着“开放、自由、自治、进化”的原则促进NULS项目和社区发展。NULS大使是全体社区成员带领社区发展的主要的指南者,所以NULS的社区大使应该以身作则,为社区发展做出更大的贡献。 + + + +## **作为NULS的大使,你将获得** + +1、NULS社区发展至高的荣誉,所有的大使的工作记录都会记录在NULS社区,未来都可以记录在NULS的区块数据中; + +2、你将获得一个节点产生的费用,可以支配这部分费用来发展当地NULS社区; + +3、可以和NULS全球其他地区的社区大使一起工作,和NULS理事会深度交流探讨NULS未来发展; + +4、可以获得大量的社区支持者,如果想要建立自己的节点会变得非常容易。 + + + +## **作为NULS的大使,你可以从这些方面来开展工作** + +### 1、社区拓展 + +(1)通过互联网或者线下交流的方式让其他人了解NULS。 + +(2)组织一些NULS的爱好者或者志愿者一起宣传NULS的技术和理念。 + +(3)将NULS社区其他地区的发展情况分享到当地社区。 + +(4)持续分享NULS项目的进展、规划、新闻等到当地社区。 + +(5)联系当地的媒体和论坛,帮助NULS的宣传发布NULS的介绍或者新闻。 + +(6)分享NULS的故事给社区。 + +(7)可以提供任何材料来协助营销团队其他的大使,例如照片、视频、见面会和商家合作文章等。 + +(8)将团队制作的视频或者其他内容,用当地的语言分享给您所在国家/地区的人们。 + +(9)如果可能的话,可以与交流团队协调,协调本地交易所,增加NULS交易对。 + +(10)帮助联系一些区块链项目基于NULS搭建,可以是区块链或者DApp。 + + + +### 2、社区活动 + +(1)在您的城市或国家举办当地见面会,与NULS社区成员会面,并引导新人认识NULS是什么。 + +(2)参加您所在地区的任何可能的加密货币聚会并代表NULS出席。 + +(3)可以组织当地的其他成员(NULStar)代表NULS参与或出席线下活动。 + +(4)结合一些节日组织适合当地的论坛或者线下活动宣传NULS。 + +(5)尝试和一些商家来一起做活动,并引导让他们加密货币抵扣、支付或者冠名。 + + + +## 了解NULS可以从这里开始 + +1、NULS大使工作看板([点击进入](https://devs.nuls.world/b/HKQeYfjDuGTuZbAQz/nuls-ambassador)),你可以在看板中添加一个你自己的列表,然后把正在做的工作、将要做的事情都放到看板上,方便其他大使和成员知道,其他成员可以以此来支持你的工作开展。 + +2、你可以了解NULS常用的信息,例如NULS的简介,上线的平台,合作伙伴,媒体频道,社区群组,社区网站等。 + +3、如果你在使用对外的宣传资料时,请注意NULS的Logo和字母都是大写,并且请使用标准的VIS,包含了PPT模板、帽子、文化衫、信纸、公告、Logo等,也可以在这个看板上找到。 + +4、请在看板上完善你的邮箱、Telegram、领英等账号,以便互相联系交流,可以尽快假如NULS Ambasaddor群组。 + +5、你需要经常关注看板和Telegram群组,保持能够伙伴在需要你的时候可以联系上。 + +6、如果你需要任何的帮助和支持,以及需要询问的问题,你可以在群组中提出,团队成员会解答大家的疑问。 + +7、如果你想了解更多技术的内容或者帮助其他人了解,可以关注[Github](https://github.com/nuls-io/)和[dev.nuls.io](https://dev.nuls.io/)。 + +7、有任何的建议,疑问和想法,以及所有的工作发展都可以在社区论坛[nuls.community](https://nuls.community/)上面发帖。 + + + +## 招募志愿者组织当地的社群 + + + +1、招募当地的NULS爱好者或者志愿者,组建线上交流的群组,引导大家一起帮助NULS的发展。 + +2、组织开展一些线下见面会活动。 + +3、让更多的区块链投资人了解NULS,引导他们对NULS投资。 + +4、帮助NULS寻找更多的区块链技术爱好者加入。 + + + +## 发展当地的NULS生态 + +1、尝试联系一些本地的交易所,免费的列出NULS,如果一些比较好的交易所,需要上市费用,可以介绍给NULS团队; + +2、帮助NULS对接开发区块链项目的伙伴基于NULS开发,或者使用NULS来创建区块链和DApp。 + +3、如果你们有一些习惯使用的第三方钱包APP或者硬件钱包,请试图和他们联系,让他们支持NULS。 + + + +## 将NULS的理念和技术传播到当地 + +1、可以找一些当地的技术论坛或者区块链论坛,帮助NULS把相关的信息传递到这些论坛。 + +2、和当地的一些科技媒体或者区块链媒体取得联系,代表NULS做一些采访或者报道,也可以发布一些NULS的新闻。 + +3、利用当地主流的媒体网站,传播NULS的新闻和项目进展。 + + + + + + + +## NULStar指南和职责 + +### 成为NULStar的要求 + +1、必须是社区的积极成员。这包括转发,订阅,关注和喜欢社交媒体上的材料和内容,或创建社交媒体帐户以帮助推广NULS。它还包括提供某种形式的内容(艺术,广告,文章或积极参与NULS Discord,TG,微信社区等)或参与我们的社区活动和竞赛内容或行动。 + +2、必须了解NULS项目 - 了解概念,使命,价值观,目标,并了解项目的发展和新闻。此测试伴随此测试验证潜在的NULStar是否充分了解该项目。 + +3、必须住在人口超过35万的城市。 + +### NULStar的职责 + +1、显示我们的技术概念,平台愿景,NULS社区的价值观以及发展我们社区的目标的实用知识。 NULStar测试中超过85%的分数使个人有资格成为NULStar。 + +2、在NULStar城市/地区举行定期加密聚会,介绍和讨论NULS项目。聚会可以包括以太坊,比特币和区块链聚会和活动。 + +### NULStars的奖励 + +1、NULStars由NULS大使在各自的地区委托,NULStars由各大使协商支付个人奖金。所有赏金均在NULS中支付,每次聚会的奖金为50-100 NULS。赏金数额由大使自行决定。 + +2、那些表现出良好沟通技巧并坚持项目使命和价值观的人士,包括为社区做出的贡献,直接反映他们在城市所做的努力,可以作为他们所在地区的大使参与未来的活动。 + + + + + +## 指导手册会不断更新,希望大使们和NULS一起成长! \ No newline at end of file diff --git a/docs/zh/learn/NIPIntroduction.md b/docs/zh/learn/NIPIntroduction.md new file mode 100644 index 00000000..c9268d43 --- /dev/null +++ b/docs/zh/learn/NIPIntroduction.md @@ -0,0 +1,15 @@ +# NIP介绍 + +## 什么是NIP? + +NIP代表NULS改善提案。 NIP是一个设计文档,用于向NULS社区提供信息,描述NULS相关的改善流程或新功能。 NIP作者负责在社区内建立共识并记录不同意见. + +## NIP产生的理由 + +- 我们希望NIP成为提出新功能、收集社区技术意见以及记录NULS设计决策的主要机制。 由于NIP在版本化存储库中被作为文本文件维护,因此其修订历史记录就是功能提议的历史记录 + +- 对于NULS实施者,NIP是跟踪其实施进度的便捷手段。 理想情况下,每个功能的维护者都会列出他们已实现的NIP。 这将为用户提供一种方便的方法来了解某个功能或库的当前状态。 + +## 获取所有NIP + +通过NULS的github可以获取所有的NIP,github地址为:[https://github.com/nuls-io/NIPs](https://github.com/nuls-io/NIPs) \ No newline at end of file diff --git a/docs/zh/learn/NULSExplorerGuide.md b/docs/zh/learn/NULSExplorerGuide.md new file mode 100755 index 00000000..b725e14b --- /dev/null +++ b/docs/zh/learn/NULSExplorerGuide.md @@ -0,0 +1,111 @@ +# NULS浏览器使用指南 + +首先进入[NULS Explore](https://nulscan.io) + +## 什么是NULS Explorer + +​ NULS浏览器是NULS核心团队开发的一个图形化的用户界面,为您提供与NULS区块链交互。通过NULS浏览器,您可以浏览NULS区块链的基本信息、已添加到NULS区块链中的区块、链上的交易、账户、共识及智能合约等相关信息. + +![1552373134638](./explorer/1552373134638.png) + +## 搜索 + +​ 如果您想精确搜索某区块、交易、地址等信息,可以通过NULS Explorer首页或其他页面顶部导航栏中的搜索框进行搜索 + +![20190312145034](./explorer/20190312145034.png) + +![20190312145056](./explorer/20190312145056.png) + +## 共识奖励计算器 + +​ NULS区块链使用的是POC共识机制,您可以通过锁定一定数目(2000-500000)的NULS进行挖矿。NULS Explorer提供了共识奖励计算器,供您计算参与委托和创建节点的日、周、月、年奖励。共识奖励计算器中的参数都自带默认值,您可以随意进行修改计算(符合参数取值范围)。 + +![20190312150103](./explorer/20190312150103.png) + +![20190312150047](./explorer/20190312150047.png) + +## 区块 + +​ 在NULS Explorer中,您可以通过导航栏“区块”进入区块页面,区块列表中分页显示NULS链全部区块(高度、时间、交易数量、出块节点、区块大小、块奖励),可以通过列表右上角的“隐藏共识奖励区块”对列表进行筛选(过滤只有共识奖励的区块)。 + +![20190312151157](./explorer/20190312151157.png) + +如果您需要查看某个区块的更多信息,直接点击该区块高度(或搜索框输入高度进行搜索),将跳转至区块详情页面看到该区块更为详细的参数信息。 + +![20190312151528](./explorer/20190312151528.png) + +PS:区块列表中的出块节点、区块详情中的出块节点、打包地址、TXID都可以点击跳转至对应的详情页面。 + +## 账户资产 + +​ 在NULS Explorer中,您可以通过导航栏的“账户”进入账户页面,账户列表显示NULS区块链中所有持有NULS的账户地址信息(地址、总计、总收入、总支出),列表中“总计”列可以进行排序(默认从大到小)。 + +![20190312152642](./explorer/20190312152642.png) + +如果您需要获取某个地址的更多信息,直接点击列表中的地址(或搜索框输入地址进行搜索),将跳转至地址详情页面,展示更多该地址的参数信息。 + +![20190312153112](./explorer/20190312153112.png) + +## 交易 + +​ NULS Explorer中,您可以通过导航栏的“交易”进入交易页面(也可以通过首页“14天NULS交易历史”图表右上角的“更多”进入该页面),该页面上半部一图表方式显示交易历史数量,下部分以列表显示NULS区块链的全部交易,可以进行筛选和一次共识奖励交易。 + +![20190312153758](./explorer/20190312153758.png) + +​ 当您需要查看某个交易的详细信息时,您可以点击交易列表中的TXID(或者在导航栏中的搜索框输入该交易的TXID进行搜索)进入该交易的详情页面,获取该交易的更多信息。 + +![20190312154059](./explorer/20190312154059.png) + +## 共识 + +​ 在NULS Explorer中,您可以通过导航栏的“共识”进入共识页面(也可以通过点击首页的“共识节点”)。在共识页面,上部分显示NULS区块链的全网委托信息(图表),下部分显示节点信息和轮次信息。 + +![20190312154512](./explorer/20190312154512.png) + +### 节点信息 + +​ 您可以对节点信息的进行视图切换、排序、筛选(节点类型、别名、地址、ID)。 + +![20190312154925](./explorer/20190312154925.png) + +如需查看某个节点的更多信息,可以点击节点进入详情页面(运行信息、基本信息、出块列表、当前委托信息、历史委托信息) + +![20190312155458](./explorer/20190312155458.png) + +### 轮次信息 + +​ 轮次信息显示当前轮次的信息和轮次列表(轮次、时间区间、出块节点数、红/黄牌、正常出块节点、丢块率) + +![20190312155710](./explorer/20190312155710.png) + +您可以点击轮次列表中的轮次查看该轮次的出块详情(首页的区块动图可以点击进入当前轮次详情页面),详情页面将展示更多更详细的轮次信息。 + +![20190312160126](./explorer/20190312160126.png) + +## 合约 + +​ 在NULS Explorer中,您可以通过导航栏的“合约”进入合约页面,合约页面有全部合约和NRC-20合约。所有合约列表右上角有“隐藏NRC-20合约”,打开开关即可隐藏NRC-20合约。 + +![20190312160629](./explorer/20190312160629.png) + +如果你需要查看合约的详情,直接点击列表中的合约地址即可进入合约详情页面(基本信息、交易列表、代码、方法)。 + +![20190312160828](./explorer/20190312160828.png) + +### 代币详情 + +​ 如果你需要查询NRC-20代币的信息,可以切换到NRC-20列表,点击通证的缩写,或者进入NRC-20合约详情页面点击基本信息中的“通证”。 + +![20190312162211](./explorer/20190312162211.png) + +### 合约认证 + +​ 在新版的NULS Explorer中,我们新增了合约代码认证的功能,极大地增强了合约的安全性。您可以在合约列表中直接点击状态列的未认证跳转至代码认证页面,或者进入合约详情页面点击代码,进行合约代码认证,您只需要上传该合约的压缩包即可,会自行认证返回结果。 + +![20190312161634](./explorer/20190312161634.png) + +## 链接 + +​ NULS Explorer底部footer提供了一些链接,包含NULS官网、NULS GitHub、NULS网页轻钱包、NULS社区。 + +![20190312162707](./explorer/20190312162707.png) \ No newline at end of file diff --git a/docs/zh/learn/NULSNav.md b/docs/zh/learn/NULSNav.md new file mode 100644 index 00000000..4d9e1d6d --- /dev/null +++ b/docs/zh/learn/NULSNav.md @@ -0,0 +1,3 @@ +# NULS 导航 + + \ No newline at end of file diff --git a/docs/zh/learn/NULSTransaction.md b/docs/zh/learn/NULSTransaction.md new file mode 100644 index 00000000..1950fa30 --- /dev/null +++ b/docs/zh/learn/NULSTransaction.md @@ -0,0 +1,14 @@ +# NULS交易指南 + +## 火币交易使用指南 +- 中文:[https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432](https://huobiglobal.zendesk.com/hc/zh-cn/categories/115000389432) +- English:[https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432](https://huobiglobal.zendesk.com/hc/en-us/categories/115000389432) + +## 币安交易使用指南 +- 中文:[https://support.binance.com/hc/zh-cn/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) +- English:[https://support.binance.com/hc/en-us/categories/115000056052](https://support.binance.com/hc/zh-cn/categories/115000056052) + +## OKEx交易使用指南 + +- 中文:[https://support.okex.com/hc/zh-cn/categories/115000275231](https://support.okex.com/hc/zh-cn/categories/115000275231) +- English:[https://support.okex.com/hc/en-us/categories/115000275231](https://support.okex.com/hc/en-us/categories/115000275231) \ No newline at end of file diff --git a/docs/zh/learn/README.md b/docs/zh/learn/README.md new file mode 100644 index 00000000..ce014d8d --- /dev/null +++ b/docs/zh/learn/README.md @@ -0,0 +1,10 @@ +# 欢迎来到NULS + + +> NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动 + +NULS文档库是NULS所有文档的合集,在这里你可以获取NULS相关的技术手册,了解NULS社区以及查看用户操作手册等等 + +## NULS2.0 Beta版本已发布 + +[前往体验](/zh/NULS2.0/) \ No newline at end of file diff --git a/docs/zh/learn/clientWalletGuide.md b/docs/zh/learn/clientWalletGuide.md new file mode 100644 index 00000000..e43415c8 --- /dev/null +++ b/docs/zh/learn/clientWalletGuide.md @@ -0,0 +1,239 @@ +# 客户端钱包使用指南 +## 客户端 +### 获取 + +​ 在NULS官网(nuls.io)下载钱包客户端后运行程序。 + +![1547434994872](./images/1547434994872.png) + +### 安装 + +​ NULS钱包客户端是绿色免安装的,文件解压之后直接点击文件夹里的exe应用程序就可以进入客户端界面。 + + + +## 账户 + +### 创建账户 + +#### 钱包无账户时创建账户 + +​ 钱包语言已切换为中文,开始创建自己的账户。点击顶部菜单的“钱包”开始“创建账户”,界面如图1: + +![1547458467571](./images/1547458467571.png) + +##### 创建有密码的账户 + +​ 点击“创建账户”之后,首先设置密码,输入两次密码一致,注意密码规则:8-20位字符,需包含字母和数字。 + +然后点击“确定”,界面如图2: + +![1547458489793](./images/1547458489793.png) + +​ **PS:账户密码一定要认真保存,丢失后将无法进行转账和共识等关键操作。** + +##### 创建不带密码的账户 + +​ 点击“创建账户”后,弹出设置密码窗口,直接点击“此账户不需要密码”即可创建无密码账户。 + +#### 钱包有账户时创建账户 + +​ 点击顶部菜单的钱包,进入钱包页面后,点击“账户管理”图标(见图3): + +![1547436510741](./images/1547436510741.png) + +​ 进入账户管理界面之后,点击账户列表右上方的“+”(见图4),进入创建或导入账户界面(见下图5)。 + +![1547436748834](./images/1547436748834.png) + +![1547436768246](./images/1547436768246.png) + +​ 选择“创建账户”,之后的操作请参照“**创建有密码账户**”和“**创建不带密码账户**”。 + +### 备份账户 + +#### 备份入口 + +​ 账户创建成功之后,此时需要立即进行账户备份,以保证账户资产安全。 + +- 方式一:点击顶部菜单中的“设置”,进入设置页面之后,点击“账户备份”按钮(见图6),进入账户管理界面(如图7)。 + +![1547437357998](./images/1547437357998.png) + +![1547437427946](./images/1547437427946.png) + +- 方式二:点击顶部菜单“钱包”,再点击“账户管理”图标,进入账户管理界面(图7)。 +- 方式三:钱包地址创建成功后,直接在完成界面进行备份,设置密码的地址备份界面(图8),没有设置密码的地址备份界面(图9)。 + +![1547445305902](./images/1547445305902.png) + +![1547445221113](./images/1547445221113.png) + +- 当账户已经设置密码,点击“备份”,弹出密码确认框,输入正确账户密码之后进入钱包备份界面(图10),可进行Keystore备份和私钥备份; +- 当账户未设置密码,点击“备份”,直接跳转至账户备份界面(图11),只能进行Keystore备份。 + +![1547437842317](./images/1547437842317.png) + +![1547437878443](./images/1547437878443.png) + +#### 明文私钥备份 + +​ 进入已经设置密码账户备份界面,点击“明文私钥备份”,弹出私钥备份窗口,然后点击“复制”按钮(图12),提示复制成功。 + +![1547458691614](./images/1547458691614.png) + +#### Keystore备份 + +​ 点击“Keystore备份”,直接显示Keystore保存路径(图13),在该路径下可以查看Keystore备份文件。 + +![1547458844211](./images/1547458844211.png) + +### 导入账户 + +#### 钱包中无账户时导入账户 + +- 点击顶部菜单的“钱包”,选择“导入账户”(图14); +- 进入导入账户页面(图15); +- 选择备份时的明文私钥或者Keystore文件进行导入,将备份账户导入钱包。 + +![1547459086013](./images/1547459086013.png) + +![1547459110975](./images/1547459110975.png) + +#### 钱包中已有账户时导入账户 + + - 如果钱包中已有账户地址,点击顶部菜单的“钱包”进入钱包界面; + - 点击钱包页面的“账户管理”图标(图16)进入账户管理界面(图17); + - 点击账户管理界面右上角的“+”进入创建或导入账户界面(图18),选择导入账户进入导入账户界面(图19) + - 选择明文私钥(导入时可以设置密码,也可以不设置密码)或者Keystore文件(如果备份Keystore文件是账户已经设置了密码,则导入的时候需要进行密码确认才能成功导入)进行导入,将已有的账户导入钱包。 + +![1547459677163](./images/1547459677163.png) + +![1547459708942](./images/1547459708942.png) + +![1547459737912](./images/1547459737912.png) + +![1547459824098](./images/1547459824098.png) + +### 管理账户 + +- 在钱包界面,点击账户管理图标进入账户管理界面,此界面展示了钱包的所有账户信息,可花费NULS对账户设置别名(图20),一旦设置便不可更改。 +- 该界面也可以移除和备份账户,备份流程见“备份账户”。 +- 该界面可以进入创建或导入账户界面,其流程与“创建账户”、“导入账户”一致。 +- 该界面可以对没有密码的账户进行密码设置,对已有密码的账户可以进行密码修改(具体流程见“修改密码”、“设置密码”),账户管理界面如图21。 + +![1547461252921](./images/1547461252921.png) + +![1547461277501](./images/1547461277501.png) + +​ 账户管理界面还可以对已有账户设置备注(图22) + +![1547461383782](./images/1547461383782.png) + +### 交易 + +- 钱包首页展示了当前账户的资产情况,包括总额、可用和冻结; +- 可以通过账户地址的下拉框切换不同账户查看账户信息 +- 在账户资产页面,点击资产后面的“转账”(图23)进入转账界面(图24)。 + +![1547460181242](./images/1547460181242.png) + +![1547460237710](./images/1547460237710.png) + +- 进入转账界面之后,转出地址可以通过下拉列表进行选择; +- 输入收款地址(可以点击收款地址输入框后面的头像图标选择通讯录中已经保存的联系人,选择之后地址自动填入收款地址输入框); +- 输入正确的转账金额(备注可选填); +- 点击确认转账即可进行转账(若转出地址有密码,需要输入正确的密码发起转账交易); +- 转账完成之后进入转出地址交易记录界面,可以查看该交易进度(图25)。 + +![1547460590047](./images/1547460590047.png) + +​ 点击txid可以查看转账详情,界面如图26。 + +![1547460865338](./images/1547460865338.png) + +​ + +## 共识 +### 创建共识节点 + +​ 点击钱包顶部菜单的“共识”,进入共识界面,该界面展示了共识的总览信息,包括全网的委托总额和节点总数以及自己的参与共识情况,界面下方展示了全网所有的共识节点和自己创建、委托的共识节点信息(图27) + +![20190115102249](./images/20190115102249.png) + +- 当前账户(未受红牌惩罚)还未创建节点,点击我的总体情况中的创建(图27中红框标识),便可进入创建节点界面(图28) +- 输入正确的必填信息,考虑到安全问题,出块地址必须使用自己创建的其他账户地址,创建节点的保证金范围:20000-200000NULS,代理佣金比例(10%-100%)一旦确定便不可更改 +- 点击确定经过密码确认之后便成功创建节点,节点创建成功后返回共识页面(图27)。 + +![20190115103504](./images/20190115103504.png) + +**PS:创建节点时,出块地址不能设置密码,节点正常出块过程中,出块地址不能设置密码,否则无法正常出块并影响节点信用值** + +### 注销共识节点 + +​ 账户自己创建的节点可以进行注销(节点注销之后,创建节点时的保证金会被冻结3天),点击钱包顶端菜单“共识”进入共识界面(图29),点击我的总体情况中创建节点后面的查看(图29红框标识)。 + +![20190115104427](./images/20190115104427.png) + +​ 进入节点详情页面(图30),点击“注销节点”按钮,确认密码之后则节点注销成功。 + +![20190115104911](./images/20190115104911.png) + +### 参与共识 + +- 在共识界面中,我的总体情况点击委托节点后面的“委托”入口(也可以直接点击节点列表中的某个未委托节点进入); +- 在参与共识界面(图31)显示节点的信息(节点ID、节点来源、佣金比例、保证金、参与人数、信用值、委托数量); +- 可以在该界面直接选择委托地址,输入保证金参与委托(需要确认密码)。 + +![20190115110413](./images/20190115110413.png) + +### 追加和退出共识 + +​ 在共识界面中,我的共识table页中点击某个节点进入节点详情(图32),此页面可以进行追加委托保证金和选择退出共识。 + +![20190115110806](./images/20190115110806.png) + +## 设置 + +​ 点击顶部菜单的“设置”,进入系统设置界面(图33),可以对系统语言、通讯录、密码进行设置和账户备份、版本升级、退出系统。 + +![20190115111229](./images/20190115111229.png) + +### 语言切换 + +​ 系统设置界面中可以对系统语言进行中英文切换(图34)。 + +![20190115111447](./images/20190115111447.png) + +### 查看通讯录 + +​ 系统设置界面可以查看通讯录,在通讯录界面(图35)可以对通讯录进行新增、编辑和删除操作。 + +![20190115111721](./images/20190115111721.png) + +### 设置/修改密码 + +#### 设置密码 + +​ 在系统设置中,对为设置密码的账户地址可以进行密码设置(图36),设置密码需要符合密码规则。 + +![20190115112217](./images/20190115112217.png) + +#### 修改密码 + +​ 在系统设置中,对已经设置密码的账户地址可以进行密码修改(图37),修改密码时,需要输入账户地址当前的正确密码,修改的密码需要符合密码规则。 + +![20190115112121](./images/20190115112121.png) + +### 版本升级 + +​ 在系统设置中,当最新版本号高于当前版本号时,可以直接点击“最新版本”(图38),对系统进行升级。 + +![20190115112741](./images/20190115112741.png) + +### 退出系统 + +​ 在系统设置界面进行退出操作,直接点击“退出系统”按钮(图38)即可。 + + + diff --git a/docs/zh/learn/communityImages/wps55B5.tmp.jpg b/docs/zh/learn/communityImages/wps55B5.tmp.jpg new file mode 100644 index 00000000..7eebbade Binary files /dev/null and b/docs/zh/learn/communityImages/wps55B5.tmp.jpg differ diff --git a/docs/zh/learn/communityImages/wps96E5.tmp.jpg b/docs/zh/learn/communityImages/wps96E5.tmp.jpg new file mode 100644 index 00000000..bb350529 Binary files /dev/null and b/docs/zh/learn/communityImages/wps96E5.tmp.jpg differ diff --git a/docs/zh/learn/communityImages/wpsA8AA.tmp.jpg b/docs/zh/learn/communityImages/wpsA8AA.tmp.jpg new file mode 100644 index 00000000..342f1ae4 Binary files /dev/null and b/docs/zh/learn/communityImages/wpsA8AA.tmp.jpg differ diff --git a/docs/zh/learn/communityImages/wpsBF9.tmp.jpg b/docs/zh/learn/communityImages/wpsBF9.tmp.jpg new file mode 100644 index 00000000..14cad495 Binary files /dev/null and b/docs/zh/learn/communityImages/wpsBF9.tmp.jpg differ diff --git a/docs/zh/learn/communityImages/wpsD101.tmp.jpg b/docs/zh/learn/communityImages/wpsD101.tmp.jpg new file mode 100644 index 00000000..55ede8dd Binary files /dev/null and b/docs/zh/learn/communityImages/wpsD101.tmp.jpg differ diff --git a/docs/zh/learn/communityImages/wpsFCF4.tmp.jpg b/docs/zh/learn/communityImages/wpsFCF4.tmp.jpg new file mode 100644 index 00000000..40a0bf70 Binary files /dev/null and b/docs/zh/learn/communityImages/wpsFCF4.tmp.jpg differ diff --git a/docs/zh/learn/explorer/1552373134638.png b/docs/zh/learn/explorer/1552373134638.png new file mode 100755 index 00000000..1910130b Binary files /dev/null and b/docs/zh/learn/explorer/1552373134638.png differ diff --git a/docs/zh/learn/explorer/20190312145034.png b/docs/zh/learn/explorer/20190312145034.png new file mode 100755 index 00000000..1407deea Binary files /dev/null and b/docs/zh/learn/explorer/20190312145034.png differ diff --git a/docs/zh/learn/explorer/20190312145056.png b/docs/zh/learn/explorer/20190312145056.png new file mode 100755 index 00000000..79b8a3b4 Binary files /dev/null and b/docs/zh/learn/explorer/20190312145056.png differ diff --git a/docs/zh/learn/explorer/20190312150047.png b/docs/zh/learn/explorer/20190312150047.png new file mode 100755 index 00000000..cee00f05 Binary files /dev/null and b/docs/zh/learn/explorer/20190312150047.png differ diff --git a/docs/zh/learn/explorer/20190312150103.png b/docs/zh/learn/explorer/20190312150103.png new file mode 100755 index 00000000..929027f1 Binary files /dev/null and b/docs/zh/learn/explorer/20190312150103.png differ diff --git a/docs/zh/learn/explorer/20190312151157.png b/docs/zh/learn/explorer/20190312151157.png new file mode 100755 index 00000000..853c0840 Binary files /dev/null and b/docs/zh/learn/explorer/20190312151157.png differ diff --git a/docs/zh/learn/explorer/20190312151528.png b/docs/zh/learn/explorer/20190312151528.png new file mode 100755 index 00000000..d72ae1cc Binary files /dev/null and b/docs/zh/learn/explorer/20190312151528.png differ diff --git a/docs/zh/learn/explorer/20190312152642.png b/docs/zh/learn/explorer/20190312152642.png new file mode 100755 index 00000000..faf5c420 Binary files /dev/null and b/docs/zh/learn/explorer/20190312152642.png differ diff --git a/docs/zh/learn/explorer/20190312153112.png b/docs/zh/learn/explorer/20190312153112.png new file mode 100755 index 00000000..95cc8b48 Binary files /dev/null and b/docs/zh/learn/explorer/20190312153112.png differ diff --git a/docs/zh/learn/explorer/20190312153758.png b/docs/zh/learn/explorer/20190312153758.png new file mode 100755 index 00000000..1dc120d2 Binary files /dev/null and b/docs/zh/learn/explorer/20190312153758.png differ diff --git a/docs/zh/learn/explorer/20190312154059.png b/docs/zh/learn/explorer/20190312154059.png new file mode 100755 index 00000000..310e2c89 Binary files /dev/null and b/docs/zh/learn/explorer/20190312154059.png differ diff --git a/docs/zh/learn/explorer/20190312154512.png b/docs/zh/learn/explorer/20190312154512.png new file mode 100755 index 00000000..0615d586 Binary files /dev/null and b/docs/zh/learn/explorer/20190312154512.png differ diff --git a/docs/zh/learn/explorer/20190312154925.png b/docs/zh/learn/explorer/20190312154925.png new file mode 100755 index 00000000..2bcba622 Binary files /dev/null and b/docs/zh/learn/explorer/20190312154925.png differ diff --git a/docs/zh/learn/explorer/20190312155458.png b/docs/zh/learn/explorer/20190312155458.png new file mode 100755 index 00000000..0a80bdab Binary files /dev/null and b/docs/zh/learn/explorer/20190312155458.png differ diff --git a/docs/zh/learn/explorer/20190312155710.png b/docs/zh/learn/explorer/20190312155710.png new file mode 100755 index 00000000..39e8714c Binary files /dev/null and b/docs/zh/learn/explorer/20190312155710.png differ diff --git a/docs/zh/learn/explorer/20190312160126.png b/docs/zh/learn/explorer/20190312160126.png new file mode 100755 index 00000000..cdfd1a89 Binary files /dev/null and b/docs/zh/learn/explorer/20190312160126.png differ diff --git a/docs/zh/learn/explorer/20190312160629.png b/docs/zh/learn/explorer/20190312160629.png new file mode 100755 index 00000000..f6a569bf Binary files /dev/null and b/docs/zh/learn/explorer/20190312160629.png differ diff --git a/docs/zh/learn/explorer/20190312160828.png b/docs/zh/learn/explorer/20190312160828.png new file mode 100755 index 00000000..ce9177c8 Binary files /dev/null and b/docs/zh/learn/explorer/20190312160828.png differ diff --git a/docs/zh/learn/explorer/20190312161634.png b/docs/zh/learn/explorer/20190312161634.png new file mode 100755 index 00000000..729dc6b1 Binary files /dev/null and b/docs/zh/learn/explorer/20190312161634.png differ diff --git a/docs/zh/learn/explorer/20190312162032.png b/docs/zh/learn/explorer/20190312162032.png new file mode 100755 index 00000000..6973103c Binary files /dev/null and b/docs/zh/learn/explorer/20190312162032.png differ diff --git a/docs/zh/learn/explorer/20190312162211.png b/docs/zh/learn/explorer/20190312162211.png new file mode 100755 index 00000000..b061b8c5 Binary files /dev/null and b/docs/zh/learn/explorer/20190312162211.png differ diff --git a/docs/zh/learn/explorer/20190312162707.png b/docs/zh/learn/explorer/20190312162707.png new file mode 100755 index 00000000..e709f793 Binary files /dev/null and b/docs/zh/learn/explorer/20190312162707.png differ diff --git a/docs/zh/learn/howToContribute.md b/docs/zh/learn/howToContribute.md new file mode 100644 index 00000000..99987fc9 --- /dev/null +++ b/docs/zh/learn/howToContribute.md @@ -0,0 +1,44 @@ +# 如何做贡献 +> NULS的发展是与社区分不开的,需要社区成员一起参与进来。我们提供了不同的方式让社区成员参与,大家可以选择自己擅长的方式来为NULS做贡献。对每位贡献者,在征得其同意之后,会公示贡献者名字(若拥有节点,我们也会附上其节点名) +## 加入主网开发 +虽然主网现在处于稳定运行的状态,但为了应对变化,主网开发仍然在进行中。我们需要社区的帮助来解决主网开发中面临的挑战,一起完善NULS这个区块链基础设施。我们呼吁社区的开发者能够加入我们,贡献自己的一份力量,同时你的付出也会得到应有的奖励。 + +- 如何加入技术社区:[https://nuls.io/developer](https://nuls.io/developer) +- NULS Github:[https://github.com/nuls-io](https://github.com/nuls-io) +## 报告错误 +在软件开发过程中,尽管有严格的测试,但我们还是无法避免程序中出现bug,因此如果你在使用我们应用或者进行开发的过程中发现了bug,请及时反馈给我们,我们会积极进行处理。反馈bug的方式有三种: +- 通过在[社区论坛](https://nuls.community/)回帖进行反馈 + - 主网:https://nuls.community/d/135-collect-the-bugs-of-the-mainnet-bugs + - 测试网:https://nuls.community/d/134-collect-the-bugs-of-the-testnet-bugs + +- 发送邮件到support@nuls.io +- 直接反馈给社区经理或运营人员 + +## 编写文档 +NULS制定了文档编写激励计划,邀请社区一起编写NULS相关文档,并会根据社区成员的付出给予相应的奖励。 + +## 翻译文档 +NULS作为一个全球性区块链开源社区项目,需要大量的中英双语文档,如果你是这方面的专业人士,那么我们十分需要你的帮助。 + +## 贡献者名单 + +> 排名不分先后,仅按照字母排序 + +名字|邮箱| 节点别名/ID +:--|:--|:-- +Angang Tang | tangangang@nuls.io | -- +Albert | albert@nuls.io | -- +Charlie Li | lichao@nuls.io | --- +Cody Lan | lanjinsheng@nuls.io | --- +Davi Yang | davi@nuls.io | --- +Yuanchen Jiang | jiangyuanchen@nuls.io | --- +Yifeng Qin | qinyifeng@nuls.io |-- +Niels | niels@nuls.io | niels +Pierre Luo | luohao@nuls.io |--- +Pen Luo | pen@nuls.io |--- +Siwei | 13809668344@139.com |siwei +Vivi Zhou | zhouwei@nuls.io |--- + + + + diff --git a/docs/zh/learn/images/1547434994872.png b/docs/zh/learn/images/1547434994872.png new file mode 100644 index 00000000..4f3d45f8 Binary files /dev/null and b/docs/zh/learn/images/1547434994872.png differ diff --git a/docs/zh/learn/images/1547435278942.png b/docs/zh/learn/images/1547435278942.png new file mode 100644 index 00000000..c07cf084 Binary files /dev/null and b/docs/zh/learn/images/1547435278942.png differ diff --git a/docs/zh/learn/images/1547435629637.png b/docs/zh/learn/images/1547435629637.png new file mode 100644 index 00000000..25400187 Binary files /dev/null and b/docs/zh/learn/images/1547435629637.png differ diff --git a/docs/zh/learn/images/1547435828304.png b/docs/zh/learn/images/1547435828304.png new file mode 100644 index 00000000..9a3f3333 Binary files /dev/null and b/docs/zh/learn/images/1547435828304.png differ diff --git a/docs/zh/learn/images/1547436510741.png b/docs/zh/learn/images/1547436510741.png new file mode 100644 index 00000000..bea8562b Binary files /dev/null and b/docs/zh/learn/images/1547436510741.png differ diff --git a/docs/zh/learn/images/1547436748834.png b/docs/zh/learn/images/1547436748834.png new file mode 100644 index 00000000..da026135 Binary files /dev/null and b/docs/zh/learn/images/1547436748834.png differ diff --git a/docs/zh/learn/images/1547436768246.png b/docs/zh/learn/images/1547436768246.png new file mode 100644 index 00000000..98eb650f Binary files /dev/null and b/docs/zh/learn/images/1547436768246.png differ diff --git a/docs/zh/learn/images/1547437357998.png b/docs/zh/learn/images/1547437357998.png new file mode 100644 index 00000000..0759e9f8 Binary files /dev/null and b/docs/zh/learn/images/1547437357998.png differ diff --git a/docs/zh/learn/images/1547437427946.png b/docs/zh/learn/images/1547437427946.png new file mode 100644 index 00000000..39b0ad28 Binary files /dev/null and b/docs/zh/learn/images/1547437427946.png differ diff --git a/docs/zh/learn/images/1547437842317.png b/docs/zh/learn/images/1547437842317.png new file mode 100644 index 00000000..8f0f5e33 Binary files /dev/null and b/docs/zh/learn/images/1547437842317.png differ diff --git a/docs/zh/learn/images/1547437878443.png b/docs/zh/learn/images/1547437878443.png new file mode 100644 index 00000000..f3b31d05 Binary files /dev/null and b/docs/zh/learn/images/1547437878443.png differ diff --git a/docs/zh/learn/images/1547445165880.png b/docs/zh/learn/images/1547445165880.png new file mode 100644 index 00000000..d35d9fd5 Binary files /dev/null and b/docs/zh/learn/images/1547445165880.png differ diff --git a/docs/zh/learn/images/1547445221113.png b/docs/zh/learn/images/1547445221113.png new file mode 100644 index 00000000..ce0556da Binary files /dev/null and b/docs/zh/learn/images/1547445221113.png differ diff --git a/docs/zh/learn/images/1547445290715.png b/docs/zh/learn/images/1547445290715.png new file mode 100644 index 00000000..98549fdc Binary files /dev/null and b/docs/zh/learn/images/1547445290715.png differ diff --git a/docs/zh/learn/images/1547445305902.png b/docs/zh/learn/images/1547445305902.png new file mode 100644 index 00000000..1a61d124 Binary files /dev/null and b/docs/zh/learn/images/1547445305902.png differ diff --git a/docs/zh/learn/images/1547458467571.png b/docs/zh/learn/images/1547458467571.png new file mode 100644 index 00000000..b70de5be Binary files /dev/null and b/docs/zh/learn/images/1547458467571.png differ diff --git a/docs/zh/learn/images/1547458489793.png b/docs/zh/learn/images/1547458489793.png new file mode 100644 index 00000000..0d0f6751 Binary files /dev/null and b/docs/zh/learn/images/1547458489793.png differ diff --git a/docs/zh/learn/images/1547458691614.png b/docs/zh/learn/images/1547458691614.png new file mode 100644 index 00000000..cfdea2db Binary files /dev/null and b/docs/zh/learn/images/1547458691614.png differ diff --git a/docs/zh/learn/images/1547458844211.png b/docs/zh/learn/images/1547458844211.png new file mode 100644 index 00000000..7e97a3fc Binary files /dev/null and b/docs/zh/learn/images/1547458844211.png differ diff --git a/docs/zh/learn/images/1547459086013.png b/docs/zh/learn/images/1547459086013.png new file mode 100644 index 00000000..f58c6b4a Binary files /dev/null and b/docs/zh/learn/images/1547459086013.png differ diff --git a/docs/zh/learn/images/1547459110975.png b/docs/zh/learn/images/1547459110975.png new file mode 100644 index 00000000..21a69dc7 Binary files /dev/null and b/docs/zh/learn/images/1547459110975.png differ diff --git a/docs/zh/learn/images/1547459677163.png b/docs/zh/learn/images/1547459677163.png new file mode 100644 index 00000000..d64ba1b9 Binary files /dev/null and b/docs/zh/learn/images/1547459677163.png differ diff --git a/docs/zh/learn/images/1547459708942.png b/docs/zh/learn/images/1547459708942.png new file mode 100644 index 00000000..9fe25f6a Binary files /dev/null and b/docs/zh/learn/images/1547459708942.png differ diff --git a/docs/zh/learn/images/1547459737912.png b/docs/zh/learn/images/1547459737912.png new file mode 100644 index 00000000..4a5aeb26 Binary files /dev/null and b/docs/zh/learn/images/1547459737912.png differ diff --git a/docs/zh/learn/images/1547459824098.png b/docs/zh/learn/images/1547459824098.png new file mode 100644 index 00000000..8984ed52 Binary files /dev/null and b/docs/zh/learn/images/1547459824098.png differ diff --git a/docs/zh/learn/images/1547460181242.png b/docs/zh/learn/images/1547460181242.png new file mode 100644 index 00000000..00f43d7b Binary files /dev/null and b/docs/zh/learn/images/1547460181242.png differ diff --git a/docs/zh/learn/images/1547460237710.png b/docs/zh/learn/images/1547460237710.png new file mode 100644 index 00000000..30502ba1 Binary files /dev/null and b/docs/zh/learn/images/1547460237710.png differ diff --git a/docs/zh/learn/images/1547460590047.png b/docs/zh/learn/images/1547460590047.png new file mode 100644 index 00000000..156e6f19 Binary files /dev/null and b/docs/zh/learn/images/1547460590047.png differ diff --git a/docs/zh/learn/images/1547460865338.png b/docs/zh/learn/images/1547460865338.png new file mode 100644 index 00000000..7249898d Binary files /dev/null and b/docs/zh/learn/images/1547460865338.png differ diff --git a/docs/zh/learn/images/1547461252921.png b/docs/zh/learn/images/1547461252921.png new file mode 100644 index 00000000..4c2176c0 Binary files /dev/null and b/docs/zh/learn/images/1547461252921.png differ diff --git a/docs/zh/learn/images/1547461277501.png b/docs/zh/learn/images/1547461277501.png new file mode 100644 index 00000000..f76adc14 Binary files /dev/null and b/docs/zh/learn/images/1547461277501.png differ diff --git a/docs/zh/learn/images/1547461383782.png b/docs/zh/learn/images/1547461383782.png new file mode 100644 index 00000000..e4751450 Binary files /dev/null and b/docs/zh/learn/images/1547461383782.png differ diff --git a/docs/zh/learn/images/20190115102249.png b/docs/zh/learn/images/20190115102249.png new file mode 100644 index 00000000..3b5efab6 Binary files /dev/null and b/docs/zh/learn/images/20190115102249.png differ diff --git a/docs/zh/learn/images/20190115103504.png b/docs/zh/learn/images/20190115103504.png new file mode 100644 index 00000000..91f74f6b Binary files /dev/null and b/docs/zh/learn/images/20190115103504.png differ diff --git a/docs/zh/learn/images/20190115104427.png b/docs/zh/learn/images/20190115104427.png new file mode 100644 index 00000000..9d51ef03 Binary files /dev/null and b/docs/zh/learn/images/20190115104427.png differ diff --git a/docs/zh/learn/images/20190115104911.png b/docs/zh/learn/images/20190115104911.png new file mode 100644 index 00000000..b945d149 Binary files /dev/null and b/docs/zh/learn/images/20190115104911.png differ diff --git a/docs/zh/learn/images/20190115110413.png b/docs/zh/learn/images/20190115110413.png new file mode 100644 index 00000000..0e8536eb Binary files /dev/null and b/docs/zh/learn/images/20190115110413.png differ diff --git a/docs/zh/learn/images/20190115110806.png b/docs/zh/learn/images/20190115110806.png new file mode 100644 index 00000000..acc240d5 Binary files /dev/null and b/docs/zh/learn/images/20190115110806.png differ diff --git a/docs/zh/learn/images/20190115111229.png b/docs/zh/learn/images/20190115111229.png new file mode 100644 index 00000000..458a8b9b Binary files /dev/null and b/docs/zh/learn/images/20190115111229.png differ diff --git a/docs/zh/learn/images/20190115111447.png b/docs/zh/learn/images/20190115111447.png new file mode 100644 index 00000000..8ee2af6e Binary files /dev/null and b/docs/zh/learn/images/20190115111447.png differ diff --git a/docs/zh/learn/images/20190115111721.png b/docs/zh/learn/images/20190115111721.png new file mode 100644 index 00000000..77340c63 Binary files /dev/null and b/docs/zh/learn/images/20190115111721.png differ diff --git a/docs/zh/learn/images/20190115112121.png b/docs/zh/learn/images/20190115112121.png new file mode 100644 index 00000000..3ac2b58e Binary files /dev/null and b/docs/zh/learn/images/20190115112121.png differ diff --git a/docs/zh/learn/images/20190115112217.png b/docs/zh/learn/images/20190115112217.png new file mode 100644 index 00000000..93962f48 Binary files /dev/null and b/docs/zh/learn/images/20190115112217.png differ diff --git a/docs/zh/learn/images/20190115112741.png b/docs/zh/learn/images/20190115112741.png new file mode 100644 index 00000000..e09b34a0 Binary files /dev/null and b/docs/zh/learn/images/20190115112741.png differ diff --git a/docs/zh/learn/introduction.md b/docs/zh/learn/introduction.md new file mode 100644 index 00000000..f911c931 --- /dev/null +++ b/docs/zh/learn/introduction.md @@ -0,0 +1,25 @@ +# NULS是什么 + +### NULS是一个面向可定制化服务的区块链基础设施,由全球化开源社区推动 + +NULS设计的技术架构由微内核和功能模块组成,提出了弱化主链的全新思维,通过将事件和服务剥离,进而实现高度模块化的底层架构。同时,NULS制定了一套工业化区块链技术标准,遵循热插拔、模块化、平行扩展原则,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程以及链之间的交互 + +NULS于创立之初,即已提出模块化思维与多链并行基本架构,NULS秉承以“链”为核心的发展理念,着力打造核心产品“链工厂”。同时,NULS将通过跨链模块实现链之间的价值流通,打造区块链大生态 + +## 1 NULS的愿景 + +- 为企业级应用提供灵活易用的区块链技术支持 +- 突破区块链技术瓶颈,提供稳定、高效、高性能的网络运行环境 +- 通过降低开发和使用成本,推动区块链商业应用进程 +- 通过分布式网络布局,构建强大信用体系 +## 2.白皮书 +NULS白皮书是一个权威性的报告,它指出了NULS的目标是什么,以及我们打算如何实现它 + +[查看白皮书了解更多](https://nuls.io/api/v1/download/files/papers/white/NULS_whitepaper_zh_V1.0.pdf) + +## 3.黄皮书 + +NULS黄皮书是白皮书的技术详解版本,它深入研究了NULS的各个方面 + + +[查看黄皮书了解更多](https://nuls.io/api/v1/download/files/papers/yellow/NulsYellowpaper1.1.pdf) \ No newline at end of file diff --git a/docs/zh/learn/joinCCC.md b/docs/zh/learn/joinCCC.md new file mode 100644 index 00000000..b3184392 --- /dev/null +++ b/docs/zh/learn/joinCCC.md @@ -0,0 +1,68 @@ + +# 如何成为社区开发者 + +## 一、NULS简介 +NULS 是一个区块链公链项目,其致力于打造由社区驱动的一个真正开源、自我革新的区块链平台。NULS期望通过构建灵活易用的区块链基础设施,最大限度降低企业/个人使用区块链底层技术的难度。 +NULS技术社区,是由来自NULS社区的一批对NULS充满激情与梦想的技术开发人员构建而成。技术社区将和NULS核心开发团队共同搭建NULS底层,通过实现模块化、多链并行、跨链等机制,让企业/个人都可以通过简单配置定制自己的区块链。 + +在社区里我们坚持以下的理念: +- 平等 (Equal):技术社区与核心团队是平等关系,一起合作开发; +- 共建 (Synergetic):技术社区与核心开发团队共建技术底层,共同打造NULS生态; +- 共享 (Sharing): + - 社区共享NULS技术成果 + - 社区共享NULS发展红利 + - 社区共享NULS的影响力和名誉 + - 行业共享NULS带来的技术革新 + - 行业共享NULS推动行业发展的标准制定 +- 公平 (Fair):每个开发者的收益,依据的是其能力和贡献的大小,做到公平公正; +- 创新 (Innovative):强大的技术社区是迸发区块链创新思维的基本保障。 + +## 二、你是我们在寻找的TA吗? +NULS技术社区向所有开发者开放。 +如果你: +对区块链世界充满期待,希望用代码创造出新的世界。 + +请加入我们的技术社区电报群:[https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ](https://t.me/joinchat/HK7hw0uqJGC31heVAHKFyQ) +注意:我们不是寻求任务外包。任何你认为值得改进的地方,都是你可以发挥的空间。 + +## 三、我们能提供什么? +NULS团队会为技术社区的每一个为NULS项目作出贡献的开发者提供奖励,奖励的大小基于贡献的大小。 +目前,如果你能通过前期表现,加入技术社区核心开发团队(Code Craft Council),我们会为你创建一个节点,并委托20万NULS Token,节点奖励的50%部分将用于支持开发者(目前大约1500NULS/月),剩下50%会注入社区基金池。注:50%是初始值,后续调整由社区决定,我们会在社区进行公示。 + +## 四、我们的计划 +让造链变得容易! +首先,我们希望建立一个涵盖80%区块链底层技术的模块仓库。 +通过增加模块仓库的模块数量,我们将降低区块链行业的进入门槛,企业发链成本会更低,用户用链会更容易。我们相信,只有这样,区块链技术才能更加融入到日常生活中。 +我们正和技术社区一起,构建一个全新的架构——NULS2.0。新的架构将使NULS的模块能独立运行,模块之间低耦合的利用标准定义的接口进行交互。届时,任何开发者(不限开发语言),只需遵守NULS模块的标准,即可使用自己擅长的开发语言,开发自己所需的功能模块,丰富模块仓库。 +其次,基于模块仓库,NULS会推出一款杀手级的造链产品——“链工厂”。如果开发者很清楚自己开发的区块链的参数,比如共识机制、区块大小、出块时间等,即使他对底层技术不甚了解,也仅需4步,即可在几分钟内拥有一条自己的公链(当然联盟链和私链也是支持的),极大的缩短了目前公链开发少则半年多则1年的耗时。 +以上所有的工作,都将有技术社区的参与。如果你对我们的计划有任何的意见与建议,均可在技术社区中提出,展示你独到的见解。 +现在NULS技术社区有中西方开发者200余人,我们欢迎更多的开发者加入。你们将协助核心团队进行NULS底层的开发工作。 + +## 五、技术社区的现状: + +(1)我们一直认为NULS属于社区,NULS技术的长远发展离不开极具创造力的社区技术力量,在过去一年时间里我们很高兴能看到社区开发者自愿为NULS贡献自己的力量。其中来自英国的Josh为NULS开发了官网(nuls.io),来自法国的Moshe为NULS开发了区块链浏览器(nuls.world/)和轻钱包(nuls.world/wallet),来自玻利维亚的Berzeck正在参与NULS的底层开发工作。 + +(2)尽管如此,我们还有很多的工作尚待完成。我们会在本帖下方持续更新一个任务清单,该清单会包含NULS的设计、开发、改进等方面的工作。所有开发者都可以根据自己的能力和兴趣进行选择。 + +## 六、如何加入开发团队 +(1)为方便沟通,请先加入技术社区的Telegram群(见上),并阅读群置顶消息; + +(2)跟社区开发者Moshe进行初步沟通,简要介绍自己的经历、擅长的编程语言等,社区开发者会跟你交流一些技术相关信息,并了解你希望做些什么,这将决定你接下来的工作内容。 +同时我们强烈建议你通过下面的链接,去了解更多关于NULS的内容: + +- 官网:[https://nuls.io/](https://nuls.io/) +- 代码:[https://github.com/nuls-io/nuls](https://github.com/nuls-io/nuls) +- 开发者文档:[https://dev.nuls.io/docs/](https://dev.nuls.io/docs/) +- 社区论坛:[https://nuls.community](https://nuls.community) + +(3)你可以选择感兴趣并胜任的任务。届时,我们会让你加入各个开发小组,同其他开发人员一起工作。在这里,我们强烈建议你下载微信作为沟通交流工具: +[https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh](https://play.google.com/store/apps/details?id=com.tencent.mm&hl=zh) + +(4)在小组中,各小组leader会提供必要的文档资料以便开发者更快入手。同时,我们希望开发者们互相之间保持高效的沟通和交流,以便工作的开展。通过约1个月的工作,那些保持稳定工作状态、高质量产出的开发者可以向技术社区提出节点申请。 + +技术社区和核心团队经过仔细审核后,如果申请被批准,我们将为你创建一个节点(这将是你获得奖励的基础)。 + +## 七、查看任务清单 + +[任务清单](https://nuls.community/d/90-nuls)持续更新中 + diff --git a/docs/zh/learn/lightWalletGuide.md b/docs/zh/learn/lightWalletGuide.md new file mode 100644 index 00000000..f3c10af4 --- /dev/null +++ b/docs/zh/learn/lightWalletGuide.md @@ -0,0 +1,83 @@ +# 网页钱包使用指南 +## 访问钱包 +网页钱包地址:[https://wallet.nuls.io](https://wallet.nuls.io) +## 语言切换 +点击右上角,可以自由切换页面语言 +![](https://i.imgur.com/FPnAva0.jpg) +## 账户 +### 创建账户 +1.点击创建账户 +![](https://i.imgur.com/c3K28m8.jpg) +2.设置钱包密码、仔细阅读并勾选同意服务协议、点击创建账户 +![](https://i.imgur.com/s2iYP4P.jpg) +**注:创建好账户后,应立即进行备份,并将备份资料存放在安全的地方,否则有资产丢失的风险!** +### 备份账户 +1.点击Keystore备份 +![](https://i.imgur.com/RWJIsW8.jpg) +2.当您得到一个Keystore文件后,请点击备份完成 +![](https://i.imgur.com/vuv56b1.jpg) +### 导入账户 +1.点击导入账户 +![](https://i.imgur.com/wAgIdr8.jpg) +2.点击导入Keystore +![](https://i.imgur.com/AUpa10l.jpg) +3.选择你的Keystore文件后,点击打开 +![](https://i.imgur.com/E2qvUSq.jpg) +4.输入账户密码,点击确认 +![](https://i.imgur.com/wM1KNqI.jpg) + +## 设置 +点击菜单栏的设置,您可以根据需求,对当前账户进行备份、修改密码、设置别名 +![](https://i.imgur.com/LiBaeqx.jpg) +### 账户备份 +具体步骤与备份账户相同 +### 修改密码 +输入原密码及新密码,点击确认 +![](https://i.imgur.com/RaYCuBn.jpg) +### 设置别名 +输入别名,并确保有足够的余额,点击确定 +![](https://i.imgur.com/9HW0ZCE.jpg) + +## 交易 +1.点击转账 +![](https://i.imgur.com/a01jlHa.jpg) +2.输入收款地址、转账金额,手续费根据全网交易情况增减,一般默认即可 +![](https://i.imgur.com/V9kwcHp.jpg) +3.输入账户密码,点击确认 +![](https://i.imgur.com/zz4sO0r.jpg) +4.查看交易记录,状态为“已确认”则表示交易成功 +![](https://i.imgur.com/TtZHe22.jpg) + +## 共识 +点击菜单栏的“共识”可以查看共识信息,参与共识、追加共识、退出共识等操作 +![](https://i.imgur.com/Xg1VR2v.jpg) +### 参与共识 +1.点击“加入委托” +![](https://i.imgur.com/vXBiL9X.jpg) +2.选择节点,也可以通过搜索节点名称,找到节点 +![](https://i.imgur.com/zz28Xe6.jpg) +3.输入委托金额,点击“确定委托” +![](https://i.imgur.com/u2u9cNR.jpg) +4.输入账户密码,点击确认 +### 追加共识 +1.点击我参与的共识节点 +![](https://i.imgur.com/VYBcQhR.jpg) +2.点击“追加” +![](https://i.imgur.com/MaQ7rsg.jpg) +3.输入委托金额,点击“确定委托” +4.输入账户密码,点击确认 +### 退出共识 +1.点击我参与的共识节点 +![](https://i.imgur.com/VYBcQhR.jpg) +2.点击“退出” +![](https://i.imgur.com/TyKOfub.jpg) +3.输入账户密码,点击确认 + +## 投票 +1.点击“投票”进入投票页面 +![](https://i.imgur.com/2m9ZTHT.jpg) +2.点击标题 +![](https://i.imgur.com/fWEVFrV.jpg) +3.根据投票规则,选择您支持的事项,点击“投票” +![](https://i.imgur.com/v9wFGqz.jpg) +4.输入账户密码,点击确认 \ No newline at end of file diff --git a/docs/zh/learn/lightWalletGuide/1.jpg b/docs/zh/learn/lightWalletGuide/1.jpg new file mode 100644 index 00000000..701c66a5 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/1.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/10.jpg b/docs/zh/learn/lightWalletGuide/10.jpg new file mode 100644 index 00000000..e0d7a346 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/10.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/11.jpg b/docs/zh/learn/lightWalletGuide/11.jpg new file mode 100644 index 00000000..a32d7c31 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/11.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/12.jpg b/docs/zh/learn/lightWalletGuide/12.jpg new file mode 100644 index 00000000..770cf0c3 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/12.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/13.jpg b/docs/zh/learn/lightWalletGuide/13.jpg new file mode 100644 index 00000000..d093c9a6 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/13.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/14.jpg b/docs/zh/learn/lightWalletGuide/14.jpg new file mode 100644 index 00000000..92230636 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/14.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/15.jpg b/docs/zh/learn/lightWalletGuide/15.jpg new file mode 100644 index 00000000..b3e258d8 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/15.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/16.jpg b/docs/zh/learn/lightWalletGuide/16.jpg new file mode 100644 index 00000000..6d1c4595 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/16.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/17.jpg b/docs/zh/learn/lightWalletGuide/17.jpg new file mode 100644 index 00000000..96a110ee Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/17.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/18.jpg b/docs/zh/learn/lightWalletGuide/18.jpg new file mode 100644 index 00000000..a5c7a37c Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/18.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/19.jpg b/docs/zh/learn/lightWalletGuide/19.jpg new file mode 100644 index 00000000..3b4c282d Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/19.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/2.jpg b/docs/zh/learn/lightWalletGuide/2.jpg new file mode 100644 index 00000000..ae74206c Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/2.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/20.jpg b/docs/zh/learn/lightWalletGuide/20.jpg new file mode 100644 index 00000000..4d493b71 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/20.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/21.jpg b/docs/zh/learn/lightWalletGuide/21.jpg new file mode 100644 index 00000000..69df03c4 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/21.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/22.jpg b/docs/zh/learn/lightWalletGuide/22.jpg new file mode 100644 index 00000000..9ba7e0a1 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/22.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/23.jpg b/docs/zh/learn/lightWalletGuide/23.jpg new file mode 100644 index 00000000..d391d588 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/23.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/24.jpg b/docs/zh/learn/lightWalletGuide/24.jpg new file mode 100644 index 00000000..ed11921d Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/24.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/25.jpg b/docs/zh/learn/lightWalletGuide/25.jpg new file mode 100644 index 00000000..97c90ba2 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/25.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/26.jpg b/docs/zh/learn/lightWalletGuide/26.jpg new file mode 100644 index 00000000..e0772f40 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/26.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/27.jpg b/docs/zh/learn/lightWalletGuide/27.jpg new file mode 100644 index 00000000..7b54e53e Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/27.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/3.jpg b/docs/zh/learn/lightWalletGuide/3.jpg new file mode 100644 index 00000000..8f32e1c3 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/3.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/4.jpg b/docs/zh/learn/lightWalletGuide/4.jpg new file mode 100644 index 00000000..aafcf710 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/4.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/5.jpg b/docs/zh/learn/lightWalletGuide/5.jpg new file mode 100644 index 00000000..7af94683 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/5.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/6.jpg b/docs/zh/learn/lightWalletGuide/6.jpg new file mode 100644 index 00000000..769a231e Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/6.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/7.jpg b/docs/zh/learn/lightWalletGuide/7.jpg new file mode 100644 index 00000000..809f464d Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/7.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/8.jpg b/docs/zh/learn/lightWalletGuide/8.jpg new file mode 100644 index 00000000..87c0929b Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/8.jpg differ diff --git a/docs/zh/learn/lightWalletGuide/9.jpg b/docs/zh/learn/lightWalletGuide/9.jpg new file mode 100644 index 00000000..3dde6e93 Binary files /dev/null and b/docs/zh/learn/lightWalletGuide/9.jpg differ diff --git a/docs/zh/learn/toolsGuide.md b/docs/zh/learn/toolsGuide.md new file mode 100644 index 00000000..39a05f3c --- /dev/null +++ b/docs/zh/learn/toolsGuide.md @@ -0,0 +1,48 @@ + + +# 社区投票指南 + +### 1 投票 + +如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。 + +![img](./communityImages/wpsA8AA.tmp.jpg) + +点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。 + +![img](./communityImages/wpsBF9.tmp.jpg) + +若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。 + +系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。 + +投票详情的各个选项,可以点击展开详情,查看票数分布情况。 + +### 2 更新投票 + +如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。 + +![img](./communityImages/wps55B5.tmp.jpg) + +同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。 + +![img](./communityImages/wps96E5.tmp.jpg) + +### 3 查看我的投票 + +在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。 + +![img](./communityImages/wpsD101.tmp.jpg) + +点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。 + +### 4创建投票 + +在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。 + +为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。 + +![img](./communityImages/wpsFCF4.tmp.jpg) + +创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。 + diff --git a/package.json b/package.json index 2c3805f6..1e7ae03c 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,9 @@ { - "name": "NULS-developer-site", - "version": "1.0.0", - "license": "MIT", - "hexo": { - "version": "3.7.1" - }, "scripts": { - "build": "rm -rf public && hexo generate", - "eslint": "eslint .", - "deploy": "hexo clean && hexo deploy", - "dev": "hexo server", - "clean": "hexo clean" - }, - "dependencies": { - "cheerio": "^0.22.0", - "hexo": "^3.7.1", - "hexo-deployer-git": "^0.3.1", - "hexo-generator-archive": "^0.1.4", - "hexo-generator-feed": "^1.1.0", - "hexo-generator-sitemap": "^1.1.2", - "hexo-renderer-jade": "^0.4.1", - "hexo-renderer-marked": "^0.3.2", - "hexo-renderer-stylus": "^0.3.1", - "hexo-server": "^0.3.2", - "lodash": "^4.5.1", - "lunr": "^2.1.2" + "dev": "vuepress dev docs", + "build": "vuepress build docs" }, "devDependencies": { - "del": "^3.0.0", - "eslint": "^5.1.0", - "eslint-config-hexo": "^3.0.0" + "vuepress": "^0.14.8" } } diff --git a/scaffolds/page.md b/scaffolds/page.md deleted file mode 100644 index 93e57c5e..00000000 --- a/scaffolds/page.md +++ /dev/null @@ -1,2 +0,0 @@ -title: {{ title }} ---- \ No newline at end of file diff --git a/scaffolds/post.md b/scaffolds/post.md deleted file mode 100644 index 93e57c5e..00000000 --- a/scaffolds/post.md +++ /dev/null @@ -1,2 +0,0 @@ -title: {{ title }} ---- \ No newline at end of file diff --git a/scripts/helpers.js b/scripts/helpers.js deleted file mode 100644 index 3696aacb..00000000 --- a/scripts/helpers.js +++ /dev/null @@ -1,164 +0,0 @@ -/* global hexo */ - -'use strict'; - -var pathFn = require('path'); -var _ = require('lodash'); -var cheerio = require('cheerio'); -var lunr = require('lunr'); - -var localizedPath = ['docs', 'protocol', 'manual', 'contract', 'chain']; - -function startsWith(str, start) { - return str.substring(0, start.length) === start; -} - -hexo.extend.helper.register('page_nav', function() { - var type = this.page.canonical_path.split('/')[0]; - var sidebar = this.site.data.sidebar[type]; - var path = pathFn.basename(this.path); - var list = {}; - var prefix = 'sidebar.' + type + '.'; - - for (var i in sidebar) { - for (var j in sidebar[i]) { - list[sidebar[i][j]] = j; - } - } - - var keys = Object.keys(list); - var index = keys.indexOf(path); - var result = ''; - - if (index > 0) { - result += ''; - } - - if (index < keys.length - 1) { - result += ''; - } - - return result; -}); - -hexo.extend.helper.register('doc_sidebar', function(className) { - var type = this.page.canonical_path.split('/')[0]; - var sidebar = this.site.data.sidebar[type]; - var path = pathFn.basename(this.path); - var result = ''; - var self = this; - var prefix = 'sidebar.' + type + '.'; - - _.each(sidebar, function(menu, title) { - result += '' + self.__(prefix + title) + ''; - - _.each(menu, function(link, text) { - var itemClass = className + '-link'; - if (link === path) itemClass += ' current'; - - result += '' + self.__(prefix + text) + ''; - }); - }); - - return result; -}); - -hexo.extend.helper.register('header_menu', function(className) { - var menu = this.site.data.menu; - var result = ''; - var self = this; - var lang = this.page.lang; - var isEnglish = lang === 'en'; - - _.each(menu, function(path, title) { - if (!isEnglish && ~localizedPath.indexOf(title)) path = lang + path; - - result += '' + self.__('menu.' + title) + ''; - }); - - return result; -}); - -hexo.extend.helper.register('canonical_url', function(lang) { - var path = this.page.canonical_path; - if (lang && lang !== 'en') path = lang + '/' + path; - return this.config.url + '/' + path; -}); - -hexo.extend.helper.register('url_for_lang', function(path) { - var lang = this.page.lang; - var url = this.url_for(path); - - if (lang !== 'en' && url[0] === '/') url = '/' + lang + url; - - return url; -}); - -hexo.extend.helper.register('raw_link', function(path) { - return 'https://github.com/nuls-io/devsite/edit/master/source/' + path; -}); - -hexo.extend.helper.register('page_anchor', function(str) { - var $ = cheerio.load(str, {decodeEntities: false}); - var headings = $('h1, h2, h3, h4, h5, h6'); - - if (!headings.length) return str; - - headings.each(function() { - var id = $(this).attr('id'); - - $(this) - .addClass('article-heading') - .append(''); - }); - - return $.html(); -}); - -hexo.extend.helper.register('lunr_index', function(data) { - var index = lunr(function() { - this.field('name', {boost: 10}); - this.field('tags', {boost: 50}); - this.field('description'); - this.ref('id'); - - _.sortBy(data, 'name').forEach((item, i) => { - this.add(_.assign({ id: i }, item)); - }); - }); - - return JSON.stringify(index); -}); - -hexo.extend.helper.register('canonical_path_for_nav', function() { - var path = this.page.canonical_path; - if (startsWith(path, 'docs/') - || startsWith(path, 'protocol/') - || startsWith(path, 'manual/') - || startsWith(path, 'contract/') - || startsWith(path, 'chain/') - ) { - return path; - } - return ''; - -}); - -hexo.extend.helper.register('lang_name', function(lang) { - var data = this.site.data.languages[lang]; - return data.name || data; -}); - -hexo.extend.helper.register('disqus_lang', function() { - var lang = this.page.lang; - var data = this.site.data.languages[lang]; - - return data.disqus_lang || lang; -}); - -hexo.extend.helper.register('hexo_version', function() { - return this.env.version; -}); - diff --git a/scripts/tags.js b/scripts/tags.js deleted file mode 100644 index 252ec4f4..00000000 --- a/scripts/tags.js +++ /dev/null @@ -1,19 +0,0 @@ -/* global hexo */ - -'use strict'; - -hexo.extend.tag.register('note', function(args, content) { - var className = args.shift(); - var header = ''; - var result = ''; - - if (args.length) { - header += '' + args.join(' ') + ''; - } - - result += '
' + header; - result += hexo.render.renderSync({text: content, engine: 'markdown'}); - result += '
'; - - return result; -}, true); diff --git a/source/CNAME b/source/CNAME deleted file mode 100644 index 41506172..00000000 --- a/source/CNAME +++ /dev/null @@ -1 +0,0 @@ -dev.nuls.io diff --git a/source/README.md b/source/README.md deleted file mode 100644 index afe2f844..00000000 --- a/source/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# NULS Official Developer Website - -The website for NULS Developer. You can see the generated files at [nuls-io/nuls-io.github.io](https://github.com/nuls-io/nuls-io.github.io) repository. - -## Getting started - -Install dependencies: - -```bash -$ git clone https://github.com/nuls-io/devsite.git -$ cd devsite -$ yarn install -``` - -Run server: - -```bash -$ yarn run dev -``` - -Generate: - -```bash -$ yarn run build -``` - -## Contributors - - Waiting for you - -## License - -Source released under the [MIT license](https://opensource.org/licenses/MIT) - -Power by [HEXO](https://hexo.io) - -Documentation released under the [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) - - - diff --git a/source/_data/languages.yml b/source/_data/languages.yml deleted file mode 100644 index 05fd7cda..00000000 --- a/source/_data/languages.yml +++ /dev/null @@ -1,4 +0,0 @@ -en: English -zh-cn: - name: 简体中文 - disqus_lang: zh diff --git a/source/_data/menu.yml b/source/_data/menu.yml deleted file mode 100644 index 86e6f59b..00000000 --- a/source/_data/menu.yml +++ /dev/null @@ -1,6 +0,0 @@ -docs: /docs/ -protocol: /protocol/ -contract: /contract/ -chain: /chain/ -manual: /manual/ -news: /news/ diff --git a/source/_data/sidebar.yml b/source/_data/sidebar.yml deleted file mode 100644 index fd754b50..00000000 --- a/source/_data/sidebar.yml +++ /dev/null @@ -1,43 +0,0 @@ -docs: - started: - overview: index.html - manual: manual.html - sdk: sdk.html - -protocol: - started: - overview: index.html - network: network.html - protocol: protocol.html - transaction: transaction.html - -contract: - started: - Development_manual: index.html - NRC_20: NRC-20_Token_Standard.html - IDEA_plugin: IdeaPlugin.html - Community_vote: CommunityVote.html - Contract_manual: smartContract.html - Smart_contract_fee: SmartContractFee.html - -chain: - started: - overview: index.html - -manual: - started: - architecture: index.html # 总体设计 - modularity: modularity.html # 为什么模块化 - structure: structure.html # 目录结构 - modularoverview: modular_overview.html # 模块说明 - kernel: micro_kernel.html # 微内核 - message_bus: message_bus.html # 消息总线 - - module: - network: network_overview.html # 网络模块 - storage: storage.html # 存储模块 - account: account.html # 账户模块 - ledger: ledger.html # 账本模块 - protocol: protocol.html # 通用协议 - consensus: consensus.html # 共识模块 - contract: contract.html # 合约模块 diff --git a/source/_posts/2018-07-16-Initialized.md b/source/_posts/2018-07-16-Initialized.md deleted file mode 100644 index 544f2528..00000000 --- a/source/_posts/2018-07-16-Initialized.md +++ /dev/null @@ -1,6 +0,0 @@ -title: NULS Developer Website Initialized ------------------------------------------ - -# Welcome - -As the title, the NULS developer site is created. I hope everyone can contribute together. diff --git a/source/browserconfig.xml b/source/browserconfig.xml deleted file mode 100644 index 24a1622a..00000000 --- a/source/browserconfig.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - #2f83cd - - - diff --git a/source/chain/image/3.1.png b/source/chain/image/3.1.png deleted file mode 100755 index 93b21b2d..00000000 Binary files a/source/chain/image/3.1.png and /dev/null differ diff --git a/source/chain/image/4.1.jpg b/source/chain/image/4.1.jpg deleted file mode 100755 index 516e47b5..00000000 Binary files a/source/chain/image/4.1.jpg and /dev/null differ diff --git a/source/chain/image/4.2.png b/source/chain/image/4.2.png deleted file mode 100755 index 608ac453..00000000 Binary files a/source/chain/image/4.2.png and /dev/null differ diff --git a/source/chain/index.md b/source/chain/index.md deleted file mode 100644 index 40dcad0f..00000000 --- a/source/chain/index.md +++ /dev/null @@ -1,84 +0,0 @@ -title: Cross-chain Overall Design ---- - -## 1 Industrial Background - -Blockchain is a decentralized application operating system. Cross-chain technology is in need for linking multiple operating systems together, thus substantially developing the ecosystem to form the internet of blockchain. - -## 2 Design Objectives - -* To define cross-chain standards and realize cross-chain communication. -* To build Satellite Chain to realize cross-chain asset transfer - -## 3 Overall Plan - -### 3.1 Overall Architecture - -![design](./image/3.1.png) - -Clarification: - -​ An independent Satellite Chain is responsible for communication among all chains and realizing cross-chain communication in an open way. - -​ Blockchains (in the ecology) based on NULS module warehouse can communicate with Satellite Chain in the underlying level by adding cross-chain modules via selecting modules. - -​ For Ethereum and Bitcoin and other public chains free from influence by NULS, protocol conversion should be achieved by a special mechanism, in which the public chain protocol and NULS cross-chain protocol will be adapted to realize communication with a unified protocol. - -​ All blockchains can only communicate with the Satellite Chain, which is responsible for verifying transactions and all parallel chains trust the verification results. - -* Linking Methods Between Chains - - All nodes in the blockchain will operate cross-chain modules and are connected to some nodes of the Satellite Chain. Corresponding random algorithm will decide specific nodes to be connected and try to guarantee diversion of the connection so as to safeguard the network security. - -* How to realize cross-chain transaction - - Suppose Account a1 of Chain A transfers its Asset a to Account b1 of Chain b, the procedures are as follows: - - * Cross-chain transaction will be initiated in Chain A and is subject to the verification of Chain A first; - * When certain blocks are accumulated, cross-chain modules will push the transaction to nodes in Satellite Chain; - * After receipt, Satellite Chain will verify the transaction in the following two steps: - * 1 Inquire nodes in Chain A if the transaction is verified and if the transaction sent to Satellite Chain by cross-chain protocol is correct and authentic; - * 2 Verify the transaction by Byzantine fault tolerant algorithm in Satellite Chain. The transaction will be regarded as invalid if a majority of nodes cannot agree. - * The transaction will be packaged in blocks of Satellite Chain; - * Nodes will push this cross-chain transaction to Chain B; - * Nodes of Chain B will verify the transaction via nodes connected to Satellite Chain. If it cannot pass the verification, this transaction will be discarded; - * If it passes the verification, corresponding asset will be placed in target address; - * This transaction will be verified in Chain B consensus. - * The transaction is complete and corresponding asset is available in Chain B. - -* Adaptation of Multiple Algorithms - - Satellite Chain supports most of mathematical algorithms used at present, including digest algorithm, symmetric encryption and asymmetric encryption among others. These algorithms can be used via a unified interface provided by the algorithm library. - -* Community-based Governance - - Community governance mechanism is built in Satellite Chain. Its functions include modifying system operation parameters, upgrading protocols, handling malicious chains, using community asset among others. - - - -## 4 Satellite Chain Design - -### 4.1 Satellite Chain Architecture - - ![layer](./image/4.1.jpg) - -* Satellite Chain verifies and packages cross-chain transaction by POC consensus mechanism and Byzantine fault tolerant algorithm, which strikes a balance between decentralization and performance and security. - -* Protocols in Satellite Chain are NULS cross-chain protocols with unified definition. Every node will connect multiple nodes in multiple blockchains. -* Satellite Chain provides chain management mechanism to supervise all corresponding blockchains registered on it. Registration contents include chain information, asset information and cross-chain pledge among others. -* When one blockchain receives assets from other blockchains, corresponding assets will be in place in this chain. Tokens in different blockchains will be stored as assets in other blockchains. -* Details for asset transfer to one blockchain from other chains will be stored in Satellite Chain. It should be verified if the asset is to transfer out of this blockchain and illegal asset transfer from this chain is not allowed. Malicious blockchains will be dealt with by community mechanism, including cross-chain pausing, cross-chain suspending and forfeiture of deposit. -* Blockchain will provide an api user manual. Any developer can develop his/her own wallet, browser, light wallet among other tools. -* Smart contract will not be operated in Satellite Chain so as to reduce operation complexity of Satellite Chain. -* Satellite Chain provides protocol application extension. Developers can use this protocol to develop DApp and optimize cross-chain protocols. -### 4.2 Satellite Chain Operation - -![](./image/4.2.png) - -* Satellite Chain has a modular architecture. -* Every module can be an independently operating micro service. -* Micro services are directly linked by http protocol communication. -* Module development languages are not restrained. -* Satellite Chain provides micro kernel module to manage service, configuration and data sharing function. -* Modules of Satellite Chain can also be used by NULS main network to some extent, so modules in Satellite Chain will also be included in NULS module library as NULS modules do. There modules are available for direct use of Chain Factory. -* Every in-use module is subject to extension. If a module in the library can only meet partial operation needs, this module can be extended instead of re-developing. diff --git a/source/contract/CommunityVote.md b/source/contract/CommunityVote.md deleted file mode 100644 index 12f804fd..00000000 --- a/source/contract/CommunityVote.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -typora-copy-images-to: communityImagesCN ---- - -## Guide to Community Vote - -### 1 Voting - -If you want to participate in the community vote X created by address A, you can search for the community vote you want to participate in by entering the community vote title X or the creator’s address A. After finding the community vote X, you can see some key information about the community vote in the voting list. - -![1542526165310](communityImagesCN/1542526165310.png) - -Click on the title of the community vote X to enter the voting details page, which shows the detailed information of the vote. The upper right corner shows my address B and my corresponding available votes N. The available votes are subject to the total amount of NULS in my address B. Currently the ratio of votes to NULS is 1:1, while the fractional part of the total is excluded. - -![1542526178695](communityImagesCN/1542526178695.png) - -If community voting is still in progress, you can cast your vote by selecting the appropriate option according to the voting rules, and then click "Vote" to enter the password and submit your vote. - -The way votes are counted is as follows: whether single or multiple options are involved, as long as the submission of your vote is successful, the submitted votes will count towards your available votes N. N can be 0, but still requires your address B to have enough NULS to pay the fee to guarantee the vote submitted is a success. After casting your vote, if the amount of NULS in address B changes, and voting is still in progress, the corresponding options selected will reflect the total number of votes for that option, according to the amount of NULS in address B. - -The system allows the creator of the community vote to set the type of voting result as either changeable or unchangeable. If the voting result cannot be changed, the voter cannot change their selected option. If the voting result can be changed and voting is still in progress, then the voter can enter the voting details page again, select another option according to the voting rules, and change their voting option. The number of the votes counted towards the original selected option is reduced by N, while the number of votes counted towards the newly selected option is increased by N. - -Each option in the voting details page is clickable to show the current or final distribution of votes. - -### 2 Changing and Updating Your Vote - -As mentioned before, if the creator sets the voting result to be changeable when creating the community vote Y and voting is still in progress, then the voter can re-enter the details page of the community vote Y, select a new option according to the voting rules, and update their vote. Simply click "Update Voting" and enter the password to complete the new submission. - -![1542526190286](communityImagesCN/1542526190286.png) - -There will be a well-marked icon in the voting list that indicates whether a community vote is of the changeable type. - -![1542526202833](communityImagesCN/1542526202833.png) - -### 3 Checking My Votes - -In the voting list, click on "My Voting" on the right to enter “my” voting list, which shows the community votes created by you and the community votes you participated in. If Z is the community vote you have created, and it is still in progress, then its address will appear yellow. - -![1542526213174](communityImagesCN/1542526213174.png) - -If you click on the title of the community vote you participated in, all of the voting options you selected can be seen. If the community vote is of a changeable type and it is still in progress, then you can change your vote by choosing another option and submitting your changed vote according to the voting rules. - -### 4 Creating A Community Vote - -In the voting list, click **“Create Voting"** to enter the information page of the community vote and fill in the corresponding options and settings. Afterwards, select the correct start and end time. Once finished, click "Confirm" to complete creation of your community vote. Creating a community vote requires that there is enough NULS in your address B to provide a deposit and a fee. - -In order to prevent the creation of frivolous or duplicate community votes that are not needed, each community vote created requires a deposit of 100 NULS. The block height to unlock the deposit is calculated according to the creation time and the end time of the community vote. When the block height corresponding to the end time has been reached, the deposit can be unlocked. - -![1542526223816](communityImagesCN/1542526223816.png) - -When creating a community vote, **please fill in the item contents** **carefully.** Once the community vote has been created successfully**, it cannot be modified**. It will take about one minute to confirm the created community vote on the NULS network, and the voting list page will then be refreshed. - diff --git a/source/contract/SmartContractFee.md b/source/contract/SmartContractFee.md deleted file mode 100644 index 9aa92dca..00000000 --- a/source/contract/SmartContractFee.md +++ /dev/null @@ -1,53 +0,0 @@ -## Service charge for smart contracts - -### 1. Standards of service charge for smart contracts: How is the service fee charged? How much does it cost an interface invoker? Who will receive the service charge? - -> `Background:` Since the NULS Main-Net uses the UTXO model, the transaction size is also used as one of the charging standards. - -In the main-net, there are now three more types of transactions: `creating a smart contract`, `invoking a smart contract`, `deleting a smart contract` - -The difference between those three transactions and other transactions such as `transfer` is that the execution of smart contracts will be added. So, execution of smart contracts will also be applied to the charging standards. - -* Calculation of smart contract service charge - -```java -public static final int COMPARISON = 1 ; //Compare bytecode -public static final int CONSTANT = 1 ; //Simple numeric type bytecode -public static final int LDC = 1 ; //Numeric constant, string constant (length * LDC) -public static final int CONTROL = . 5 ; //Control bytecode -public static final int TABLESWITCH = 2 ; //Switch bytecode (size * TABLESWITCH) -public static final int LOOKUPSWITCH = 2 ; //Switch bytecode (size * LOOKUPSWITCH) -public static final int CONVERSION = 1 ; //Value conversion -public static final int EXTENDED = 1 ; //Null determine -public static final int MULTIANEWARRAY = 1 ; //Multidimensional Array (size * MULTIANEWARRAY) -public static final int LOAD = 1 ; / /Send the local variable to the top of the stack -public static final int ARRAYLOAD = 5 ; / /Send an item of the array to the top of the stack -public static final int MATH = 1 ; //Mathematical operations and shift operations -public static final int REFERENCE = 10 ; //Object related operations -public static final int NEWARRAY = 1 ; //One-dimensional array (size * NEWARRAY) -public static final int STACK = 2 ; //Stack operation -public static final int STORE = 1 ; // Save the value in the top of the stack to a local variable -public static final int ARRAYSTORE = 5; //Save the value of the stack to an array -public static final int TRANSFER = 1000 ; //Transfer transaction - -``` - -* Total service charge for invoking a smart contract -The total service charge for a contract transaction consists of three parts -- The first part is the transaction fee based on the transaction size, calculated according to the byte size -> 0.001NULS/KB, which is 0.001 NULS per 1000 bytes. If the transaction size is less than 1000 bytes, the transaction fee is set as 0.001 NULS. - -- The second part is the ‘Gas*Price’ consumed by executing the contract. The ‘Price’ is the unit cost, which means how much ‘Na’ there is for each Gas. ‘Na’ is the smallest unit of NULS, and 1 NULS = 100 million Na. -> For example, if executing a contract consumes 20,000 Gas and the set Price is 20 Na/Gas, then the Na consumed this time would be 20,000 * 20 = 400,000 Na, which is 0.004 NULS. - -- The third part refers to the remaining part of the GasLimit. GasLimit is set by the contract invoker. If it is not fully consumed by executing the current contract, the remaining Gas will be returned as the consensus reward. -> Still using the previous example, if the GasLimit set for the contract is 30,000 Gas and executing the contract consumes 20,000 Gas, then 10,000 Gas will be left. The 10,000 Gas has: 10,000 * 20 = 200,000 Na, which is 0.002 NULS. This will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block. - -* How much does a contract invoker pay? - -To start the contract transaction, the contract invoker pays the first, second and third part. In practical, the third part will be returned to the contract invoker in the CoinBase transaction (consensus reward) of the current packing block. - -* Who receives the service charge? - -> `Precondition:`This part of the cost is reflected in the CoinBase transaction (consensus reward) of the block. - -The block packer receives the first and second parts of the service charge, and the contract invoker receives the third part. \ No newline at end of file diff --git a/source/contract/index.md b/source/contract/index.md deleted file mode 100644 index 584b7e94..00000000 --- a/source/contract/index.md +++ /dev/null @@ -1,1122 +0,0 @@ -# NULS Smart Contract Development Manual - -## 1. Introduction - -NULS smart contract is developed with Java, and it operates in NULS virtual machine. Not all Java features are applicable to contract development and the relevant restrictions are specified in section 3. - -## 2. Development environment - -### 2.1 Setup of NULS wallet - -### 2.2 Setup of JDK 8 - -### 2.3 Setup of IntelliJ IDEA - -NULS smart contract adopts IntelliJ IDEA as development tool - -### 2.4 Setup of NULS smart contract plug-ins - -[Click to download the plugin](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) - -NULS smart contract plug-ins provide the following main functions: - -* Newly create NULS contract project -* Provide the unavailable Java properties, classes ad methods -* Compile, package and deploy contracts -* Display and call contract methods - -## 3. NULS smart contract specifications and syntax - -NULS smart contract syntax is a subset of Java syntax, with some restrictions - -### 3.1 NULS smart contract specifications - -> **_Main classes of contracts must implement contract interfaces. A smart contract can have a class implementing contract interface only; and other classes and interfaces provide functions for such contract._** - -### 3.2 Keywords - -Java key words are listed as follows and those not applicable for NULS smart contract will be marked - -Access control - -* public -* protected -* private - -Key words and instantiated object of definition class, interface, abstract class, implementation interface and derivative class - -* class -* interface -* abstract -* implements -* extends -* new - -Key words of package - -* import -* package - -Key words of data type - -* byte -* char -* boolean -* short -* int -* float -* long -* double -* void -* null -* true -* false - -Conditional loops (process control) - -* if -* else -* while -* for -* switch -* case -* default -* do -* break -* continue -* return -* instanceof - -Error processing - -* catch -* try -* finally -* throw -* throws - -Modification method, class, property and variables - -* static -* final -* super -* this -* native(not supported) -* strictfp(not supported) -* synchronized(not supported) -* transient(not supported) -* volatile(not supported) - -other - -* enum(not supported) -* assert(not supported) - -### 3.3 Basic syntax - -The following syntax is the same with Java and simply listed here under, with specific details referred to the relevant documents of Java - -* Identifiers are consisted of character, underline, dollar sign or figure, beginning with character, underline or dollar sign -* Basic data type: byte short int long float double char boolean -* Reference data type: class, interface, array -* Arithmetic operators: + - * /%++ - -* Relational operator: > <> = <= ==! = -* Logical Operators: ! &| ^ && || -* Bit operator: &| ^~>> << >>> -* Assignment operator: = -* Extension assignment operators: + = - = * = / = -* String link operator: + -* Conditional operators: ? : -* Process control sentence (if, switch, for, while, do...while) - - -### 3.4 Available class - -NULS smart contract can be developed with the following class - -* io.nuls.contract.sdk.Address -* io.nuls.contract.sdk.Block -* io.nuls.contract.sdk.BlockHeader -* io.nuls.contract.sdk.Contract -* io.nuls.contract.sdk.Event -* io.nuls.contract.sdk.Msg -* io.nuls.contract.sdk.Utils -* io.nuls.contract.sdk.annotation.View -* io.nuls.contract.sdk.annotation.Required -* io.nuls.contract.sdk.annotation.Payable -* java.lang.Boolean -* java.lang.Byte -* java.lang.Short -* java.lang.Character -* java.lang.Integer -* java.lang.Long -* java.lang.Float -* java.lang.Double -* java.lang.String -* java.lang.StringBuilder -* java.math.BigInteger -* java.math.BigDecimal -* java.util.Collection -* java.util.List -* java.util.ArrayList -* java.util.LinkedList -* java.util.Map -* java.util.HashMap -* java.util.LinkedHashMap -* java.util.Set -* java.util.HashSet - -### 3.5 Other restrictions - -* Contract class can have one construction method. No restriction for other classes -* The maximum gas consumption for executing a contract method once is 10 million, including the method of the `@View` type, Make sure to optimize the contract code as much as possible. - -## 4. Nuls smart contract example - -a simple contract - -> **_Main classes of contract must implement contract interface, and other classes and interfaces provide functions for this contract_** - - -```java - -package contracts.examples; - -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.annotation.Payable; -import io.nuls.contract.sdk.annotation.Required; -import io.nuls.contract.sdk.annotation.View; - -public class SimpleStorage implements Contract { - - private String storedData; - - @View - public String getStoredData() { - return storedData; - } - - @Payable - public void setStoredData(@Required String storedData) { - this.storedData = storedData; - } - -} -``` - -In one contract project, it requires to introduce a jar package “contract-sdk.jar” which provides the class to get block and transaction details -The project has several classes and interfaces - -When compiling, packaging and deploying the prepared contract onto the NULS chain, the virtual machine will implement the construction method of this contract to initialize it, and save the contract status onto the chain. The contract status is the member variables of contract class - -After the contract is deployed, all public methods of contract class can be called so as to read or modify the contract status - - -Explanatory comments - -@View labels the method of @View. After it is called, the contract status will remain and it can be researched by such means - -@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in - -@Required labels the parameter of @Required. When it is called, there must be transfer-in value - -Go to download NULS source code on github, and get some contract examples - -## 5. NULS Contract SDK - -Contract SDK provides several classes to be convenient for contract development: - -### io.nuls.contract.sdk.Address - -```java -public class Address { - - private final String address; - - public Address(String address) { - valid(address); - this.address = address; - } - - /** - * Get the balance of the address (only the balance of contract address) - * - * @return - */ - public native BigInteger balance(); - - /** - * Transfer amount to the address from contract - * - * @param value transfer amount (in Na) - */ - public native void transfer(BigInteger value); - - /** - * Contract method to call the address - * - * @param Method name - * @param Method signature - * @param Parameters - * @param value Incidental currency (in Na) - */ - public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); - - /** - * Call the contract method of this address with a return value(String) - * - * @param Method name - * @param Method signature - * @param Parameters - * @param value Incidental currency (in Na) - * @return return value after calling the contract - */ - public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); - - /** - * Verify the address - * - * @param address - * @see io.nuls.kernel.utils.AddressTool#validAddress(String) - */ - private native void valid(String address); - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Address address1 = (Address) o; - return address != null ? address.equals(address1.address) : address1.address == null; - } - - @Override - public int hashCode() { - return address != null ? address.hashCode() : 0; - } - - @Override - public String toString() { - return address; - } - -} -``` - -### io.nuls.contract.sdk.Block - -```java -public class Block { - - /** - * Given block’s head - * - * @param blockNumber - * @return - */ - public static native BlockHeader getBlockHeader(long blockNumber); - - /** - * Current block’s head - * - * @return - */ - public static native BlockHeader currentBlockHeader(); - - /** - * Newest block’s head - * - * @return - */ - public static native BlockHeader newestBlockHeader(); - - /** - * Given block’s hash - * - * @param blockNumber - * @return - */ - public static String blockhash(long blockNumber) { - return getBlockHeader(blockNumber).getHash(); - } - - /** - * - * CCurrent block’s miner address - * - * @return - */ - public static Address coinbase() { - return currentBlockHeader().getPackingAddress(); - } - - /** - * - * Current block’s No. - * - * @return - */ - public static long number() { - return currentBlockHeader().getHeight(); - } - - /** - * - * Current block’s time stamp - * - * @return - */ - public static long timestamp() { - return currentBlockHeader().getTime(); - } - -} -``` - -### io.nuls.contract.sdk.BlockHeader - -```java -public class BlockHeader { - - private String hash; - private long time; - private long height; - private long txCount; - private Address packingAddress; - private String stateRoot; - - public String getHash() { - return hash; - } - - public long getTime() { - return time; - } - - public long getHeight() { - return height; - } - - public long getTxCount() { - return txCount; - } - - public Address getPackingAddress() { - return packingAddress; - } - - public String getStateRoot() { - return stateRoot; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - BlockHeader that = (BlockHeader) o; - - if (time != that.time) return false; - if (height != that.height) return false; - if (txCount != that.txCount) return false; - if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; - if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) - return false; - return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; - } - - @Override - public int hashCode() { - int result = hash != null ? hash.hashCode() : 0; - result = 31 * result + (int) (time ^ (time >>> 32)); - result = 31 * result + (int) (height ^ (height >>> 32)); - result = 31 * result + (int) (txCount ^ (txCount >>> 32)); - result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); - result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "BlockHeader{" + - "hash='" + hash + '\'' + - ", time=" + time + - ", height=" + height + - ", txCount=" + txCount + - ", packingAddress=" + packingAddress + - ", stateRoot='" + stateRoot + '\'' + - '}'; - } - -} -``` - -### io.nuls.contract.sdk.Contract - -```java -/** - * Contract interface, implemented by contract class - */ -public interface Contract { - - /** - * Directly transfer to the contract, this method will be called, no action is done by default. If the contract address is to accept direct transfer, you can override this method and mark the `@Payable` annotation. - */ - default void _payable() { - } - -} -``` - -### io.nuls.contract.sdk.Event - -```java -/** -* Event interface, implemented by event class -*/ -public interface Event { -} -``` - -### io.nuls.contract.sdk.Msg - -```java -public class Msg { - - /** - * Remaining gas - * - * @return - */ - public static native long gasleft(); - - /** - * sender of the contract - * - * @return - */ - public static native Address sender(); - - /** - * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na - * - * @return - */ - public static native BigInteger value(); - - /** - * Gas price - * - * @return - */ - public static native long gasprice(); - - /** - * Contract address - * - * @return - */ - public static native Address address(); - -} -``` - -### io.nuls.contract.sdk.Utils - -```java -public class Utils { - - private Utils() { - } - - /** - * Check conditions; if conditions are not met, it will roll back. - * - * @param expression - */ - public static void require(boolean expression) { - if (!expression) { - revert(); - } - } - - /** - * Check conditions; if conditions are not met, it will roll back - * - * @param expression - * @param errorMessage - */ - public static void require(boolean expression, String errorMessage) { - if (!expression) { - revert(errorMessage); - } - } - - /** - * Terminate implementation and restore status - */ - public static void revert() { - revert(null); - } - - /** - * Terminate implementation and restore status - * - * @param errorMessage - */ - public static native void revert(String errorMessage); - - /** - * Send events - * - * @param event - */ - public static native void emit(Event event); - - /** - * @param seed a private seed - * @return pseudo random number (0 ~ 1) - */ - public static float pseudoRandom(long seed) { - int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); - int hash2 = Msg.address().toString().substring(2).hashCode(); - int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; - int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); - - long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; - - seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); - return ((int) (seed >>> 24) / (float) (1 << 24)); - } - - /** - * @return pseudo random number (0 ~ 1) - */ - public static float pseudoRandom() { - return pseudoRandom(0x5DEECE66DL); - } - - /** - * @param src source string - * @return sha3-256 hash (utf-8 encode) - */ - public static native String sha3(String src); - - /** - * @param bytes source byte array - * @return sha3-256 hash - */ - public static native String sha3(byte[] bytes); - -} -``` - -### io.nuls.contract.sdk.annotation.Payable - -`@Payable labels the method of @Payable. Only when it is called, the amount can be transferred in` - -```java -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Payable { -} -``` - -### io.nuls.contract.sdk.annotation.Required - -`@Required labels the parameter of @Required. When it is called, there must be transfer-in value.` - -```java -@Target({ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Required { -} -``` - -### io.nuls.contract.sdk.annotation.View - -`@Viewlabels the method of @View. After it is called, the contract status will remain and it can be researched by such means` - -```java -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface View { -} -``` - -## 6. Main RPC interface of smart contract - -See parameter structure and simple examples hereafter. See details of other interfaces at [Swagger UI] (http://127.0.0.1:8001/docs#/) -> The default port of test network’s “Swagger UI” is 8001, and that of official network is 6001 - -### 6.1 Create smart contract - -- POST `/api/contract/create` - -|Parameter|Type|Description| -|:-:|:-:|:-:| -|sender* |string |transaction creator | -|password* |string| password of transaction creator| -|gasLimit*| long| max. gas consumption| -|price* | long| unit price of implementation contract| -|contractCode* |string| smart contract code (byte code’s Hex coded string)| -|remark |string |remark| -|args |string[][]|Parameter list| - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "gasLimit": 4687, - "price": 20, - "password": "xxx", - "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", - "remark": "asd", - "args": [] -} -``` - - - -### 6.2 Estimate the gas consumption for creating smart contract - -- POST `/api/contract/imputedgas/create` - -|Parameter|Type|Description| -|:-:|:-:|:-:| -|sender* |string |transaction creator | -|password* |string| password of transaction creator| -|price* | long| unit price of implementation contract| -|contractCode* |string| smart contract code (byte code’s Hex coded string)| -|args |string[][]|Parameter list| - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "price": 20, - "password": "xxx", - "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", - "args": [] -} -``` - - - -### 6.3 Call smart contract - -- POST `/api/contract/call` - -|Parameter|Type|Description| -|:-:|:-:|:-:| -|sender* |string |transaction creator | -|password* |string| password of transaction creator| -|contractAddress* |string| address of smart contract| -|gasLimit* | long| max. gas consumption| -|price* | long|unit price of implementation contract| -|value |long| amount transferred by transaction creator to contract address (Na - 100000000Na=1NULS)| -|methodName* |string| method name| -|methodDesc |string|method signature which may be not transferred if the method name is not repeated| -|remark |string| remark | -|args |string[][]|Parameter list| - - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "password": "", - "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U", - "gasLimit": 8000, - "price": 20, - "value": 0, - "methodName": "balance", - "methodDesc": "", - "remark": "qwe" - "args": [] -} -``` - - -### 6.4 Estimate the gas consumption for calling smart contract (see `Swagger UI`) - -- POST `/api/contract/imputedgas/call` - - - -### 6.5 Estimate the price for calling smart contract (see `Swagger UI`) -- POST `/api/contract/imputedprice` - - - -### 6.6 Terminate smart contract (see `Swagger UI`) - -- POST `/api/contract/delete` - - - -### 6.7 Call the smart contract function which is not linked to blockchain (see `Swagger UI`) - -- POST `/api/contract/view` - - - -### 6.8 Get the implementation results of smart contract (see `Swagger UI`) - -- GET `/api/contract/result/{hash}` - - - -### 6.9 Get the basic information of smart contract (see `Swagger UI`) - -- GET `/api/contract/info/{address}` - - - -### 6.10 Verify if it is contract address (see `Swagger UI`) - -- GET `/api/contract/{address}` - - - -### 6.11 Get the NULS balance of smart contract address (see `Swagger UI`) - -- GET `/api/contract/balance/{address}` - - - -### 6.12 Get the transaction details of smart contract (see `Swagger UI`) - -- GET `/api/contract/tx/{hash}` - - - -### 6.13 Get the transaction list of smart contract (see `Swagger UI`) - -- GET `/api/contract/tx/list/{address}` - - -### 6.14 Inquire contract UTXO as per address and limit (see `Swagger UI`) - -- GET `/api/contract/limit/{address}/{limit}` - - - -### 6.15 Inquire contract UTXO as per address and amount (see `Swagger UI`) - -- GET `/api/contract/amount/{address}/{amount}` - - -### 6.16 Transfer amount to smart contract (see `Swagger UI`) - -- POST `/api/contract/transfer` - - - -## 7. Example - -### 7.1 Voting smart contract code `segments` are as follows - -> Full code: `https://github.com/nuls-io/nuls-vote` - -```java -package io.nuls.vote.contract; - -import io.nuls.contract.sdk.Address; -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.Utils; -import io.nuls.contract.sdk.annotation.Payable; -import io.nuls.contract.sdk.annotation.View; -import io.nuls.vote.contract.func.BaseVote; -import io.nuls.vote.contract.func.VoteInterface; -import io.nuls.vote.contract.model.VoteConfig; -import io.nuls.vote.contract.model.VoteEntity; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -public class VoteContract implements Contract { - - private VoteInterface baseVote; - - public VoteContract(long minRecognizance) { - baseVote = new BaseVote(BigInteger.valueOf(minRecognizance)); - } - - @Payable - public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) { - VoteEntity voteEntity = baseVote.create(title, desc, items); - - VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify); - boolean success = baseVote.init(voteEntity.getId(), config); - - Utils.require(success); - - return voteEntity; - } - - public boolean vote(long voteId, long[] itemIds) { - return baseVote.vote(voteId, itemIds); - } - - public boolean redemption(long voteId) { - return baseVote.redemption(voteId); - } - - @View - public boolean canVote(long voteId) { - return baseVote.canVote(voteId); - } - - @View - public VoteEntity queryVote(long voteId) { - return baseVote.queryVote(voteId); - } - - @View - public Map> queryVoteResult(long voteId) { - return baseVote.queryVoteResult(voteId); - } - - @View - public boolean queryAddressHasVote(long voteId, Address address) { - return baseVote.queryAddressHasVote(voteId, address); - } -} - -``` - -If the methods of smart contract include the parameter of `array type`, please use the following method to transfer parameters -> Refer to the `create` method in the aforesaid voting contract code - -```javascript -{ - "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", - "password": "", - "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", - "gasLimit": 200000, - "price": 1, - "value": 10000000000, - "methodName": "create", - "methodDesc": "", - "remark": "", - "args": [ -     "Test voting 1", -     "Voting contract 1", -     [ -       "Option 1", -       "Option 2", -       "Option 3" -     ], -     1536044066056, 1536184066056, false, 300, false -   ] -} -``` - - -### 7.2 Standard Token Smart contract code `segments` - -> Full code: `https://github.com/nuls-io/nuls-nrc20` - -```java -package io.nuls.contract.token; - -import io.nuls.contract.sdk.Address; -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.Msg; -import io.nuls.contract.sdk.annotation.Required; -import io.nuls.contract.sdk.annotation.View; - -import java.math.BigInteger; -import java.util.HashMap; -import java.util.Map; - -import static io.nuls.contract.sdk.Utils.emit; -import static io.nuls.contract.sdk.Utils.require; - -public class SimpleToken implements Contract, Token { - - private final String name; - private final String symbol; - private final int decimals; - private BigInteger totalSupply = BigInteger.ZERO; - - private Map balances = new HashMap(); - private Map> allowed = new HashMap>(); - - @Override - @View - public String name() { - return name; - } - - @Override - @View - public String symbol() { - return symbol; - } - - @Override - @View - public int decimals() { - return decimals; - } - - @Override - @View - public BigInteger totalSupply() { - return totalSupply; - } - - public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) { - this.name = name; - this.symbol = symbol; - this.decimals = decimals; - totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));; - balances.put(Msg.sender(), totalSupply); - emit(new TransferEvent(null, Msg.sender(), totalSupply)); - } - - @Override - @View - public BigInteger allowance(@Required Address owner, @Required Address spender) { - Map ownerAllowed = allowed.get(owner); - if (ownerAllowed == null) { - return BigInteger.ZERO; - } - BigInteger value = ownerAllowed.get(spender); - if (value == null) { - value = BigInteger.ZERO; - } - return value; - } - - @Override - public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) { - subtractAllowed(from, Msg.sender(), value); - subtractBalance(from, value); - addBalance(to, value); - emit(new TransferEvent(from, to, value)); - return true; - } - - @Override - @View - public BigInteger balanceOf(@Required Address owner) { - require(owner != null); - BigInteger balance = balances.get(owner); - if (balance == null) { - balance = BigInteger.ZERO; - } - return balance; - } - - @Override - public boolean transfer(@Required Address to, @Required BigInteger value) { - subtractBalance(Msg.sender(), value); - addBalance(to, value); - emit(new TransferEvent(Msg.sender(), to, value)); - return true; - } - - @Override - public boolean approve(@Required Address spender, @Required BigInteger value) { - setAllowed(Msg.sender(), spender, value); - emit(new ApprovalEvent(Msg.sender(), spender, value)); - return true; - } - - public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) { - addAllowed(Msg.sender(), spender, addedValue); - emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); - return true; - } - - public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) { - check(subtractedValue); - BigInteger oldValue = allowance(Msg.sender(), spender); - if (subtractedValue.compareTo(oldValue) > 0) { - setAllowed(Msg.sender(), spender, BigInteger.ZERO); - } else { - subtractAllowed(Msg.sender(), spender, subtractedValue); - } - emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); - return true; - } - - private void addAllowed(Address address1, Address address2, BigInteger value) { - BigInteger allowance = allowance(address1, address2); - check(allowance); - check(value); - setAllowed(address1, address2, allowance.add(value)); - } - - private void subtractAllowed(Address address1, Address address2, BigInteger value) { - BigInteger allowance = allowance(address1, address2); - check(allowance, value, "Insufficient approved token"); - setAllowed(address1, address2, allowance.subtract(value)); - } - - private void setAllowed(Address address1, Address address2, BigInteger value) { - check(value); - Map address1Allowed = allowed.get(address1); - if (address1Allowed == null) { - address1Allowed = new HashMap(); - allowed.put(address1, address1Allowed); - } - address1Allowed.put(address2, value); - } - - private void addBalance(Address address, BigInteger value) { - BigInteger balance = balanceOf(address); - check(value, "The value must be greater than or equal to 0."); - check(balance); - balances.put(address, balance.add(value)); - } - - private void subtractBalance(Address address, BigInteger value) { - BigInteger balance = balanceOf(address); - check(balance, value, "Insufficient balance of token."); - balances.put(address, balance.subtract(value)); - } - - private void check(BigInteger value) { - require(value != null && value.compareTo(BigInteger.ZERO) >= 0); - } - - private void check(BigInteger value1, BigInteger value2) { - check(value1); - check(value2); - require(value1.compareTo(value2) >= 0); - } - - private void check(BigInteger value, String msg) { - require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg); - } - - private void check(BigInteger value1, BigInteger value2, String msg) { - check(value1); - check(value2); - require(value1.compareTo(value2) >= 0, msg); - } - - - -} - -``` - - - - - diff --git a/source/docs/index.md b/source/docs/index.md deleted file mode 100644 index 448f226b..00000000 --- a/source/docs/index.md +++ /dev/null @@ -1,60 +0,0 @@ -title: How to run the node --------------------------- - -## What you'll need - -* JDK 1.8 -* Maven 3.3+ -* Git 2.x -* IDE ( Optional ) - -## Getting Source - -```sh -$ git clone https://github.com/nuls-io/nuls.git && cd nuls -``` - -## Build Source - -Make sure the JDK version is 1.8 - -```sh -$ mvn -v -Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00) -Maven home: /usr/local/Cellar/maven/3.5.4/libexec -Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre -``` - -If the Java version is not 1.8, it is recommended to install and set it to version 1.8. - -Now,we can build the node. - -``` -$ mvn clean package -``` - -After the command is successfully executed, you can find the compilation result in the path. - -> client-module/client/target/nuls-node.tar.gz - -## Run Node - -```shell -$ mvn clean package -$ cd client-module/client/target -$ mkdir nuls-node -$ tar -zxvf nuls-node.tar.gz -C nuls-node -$ cd nuls-node/bin -``` - -- Using start.sh running the nuls process. -- Using stop.sh stop the nuls process. -- Using cmd.sh running the nuls shell. - - -## Use IDEA - -Import the project folder into the IDEA and set configurations. - - -![图片](assert/launcher.jpg) diff --git a/source/docs/manual.md b/source/docs/manual.md deleted file mode 100644 index 65e8996d..00000000 --- a/source/docs/manual.md +++ /dev/null @@ -1,1549 +0,0 @@ -## NULS-Wallet-Linux64 User Manual - -### Introduction - -​ The User Manual (hereinafter referred to as Manual) is for the full-node wallet of NULS (Linux). Before reading this Manual, please know about the basic operation and usage of Linux system. The Manual includes operations for creating account, importing account, transferring, building nodes, agency and others with NULS wallet. It is recommended to build stable NULS nodes with Linux system server. - -### Version Update Records - -| Version | Date updated | Contents | -| :----: | :--------: | :----------------: | -| V1.0.0 | 2018-07-12 | All functions of official version | - -### Preparation - -#### Server hardware - -**Server for creating NULS nodes shall be with configurations not lower than the following** - -| CPU | Memory | Hard Disk | Broadband | -|:---------:| :----: | :------: | :---:| -|Quad-core 3.0GHz | 16G | 128G Hard Disk | 20M Uplink | - -**Recommendation** - -| CPU | Memory | Hard Disk | Broadband | -| :---------: | :---: | :------: | :------: | -| 8-core 3.0GHz | 32G | 256G Hard Disk | 100M Uplink | - -#### Version of system and core - -**Linux system** - -- CentOS (recommended) - -It is recommended to use core of version 2.6.32 or higher. - -### Start - -#### Download - -* NULS official website for downloading the latest full-node wallet:http://nuls.io/wallet -* GitHub:https://github.com/nuls-io/nuls-wallet-release - -* Enter [wallet download on NULS website](http://nuls.io/wallet),and select Linux download. MEGA and Baidu Cloud Disk are available and optional for users. - - The following is for downloading wallet (v1.0.0) in Linux system: - - ```shell - $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz - ``` - - Note: the downloading link for the subsequent versions is subject to change. - -#### Install - -- Extract downloaded files in Linux system - - ```shell - $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz - ``` - -#### Operate - -- Enter bin catalogue and run startup script to start full-node wallet - - ```shell - $ cd bin - $ ./start.sh - ``` - -### Use wallet - -#### Quick-start - -- Upon confirming the wallet is started, start the command line of wallet to run it. - - Enter bin catalogue to execute the following commands: - - ```shell - $ ./cmd.sh - ``` - - Display NULS naming prompt `nuls>>> `, and then directly input NULS wallet operation command to run it. - - The following gives an example of account creating: - - ```shell - nuls>>> create - Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. - Enter your password:********* - Please confirm new password:********* - [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ] - nuls>>> - ``` - - Command `create` is to create a single account, insert password, confirm the inserted password, and receive the account address if the account is created successfully. - - - -### Conventions - -- For password: it must be 8 to 20 digits, including letters and figures. -- Command parameter description means the required parameter; [parameter] means optional parameter. "|" means alternative parameter, that is, the front or later parameter is required. - -### Wallet command - -#### Help command - -All commands for output and printing - -- **Command: help [-a] ** - -| Parameter | Description | -| :--- | :------------------- | -| -a | Formatting printing command, optional | - -Return message help - -```json -getaccount
--get account information -``` - -Return message help -a - -```json -getaccount
--get account information - OPTIONS: -
the account address - Required -``` - -Example - -```shell -nuls>>> help -nuls>>> help -a -``` - - - -#### Create account - -Create account and return to account addresses collection - -- **Command: create [number] ** - -| Parameter | Description | -| :------- | :------------------- | -| [number] | Quantity of accounts created, optional | - -Upon creating account, receive prompt of password inserting; if the account is not to have a password, ignore it and directly enter; - -Return accounts collection - -```json -[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] -``` - -Example, to create 2 accounts without password - -```shell -nuls>>> create 2 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password: -[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] -``` - - - -#### Backup account - -For backup of account, generate a backup file, titled as account address, with .keystore file extension as and file as account - -- **Command: backup <address> [path]** - -| Parameter | Description | -| --------------- | ---------------------------------------------------- | -| <address> | Account address, required | -| [path] | The target folder of backup files, defaults to be the current folder, optional | - -Note: insert current password when backup the encrypted account, and use such password when importing the backup files to generate account. It is permitted but not recommended to backup an unencrypted account, because it is not safe. - -Return message - -```shell -The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -``` - -Example: backup of an account with password - -```shell -nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -``` - - - -#### Remove account - -Remove local account according to account address; if the account is encrypted, insert password. - -- **Command: remove <address> ** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> | Account address, required | - -Return message - -```json -Success -``` - -Example - -```shell -nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -Success -``` - - - -#### Set account password - -Set password for the unencrypted accounts based on account address. No password setting for the encrypted accounts. - -- **Command: setpwd <address> ** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> | Account address, required | - -Return message - -```json -Success -``` - -Example - -```shell -nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Please enter the new password(8-20 characters, the combination of letters and numbers). -Enter your new password:********** -Please confirm new password:********** -Success -``` - - - -#### Change account password - -Change password of the encrypted accounts based on account address. No password changing for the unencrypted accounts. Require original password when replacing it with a new one. - -- **Command: resetpwd <address> ** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> | Account address, required | - -Return message - -```json -Success -``` - -Example - -```shell -nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Enter your old password:********** -Please enter the new password(8-20 characters, the combination of letters and numbers). -Enter your new password:********** -Please confirm new password:********** -Success -``` - - - -#### Set nickname - -Set a nickname for account. If the account is used to create nodes, the nickname will be displayed as node source. - -- **Command:setalias <address> <alias>** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> | Account address, required | -| <alias> | Nickname, required | - -Return message, transaction hash - -```json -"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" -``` - -Example - -```shell -nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias -"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" -``` - - - -#### Imported account keystore - -Imported account keystore files, and create a local account. Receive failure to import if there is an existing local account. - -- **Command: import keystore <path> ** - -| Parameter | Description | -| ------------ | ------------------------------ | -| <path> | Address of keystore files to be imported, required | - -Note: when importing keystore files to create an account, if they are encrypted, the password for backup of keystore files is required. - -Return message, imported account address - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -Example - -```shell -nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### Imported account’s private key - -Import account’s private key and create a local account. Receive failure to import if there is an existing local account. - -- **Command:import <privatekey> ** - -| Parameter | Description | -| ------------------ | ---------------- | -| <privatekey> | Account’s private key, required | - -注意:Note: when importing such private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. - -Return message, imported account address - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -Example - -```shell -nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -Please confirm new password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### Imported account’s private key (overwritten) - -Import account’s private key and create a local account. Receive failure to realize overwritten import if there is an existing local account. - -- **Command:import <privatekey> ** - -| Parameter | Description | -| ------------------ | ---------------- | -| <privatekey> | Account’s private key, required | - -Note: when importing account’s private key, set a new password. If the account does not need to be encrypted, users do not need to insert a new password. - -Overwritten import: if the account exists locally, the password before importing will be replaced with a new password after performing overwritten import; if the account is not encrypted after this import, the account will be unencrypted account (even though the account is encrypted before such import). - -Return message, imported account address - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -Example - -```shell -nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -Please confirm new password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### Inquire account information - -Inquire account information based on account address - -- **Command:getaccount <address>** - -| Parameter | Description | -| --------------- | :------------- | -| <address> | Account address, required | - -Return message - -```json -{ - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address - "alias" : null,//Nickname - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//Public key - "priKey" : "",//Private key (unavailable if the account is encrypted) - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//Private key after encryption (unavailable if the account is encrypted) - "extend" : null, - "createTime" : "2018-07-13 11:39:14",//Creation time - "encrypted" : true//Encrypted or not (set password or not) -} -``` - -Example - -```shell -nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -{ - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", - "alias" : null, - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", - "priKey" : "", - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", - "extend" : null, - "createTime" : "2018-07-13 11:39:14", - "encrypted" : true -} -``` - - - -#### Inquire list of accounts - -Inquire list of accounts as per paging parameter, and output all accounts in reverse sequence of creation time - -- **Command:getaccounts <pageNumber> <pageSize>** - -| Parameter | Description | -| ------------------ | -------------------------------- | -| <pageNumber> | Page, to get the data on which page, required| -| <pageSize> | Number of data displayed on each page, required | - -Return message, output accounts collection - -```json -[ { - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//Account address - "alias" : null,//Nickname - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",// Public key - "priKey" : "",//Private key (unavailable if the account is encrypted) - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",// Private key after encryption (unavailable if the account is encrypted) - "extend" : null, - "createTime" : "2018-07-13 11:39:14",//Creation time - "encrypted" : true//Encrypted or not (set password or not) -}, { - "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", - "alias" : null, - "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", - "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", - "encryptedPriKey" : "", - "extend" : null, - "createTime" : "2018-07-13 11:02:23", - "encrypted" : false -} ] -``` - - - -Example: to get list of accounts, showing page 1, 2 items per page - -```shell -nuls>>> getaccounts 1 2 -[ { - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", - "alias" : null, - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", - "priKey" : "", - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", - "extend" : null, - "createTime" : "2018-07-13 11:39:14", - "encrypted" : true -}, { - "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", - "alias" : null, - "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", - "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", - "encryptedPriKey" : "", - "extend" : null, - "createTime" : "2018-07-13 11:02:23", - "encrypted" : false -} ] -``` - - - -#### Inquire account’s private key - -Inquire account’s private key based on account address; if the account is encrypted, insert password. - -- **Command:getprikey <address> ** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> | Account address, required | - -Return message, imported account address - -```json -"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" -``` - -Example - -```shell -nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" -``` - - - -#### Inquire account balance - -Inquire account balance based on account address - -- **Command:getbalance <address> ** - -| Parameter | Description | -| --------------- | ---------------- | -| <address> |Account address, required | - -Return message, imported account address - -```json -{ - "balance" : "9999998.99",//Balance - "locked" : "0",//Locked balance - "usable" : "9999998.99"//Available balance -} -``` - -Example - -```shell -nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -{ - "balance" : "9999998.99", - "locked" : "0", - "usable" : "9999998.99" -} -``` - - - -#### Transfer - -Transfer NULS into another account address based on account address. If such account has password, insert password; if it has no password, transfer out directly. - -- **Command: transfer <address> <toAddress> <amount> [remark] ** - -| Parameter | Description | -| ----------------- | ----------------------------------------------- | -| <address> | transferring address, required | -| <toAddress> | receiving address, required | -| <amount> | transferred amount, round to 8 decimals in total (in NULS), required | -| [remark] | Remarks, required | - -Return message, transfer transaction hash - -```json -"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" -``` -Example - -```shell -nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 Transfer -Please enter the password. -Enter your password:********** -"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" -``` - - - -#### Inquire transaction details - -Inquire transaction details as per transaction hash - -- **Command:gettx <hash>** - -| Parameter | Description | -| ------------ | -------------- | -| <hash> | Transaction hash, required | - -Return message, transaction details - -```json -{ - "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash - "type" : "transfer",//Transaction type (transfer transaction as an example) - "time" : "2018-07-16 11:21:46",//Transaction time - "blockHeight" : 26269,//Block height of package transaction - "fee" : "0.001",//Transaction service charge - "value" : "100",//(Transfer) transaction amount - "remark" : "Transfer",//remarks - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//Signature - "status" : "confirm",//Status of transaction confirmation (confirmed or unconfirmed) - "confirmCount" : 46,//Times of confirmation - "size" : 254,//Size of transaction - "inputs" : [ {//Input of transaction - "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979998.98", - "lockTime" : 0 - } ], - "outputs" : [ {//Output of transaction - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 0, - "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"// Target address of transaction output (means to transfer 100 to the target address) - "value" : "100", - "lockTime" : 0, - "status" : "usable" - }, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//Transaction hash - "index" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//Target address of transaction output (means to give users changes) - "value" : "9979898.979", - "lockTime" : 0, - "status" : "usable" - } ] -} -``` - -Example, to inquire transfer transaction - -```shell -nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596 -{ - "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "type" : "transfer", - "time" : "2018-07-16 11:21:46", - "blockHeight" : 26269, - "fee" : "0.001", - "value" : "100", - "remark" : "Transfer", - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1", - "status" : "confirm", - "confirmCount" : 46, - "size" : 254, - "inputs" : [ { - "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979998.98", - "lockTime" : 0 - } ], - "outputs" : [ { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 0, - "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T", - "value" : "100", - "lockTime" : 0, - "status" : "usable" - }, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979898.979", - "lockTime" : 0, - "status" : "usable" - } ] -} -``` - - - -#### Inquire list of transactions - -Inquire list of transactions in this account based on account address - -- **Command:gettxlist <address> <pageNumber> <pageSize>** - -| Parameter | Description | -| ------------------ | -------------------------------- | -| <address> |Account address, required | -| <pageNumber> | Page, to get the data on which page, required | -| <pageSize> | Number of data displayed on each page, required | - -Return message, transaction details - -```json -[ { - "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//Transaction hash - "blockHeight" : 26473,//Block height of transaction - "time" : "2018-07-16 11:55:43",//Transaction time - "txType" : "transfer",//Transaction type - "status" : 1,//Status of confirmation - "info" : "+100"//Message -},{ - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "blockHeight" : 26269, - "time" : "2018-07-16 11:21:46", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -} ] -``` - -Example - -```shell -nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10 -[ { - "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e", - "blockHeight" : 26473, - "time" : "2018-07-16 11:55:43", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -}, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "blockHeight" : 26269, - "time" : "2018-07-16 11:21:46", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -} ] -``` - - - -#### Create node - -Create node based on account address. Need an account package address when creating node (package address shall have no password), and deposit of 2 at least. - -- **Command:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> ** - -| Parameter | Description | -| ---------------------- | ------------------------------------------------------------ | -| <agentAddress> | Account address of nodes created, required | -| <packingAddress> | Node account package address, required (note: the account shall have no password, otherwise the node cannot package) | -| <commissionRate> | Agent commission proportion, with a range of 10~100, required | -| <deposit> | Node creating deposit of 2 at least, required | - -Return message, agent hash of return node - -```json -"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" -``` - -Example: to create a node, commission proportion of 10%, and deposit of 20000 NULS - -```shell -nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 -Please enter the password. -Enter your password:********** -"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" -``` - - - -#### Include consensus (agency node) - -Include consensus of 2000NULS at least based on account address and node agent hash - -- **Command:deposit <address> <agentHash> <deposit> ** - -| Parameter | Description | -| ----------------- | -------------------------------------- | -| <address> | Account address, required | -| <agentHash> | Node agent hash, required | -| <deposit> | Include consensus deposit, not less than 2000NULS, required | - -Return message, transaction hash for including consensus; to exit the consensus, require such hash. - -```json -"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" -``` - -Example - -```shell -nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 -"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" -``` - - - -#### Exit the consensus (agency) - -Exit the consensus (agency) based on account address and transaction hash for including consensus. When an account agents several nodes, each agent transaction is independent, so users shall exit the corresponding agent rather than all agents as per the transaction hash of an agent. - -- **Command: withdraw <address> <txHash> ** - -| Parameter | Description | -| --------------- | ---------------------- | -| <address> | Account address, required | -| <txHash> | Transaction hash upon agency, required | - -Return message, transaction hash upon exiting the consensus - -```json -"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" -``` - -Example - -```shell -nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 -"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" -``` - - - -#### Stop node - -Stop node, all NULS agented to node will be returned, and the deposit in account of node creator will be locked for 72 hours. - -- **Command:stopagent <address> ** - -| Parameter | Description | -| --------------- | -------------- | -| <address> | Account address, required | - -Return message, transaction hash of stop node - -```json -"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" -``` - -Example - -```shell -nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Please enter the password. -Enter your password:********** -"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" -``` - - - -#### Get node details - -Get node details as per agent hash of node - -- **Command: getagent <agentHash> ** - -| Parameter | Description | -| ----------------- | --------------------- | -| <agentHash> | Node agent hash, required | - -Return message - -```json -{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) - "deposit" : "20000",//Deposit for creating node - "commissionRate" : 60.0,//Agent commission proportion - "agentName" : null,//Node name (source) - "agentId" : "35024DE6",//Node ID - "time" : "2018-07-16 16:33:38",//Time for creating node - "blockHeight" : 28141,// Block height of node creating transaction - "delHeight" : -1, - "status" : "consensus",// Status - "creditVal" : 0.05,//Credit value - "totalDeposit" : "208000",//Current total agency amount of node - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5//Quantity of participants -} -``` - -Example - -```shell -nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6 -{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.05, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -} -``` - - - -#### Get list of nodes - -As per list of consensus nodes - -- **Command:getagents <pageNumber> <pageSize> ** - -| Parameter | Description | -| ------------------ | -------------------------------- | -| <pageNumber> | Page, to get the data on which page, required | -| <pageSize> | Number of data displayed on each page, required | - -Return message - -```json -[{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Account address for creating node - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//Node package (block) address - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//Bonus address (default to be address for creating node) - "deposit" : "20000",//Deposit for creating node - "commissionRate" : 60.0,//Agent commission proportion - "agentName" : null,//Node name (source) - "agentId" : "35024DE6",//Node ID - "time" : "2018-07-16 16:33:38",//Time for creating node - "blockHeight" : 28141,//Block height of node creating transaction - "delHeight" : -1, - "status" : "consensus",//Status - "creditVal" : 0.05,//Credit value - "totalDeposit" : "208000",//Current total agent amount of node - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5//Quantity of participants -}] -``` - -Example - -```shell -nuls>>> getagents 1 2 -[ { - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.18, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -}, { - "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", - "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", - "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7", - "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", - "deposit" : "20000", - "commissionRate" : 10.0, - "agentName" : null, - "agentId" : "5CE291D8", - "time" : "2018-07-16 16:31:12", - "blockHeight" : 28126, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : -0.16, - "totalDeposit" : "208000", - "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", - "memberCount" : 5 -} ] -``` - - - -#### Get total information of network consensuses - -Inquire total information of network consensuses - -- **Command:getconsensus ** - -Return message - -```json -{ - "agentCount" : 6,//Quantity of nodes - "totalDeposit" : "1758000",//Total quantity of agents - "rewardOfDay" : "0",//Bonus - "consensusAccountNumber" : 6,//Quantity of consensus accounts - "packingAgentCount" : 6//Quantity of package addresses -} -``` - -Example - -```shell -nuls>>> getconsensus -{ - "agentCount" : 6, - "totalDeposit" : "1758000", - "rewardOfDay" : "0", - "consensusAccountNumber" : 6, - "packingAgentCount" : 6 -} -``` - - - -#### Get general of agents in single account - -Get the general of all agents (consensuses) information of the account based on account address - -- **Command:getdepositedinfo <address> ** - -| Parameter | Description | -| --------------- | -------------- | -| <address> |Account address, required | - -Return message - -```json -{ - "agentCount" : 1,//Quantity of nodes created - "totalDeposit" : "1600000",// Quantity of total agents - "joinAgentCount" : 6,//Quantity of nodes in agency - "usableBalance" : "8048998.869",//Available balance - "reward" : "219.65910271",//Total bonuses gained - "rewardOfDay" : "219.65910271",//Bonuses gained a day - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//Node hash -} -``` - -Example - -```shell -nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -{ - "agentCount" : 1, - "totalDeposit" : "1600000", - "joinAgentCount" : 6, - "usableBalance" : "8048998.869", - "reward" : "219.65910271", - "rewardOfDay" : "219.65910271", - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd" -} -``` - - - -#### Get list of agent information of single account - -Get list of agent information of the account as per address (return consensus information list), and review the list of agency information of the account under a node when following the agent hash. - -- **Command:getdepositeds <address> <pageNumber> <pageSize> [agentHash] ** - -| Parameter | Description | -| ------------------ | -------------------------------- | -| <address> | Account address, required | -| <pageNumber> | Page, to get the data on which page, required | -| <pageSize> | Number of data displayed on each page, required | -| [agentHash] | Node hash, optional | - -Return message - -```json -[{ - "deposit" : "2000",//Agency amount - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Address of agent - "time" : "2018-07-16 16:38:25",//Time - "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//Agency transaction hash - "blockHeight" : 28148,//Block height of transaction - "delHeight" : -1, - "status" : "consensus",//Node status - "agentName" : "35024DE6",//Node name - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//Node address -}] -``` - -Example - -```shell -nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 -[ { - "deposit" : "2000", - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "time" : "2018-07-16 16:38:25", - "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221", - "blockHeight" : 28148, - "delHeight" : -1, - "status" : "consensus", - "agentName" : "35024DE6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh" -}, { - "deposit" : "2000", - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "time" : "2018-07-16 16:38:43", - "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234", - "blockHeight" : 28149, - "delHeight" : -1, - "status" : "consensus", - "agentName" : "E09EB7FD", - "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT" -} ] -``` - - - -#### Get list of agency nodes of single account - -Inquire list of agency nodes asper address (return list of node information) - -- **Command:getdepositedagents <address> <pageNumber> <pageSize> ** - -| Parameter | Description | -| ------------------ | -------------------------------- | -| <address> |Account address, required | -| <pageNumber> | Page, to get the data on which page, required | -| <pageSize> | Number of data displayed on each page, required | - -Return message - -```json -[ { - "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//Node hash - "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Account address for creating node - "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//Node package (block) address - "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//Bonus address (default to be address for creating node) - "deposit" : "20000",//Deposit for creating node - "commissionRate" : 40.0,//Agent commission proportion - "agentName" : null,//Node name (source) - "agentId" : "0198ACAF",// Node ID - "time" : "2018-07-16 16:32:52",//Time for creating node - "blockHeight" : 28136,//Block height of node creating transaction - "delHeight" : -1, - "status" : "consensus",//Status - "creditVal" : -0.91,//Credit value - "totalDeposit" : "204000",//Current total agent amount of node - "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "memberCount" : 3// Quantity of participants -}] -``` - -Example, to get page 1, display 2 items per page - -```shell -nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 -[ { - "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr", - "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "deposit" : "20000", - "commissionRate" : 40.0, - "agentName" : null, - "agentId" : "0198ACAF", - "time" : "2018-07-16 16:32:52", - "blockHeight" : 28136, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : -0.91, - "totalDeposit" : "204000", - "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "memberCount" : 3 -}, { - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.91, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -} ] -``` - - - -#### Get the latest block head information - -Get the latest block head information - -- **Command:getbestblockheader** - -Return message - -```json -{ - "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//Block hash - "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//Former block hash - "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//Merkle hash - "time" : "2018-07-17 10:25:40",//Block generation time - "height" : 33950,//Block height - "txCount" : 1,//Quantity of block package transactions - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address - "roundIndex" : 668413,//Rounds of consensuses - "consensusMemberCount" : 1,//Quantity of participants in consensus - "roundStartTime" : "2018-07-17 10:25:30",//Start time of current round - "packingIndexOfRound" : 1,//Rank of package and block in current round - "reward" : "0",//Consensus bonus - "fee" : "0",//Package service charge of block - "confirmCount" : 0,//Times of confirmation - "size" : 204,//Size of block - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"// Signature -} -``` - -Example - -```shell -nuls>>> getbestblockheader -{ - "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e", - "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d", - "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877", - "time" : "2018-07-17 10:25:40", - "height" : 33950, - "txCount" : 1, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 668413, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-17 10:25:30", - "packingIndexOfRound" : 1, - "reward" : "0", - "fee" : "0", - "confirmCount" : 0, - "size" : 204, - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9" -} -``` - - - -#### Inquire block information - -Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. - -- **Command:getblock <hash> | <height> ** - -| Parameter | Description | -| -------------- | ------------ | -| <hash> | Block hash | -| <height> | Height of block | - -Return message - -```json -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash - "time" : "2018-07-16 16:29:30",//Block generation time - "height" : 28115,//Block height - "txCount" : 2,//Quantity of block package transactions - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address - "roundIndex" : 662578,//Rounds of consensuses - "consensusMemberCount" : 1,//Quantity of participants in consensus - "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round - "packingIndexOfRound" : 1,//Rank of package and block in current round - "reward" : "0.001",//Consensus bonus - "fee" : "0.001",//Package service charge of block - "confirmCount" : 6174,//Times of confirmation - "size" : 507,//Size of block - "txList" : [ {//Transaction collection - "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//Transaction hash - "type" : "coinbase",//Transaction type - "time" : "2018-07-16 16:29:30",//Transaction time - "blockHeight" : 28115,//Block height of transaction - "fee" : "0",//Transaction service charge - "value" : null, - "remark" : null, - "scriptSig" : null, - "status" : "confirm", - "confirmCount" : 6174, - "size" : 54, - "inputs" : [ ],//Transaction input - "outputs" : [ //Transaction output - { - "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "value" : 100000, - "lockTime" : 29115 - } - ] - }], - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature -} -``` - -Example: to get block as per height - -```shell -nuls>>> getblock 28115 -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", - "time" : "2018-07-16 16:29:30", - "height" : 28115, - "txCount" : 2, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 662578, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-16 16:29:20", - "packingIndexOfRound" : 1, - "reward" : "0.001", - "fee" : "0.001", - "confirmCount" : 6174, - "size" : 507, - "txList" : [ { - "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841", - "type" : "coinbase", - "time" : "2018-07-16 16:29:30", - "blockHeight" : 28115, - "fee" : "0", - "value" : null, - "remark" : null, - "scriptSig" : null, - "status" : "confirm", - "confirmCount" : 6174, - "size" : 54, - "inputs" : [ ], - "outputs" : [ { - "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "value" : 100000, - "lockTime" : 29115 - } ] - }, { - "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b", - "type" : "transfer", - "time" : "2018-07-16 16:29:27", - "blockHeight" : 28115, - "fee" : "0.001", - "value" : null, - "remark" : null, - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663", - "status" : "confirm", - "confirmCount" : 6174, - "size" : 249, - "inputs" : [ { - "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : 972899896100000 - } ], - "outputs" : [ { - "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne", - "value" : 3000000000000, - "lockTime" : 0 - }, { - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : 969899896000000, - "lockTime" : 0 - } ] - } ], - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" -} -``` - - - -#### Inquire block head information - -Inquire block head information as per block height or block hash. Do and only choose one parameter as inquiry condition. - -- **Command:getblockheader <hash> | <height> ** - -| Parameter | Description | -| -------------- | ------------ | -| <hash> | Block hash | -| <height> | Block height | - -Return message - -```json -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//Block hash - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//Former block hash - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//Merkle hash - "time" : "2018-07-16 16:29:30",//Block generation time - "height" : 28115,//Block height - "txCount" : 2,//Quantity of block package transactions - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//Package address - "roundIndex" : 662578,//Rounds of consensuses - "consensusMemberCount" : 1,//Quantity of participants in consensus - "roundStartTime" : "2018-07-16 16:29:20",//Start time of current round - "packingIndexOfRound" : 1,//Rank of package and block in current round - "reward" : "0.001",//Consensus bonus - "fee" : "0.001",//Package service charge of block - "confirmCount" : 6174,//Times of confirmation - "size" : 507,//Size of block - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//Signature -} -``` - -Example: to get block as per height - -```shell -nuls>>> getblockheader 28115 -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", - "time" : "2018-07-16 16:29:30", - "height" : 28115, - "txCount" : 2, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 662578, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-16 16:29:20", - "packingIndexOfRound" : 1, - "reward" : "0.001", - "fee" : "0.001", - "confirmCount" : 6280, - "size" : 204, - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" -} -``` - - - -#### Inquire network information - -Inquire network basic information - -- **Command:getnetinfo ** - -Return message - -```json -{ - "localBestHeight" : 35317,//Height of local latest block - "netBestHeight" : 35317,//Height of latest block online - "timeOffset" : "0ms",//Offset of network time - "inCount" : 0,//Quantity of passive connecting nodes - "outCount" : 1//Quantity of active connecting nodes -} -``` - -Example - -```shell -nuls>>> getnetinfo -{ - "localBestHeight" : 35317, - "netBestHeight" : 35317, - "timeOffset" : "0ms", - "inCount" : 0, - "outCount" : 1 -} -``` - - - -#### Inquire network node IP - -Inquire network node IP - -- **Command: getnetnodes ** - -Return message - -```json -[ "192.168.1.223" ] -``` - -Example: get block as per height - -```shell -nuls>>> getnetnodes -[ "192.168.1.223" ] -``` - - - -#### Inquire current version information - -Inquire current version number - -- **Command:version ** - -Return message - -```json -[ "192.168.1.223" ] -``` - -Example - -```shell -nuls>>> version -{ - "myVersion" : "1.0.0", - "newestVersion" : "0.9.11", - "upgradable" : false, - "infromation" : " Address format modification, node finding logic optimizing, block downloading logic optimizing, property and stability optimizing" -} -``` - - - -#### Version update - -Inquire current version number - -- **Command:upgrade <version> ** - -Example - -```shell -nuls>>> version 1.0.0 -``` - - - -#### Exit wallet command program - -Exiting from wallet command line program does not mean exiting from wallet node started. - -- **Command:exit** - -Example - -```shell -nuls>>> exit -``` diff --git a/source/docs/sdk.md b/source/docs/sdk.md deleted file mode 100644 index 37de4a10..00000000 --- a/source/docs/sdk.md +++ /dev/null @@ -1,2802 +0,0 @@ -title: NULS-SDK ---- - - -## 介绍 -本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。 -### 约定 - -- 所有SDK接口统一返回Result(说明见文末附件数据解释) -- 每个接口描述的返回对象是指Result中data属性的内容 -- 除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na -- 运行SDK前,需要确认NULS节点服务已经启动并工作正常 -- 推荐使用JDK1.8+ - -### 版本更新记录 - - - -| 版本 | 更新日期 | 更新内容 | -| :-------: | :--------: | :----------------------------------------------------------: | -| v0.9.11.0 | 2018-06-19 | 对接NULS服务各项基础功能的接口 | -| v0.9.11.1 | 2018-06-22 | 新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1 | -| v0.9.14 | 2018-07-04 | 修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等) | -| v0.9.15 | 2018-07-07 | 新增4个共识接口,4.1——4.4 | -| v0.9.16 | 2018-07-11 | 新增接口4.5 | -| v1.0.1 | 2018-07-13 | 新增错误码 | -| v1.1.0 | 2018-09-28 | 新增多账户转账接口 | - - - -## 快速入门 -### 1.引入文件 -使用构建工具导入jar包 - -- maven方式 - -```xml - - io.nuls.sdk - sdk-all - 1.0.1 - -``` - -### 2.创建SDK实例 -首先添加SDK命名空间 - -```java -//SDK启动类命名空间 -import io.nuls.sdk.SDKBootstrap; -import io.nuls.sdk.model.Result; -//引入SDK调用工具的命名空间 -import io.nuls.sdk.tool.NulsSDKTool; -``` - -引入后 使用下列代码生成一个实例client - -- 初始化SDK -- 初始化方法不传参数时,默认PRC ip和端口分别为`127.0.0.1`,`8001` - -```java -//默认 -SDKBootstrap.init(); -//传入NULS服务的ip,port -SDKBootstrap.init("192.168.1.88", "8001"); -``` - -- 使用工具类调用接口方法 - - -```java -Result result = NulsSDKTool.createAccount("nuls123456"); -``` - *e.g 创建一个带密码的账户的完整示例* - -```java -import io.nuls.sdk.SDKBootstrap; -import io.nuls.sdk.model.Result; -//根据需求引入对应模块的命名空间 -import io.nuls.sdk.tool.NulsSDKTool; - -public static void main(String[] args) { - SDKBootstrap.init(); - Result result = NulsSDKTool.createAccount("nuls123456"); -} -``` --- -### 账户 AccountService -#### 1.1 创建账户 -接口 - -**`Result createAccount(int count, String password);`** - -说明 -> 创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户; -> 成功创建的账户信息将被持久化至NULS服务本地数据库中。 -> -> 返回成功创建的账户地址集合 - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "list": [ //返回创建账户的地址集合 - "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv", - "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv" - ] - } -} -``` - - -*e.g 示例代码* - -```java -//创建一个没有密码的账户 -createAccount(); -//创建一个有密码的账户 -createAccount("nuls123456"); -//创建3个没有密码的账户 -createAccount(3); -//创建3个有密码的账户 -createAccount(3, "nuls123456"); -``` ---- - -#### 1.2 创建离线账户 -接口 - -**`Result createOfflineAccount(int count, String password)`** - -说明 - -> 直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作 -> Create encrypted off-line accounts (Not saved to the database) -> -> Result.data `List` - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "list":[ - { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - }, - { - "address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD", - "alias": null, - "pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb", - "extend": null, - "createTime": 1529314943624, - "encrypted": true, - "priKey": "", - "encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0" - } - ] - } -} -``` - -*e.g 示例代码* - -```java -//创建一个没有密码的离线账户 -createOfflineAccount(); -//创建一个有密码的离线账户 -createOfflineAccount("nuls123456"); -//创建3个没有密码的离线账户 -createOfflineAccount(3); -//创建3个有密码的离线账户 -createOfflineAccount(3, "nuls123456"); -``` - ---- - -#### 1.3 获取账户 - -接口 - -**`Result getAccount(String address)`** - -说明 - -> 根据账户地址获取一个账户的信息 -> -> Result.data `AccountInfo` - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - } -} -``` - -*e.g 示例代码* - -```java -getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.4 获取设置别名的手续费 -接口 - -**`Result getAliasFee(String address, String alias)`** - -说明 - -> 根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费) -> -> Result.data `double`, unit is `NULS` - -**注意!** 此接口返回的手续费单位为`NULS` - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "value": 0.01 //(单位为NULS) - } -} -``` - -*e.g 示例代码* - -```java -getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666"); -``` ---- - -#### 1.5 获取账户列表 -接口 - -**`Result getAccountList(int pageNumber, int pageSize)`** - -说明 - -> 根据分页参数获取账户列表 -> -> Result.data Page `List` - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
pageNumberint必填页码,必须大于0
pageSizeint必填每页返回数据记录数量, 取值范围1~100
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "pageNumber": 1, - "pageSize": 10, - "total": 100, - "pages": 10, - "list": [ - { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - }, - { - "address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP", - "alias": null, - "pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184", - "extend": null, - "createTime": 1529311250627, - "encrypted": true, - "priKey": null, - "encryptedPriKey": null - } - ... - - ] - } -} -``` - -*e.g 示例代码* - -```java -getAccountList(1, 10); -``` ---- - -#### 1.6 根据账户别名获取账户地址 -接口 - -**`Result getAddressByAlias(String alias)`** - -说明 -> 根据账户别名获取账户地址字符串 -> -> Result.data `String` - - - - - - - - - - - - - - -
参数类型是否必填说明
aliasString必填账户别名
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS" - } -} -``` -*e.g 示例代码* - -```java - getAddressByAlias("factory666"); -``` ---- - -#### 1.7 获取账户私钥 -接口 - -**`Result getPrikey(String address, String password)`** - -说明 -> 根据账户地址和密码获取账户私钥,返回私钥字符串 -> -> Result.data `String` - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24" - } -} -``` -*e.g 示例代码* - -```java -//有密码的账户调用方式 -getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -//无密码的账户调用方式 -getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.8 验证别名是否可以使用 -接口 - -**`Result isAliasUsable(String alias)`** - -说明 -> 根据别名名称验证别名是否可用(是否没有被使用) -> -> Result - - - - - - - - - - - - - - -
参数类型是否必填说明
aliasString必填别名名称
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示别名可以使用 - "success": true, - "data": { - "value":true - } -} -``` -- 返回 别名不可用的情况 - -```json -{ //表示别名不可以使用 - "success": true, - "data":{ - "value": false - } -} -``` -- 返回错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -isAliasUsable("factory666"); -``` ---- - -#### 1.9 备份账户 -接口 - -**`Result backupAccount(String address, String path, String password)`** - -说明 - -> 根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码 -> -> Result 返回生成的文件地址 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
pathString必填将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore" - } -} -``` -*e.g 示例代码* - -```java -//备份一个没有密码的账户至当前目录 -backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null); -//备份一个有密码的账户至/backup目录 -backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456"); -``` ---- - -#### 1.10 导入账户 -接口 - -**`Result importAccountByKeystore`** - -说明 - -> 根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
path/fileReaderString/FileReader必填待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象
passwordString非必填.keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS" - } -} -``` -*e.g 示例代码* - -```java -//导入一个有密码的账户 -importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true); -importAccountByKeystore(fileReader, "nuls123456", true); -//导入一个没有密码的账户 -importAccountByKeystore("/backup/XXXXXX.keystore", false); -importAccountByKeystore(fileReader, false); -``` ---- - -#### 1.11 导入账户(私钥) -接口 - -**`Result importAccountByPriKey(String privateKey, String password, boolean overwrite)`** - -说明 - -> 根据私钥导入账户 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
privateKeyString必填账户私钥
passwordString非必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS" - } -} -``` -*e.g 示例代码* - -```java -//导入账户时设置密码 -importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true); -//导入账户时不设置密码 -importAccountByPriKey("1f9d3ad044e0e120......", true); -``` ---- - -#### 1.12 验证账户是否加密 -接口 - -**`Result isEncrypted(String address)`** - -说明 - -> 验证账户是否加密 -> -> Result - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示已加密 - "success": true, - "data": { - "value":true - } -} -``` -- 返回 未加密 - -```json -{ - "success": true, - "data":{ - "value": false - } -} -``` -- 返回错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` - -*e.g 示例代码* - -```java -isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.13 移除账户 -接口 - -**`Result removeAccount(String address, String password)`** - -说明 - -> 移除账户 -> -> Result - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -``` ---- - -#### 1.13 设置密码 -接口 - -**`Result setPassword(String address, String password)`** - -说明 - -> 为未加密的账户设置密码,已加密账户不能调用此接口 -> -> Result - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -``` ---- - -#### 1.14 修改密码 -接口 - -**`Result resetPassword(String address, String password, String newPassword)`** - -说明 - -> 为已加密的账户修改密码,未加密账户不能调用此接口 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString必填账户当前密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111"); -``` ---- - -#### 1.15 设置别名 -接口 - -**`Result setAlias(String address, String alias, String password)`** - -说明 - -> 为账户设置一个别名 -> -> Result 返回设置别名的交易hash - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
passwordString密码账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6" - } -} -``` -- 错误示例 - -```json -{ - "success": false, - "data":{ - "code": "ACT007", - "msg": "The account already set an alias" - } -} -``` -*e.g 示例代码* - -```java -setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111"); -setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666"); -``` ---- - -#### 1.16 设置离线账户密码 -接口 - -**`Result setPasswordOffline(String address, String priKey, String password)`** - -说明 - -> 设置离线账户密码, sdk中独立加密,不与NULS服务交互 -> -> Result 返回加密后的私钥(encryptedPriKey) - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
priKeyString必填账户的私钥
passwordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" - } -} -``` -*e.g 示例代码* - -```java -setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456"); -``` ---- - -#### 1.17 修改离线账户密码 -接口 - -**`Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)`** - -接口 - -> 修改离线账户密码, sdk中独立修改, 不与NULS服务交互 -> -> Result 返回新密码生成的加密后的私钥(encryptedPriKey) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
encryptedPriKeyString必填加密后的私钥
passwordString必填原密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" - } -} -``` -*e.g 示例代码* - -```java -resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456"); -``` ---- - -### 交易 AccountLedgerService - -#### 2.1 创建转账交易 -接口 - -**`Result createTransaction(List inputs, List outputs, String remark)`** - -说明 - -> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
remarkString非必填交易备注
- -*e.g 示例代码* - -```java -String remark = "create transaction demo"; -long fee = 100000; -List inputs = new ArrayList<>(); -List outputs = new ArrayList<>(); - -//组装交易的inputs,示例中的input属性均必填 -Input input = new Input(); -input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); -input.setFromIndex(1); -input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") -input.setValue(1000000000L); -input.setLockTime(0); -inputs.add(input); - -//组装交易的outputs,示例中的output属性均必填 -Output output = new Output(); -output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); -output.setValue(1000000L); -output.setLockTime(0L); -outputs.add(output); - -output = new Output(); -output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); -output.setValue(1000000000L - 1000000 - fee); -output.setLockTime(0L); -outputs.add(output); - -Result result = NulsSDKTool.createTransaction(inputs, outputs, remark); -``` ---- - - -> **交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:100000 NA/1KB -> -> **交易大小的计算**:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 -> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 2.2 交易签名 - -接口 - -**`Result signTransaction(String txHex, String priKey, String address, String password)`** - -说明 - -> 通过私钥,给交易签名 -> -> Result.data `String` 签名后的交易,16进制后的序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
priKeyString必填交易的私钥
addressString必填私钥对应的地址,用于验证私钥合法性
passwordString非必填私钥的密码,如果私钥未加密可不传
- -*e.g 示例代码* - -```java -String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; -String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"; -String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"; -String password = "NULS6352s!f"; -Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password); -``` - -> - ---- - -#### 2.3 根据交易hash查询交易详情 -接口 - -**`Result getTxByHash(String hash)`** - -说明 - -> 根据交易hash查询交易详情 -> -> Result.data `Transaction` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填交易的hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 99900000000, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 1, - "confirmCount": 14, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9999899000000 - } - ], - "outputs": [ - { - "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "index": 0, - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0, - "status": 0 - }, - { - "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "index": 1, - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0, - "status": 0 - } - ] - } -} -``` -*e.g 示例代码* - -```java -getTxByHash("041f3d2ceed........"); -``` ---- - -#### 2.4 转账 -接口 - -**`Result transfer(String address, String toAddress, String password, long amount, String remark)`** - -说明 - -> 发起转账交易 -> -> Result 返回交易hash - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填转出者账户的地址
toAddressString必填接收者账户的地址
passwordString非必填转出者账户的密码,如果账户没有加密则不填
amountlong必填转账金额(单位:Na)
remarkString必填备注
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2" - } -} -``` -*e.g 示例代码* - -```java - //账户有密码 -transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "备注1NULS=10000000Na"); -//账户没有密码 -transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, "备注1NULS=10000000Na"); -``` ---- - -#### 2.5 查询账户余额 -接口 - -**`Result getBalance(String address)`** - -说明 - -> 获取账户余额 -> -> Result.data `BalanceInfo ` - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "balance": 1009899998900000, - "usable": 1009899998900000, - "locked": 0 - } -} -``` -*e.g 示例代码* - -```java -getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS"); -``` ---- - -#### 2.6 广播交易 -接口 - -**`Result broadcastTransaction(String txHex);`** - -说明 - -> 广播交易 -> -> Result.data String 返回交易hash - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制交易序列化数据
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85" - } -} - -``` -*e.g 示例代码* - -```java -String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"; -Result result = service.broadcastTransaction(txHex); -if(result.isSuccess()) { - String txHash = (String)result.getData(); -} -``` ---- - -#### 2.7 创建多地址转账交易 - -接口 - -**`Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)`** - -说明 - -> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
nInputAccountint必填输入账户数
remarkString非必填交易备注
- -*e.g 示例代码* - -```java -String remark = "create transaction demo"; -long fee = 100000; -List inputs = new ArrayList<>(); -List outputs = new ArrayList<>(); -int nInputAccount = 2; - -//组装交易的inputs,示例中的input属性均必填 -Input input = new Input(); -input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); -input.setFromIndex(1); -input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") -input.setValue(1000000000L); -input.setLockTime(0); -inputs.add(input); - -//组装交易的outputs,示例中的output属性均必填 -Output output = new Output(); -output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); -output.setValue(1000000L); -output.setLockTime(0L); -outputs.add(output); - -output = new Output(); -output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); -output.setValue(1000000000L - 1000000 - fee); -output.setLockTime(0L); -outputs.add(output); - -Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark); -``` - ------- - -> **交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:100000 NA/1KB -> -> **交易大小的计算**:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 -> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 2.8 多地址转账交易签名 - -接口 - -**`Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)`** - -说明 - -> 通过私钥,给交易签名 -> -> Result.data `String` 签名后的交易,16进制后的序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
privKeysList必填交易的私钥
passwordsList必填私钥对应的密码(多个账户密码必须一样)
- -*e.g 示例代码* - -```java -String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; -List priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"); -List passwords = Arrays.asList("123456","123456"); -Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords); -``` - -> - -### 区块 BlockService - -#### 3.1 根据区块高度获取区块头 -接口 - -**`Result getblockHeader(int height)`** - -说明 - -> 根据区块高度获取区块头信息 -> -> Result.data `BlockHeader ` - - - - - - - - - - - - - - -
参数类型是否必填说明
heightint必填区块高度
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} -``` -*e.g 示例代码* - -```java -getblockHeader(10); -``` ---- - -#### 3.2 根据区块hash获取区块头 -接口 - -**`Result getblockHeader(String hash)`** - -说明 - -> 根据区块hash获取区块头 -> -> Result.data `BlockHeader` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填区块hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} -``` -*e.g 示例代码* - -```java -getblockHeader("041f3d2ceed........"); -``` ---- - -#### 3.3 根据区块高度获取区块 -接口 - -**`Result getBlock(int height)`** - -说明 - -> 根据区块高度获取区块 -> -> Result.data `Block ` - - - - - - - - - - - - - - -
参数类型是否必填说明
heightint必填区块高度
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", - "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", - "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", - "time": 1529323210000, - "height": 1884, - "txCount": 1884, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", - "roundIndex": 420416, - "consensusMemberCount": 5, - "roundStartTime": 1529323170000, - "packingIndexOfRound": 4, - "confirmCount": 33, - "reward": 100000, - "fee": 100000, - "size": 5, - "txList": [ - { - "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", - "type": 1, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 54, - "inputs": [], - "outputs": [ - { - "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "value": 100000, - "lockTime": 2884 - } - ] - }, - { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 0, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 0, - "confirmCount": 33, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": null, - "value": 9999899000000 - } - ], - "outputs": [ - { - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0 - }, - { - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0 - } - ] - }, - { - "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", - "type": 7, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 38, - "inputs": [], - "outputs": [] - } - ] - } -} -``` -*e.g 示例代码* - -```java -getBlock(10); -``` ---- - -#### 3.4 根据区块hash获取区块 -接口 - -**`Result getBlock(String hash)`** - -说明 - -> 根据区块hash获取区块 -> -> Result.data `Block ` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填区块hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", - "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", - "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", - "time": 1529323210000, - "height": 1884, - "txCount": 1884, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", - "roundIndex": 420416, - "consensusMemberCount": 5, - "roundStartTime": 1529323170000, - "packingIndexOfRound": 4, - "confirmCount": 33, - "reward": 100000, - "fee": 100000, - "size": 5, - "txList": [ - { - "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", - "type": 1, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 54, - "inputs": [], - "outputs": [ - { - "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "value": 100000, - "lockTime": 2884 - } - ] - }, - { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 0, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 0, - "confirmCount": 33, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": null, - "value": 9999899000000 - } - ], - "outputs": [ - { - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0 - }, - { - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0 - } - ] - }, - { - "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", - "type": 7, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 38, - "inputs": [], - "outputs": [] - } - ] - } -} -``` -*e.g 示例代码* - -```java -getBlock("041f3d2ceed........"); -``` ---- - -#### 3.5 获取最新区块头 -接口 - -**`Result getNewestBlockHash()`** - -说明 - -> 获取最新的区块头 -> -> Result.data `BlockHeader` - - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} - -``` -*e.g 示例代码* - -```java -getNewestBlockHash(); -``` ---- - -#### 3.6 获取最新区块的高度 -接口 - -**`Result getNewestBlockHight()`** - -说明 - -> 获取最新区块的高度 -> -> Result.data 高度(Long) - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": 5210 - } -}} - -``` -*e.g 示例代码* - -```java -getNewestBlockHight(); -``` ---- - -#### 3.7 获取最新区块的块Hash -接口 - -**`Result getNewestBlockHash()`** - -说明 - -> 获取最新区块的块Hash -> -> Result.data Hash值(String) - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b" - } -}} - -``` -*e.g 示例代码* - -```java -getNewestBlockHash(); -``` ---- - - - -### 共识 ConsensusService - -#### 4.1 离线组装创建节点交易 - -接口 - -**` Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee) `** - -说明 - -> 离线组装创建节点交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
agentInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
- -*e.g 示例代码* - -```java -//组装交易的inputs,示例中的input属性均必填 -List inputs = new ArrayList<>(); -Input input = new Input(); -input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -input.setFromIndex(1); -input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -input.setValue(999998760000000L); -inputs.add(input); - -//创建节点信息,示例总AgentInfo的属性均必填 -AgentInfo info = new AgentInfo(); -info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //申请共识节点的地址 -info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"); //实际打包区块的地址 -info.setDeposit(200000 * 100000000L);//创建节点的保证金, 最低20000NULS,最高200000NULS -info.setCommissionRate(10.0); //佣金比例 1-100 - -//创建节点的手续费 -Na fee = Na.valueOf(1000000L); - -Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - ------- - -> **创建共识节点交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:1000000 NA/1KB -> -> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , -> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 4.2 离线组装委托共识交易 - -接口 - -**` Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee) `** - -说明 - -> 离线组装委托共识交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
depositInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
- -*e.g 示例代码* - -```java -//组装交易的inputs,示例中的input属性均必填 -List inputs = new ArrayList<>(); -Input input = new Input(); -input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -input.setFromIndex(1); -input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -input.setValue(999998760000000L); -inputs.add(input); - -//委托共识信息,示例中DepositInfo的属性均必填 -DepositInfo info = new DepositInfo(); -info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //委托共识的地址 -info.setDeposit(300000 * 100000000L);//委托代币数量:2000NULS —— 500000NULS -info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");//创建共识节点的交易id - -//创建节点的手续费 -Na fee = Na.valueOf(1000000L); - -Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - ------- - -> **创建委托交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:1000000 NA/1KB -> -> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , -> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 4.3 离线组装退出委托共识交易 - -接口 - -**` Result createCancelDepositTransaction(Output output) `** - -说明 - -> 离线组装退出委托共识交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - -
参数类型是否必填说明
outputObject必填参与共识时被锁定的那条output
- -*e.g 示例代码* - -```java -//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额, -//将output作为参数,生成退出委托共识交易 -Output output = new Output(); -output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -output.setIndex(0); -output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -output.setValue(20000000000000L); -output.setLockTime(-1); - -Result result = NulsSDKTool.createCancelDepositTransaction(output); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - - - -#### 4.4 离线组装删除共识节点交易 - -接口 - -**` Result createStopAgentTransaction(Output output) `** - -说明 - -> 离线组装删除共识节点交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - -
参数类型是否必填说明
outputObject必填创建节点时被锁定的那条output
- -*e.g 示例代码* - -```java -//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金, -//将output作为参数,生成退出委托共识交易 -Output output = new Output(); -output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -output.setIndex(0); -output.setValue(20000000000000L); -output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -output.setLockTime(-1); - -Result result = NulsSDKTool.createStopAgentTransaction(output); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - - - -#### 4.5 获取委托共识列表 - -接口 - -**` Result getDeposits(String address, int pageNumber, int pageSize) `** - -说明 - -> 获取地址的委托共识列表 -> -> Result.data List委托列表信息 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填委托地址
pageNumberInt必填页码
pageSizeInt必填每页显示条数,1-100之间
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success":true, - "data":{ - "pageNumber":1, - "pageSize":10, - "total":1, - "pages":1, - "list":[ - { - "deposit":20000010000000, - "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c", - "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA", - "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e", - "blockHeight":98, - "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA" - } - ] - } -} -``` - -*e.g 示例代码* - -```java -Result result = NulsSDKTool.getDeposits(address, 1, 10); -``` - - - - - -### 附录 - -#### 接口返回Result示例 -##### Result - -- 表示接口访问正常,业务返回具体的数据 - -```json -{ - "success": true,//接口执行的正确性 - "data": data -} -``` -- 表示接口访问正常,业务返回true - -```json -{ //表示接口访问正常,业务返回true - "success": true,//接口执行的正确性 - "data": { - "value":true //接口业务功能的返回结果 - } -} -``` -- 表示接口访问正常,业务返回false - -```json -{ - "success": true, //接口执行的正确性 - "data":{ - "value": false //接口业务功能的返回结果 - } -} -``` -- 返回错误的情况,例如参数错误,异常等 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` - -- 这是创建一个带密码的离线账户的完整返回结果 - -```json -{ - "success": true, - //data为List - "data": { - "list":[ - { - "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr", - "alias": null, - "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0", - "extend": null, - "createTime": 1529041525794, - "encrypted": false, - "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a", - "encryptedPriKey": "" - } - ] - } -} -``` ---- - -##### Account -```json -{ - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) -} -``` ---- - -##### Input -```json - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - "lockTime": Long 锁定时间 -} -``` ---- - -##### Output -```json - { - "txHash": String, 交易hash - "index": Integer, 索引 - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) -} -``` ---- - -##### Transaction - -```json -{ - "hash": String, 交易的hash值 - "type": Integer, 交易类型 - "time": Long, 交易发起时间 - "blockHeight": Long, 区块高度 - "fee": Long, 交易手续费 - "value": Long, 交易金额 - "remark": String, 备注 - "scriptSig": String, 签名 - "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) - "confirmCount": Long, 确认次数 - "size": int, 大小 - "inputs": [ - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - } - ], - "outputs": [ - { - "txHash": String, 交易hash - "index": Integer, 索引 - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) - } - ] -} -``` ---- - -##### BalanceInfo -```json -{ - "balance": long, 余额 - "usable": long, 可用余额 - locked": long 锁定余额 -} -``` ---- - -##### BlockHeader - -```json -{ - "hash": String, 区块的hash值 - "preHash": String, 上一个区块的hash值 - "merkleHash": String, 梅克尔hash - "time": Long, 区块生成时间 - "height": Long, 区块高度 - "txCount": Long, 区块打包交易数量 - "packingAddress": String, 打包地址 - "scriptSig": String, 签名 - "roundIndex": Long, 共识轮次 - "consensusMemberCount": Integer, 参与共识成员数量 - "roundStartTime": Long, 当前共识轮开始时间 - "packingIndexOfRound": Integer, 当前轮次打包出块的名次 - "confirmCount": Long, 确认次数 - "reward": Long, 共识奖励 - "fee": Long, 获取的打包手续费 - "size": int, 大小 -} -``` ---- - -##### Block - -```json -{ - "hash": String, 区块的hash值 - "preHash": String, 上一个区块的hash值 - "merkleHash": String, 梅克尔hash - "time": Long, 区块生成时间 - "height": Long, 区块高度 - "txCount": Long, 区块打包交易数量 - "packingAddress": String, 打包地址 - "scriptSig": String, 签名 - "roundIndex": Long, 共识轮次 - "consensusMemberCount": Integer, 参与共识成员数量 - "roundStartTime": Long, 当前共识轮开始时间 - "packingIndexOfRound": Integer, 当前轮次打包出块的名次 - "confirmCount": Long, 确认次数 - "reward": Long, 共识奖励 - "fee": Long, 获取的打包手续费 - "size": int, 大小 - "txList": [ - { - "hash": String, 交易的hash值 - "type": Integer, 交易类型 - "time": Long, 交易发起时间 - "blockHeight": Long, 区块高度 - "fee": Long, 交易手续费 - "value": Long, 交易金额 - "remark": String, 备注 - "scriptSig": String, 签名 - "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) - "confirmCount": Long, 确认次数 - "size": int, 大小 - "inputs": [ 输入 - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - } - ], - "outputs": [ 输出 - { - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - } - ] - } - ] -} -``` diff --git a/source/favicon.ico b/source/favicon.ico deleted file mode 100644 index 68f7da51..00000000 Binary files a/source/favicon.ico and /dev/null differ diff --git a/source/index.jade b/source/index.jade deleted file mode 100644 index 16a4c915..00000000 --- a/source/index.jade +++ /dev/null @@ -1,57 +0,0 @@ -layout: index -description: Hexo is a fast, simple & powerful blog framework powered by Node.js. -subtitle: A fast, simple & powerful blog framework -comments: false ---- -#content-index - .inner-index - .flexible-outer - .flexible-inner - .text - .text1 The most flexible - .text2 blockchain infrastructure. - .text3 NULS is a global blockchain open-source project which has a highly customizable modular blockchain infrastructure; it consists of a microkernel and functional modules. NULS provides smart contract, multi-chain mechanism and cross-chain consensus. It aims to break the technical barriers of blockchain, to reduce the cost of development and to promote the usage of blockchain technology in the commercial field. - .features - .title.title-common Features Introduced - .line - .bg-img - .bg-text1.bg-text - p Modular architecture - p adaptability sustainable improvement - .bg-text2.bg-text - p POC (Proof-Of-Credit) - p consensus - .bg-text3.bg-text - p Multi-chain mechanism - p - .bg-text4.bg-text - p Smart Contract - p logic container - img(src="../img/index/main/tech_introduction_icon.png") - .modular - .title.title-common Modular - .line - .bg-img - img(src="../img/index/main/modular_icon.png") - .text - p The design of NULS follows the principle of “everything is a module”, using Modularization to support the advancement of techniques and App adaptation. NULS uses microkernel to manage all the modules and they interact through the Event Bus and Service Bus. - p NULS developers are able to understand and use the modules based on the instruction book without knowing details of the modules. - .contract - .title.title-common Smart Contract - .line - .bg-img - .text - p NULS Smart Contract Module has the name of NVM (NULS Virtual Machine) and supports Intelligent Assets Issuing and Circulation. - p NULS Smart Contract follows JVM and developers can use Java-based languages (e.g. Java, Groovy, JRudy, Jython, Clojure, Clojure, Kotlin, Rhino, Ceylon) to develop Smart Contract. - img(src="../img/index/main/smart contract_icon.png") - .chain - .title.title-common Parallel Multi-Chains - .line - .bg-img-chain - .text - p NULS has multi-chains facilities which include NULS Main Blockchains, Asset Blockchains, Application Blockchains, Audit Blockchains and Sibling Blockchains. - p Asset Blockchains are the Economic Center of NULS Environment and all tokens in the Environment will make cross-chain transportation and commutation there. - p Application Blockchains hold the Dapp and Intelligent Assets. - p Audit Blockchains provide the service of Public Data Audition for Private Blockchain and Consortium Blockchains. - p Sibling Blockchains are new independent blockchains created by Community Developers using NULS Module Warehouse. They have the ability to transport and commute assets with other NULS Blockchains by default. - img(src="../img/index/main/Parallel Multi-Chains_icon.png") diff --git a/source/logo.png b/source/logo.png deleted file mode 100755 index cf0d1b1f..00000000 Binary files a/source/logo.png and /dev/null differ diff --git a/source/logo.svg b/source/logo.svg deleted file mode 100644 index 51e2c50d..00000000 --- a/source/logo.svg +++ /dev/null @@ -1 +0,0 @@ -资源 1 \ No newline at end of file diff --git a/source/manual/account.md b/source/manual/account.md deleted file mode 100644 index 35fc54f3..00000000 --- a/source/manual/account.md +++ /dev/null @@ -1,398 +0,0 @@ -# NULS Account Module Resolution - -## 1、Overview - -The NULS Account Module is the basic module for providing the NULS main chain with all the functions of the account. It mainly supports the functions of account generation, security and custody, and information acquisition. Other modules can use various functions of the account and obtain account information according to the interface provided by the account module. Users or other applications can be based on RPC. The interface makes the account more practical and personalized. The account is the basic module of NULS and the carrier of user data (display window). With the development of NULS, the account module will be more complete. - -## 2、Feature - -The function of the account module is quite rich, and the same function will also provide overloading of multiple interfaces, which is convenient for use in different scenarios, mainly in the following aspects. - -#### 2.1 Account generation - -The generation aspect of the account includes creating an account and importing an account; and importing the account is divided into importing a private key to generate an account, and importing a keystore backup file to generate an account. - -#### 2.2 Security and custody - -Account security features include account backup, setting account password, modifying account password, and removing account; backup account is divided into generating Keystore backup file and obtaining private key for backup. - -#### 2.3 Access to account information - -The functions of obtaining account information mainly include querying individual account information, obtaining multiple account information, obtaining account address, checking account balance, and querying account aliases. - -#### 2.4 Practical and personalized features - -The functions of the account also include some special tool functions and personalization functions, such as setting account aliases, setting account notes, verifying whether the account is encrypted, signing, verifying the signature, verifying the account address format, and verifying that the account password is correct. - -#### 2.5 Access to account local data - -In addition to the data of the account alias, the data of the account will be locally persisted, so the account module has the function of accessing the account data, and the final implementation of the function is implemented by calling the interface of the data storage module. - - - -## 3、Interface - -- Class that defines the interface: `io.nuls.account.service.AccountService` - -```java - /** - * Create a specified number of accounts,and encrypt the accounts, - * all the accounts are encrypted by the same password - * if the password is NULL or "", the accounts will be unencrypted. - * - * @param count the number of account you want to create. - * @param password the password of the accounts. - * @return the account list created. - */ - Result> createAccount(int count, String password); - - /** - * Create unencrypted accounts. - * - * @param count the number of account you want to create. - * @return the account list created. - */ - Result> createAccount(int count); - - /** - * Create an account and encrypt it, - * if the password is NULL or "", the accounts will be unencrypted. - * - * @param password the password of the accounts(only one account in the list). - * @return the account list created. - */ - Result> createAccount(String password); - - /** - * Create an unencrypted account - * - * @return the account list created(only one account in the list). - */ - Result> createAccount(); - - /** - * delete an account by address. - * - * @param address the address of the account you want to delete. - * @param password the password of the account. - * @return the result of the operation. - */ - Result removeAccount(String address, String password); - - - /** - * Reset password by keyStore. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result updatePasswordByAccountKeyStore(AccountKeyStore keyStore, String password); - - /** - * import an account form account key store. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result importAccountFormKeyStore(AccountKeyStore keyStore, String password); - - /** - * import an account form account key store. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result importAccountFormKeyStore(AccountKeyStore keyStore); - - - /** - * import an account from plant private key and encrypt the account. - */ - Result importAccount(String prikey, String password); - - /** - * import an unencrypted account by plant private key. - */ - Result importAccount(String prikey); - - /** - * export an account to an account key store. - * - * @param address the address of the account. - * @param password the password of the account key store. - * @return the account key store object. - */ - Result exportAccountToKeyStore(String address, String password); - - /** - * Query account information by address. - * - * @param address the address of the account you want to query. - * @return the account. - */ - Result getAccount(byte[] address); - - /** - *Query account by address. - * - * @param address the address of the account you want to query. - * @return the account. - */ - Result getAccount(String address); - - /** - * Query account by account address. - * - * @param address the address of the account you want to query; - * @return the account. - */ - Result getAccount(Address address); - - /** - * Query account address by public key. - * - * @param pubKey public key string. - * @return the account address. - */ - Result
getAddress(String pubKey); - - /** - *Gets the account address object from the account binary public key. - * - * @param pubKey public key binary array. - * @return the account address. - */ - Result
getAddress(byte[] pubKey); - - /** - * Verify weather the account is encrypted according to the account. - * - * @param account the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(Account account); - - /** - * Verify weather the account is encrypted according to the account's address object. - * - * @param address The address of the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(Address address); - - /** - * Verify weather the account is encrypted according to the account's address string. - * - * @param address The address of the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(String address); - - /** - * Verify the account password. - * - * @param account - * @param password - * @return - */ - Result validPassword(Account account, String password); - - /** - * Verify the format of the address string. - * - * @param address To verify the address string. - * @return the result of the operation. - */ - Result verifyAddressFormat(String address); - - /** - * Query all account collections. - * - * @return account list of all accounts. - */ - Result> getAccountList(); - - /** - * Sign data. - * - * @param data Data to be signed. - * @param account Signed account - * @param password Account password - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, Account account, String password) throws NulsException; - - /** - * Sign data.(no password) - * - * @param data Data to be signed. - * @param account Signed account - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, Account account) throws NulsException; - - /** - * Sign data. - * - * @param data Data to be signed. - * @param ecKey eckey. - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, ECKey ecKey) throws NulsException; - - /** - * Sign data. - * - * @param digest data digest. - * @param account account to sign. - * @param password password of account. - * @return the NulsSignData object. - */ - NulsSignData signDigest(byte[] digest, Account account, String password) throws NulsException; - - /** - * Sign data digest - * - * @param digest to be signed. - * @param ecKey eckey - * @return The NulsSignData object. - */ - NulsSignData signDigest(byte[] digest, ECKey ecKey); - - /** - * Verify the signature. - * - * @param data data to be validated. - * @param signData signature. - * @param pubKey dublic key of account. - * @return the result of the opration - */ - Result verifySignData(byte[] data, NulsSignData signData, byte[] pubKey); - - /** - * Query the balance of all accounts. - * - * @return Balance object. - */ - Result getBalance() throws NulsException; - - /** - * Query the balance of an account. - * - * @param account the account. - * @return Balance object. - */ - Result getBalance(Account account) throws NulsException; - - /** - * Query the balance of an account. - * - * @param address the address of the account. - * @return Balance object. - */ - Result getBalance(Address address) throws NulsException; - - /** - * Query the balance of an account. - * - * @param address the address of the account. - * @return Balance object. - */ - Result getBalance(String address) throws NulsException; - - - /** - * Get an account alias based on the array of account address bytes - * - * @param address - * @return alias string - */ - Result getAlias(byte[] address); - - /** - * Get account alias according to account address - * - * @param address - * @return alias string - */ - Result getAlias(String address); - - /** - * Gets to set the alias transaction fee - * - * @param address - * @param aliasName - * @return - */ - Result getAliasFee(String address, String aliasName); - -``` - - - -## 4、Architectures - -- Module name:account -- Module ID:5 - -![AccountArchitecture](account/AccountArchitecture.png) - -## 5、Protocol - -##### 5.1 General transaction data structure - -| Size | Field | Data type | Description | -| ---- | ---------- | --------- | ---------------- | -| 2 | type | uint16 | Transaction type | -| 6 | time | uint48 | Timestamp | -| ?? | remark | VarByte | Remark | -| ?? | txData | ?? | Transaction data | -| ?? | coinData | ?? | Token data | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -##### 5.2 Alias transaction - -- txData:Alias - -**Alias** - -| Size | Field | Data type | Description | -| ---- | ------- | --------- | ---------------------- | -| 2 | address | VarByte | Address of the account | -| ?? | alias | String | Alias | - -## 6、Core Process - -#### 6.1 Account generation - -##### 6.1.1 create account - -The account address of NULS is generated by the combination of the default Chain ID of NULS, the default address type of NULS, and ECKey (elliptic curve encryption algorithm), and the fixed length is 23. The generated Byte array obtains the address string of the NULS account through the Base58 algorithm. When creating a new account, ECKey is an ECKey instance generated by a random seed. The public key and private key of the account and the account address are obtained by ECKey to generate a new account. - -##### 6.1.2 Backup - -After the account is generated, the clear key of the account can be obtained through the interface, so that the private key can be properly kept (ie, backed up), and a backup file can be generated by backing up the interface of the keystore file for backup. - -There are two situations when backing up the Keystore: - -1、Backup unencrypted account - -When the account has no password, the interface is directly called to generate a backup file. The file has been named with the account address and the file suffix is .keystore. And the private key in the keystore is a plaintext private key (prikey has a value, encryptedPrivateKey has no value). - -2、Backup encrypted account - -When backing up an encrypted account, you need to verify the current account password, and use this password to encrypt the private key in the keystore. The encrypted private key has a value in the generated file (encryptedPrivateKey has a value), and the plaintext private key has no value (prikey) No value). - -##### 6.1.3 Import account (private key, keystore file) - -Importing an account means that the user wants to regenerate his or her account information locally for some reason. The user needs to hold the private key of the corresponding account or the keystore backup file. The difference between a private key and a keystore is that the keystore (when the account is set with a password) can save the encrypted private key without saving the plaintext private key, so the security is higher. In this case, when the keystore file is imported, the password of the account at the time of generating the keystore file is verified. The password and the encrypted private key can be used to calculate the plaintext private key, and then the next import process is performed. - -Regardless of the way the user imports it, the corresponding ECKey instance is generated by the private key of the account, and then the account information is generated in the same way as the account creation. The way to create an account is different from the way the ECkey instance is obtained. The account generated by the same private key is consistent in the same information, and then the account transfer is used to obtain the account transfer, set the alias, create the node, commission and other transaction data from the blockchain to synchronize to the local, thus The function of importing accounts is implemented. - -Although the keystore file contains an alias for the account, since the Keystore file may be serially modified and forged, it is still necessary to restore the account's alias information by obtaining the account setting alias transaction information from the blockchain when importing the account. It is a feature that makes use of blockchain information that cannot be tampered with. - -![accountflow](account/AccountFlow.png) - -##### 6.1.4 Set up an account alias - -Setting an account alias will cost 1 NULS token. This 1 NULS will be burned to a fixed hole address, the account set alias will be saved in the blockchain, and the alias will be unique in the blockchain. A transaction will be initiated and sent to other nodes for verification, packaging, confirmation, and then setting the alias will be successful. \ No newline at end of file diff --git a/source/manual/account/AccountArchitecture.png b/source/manual/account/AccountArchitecture.png deleted file mode 100644 index 095e8e9a..00000000 Binary files a/source/manual/account/AccountArchitecture.png and /dev/null differ diff --git a/source/manual/account/AccountArchitecture.vsdx b/source/manual/account/AccountArchitecture.vsdx deleted file mode 100644 index c22afb85..00000000 Binary files a/source/manual/account/AccountArchitecture.vsdx and /dev/null differ diff --git a/source/manual/account/AccountFlow.png b/source/manual/account/AccountFlow.png deleted file mode 100644 index 0f1bbeaf..00000000 Binary files a/source/manual/account/AccountFlow.png and /dev/null differ diff --git a/source/manual/account/AccountFlow.vsdx b/source/manual/account/AccountFlow.vsdx deleted file mode 100644 index 0004b5f6..00000000 Binary files a/source/manual/account/AccountFlow.vsdx and /dev/null differ diff --git a/source/manual/consensus.md b/source/manual/consensus.md deleted file mode 100644 index b4445145..00000000 --- a/source/manual/consensus.md +++ /dev/null @@ -1,685 +0,0 @@ -title: NULS consensus module analysis ---- - -## 1、Module overview -As we all know, the core of the blockchain is the consensus mechanism. Unlike the traditional Internet's clipet-server architecture, the nodes of the blockchain are peer-to-peer, without the center, and everyone has the same rights; so in order to make the data consistent, let a network without a center maintain a set of books that everyone agrees with. This is the role of the consensus mechanism. - - -There are many public chain consensus mechanisms. The NULS main network adopts the self-originated POC (Proof Of Credit) consensus mechanism, which inherits the security and high efficiency of the Dpos consensus mechanism, and has made great improvements in collaboration. Can be seen as an upgraded version of Dpos. - - -The NULS consensus module is highly abstracted at the interface layer, and some necessary functional interfaces are extracted, which is implemented as a POC consensus. Based on the modular architecture of NULS, any other possible consensus mechanism can be implemented. Look forward to the consensus mechanism of the community, individuals or institutions to achieve their needs, and contribute the code to the main warehouse of NULS. In addition to the POC, there will be multiple consensus algorithms such as POW, POS, DPOS and PBTF. - - -This chapter focuses on the NULS consensus module interface definition and the implementation details of the default POC consensus mechanism. -​ -​ -​ **Module information** -​ -​ Module name:consensus-module -​ -​ Module structure: module top-level directory consensus-module, consesnus project for module interface definition, poc implementation directory poc, poc implementation project consensus-poc-base, consensus-poc-protocol consensus implementation of related network protocols, consensus-poc-storage consensus storage interface And implementation engineering -​ -​ Interface definition dependency module:**protocol-module、network-module** -​ -​ Implement additional dependency modules:**core-module、ledger-module、account-module、account-ledger-module** - -## 2、Module function -​ This section introduces the NULS consensus module functionality from two levels. The first level describes the interface function provided by the external interface. The external interface is a shared abstract interface that may be required by multiple consensus algorithms. The second level is summarized from the functional requirements of the POC implementation. - -### 2.1 External interface - -* New transaction: The new transaction on the network received by the node. After the verification is passed, it needs to be put into a unified memory pool for the consensus module to confirm these transactions (that is, package the transaction into the block); at the same time, receive the new transaction. When the block is located, it is quickly assembled into a complete block by looking up the transactions of these sites (because the new block is generated, the block header information and the transaction hash list are broadcast to the peer nodes). - -* Get memory pool transaction: The consensus module provides a method for querying the list of pending transactions for other modules to call when needed. - -* Obtain a single transaction: query a transaction, in fact, the transaction of the NULS system should be provided by the account book module, but the transactions provided by the account book module are all confirmed transactions, and the unconfirmed transaction is in the memory pool of the consensus module, so the consensus The module provides a functional interface for finding a single transaction, as well as looking for unconfirmed transactions. - -* New block: - - During the download process, the downloaded target block is received: when a node is just started, the local block data of the node is probably not the latest data, and the incremental block needs to be downloaded from other peer nodes, and the downloaded block needs to enter the consensus module. Through the corresponding consensus rules, the downloaded block is considered to be correct, added to the main chain and saved. - - The newly generated block received during the operation: receiving a newly born block sent from the network, the general protocol module will get the complete block information (take the way of assembling the transaction, if some transactions are not found locally , then download to the corresponding node), and then hand over the complete block to the consensus module for verification - storage and other operations. - - Whether the above two scenarios are processed by the same business logic depends on the choice of the consensus mechanism, such as the POC consensus. The only difference is that the round information in the verification is inconsistent. The former uses the calculation history round to verify, the latter. It is verified by the current consensus theory; if the implementation of the POW consensus, the same business logic can be used. That is, the specific implementation can decide whether to reuse the code. - -* Rollback block: The rollback of a block means that when the node discovers that there is a longer chain than the local main chain on the network, it accepts the longer chain on the network as the local new main chain. It is necessary to delete all the blocks in the local main chain that are not included in the longer chain on the network, and the transactions in the corresponding blocks should also be deleted (the corresponding business logic should also be reversed, the terminology is called Rollback). In most cases, whether there is a fork or not, whether it needs to be forked, depends on the implementation and selection of the consensus mechanism. Most of the time, the consensus mechanism is internally processed. The consensus module provides this interface function. Other modules need to be called when needed (such as the initial start of the download, you may need to roll back the block). In particular, not all consensus mechanisms need to be rolled back. - -### 2.2 POC functional requirements analysis -To implement POC, you first need to know the design philosophy and business rules of POC. - -##### In the POC system, there are four roles: agent, principal, packager, and rewarder. - * The agent———— the node creator, initiates a transaction that creates a consensus node, logs it into the chain, and tells everyone that I want to be a consensus node. The basic condition for node creation is to lock 20,000 NULS. The purpose of setting up this basic condition is to prove that you are really trying to maintain the basic network of NULS. - - * The principal———— NULS holder can entrust the NULS he holds to the agent according to the agent's credit value and the influence of the agent, etc., and enjoy the corresponding consensus. Revenue, if the agent node quality or integrity is found to decrease, the principal may withdraw its entrustment and change to others at any time. - - * Packager———— When creating a consensus node, the agent can specify a packager. This packager can be his own other account, or a friend who knows technology. The most important thing is that the packager can not hold any NULS. Even if the server participating in the consensus is hacked, the user will not have a huge loss, and the loss will only be affected by the earnings after the attack. - - * Rewarding people———— When creating a consensus node, an agent can not only specify a packager, but also designate a beneficiary to specify who can get the reward generated by the consensus. - -##### In the POC system, there are four business logics: creating a proxy (creating a consensus node), stopping a proxy node (exiting a consensus), delegating a consensus, and canceling a delegation. - -* Create proxy (create consensus node): Lock 20,000 NULS and initiate a registration proxy transaction. After packaging, the whole network can be seen. Others can lock NULS to the proxy node. - -* Stop the agent node (exit consensus): The agent can stop its agent qualification at any time, initiate a transaction to delete the agent node, and after the transaction is packaged and confirmed, it will quickly withdraw from the consensus and no longer participate in the production of the new block. The 20,000 NULS locked during the registration of the agent will be unlocked after 72 hours, and the rest of the NULS delegated to the node will be unlocked immediately. - -* Delegate consensus: Users with NULS of 2000 or above can choose a proxy node to commission and obtain the corresponding block revenue. Before exiting, the corresponding delegated NULS will be locked out of use. - -* Cancellation of the delegation: The user can cancel the previous entrustment. After the revocation, the locked NULS will immediately explain and no longer enjoy the corresponding consensus revenue. - -##### Two punishment mechanisms for POC systems - * Yellow card penalty: When the block node is disconnected from the network, card machine and other uncertain reasons, the block will not be out of the block, or the block is not used, then the yellow card will be punished in the next round. The yellow card penalty will affect the node's income; when 100 consecutive yellow card penalties are awarded, a red card will be imposed. - - * Red card penalty: When the block node makes malicious fork, double flower and other behaviors that seriously endanger the stability of the network, or when it receives 100 yellow card penalties continuously, the system will give a red card penalty. The node that receives the red card penalty will be forced to stop the consensus. The deposit when the agent is created is frozen for 3 months, and the node can never be created again; the corresponding node of the node that received the red card penalty is immediately unlocked. - - -##### Hidden functional requirements of POC internal systems -* Maintain an agent information form and update it based on the above four transactions received in real time. - -* Maintain a round of information table, so that each round of agents who meet the conditions of the outbound block are randomly queued out. - -* The proxy node that meets the condition of the outbound condition verifies and packages the transaction of the memory pool, assembles it into a new block and broadcasts it to the whole network. - -* Fork processing. - -The above is a functional analysis of the consensus module POC consensus mechanism implementation, and the details of each function implementation are described in the [** core process**] (#core-processer) section. - -## 3、Module interface - -The external interface definition class of the consensus module is io.nuls.consensus.service.ConsensusService -, under the conssusus project. - -* **New transaction** - * Method name: newTx - * Method description: - - - The new transaction generated on the network or locally generated by the node is initially verified and passed into the transaction memory pool for confirmation. - - * Parameter Description: - - - tx : Transaction - - - * Return value description: - - - Type:Result - - Field: - * success : Return whether the processing is successful - - * Code - -``` - /** - * receive a new transaction, add in memory pool after verify success - * @param tx - * @return Result - */ - Result newTx(Transaction tx); -``` - -* **New block is born** - * Method name: newBlock - * Method description: - - - After receiving a newly born block from the network, the general protocol module will get the complete block information (take the way of assembling the transaction, if some transactions are not found locally, download it to the corresponding node), and then complete The block is handed over to the consensus module for verification - operations such as warehousing. - - There are two overloaded methods in the interface class, whether you know exactly which peer node received the new block. - - * Parameter Description: - - - block : Complete block information(Block) - - node : Received peer node information(Node) - - - * Return value description: - - - Type:Result - - Field: - * success : Return whether the processing is successful - - * Code - -``` - /** - * receive block from other peers - * @param block - * @return Result - */ - Result newBlock(Block block); - - /** - * receive block from other peers - * @param block - * @param node - * @return Result - */ - Result newBlock(Block block, Node node); -``` - -* **Add a block to the main chain** - * Method name: addBlock - * Method description: - - - When the local block is lower than the latest height of the network, you need to download the latest incremental block from the network. After downloading to the block, call this method to add and connect the block to the local main chain. - - * Parameter Description: - - - block : Complete block information(Block) - - - * Return value description: - - - Type:Result - - Field: - * success : Return whether the processing is successful - - * Code - -``` - /** - * synchronous block from other peers - * @param block - * @return Result - */ - Result addBlock(Block block); -``` - - -* **Rollback block** - * Method name: rollbackBlock - * Method description: - - - The latest block in the local main chain is revoked. When the incoming block is not the latest block of the local main chain, it will return a failure. In the implementation of the POC, the optimal block of the main chain in the memory will be preferentially rolled back. After the success, the database is rolled back accordingly. - - * Parameter Description: - - - block : Complete block information(Block) - - - * Return value description: - - - Type:Result - - Field: - * success : Return whether the processing is successful - - * Code - -``` - /** - * Roll back the latest block and roll back the status of the chain in the consensus service memory - * - * 回滚最新区块,同时回滚共识服务内存中链的状态 - * @return Result - */ - Result rollbackBlock(Block block) throws NulsException; -``` - -* **Get the transaction list of the memory pool** - * Method name: getMemoryTxs - * Method description: - - - Get all the transactions in the memory pool - - * Parameter Description: - - - No parameters - - - * Return value: - - - Type:List\ - - Description: Transaction collection - - * Code - -``` - /** - * Get all the transactions in the memory pool - * - * 获取内存池里面的所有交易 - * @return List - */ - List getMemoryTxs(); -``` - - -* **Get a single transaction** - * Method name: getTx - * Method description: - - - Inquiring a transaction, in fact, the transaction of the NULS system should be provided by the ledger module, but the transactions provided by the ledger module are all confirmed transactions, and the unconfirmed transaction is in the memory pool of the consensus module, so the consensus module provides a lookup externally. A functional interface for a single transaction that also includes looking for unconfirmed transactions. - - * Parameter Description: - - - hash : transaction hash(NulsDigestData) - - - * return value: - - - Type:Transaction - - Description: The transaction object, if not, is null - - * Code - -``` - Transaction getTx(NulsDigestData hash); -``` - -## 4、Module architecture - -![tips](consensus/1.png) - - -## 5、Module protocol - -### TX_TYPE_REGISTER_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 4 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | uint64 | 抵押金额 | -| 23 | agentAddress | Address | 节点地址 | -| 23 | packingAddress | Address | 打包地址 | -| 23 | rewardAddress | Address | 奖励地址 | -| 8 | commissionRate | Double | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_JOIN_CONSENSUS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | byte[] | 委托金额 | -| 23 | address | byte[23] | 地址 | -| 8 | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_CANCEL_DEPOSIT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_STOP_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 停止节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_YELLOW_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | count | VarInt | 惩罚数量 | -| ?? | addres | Address[]| 被黄牌警告的节点地址| -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_RED_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 23 | address | byte[23] | 惩罚数量 | -| 1 | reasonCode | byte | 处罚代码 | -| ?? | evidence | VarByte | 证据 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - - -## 6、Core process - -#### Create an agent - -* Brief - * Any user who holds 20,000 or more NULS can create a proxy through the creation of a wallet consensus interface (Linux can be commanded via command line, or via the rpc command). After the creation, the transaction is verified and broadcasted to the entire network for confirmation. - * After the pen creation agent transaction is confirmed, the node where the package address is located will start consensus after 2 rounds. - -* flow chart -![tips](consensus/2.png) - -* Code interpretation - * The entry is the io.nuls.consensus.poc.rpc.resource.PocConsensusResource class under the consensus-poc-rpc project, corresponding to the createAgent method. - - * The createAgent method in PocConsensusResource first verifies the legality of the parameters (including the address can not be repeated, can not be empty, the account can be found in the local account, the correctness of the account password, etc.), then assemble the transaction and then call the txProcessing method for signature verification. And broadcast. - - * The corresponding network protocol is defined in the io.nuls.consensus.poc.protocol.tx.CreateAgentTransaction under the consensus-poc-protocol project; - - * The processor bound to the protocol is io.nuls.consensus.poc.tx.processor.CreateAgentTxProcessor under the consensus-poc-base project; - - * There are 3 validators, which are under the consensus-poc-base project: io.nuls.consensus.poc.tx.validator.AgentAddressesValidator、io.nuls.consensus.poc.tx.validator.AgentCountValidator、io.nuls.consensus.poc.tx.validator.CreateAgentTxValidator - - * CreateAgentTransaction will call verify method to verify when packaging, that is, call 3 bindings respectively, and return true to represent successful verification; after successful packaging, CreateAgentTxProcessor will be called to save to the database. - - * After the transaction is packaged into the block, the block will be saved by the addBlock method in io.nuls.consensus.poc.process.BlockProcess. When saving the block, some basic verification will be done first to verify whether the block header is legal. Whether the block contains a double flower transaction, etc., then it will verify whether the packager is legal, the code is - - ``` - boolean verifyAndAddBlockResult = chainManager.getMasterChain().verifyAndAddBlock(block, isDownload); - ``` - - After running here, once successful, the transaction for creating the commission is placed in the agentList of Chain corresponding to ChainChatainer, and the next time the round is calculated, this data will be included. - - **In the same way, the following entrusted consensus, stop proxy, and unconfirmed transaction are the same process after being packaged into the block.** - -#### Commission consensus - -* Brief - * Users with more than 2000NULS can choose to trust the proxy node to obtain consensus and obtain corresponding benefits. - -* flow chart - -![tips](consensus/3.png) - -* Code interpretation - * The entry is the io.nuls.consensus.poc.rpc.resource.PocConsensusResource class under the consensus-poc-rpc project, corresponding to the depositToAgent method. - - * The depositToAgent method in PocConsensusResource first verifies the legality of the parameters (including the proxy hash can not be empty and exists, the delegate account can not be empty and can be found in the local account, the correctness of the account password, etc.), then assemble the DepositTransaction transaction and then call The txProcessing method performs signature verification and broadcast. - - * The corresponding network protocol is defined in the io.nuls.consensus.poc.protocol.tx.DepositTransaction under the consensus-poc-protocol project; - - * The processor bound to the protocol is io.nuls.consensus.poc.tx.processor.DepositTxProcessor under the consensus-poc-base project; - - * The validator is io.nuls.consensus.poc.tx.validator.DepositTxValidator under the consensus-poc-base project - - * DepositTransaction will call the verify method to call the validator row validation when it is packaged. Returning true means that the verification is successful; after the package is successful, it will call DepositTxProcessor to save to the database. - - -#### Stop agent - -* Brief - * The node that successfully registers the agent can choose to stop the agent at any time, but the margin will be locked for 72 hours, and the agent will be unlocked immediately. - -* flow chart -![tips](consensus/4.png) - -* Code interpretation - * The entry is the io.nuls.consensus.poc.rpc.resource.PocConsensusResource class under the consensus-poc-rpc project, corresponding to the stopAgent method. - - * The stopAgent method in PocConsensusResource first verifies the validity of the parameters (including the proxy hash can not be empty and exists, and is the proxy created by itself, the account can not be empty and can be found in the local account, the correctness of the account password, etc.) Reassemble the StopAgentTransaction transaction and then call the txProcessing method for signature verification and broadcast. - - * When the StopAgentTransaction is assembled, the margin that was locked when the proxy was created is treated as the current input, and an output corresponding to the lock time is output, which is equivalent to spending the previous margin and relocking for a certain period of time. - - - * The corresponding network protocol is defined in the io.nuls.consensus.poc.protocol.tx.StopAgentTransaction under the consensus-poc-protocol project; - - * The processor bound to the protocol is io.nuls.consensus.poc.tx.processor.StopAgentTxProcessor under the consensus-poc-base project; - - * The validator is io.nuls.consensus.poc.tx.validator.StopAgentTxValidator under the consensus-poc-base project. - - * When the package is stopped, the StopAgentTransaction will call the verify method to call the validator to verify. The return true means the verification is successful. After the package is successful, the StopAgentTxProcessor will be saved to the database. When the StopAgentTxProcessor is executed, all the delegates corresponding to the proxy node will be Cancel and unlock. - -#### Cancel the commission - -* Brief - * The client can cancel the proxy of the proxy node at any time, and the locked deposit is immediately unlocked. - -* flow chart - -![tips](consensus/5.png) - -* Code interpretation - * The entry is the io.nuls.consensus.poc.rpc.resource.PocConsensusResource class under the consensus-poc-rpc project, corresponding to the withdraw method. - - * The withdraw method in PocConsensusResource first verifies the legality of the parameters (including the proxy hash can not be empty and exists, and is the proxy created by itself, the account can not be empty and can be found in the local account, the correctness of the account password, etc.) Reassemble the CancelDepositTransaction transaction and then call the txProcessing method for signature verification and broadcast. - - * When the CancelDepositTransaction is assembled, the margin that was locked in the previous delegate will be treated as this input, and an output that is immediately available will be output, which is equivalent to spending the previous margin and paying it to itself. - - * The corresponding network protocol is defined in the io.nuls.consensus.poc.protocol.tx. CancelDepositTransaction under the consensus-poc-protocol project. - - * The processor bound to the protocol is io.nuls.consensus.poc.tx.processor.CancelDepositTxProcessor under the consensus-poc-base project. - - * The validator is io.nuls.consensus.poc.tx.validator.CancelDepositTxValidator under the consensus-poc-base project. - - * CancelDepositTransaction will call the verify method to call the bound validator to verify when packaging, return true means the verification is successful; after the package is successful, CancelDepositTxProcessor will be called to save to the database. - - -#### Consensus round - -* Brief - * Initially, the NULS system will have five seed consensus nodes built in. The five seed consensus nodes are responsible for maintaining the initial network data in the initial period of the network; these five seed nodes have no locked margin, so the five seed nodes do not participate in the consensus reward ( Except for handling fees). - * Once the NULS system starts running, the subsequent registered consensus nodes will be added to the network maintenance of NULS. After the proxy node is successfully registered, it only needs to meet the 200,000 NULS entrustment amount to participate in the consensus. - * All the agent nodes that satisfy the consensus condition (including 5 seed nodes) have the same weight for maintaining the network (that is, the permissions between the agent nodes are the same, there is no large authority for the large amount of entrustment), and the same opportunity for the block is obtained. The consensus algorithm is randomly performed in blocks. - * All the agents who meet the consensus conditions, each period of one block, is called the consensus round; in one round, each person has a chance to make a block, and the order of the different rounds is random. - -* flow chart -![tips](consensus/6.png) - -* Code interpretation - * The process entry is the io.nuls.consensus.poc.scheduler.ConsensusScheduler class under the consensus-poc-base project. The initDatas method inside the io.nuls.consensus.poc.manager.CacheManager load method initializes the data. - - * CacheManager's load method will first load the data needed by the system from the database (including the last 100 rounds of block headers, the last 10 complete blocks, all agents, delegates, stop agents and cancel delegate records, red and yellow card records), and then Assemble an io.nuls.consensus.poc.container.ChainContainer as the main chain and set it to the chainManager. - - * ```chainManager.getMasterChain().initRound();``` - - The initRound method of io.nuls.consensus.poc.manager.RoundManager is then called to initialize the most recent round information. After the initialization is successful, it will be placed in the roundList of the RoundManager. - - * Use rounds: - - The verifyBlock method of io.nuls.consensus.poc.container.ChainContainer. First, the current round information is obtained by roundManager.getCurrentRound(), and the round information in the block header is compared. If it is not the desired round, then the roundManager.getRoundByIndex method is called again to get the desired round; or roundManager is called. .getNextRound gets the next round of the current round (without the latest round in the RoundManager). - - * Round change: - - There are two ways to change the round. The first one is the roundManager.getNextRound that ends above. The second type of doWork in io.nuls.consensus.poc.process.ConsensusProcess, the code is - - ``` MeetingRound round = chainManager.getMasterChain().getOrResetCurrentRound(); ``` - - The system executes the doWork method every 1000 milliseconds, and finally calls the RoundManager's resetRound(true) method to get the round. If the current round has ended, it will return a new round of round information. - - -#### Packing block - -* Brief - * The agent that satisfies the consensus condition, corresponding to the node where the block address is set, has one opportunity for each block. - * After the node is started, the task scheduler of the consensus module starts a task block of the packaged block, and the taskkeeper monitors in real time whether all unencrypted accounts of the current node become packaged nodes. - * If the node has an unencrypted account and becomes the outbound node of the proxy node, the task manager of the packed block monitors whether the proxy node satisfies the consensus outbound condition. Once it is satisfied, the consensus is started in the next round, and the consensus is performed according to the consensus rule. - - -* flow chart - -![tips](consensus/7.png) - -* Code interpretation - * The launch of the Consensus Packer is in the start method of io.nuls.consensus.poc.scheduler.ConsensusScheduler. - - ```java - ConsensusProcess consensusProcess = new ConsensusProcess(chainManager); - threadPool.scheduleAtFixedRate(new ConsensusProcessTask(consensusProcess), 1000L, 1000L, TimeUnit.MILLISECONDS); - ``` - - * io.nuls.consensus.poc.task.ConsensusProcessTask calls the process method of ConsensusProcess every second. - - ```java - @Override - public void run() { - try { - consensusProcess.process(); - } catch (Exception e) { - Log.error(e); - } - } - ``` - - * io.nuls.consensus.poc.process.ConsensusProcess will first determine whether to continue processing the package according to the status of the consensus module, whether the configuration is packaged, or the network status. - - * After entering the doWork method, the round information is obtained first, and then the obtained round information is used to determine whether there is any outbound information corresponding to the account that needs to be out of the block (including the time of the block, the order index, the reward address, the delegation list, and the credit value). Etc.), if not, it means that the node does not need to be out of the block, then call the clearTxMemoryPool method to periodically clear the transactions in the memory pool. - - * If it needs to be packaged, it is judged whether the current time has reached the time when the block should be released. If it is reached, the packing method is called to package. - - * The packing will first call waitReceiveNewestBlock to wait for the reception of the previous block. If the previous node is normally out of the block and received normally, it will start to pack. If the previous node fails to pack in time or the network transmission is too bad, then the maximum waits. The 1/2 of the block time interval is 5 seconds. After the timeout, even if the previous block is not received, it needs to be packaged. - - * Call doPacking to perform the operation of packing the block; the flow is the assembly block round information -> verify the transaction in the memory pool -> the end of the time or the block size reaches the upper limit -> verify the transaction in the block (including business conflict detection) -> Call addConsensusTx method to assemble coinbase transaction (reward) and red and yellow card penalty transaction assembly -> Call ConsensusTool.createBlock to assemble the complete block. - - * If the previous block was not received before packing, then it is detected again if the previous block was received. If it is received, it will be repackaged again because the transaction may be repeated. - - * The last is to save the block (saveBlock method), broadcast block (broadcastSmallBlock method). - - -#### Block verification - -* Brief - * When any NULS node receives a new block from another peer node on the network, it will check the block. Only the legal block can be correctly added to the main chain. The illegal block is It is a lone block. - * In addition to verifying the basic information of the block (such as block upper limit, signature, previous block hash reference, etc.), the most important thing is to verify whether the signer of the block is legal. - * To verify whether the signer of the block is legal, it is necessary to verify whether the block signer has a corresponding agent node, whether the corresponding agent node satisfies the consensus outbound condition, and whether the time zone of the block should be corresponding to the agent node. - -* flow chart -![tips](consensus/8.png) - -* Code interpretation - * io.nuls.consensus.poc.service.impl.ConsensusPocServiceImpl is the implementation of the consensus module external interface io.nuls.consensus.service.ConsensusService. - - ```java - @Override - public Result newBlock(Block block) { - return newBlock(block, null); - } - - @Override - public Result newBlock(Block block, Node node) { - BlockContainer blockContainer = new BlockContainer(block, node, BlockContainerStatus.RECEIVED); - boolean success = blockQueueProvider.put(blockContainer); - return new Result(success, null); - } - - @Override - public Result addBlock(Block block) { - BlockContainer blockContainer = new BlockContainer(block, BlockContainerStatus.DOWNLOADING); - boolean success = blockQueueProvider.put(blockContainer); - return new Result(success, null); - } - - ``` - - - * When the consensus module receives a request for a new block, it stores the block in a block queue provider, which is the blockQueueProvider for asynchronous processing. - - * io.nuls.consensus.poc.task.BlockProcessTask is a block processing task started by ConsensusScheduler. This task is executed every 300ms. When there is a new block in the block queue, BlockProcessTask will hand over the new block to io. The addBlock method of .nuls.consensus.poc.process.BlockProcess is processed. - - * BlockProcess's addBlock method will first verify the block, if it is larger than the current time, then directly discard, and then verify the basic information of the block (whether the block is legal), the corresponding block validator in the protocol project, respectively : - - io.nuls.protocol.model.validator.BlockFieldValidator - - io.nuls.protocol.model.validator.BlockHeaderValidator - - io.nuls.protocol.model.validator.BlockMaxSizeValidator - - io.nuls.protocol.model.validator.BlockMerkleValidator - - io.nuls.protocol.model.validator.HeaderFieldValidator - - io.nuls.protocol.model.validator.HeaderSignValidator - - * Then bifurcationUtil.validate(block.getHeader()) verifies that the block corresponds to the packager's malicious fork condition (multiple blocks are played in the same round), and if there is a malicious situation, a red card penalty is given. - - * ledgerService.verifyDoubleSpend(block) verifies that there is a double flower transaction in this block, and if there is a red card penalty. - - * **chainManager.getMasterChain().verifyAndAddBlock(block, isDownload)** Verify that the package of the block is legal, and verify that the block's coinbase transaction and penalty transaction (if any) are verified by then adding the block to the main chain in memory (while processing the block contains Create a proxy, commission, stop proxy, cancel commission, red and yellow card penalty transactions). - - * In the above successful case, continue to verify the transaction of this block, first verify the transaction signature (to provide efficiency, multi-thread asynchronous verification), and then verify whether the transaction utxo is legal **ledgerService.verifyCoinData(tx, toMaps, fromSet)**,Finally verify the business logic conflict of the transaction **tansactionService.conflictDetect(block.getTxs())**。 - - * After the transaction is verified, save the block **blockService.saveBlock(block)**。 - - * Finally, the latest block of the system is set and forwarded to other peer nodes. - - * If the above steps fail, the data of the memory main chain will be rolled back. **chainManager.getMasterChain().rollback(block)**。 - - -#### Bifurcation - -* Brief - * Due to the open nature of the block, it is possible that some peer nodes on the network are malicious (possibly modifying the program code because of open source), and it is also possible that some trusted nodes cause errors due to various unstable factors such as network and server. Blocks, blocks are not synchronized in time, etc.; - * In such a situation, it is possible that the block is malicious and needs to be discarded. It is also possible that the block is correct, but the receiving time delay of the node; then the final criterion for judging whether the block is included in the main chain is to look at the next one. Whether the block node continues to block out of this block. - * Therefore, the system needs a fork processor to handle various problems encountered during the operation of the node, and to ensure the unification of the entire network backbone. - -* flow chart - -![tips](consensus/9.png) - -* Code interpretation - * The scheduler ConsensusScheduler will start a fork processing task - - ```java - ForkChainProcess forkChainProcess = new ForkChainProcess(chainManager); - threadPool.scheduleAtFixedRate(new ForkChainProcessTask(forkChainProcess), 1000L, 1000L, TimeUnit.MILLISECONDS); - ``` - - The task is executed once per second to detect and process the forked blocks. - - * io.nuls.consensus.poc.task.ForkChainProcessTask directly calls the doProcess method of io.nuls.consensus.poc.process.ForkChainProcess. - - * ForkChainProcess's doProcess method first calls the monitorOrphanChains method to process the orphan chain to detect whether the block of the orphan chain is connected to the main chain or the forked chain. If it is connected, it will be merged. If it is not connected, the task will not be processed. - - * Next check the fork chain, the code is as follows: - - ```java - - long newestBlockHeight = chainManager.getBestBlockHeight() + PocConsensusConstant.CHANGE_CHAIN_BLOCK_DIFF_COUNT; - - ChainContainer newChain = chainManager.getMasterChain(); - if (null == newChain) { - return false; - } - Iterator iterator = chainManager.getChains().iterator(); - while (iterator.hasNext()) { - ChainContainer forkChain = iterator.next(); - if (forkChain.getChain() == null || forkChain.getChain().getStartBlockHeader() == null || forkChain.getChain().getEndBlockHeader() == null) { - iterator.remove(); - continue; - } - long newChainHeight = forkChain.getChain().getEndBlockHeader().getHeight(); - if (newChainHeight > newestBlockHeight || (newChainHeight == newestBlockHeight && forkChain.getChain().getEndBlockHeader().getTime() < newChain.getChain().getEndBlockHeader().getTime())) { - newChain = forkChain; - newestBlockHeight = newChainHeight; - } - } - - ``` - - Check all the bifurcation chains, whether there are more than 3 blocks higher than the main chain, and choose the longest bifurcation chain. If not, then newChain is still the main chain, otherwise it is the corresponding bifurcation chain. - - * Check if newChain is the main chain. If it is not the main chain, it shows that a longer bifurcation chain is found. - - ```java - - if (!newChain.equals(chainManager.getMasterChain())) { - - ChainContainer resultChain = verifyNewChain(newChain); - - if (resultChain == null) { - chainManager.getChains().remove(newChain); - } else { - //Verify pass, try to switch chain - //验证通过,尝试切换链 - boolean success = changeChain(resultChain, newChain); - if (success) { - chainManager.getChains().remove(newChain); - } - } - } - - ``` - - * The verifyNewChain method is to verify whether the new fork chain is legal. It is mainly to verify whether the block chain of the new chain and the coinbase transaction and the red and yellow card penalty transactions in the block are legal. If not, the branch chain is deleted. - - * The changeChain method is to switch this longer bifurcation chain as the main chain, first find the bifurcation point, roll back all the blocks and transactions after the bifurcation point on the main chain; then divide the block of the new bifurcation chain from the bifurcation Verify and save one by one (including block headers and transactions). If successful, set the forked chain to the new main chain and revoke if it fails. - - * After the chain switch succeeds, the fork chain in the branch chain set is deleted. - - * Finally, the clearExpiredChain method is called to clear the expired isolated chain, the forked chain, etc., and release the memory. \ No newline at end of file diff --git a/source/manual/consensus/1.png b/source/manual/consensus/1.png deleted file mode 100644 index 5698d309..00000000 Binary files a/source/manual/consensus/1.png and /dev/null differ diff --git a/source/manual/consensus/2.png b/source/manual/consensus/2.png deleted file mode 100644 index d0dd56c2..00000000 Binary files a/source/manual/consensus/2.png and /dev/null differ diff --git a/source/manual/consensus/3.png b/source/manual/consensus/3.png deleted file mode 100644 index 0626f964..00000000 Binary files a/source/manual/consensus/3.png and /dev/null differ diff --git a/source/manual/consensus/4.png b/source/manual/consensus/4.png deleted file mode 100644 index 7eb43571..00000000 Binary files a/source/manual/consensus/4.png and /dev/null differ diff --git a/source/manual/consensus/5.png b/source/manual/consensus/5.png deleted file mode 100644 index 153ab4b1..00000000 Binary files a/source/manual/consensus/5.png and /dev/null differ diff --git a/source/manual/consensus/6.png b/source/manual/consensus/6.png deleted file mode 100644 index 01b0198f..00000000 Binary files a/source/manual/consensus/6.png and /dev/null differ diff --git a/source/manual/consensus/7.png b/source/manual/consensus/7.png deleted file mode 100644 index eb2315be..00000000 Binary files a/source/manual/consensus/7.png and /dev/null differ diff --git a/source/manual/consensus/8.png b/source/manual/consensus/8.png deleted file mode 100644 index 2955ff42..00000000 Binary files a/source/manual/consensus/8.png and /dev/null differ diff --git a/source/manual/consensus/9.png b/source/manual/consensus/9.png deleted file mode 100644 index 0c9edfb1..00000000 Binary files a/source/manual/consensus/9.png and /dev/null differ diff --git a/source/manual/contract.md b/source/manual/contract.md deleted file mode 100644 index d4846237..00000000 --- a/source/manual/contract.md +++ /dev/null @@ -1,4 +0,0 @@ -title: Smart Contract ---- - -Coming Soon. \ No newline at end of file diff --git a/source/manual/index.md b/source/manual/index.md deleted file mode 100644 index 8c529522..00000000 --- a/source/manual/index.md +++ /dev/null @@ -1,93 +0,0 @@ -# Unit 2 Overall Design - -## 1、Architecture diagram - -![总体架构图](./index/structure.png) - -### 1.1 Storage and tool layer - -#### 1.1.1 Tools - -​ The NULS low-level code separates the tools-module module and provides various underlying related tool codes, including cryptography tools, http tools, caching tools, math calculation tools, configuration file operation tools, command line tools, etc., which are convenient for upper-level modules. - -#### 1.1.2 Storage layer - -​ The db-module module defines the interface of the data storage service for storing various types of data. The currently implemented version is based on LevelDB for key-value type storage, and can store any serialized data in the database, which is efficient and space-saving. - -### 1.2 Network layer - -​ The network-module module defines the interface of the network service for establishing connections and communicating with peer nodes. The currently implemented version is based on the Netty implementation and defines a set of communication protocols for managing nodes and connections. Module functions include node discovery, data transfer, timed handshake, node management, etc. - -### 1.3 Consensus layer - -​ The consensus layer defines tokens, incentive mechanisms, block packing mechanisms, basic data protocols, and core business processes. The current implementation uses POC consensus implementation. - -### 1.4 Interface layer - -​ The interface layer of NULS is divided into two parts, the smart contract and the RPC interface service. The smart contract is based on NVM and supports Java syntax. RPC is implemented by various functional modules. Each module can provide its own RPC interface. All RPC interfaces are aggregated to form the NULS RPC interface service. - -### 1.5 Application layer - -​ Business applications in the NULS ecosystem. - -## 2、 Relationship between modules - -![relationship](./index/relationship.png) - -![模块关系](./index/relationship2.png) - -### 2.1 Tools module - -​ Tool module with some basic tools built in for other modules. - -### 2.2 Core module - -​ The microkernel module is responsible for module management, thread management, context management, and configuration information management. - -### 2.3 Account module - -​ The account module is responsible for the management of addresses, public and private key pairs, and account token balances. - -### 2.4 Network module - -​ The network module is responsible for receiving and transmitting messages between peer nodes, where the service messages are sent to the message-bus module by means of interface calls. - -### 2.5 Message-Bus module - -​ The module currently implements the use of the Disruptor circular queue to buffer data and distribute the messages to the corresponding Handlers. - -### 2.6 Protocol module - -​ The currently implemented Protocol module defines the protocol for most common services and implements most of the protocol's processors, including block processing, transaction processing, data synchronization, and so on. - -### 2.7 consensus module - -​ The consensus module is responsible for token creation, management, packaging, data validation, data storage, business logic management for block packaging, and node penalties. - -### 2.8 Ledger module - -​ This module is responsible for storing token data records in transactions and transactions, and verifying that token usage is legal. - -### 2.9 Storage module - -​ The db-module storage module supports all types of data storage and is currently stored in LevelDB. - -### 2.10 Contract module - -​ The contract module is mainly used for communication with NVM (NULS virtual machine), which can perform call and query operations of smart contract related services. - -More detailed module introduction see subsequent chapters - -## 3、Core business relationship - -![区块链](./index/blockchain.png) - -- Description: - - After the system is started, the node discovery function is used to find and connect the peer nodes to realize communication between nodes. - - The received external message is uniformly processed into the ConnectionManager. If it is the message of the network module itself, it is put into the network message processor. Otherwise, it is uniformly distributed through the Message-Bus and sent to the processor corresponding to the message for processing. - - Messages are divided into 3 types, blocks, transactions and other business messages, which are handled differently - - The transaction is placed in the buffer pool and then verified for packaging by the consensus module - - Store directly after block verification - - Other business messages are processed in the handler and the network is returned to return the processing result - - The application implements data interaction by calling RPC. It can broadcast a transaction like a network, or obtain the required data from the received block. - - When each module calls the storage module, the service data will be prepared. The storage module is only responsible for adding, deleting, and changing operations, and does not perform any business processing. \ No newline at end of file diff --git a/source/manual/index/blockchain.png b/source/manual/index/blockchain.png deleted file mode 100644 index 06caa7ba..00000000 Binary files a/source/manual/index/blockchain.png and /dev/null differ diff --git a/source/manual/index/relationship.png b/source/manual/index/relationship.png deleted file mode 100644 index 2b2d62f3..00000000 Binary files a/source/manual/index/relationship.png and /dev/null differ diff --git a/source/manual/index/relationship2.png b/source/manual/index/relationship2.png deleted file mode 100644 index def24ab5..00000000 Binary files a/source/manual/index/relationship2.png and /dev/null differ diff --git a/source/manual/index/structure.png b/source/manual/index/structure.png deleted file mode 100644 index 0893266b..00000000 Binary files a/source/manual/index/structure.png and /dev/null differ diff --git a/source/manual/kernel/bootstrap-en.png b/source/manual/kernel/bootstrap-en.png deleted file mode 100644 index 2aeebaad..00000000 Binary files a/source/manual/kernel/bootstrap-en.png and /dev/null differ diff --git a/source/manual/ledger.md b/source/manual/ledger.md deleted file mode 100644 index e69de29b..00000000 diff --git a/source/manual/message_bus.md b/source/manual/message_bus.md deleted file mode 100644 index 415054ef..00000000 --- a/source/manual/message_bus.md +++ /dev/null @@ -1,86 +0,0 @@ -# NULS Message Bus Module Resolution - -## 1、Overview - -The message bus module is a functional module used by NULS to process messages. It manages all network messages and protocol messages, and provides functions such as subscription, reception, and transmission of messages. It is a data relay station for each node of NULS. - -## 2、Feature - -The message bus module manages all the messages in the NULS through the MessageManager, and provides functions such as message subscription, unsubscription, broadcast message, point-to-point sending message, receiving message, and creating message example. - -## 3、Interface - -- Class that defines the interface: `io.nuls.message.bus.service.MessageBusService` - -```java - /** - * Subscribe to message - * - * @param messageClass The class object that needs to subscribe to the message. - * @param messageHandler The message message - * @return The id of the subscription message. - */ - String subscribeMessage(Class messageClass, NulsMessageHandler messageHandler); - - - /** - * unsubscribe - * - * @param subscribeId id. - * @param subscribeId The id of the message message. - */ - void unsubscribeMessage(String subscribeId); - - /** - * Receive the message and place the message on the message bus. - * - * @param message Received message. - * @param node The message comes as to which node. - */ - void receiveMessage(BaseMessage message, Node node); - - /** - * broadcast to nodes except "excludeNode" - * - * @param message The message was broadcast. - * @param excludeNode The node that is not passed. - * @param aysn Asynchronous execution - * @return Return all broadcasted node id list - */ - Result> broadcast(BaseMessage message, Node excludeNode, boolean aysn, int percent); - - - /** - * send msg to one node - * - * @param message The message you want to sent - * @param node The node that received the message - * @param aysn Asynchronous execution - * @return Return whether sent successfully - */ - Result sendToNode(BaseMessage message, Node node, boolean aysn); - - /** - * Instantiate a message object based on message type and module identity. - */ - Result getMessageInstance(short moduleId, int type); -``` - -## 4、Architectures - -- Module name:message-bus-module -- Module ID:6 - -![mbarchitecture](message_bus/msgbusArchitecture.png) - -## 5、Core Process - -#### 5.1 Module start -> Subscribe message - -![MessageBus流程1](message_bus/flow_chart1.png) - - - -#### 5.2 Receive message -> classification processor processing -> distribution to specific message handler for processing - -![MessageBus流程2](message_bus/flow_chart2.png) \ No newline at end of file diff --git a/source/manual/message_bus/MessageBus1.vsdx b/source/manual/message_bus/MessageBus1.vsdx deleted file mode 100644 index b741ea76..00000000 Binary files a/source/manual/message_bus/MessageBus1.vsdx and /dev/null differ diff --git a/source/manual/message_bus/flow_chart1.png b/source/manual/message_bus/flow_chart1.png deleted file mode 100644 index aa350b16..00000000 Binary files a/source/manual/message_bus/flow_chart1.png and /dev/null differ diff --git a/source/manual/message_bus/flow_chart2.png b/source/manual/message_bus/flow_chart2.png deleted file mode 100644 index cd183026..00000000 Binary files a/source/manual/message_bus/flow_chart2.png and /dev/null differ diff --git a/source/manual/message_bus/msgbusArchitecture.png b/source/manual/message_bus/msgbusArchitecture.png deleted file mode 100644 index cbae0f59..00000000 Binary files a/source/manual/message_bus/msgbusArchitecture.png and /dev/null differ diff --git a/source/manual/message_bus/msgbusArchitecture.vsdx b/source/manual/message_bus/msgbusArchitecture.vsdx deleted file mode 100644 index a9b37abe..00000000 Binary files a/source/manual/message_bus/msgbusArchitecture.vsdx and /dev/null differ diff --git a/source/manual/micro_kernel.md b/source/manual/micro_kernel.md deleted file mode 100644 index 33a36c20..00000000 --- a/source/manual/micro_kernel.md +++ /dev/null @@ -1,208 +0,0 @@ -# Chapter 3 Microkernel Module Resolution - -[TOC] - -## 1, module overview - -The microkernel module is the core module of NULS, responsible for the core functions of module management, object management, thread management, service management, configuration management, etc. - -## 2, module function - -### 2.1 Configuration Management - -The microkernel module is responsible for reading and storing the system configuration file. When each module needs to be used, only the configuration manager needs to be called to obtain the required configuration item information. - -The configuration supports both the properties and the ini format. - -### 2.2 Context management - -The microkernel module provides the system's context container NulsContext, through the context container can get the latest block, creation block, network height, chain id, default address type, the context also provides a quick access to the service manager's get service object the way. - -### 2.3 Module Management - -The microkernel module defines the abstract class BaseModuleBootstrap of the module launcher. The module needs to inherit the abstract class to add the module to the management. The module manager manages the lifecycle of all modules, including loading, initializing, running, stopping, and destroying. The microkernel module also maintains the dependencies of the modules and controls the order in which the modules are started. - -### 2.4 Object Management - -An IOC container like spring-framework implements object instantiation and manages objects by annotation. The corresponding method is intercepted and verified. If the module in which the called object is located is not yet running, execution is not allowed. - -### 2.5 thread management - -The microkernel module provides a thread manager TaskManager that can create and allow threads or thread pools. Provide the default thread creation factory NulsThreadFactory, all threads should be created with this factory. - -### 2.6 Service Management - -All services in NULS are registered in the service manager. Inter-service interdependencies can be referenced by means of annotations or by the NulsContext context manager. - -### 2.7 Internationalization - -The microkernel module provides a basic internationalization solution. The language can be switched through different configuration files (zh-CN.properties, en.properties). Any language can be added to the nuls system through configuration files. - -## 3, module interface - -### 3.1 Setting the language - -Interface definition class: - -``` -io.nuls.kernel.service.KernelService -``` - -- Get the creation block - - - Method description: - Set the system language, - - Parameter Description: - Lang(String): The prefix of the internationalization configuration file. For example, the key configured in English en.properties is "en". - - Return value description: - Success(boolean): Whether the operation is successful - - code - - ``` - /** - * 设置系统语言 - * set language of system - * - * @param lang zhe name of the language properties file - * @return success or not - */ - public Result setLanguage(String lang); - ``` - -### 3.2 thread interface - -Interface definition class: - -``` -io.nuls.kernel.thread.manager.TaskManager -``` - -- Create a thread pool - - - Method description: - Create a thread pool based on the passed parameters and return - - Parameter Description: - threadCount(int): number of threads -   queueSize(int): number of queues -   Factory(NulsThreadFactory): Thread creates a factory object - - Return value description: - Data: returns the created thread pool object - - code - - ``` - /** - * 创建一个线程池,并返回 - * create a thread pool and return it; - * @param threadCount the max count of thread - * @param queueSize the max size of the queue - * @param factory which create all the threads - * @return the thread pool - */ - public static final ThreadPoolExecutor createThreadPool(int threadCount, int queueSize, NulsThreadFactory factory) - ``` - -- Create a scheduled task thread pool - - - Method description: - Create a timed task thread pool based on the passed parameters and return - - Parameter Description: - threadCount(int): number of threads -   Factory(NulsThreadFactory): Thread creates a factory object - - Return value description: - Data: returns the created thread pool object - - code - - ``` - /** - * 创建一个定时执行的线程池,并返回 - * create a scheduled thread pool and return it; - * @param threadCount the max count of thread - * @param factory which create all the threads - * @return the thread pool - */ - public static final ScheduledThreadPoolExecutor createScheduledThreadPool(int threadCount, NulsThreadFactory factory) ; - ``` - -- Asynchronous method execution - - - Method description: - The asynchronous method calls a run method, and all methods called in this way share the same thread pool. - - Parameter Description: - Runnable(Runnable):run - - Return value description: - Void - - code - - ``` - /** - * 异步执行一个方法,该方法会在系统中一个特定的线程池中异步执行, - * 该线程池为系统中所有该类的调用者共享。 - * A method is executed asynchronously, which is executed asynchronously in a specific - * thread pool in the system, which is shared by all callers of this class in the system. - * @param runnable 可以行的run方法对象,Run method object - */ - public static final void asynExecuteRunnable(Runnable runnable) - ``` - -- Create a separate thread and run - - - Method description: - Create a thread based on the parameters passed in, - - Parameter Description: - moduleId(short): module id -   threadName(String): thread name -   Runnable(Runnable): execution method object -   Deamon (boolean): whether to create a daemon - - Return value description: - Void - - code - - ``` - /** - * 创建一个独立的线程,并执行runnable的run方法 - * Create a separate thread and execute the runnable run method - * @param moduleId 模块id - * @param threadName 线程名称 - * @param runnable 方法对象 - * @param deamon 是否是守护线程 - */ - public static final void createAndRunThread(short moduleId, String threadName, Runnable runnable, boolean deamon) - ``` - -- Stop all threads of a module - - - Method description: - Stop all threads of the module based on the passed module id - - Parameter Description: - moduleId(short): module id - - Return value description: - Void - - code - - ``` - /** - * 停止一个模块的所有线程 - * stop all the threads of the module - * @param moduleId 模块id - */ - public static void shutdownByModuleId(short moduleId) - ``` - -## 4、Module architecture - -``` -1. The microkernel module is the "motherboard" of the entire NULS system. All modules are plugged into the motherboard. -2, module communication, function calls are dependent on the "main board" -3, "Motherboard" provides management and synergy -``` - -## 5、Module protocol - -skip - -## 6, the core process - -### 6.1 system startup - -![](./kernel/bootstrap-en.png) - diff --git a/source/manual/modular_overview.md b/source/manual/modular_overview.md deleted file mode 100644 index 2d07e120..00000000 --- a/source/manual/modular_overview.md +++ /dev/null @@ -1,26 +0,0 @@ -title: NULS module organization structure ---- - -The NULS system is a combination of multiple modules. The definition of the module has a set of rules: top-level directory -> interface engineering, implementation directory -> implementation project. There are also corresponding naming rules. For example, if a module is A, then the structure of this module is as follows: - -- A-module -- A -- base -- A-base -- A-protocol -- A-rpc -- A-sdk -- A-storage - -The change is that this module has a very clear implementation of many different ways, then named according to the corresponding implementation, more typical consensus module and ledger module. In this case, for example, if a module is M and its implementation is B, then the structure of this module is as follows: - -- M-module -- M -- B -- M-B-base -- M-B-protocol -- M-B-rpc -- M-B-sdk -- M-B-storage - -It is worth noting that not all module implementations must include these projects. For example, some modules do not need storage, so there is no need for storage. Some modules do not have a protocol, so no protocl is needed. \ No newline at end of file diff --git a/source/manual/modularity.md b/source/manual/modularity.md deleted file mode 100644 index 6f5bc697..00000000 --- a/source/manual/modularity.md +++ /dev/null @@ -1,20 +0,0 @@ -title: Why emphasize the use of modularity ---- - -Since the birth of Bitcoin, early blockchain applications have been a single application that serves a specific purpose. - -Anyone who wants to multiplex Bitcoin-related code can only go deep into the entire Bitcoin project and learn all the details. -Adjust the code and implement the function according to your actual situation. - -Since its inception, NULS is a PaaS for business. It has only one goal: to reduce the cost of using blockchain technology. Only with a modular bottom layer design can the blockchain become remodelable. - -## Why is this design? -Business needs are changing rapidly, and it is impossible for NULS developers to write a commercial blockchain system that covers 100% of the environment in advance. Use a minimal functional module to build together a blockchain system. As much as possible to meet as many business needs as possible at the lowest cost. - -## brings value -At present, the NULS open source modules are based on the MIT protocol, which provides good support for several commonly used blockchain networking models. There is no charge for companies to use code based on these modules. At the same time, thanks to the NULS Global Developer Program. Businesses can choose to use the free or paid authorization module provided by the community. It is even possible to screen developers from the familiar NULS underlying layer, so that enterprises can quickly build a commercial blockchain network that meets their business needs. - -## Anymore? - -NULS hopes to build a bridge between enterprises and developers and connect with NULS users worldwide to participate in the consensus. -Enterprises only need to store the hash of the side chain to the NULS main network, which can significantly improve the data credibility of closed source enterprises without sacrificing the security of sensitive data. \ No newline at end of file diff --git a/source/manual/network/m1.png b/source/manual/network/m1.png deleted file mode 100644 index 5731421b..00000000 Binary files a/source/manual/network/m1.png and /dev/null differ diff --git a/source/manual/network/m2.png b/source/manual/network/m2.png deleted file mode 100644 index 2366f62b..00000000 Binary files a/source/manual/network/m2.png and /dev/null differ diff --git a/source/manual/network/m3.png b/source/manual/network/m3.png deleted file mode 100644 index 45e03459..00000000 Binary files a/source/manual/network/m3.png and /dev/null differ diff --git a/source/manual/network/message.png b/source/manual/network/message.png deleted file mode 100644 index 51e7767a..00000000 Binary files a/source/manual/network/message.png and /dev/null differ diff --git "a/source/manual/network/network\346\236\266\346\236\204\345\233\276.png" "b/source/manual/network/network\346\236\266\346\236\204\345\233\276.png" deleted file mode 100644 index 55551e64..00000000 Binary files "a/source/manual/network/network\346\236\266\346\236\204\345\233\276.png" and /dev/null differ diff --git "a/source/manual/network/network\346\265\201\347\250\213\345\233\276.png" "b/source/manual/network/network\346\265\201\347\250\213\345\233\276.png" deleted file mode 100644 index 736dd35f..00000000 Binary files "a/source/manual/network/network\346\265\201\347\250\213\345\233\276.png" and /dev/null differ diff --git "a/source/manual/network/network\347\261\273\345\233\2761.png" "b/source/manual/network/network\347\261\273\345\233\2761.png" deleted file mode 100644 index de8781df..00000000 Binary files "a/source/manual/network/network\347\261\273\345\233\2761.png" and /dev/null differ diff --git "a/source/manual/network/network\347\261\273\345\233\2762.png" "b/source/manual/network/network\347\261\273\345\233\2762.png" deleted file mode 100644 index 359ebf0c..00000000 Binary files "a/source/manual/network/network\347\261\273\345\233\2762.png" and /dev/null differ diff --git a/source/manual/network/node1.png b/source/manual/network/node1.png deleted file mode 100644 index 7525a238..00000000 Binary files a/source/manual/network/node1.png and /dev/null differ diff --git a/source/manual/network/node2.png b/source/manual/network/node2.png deleted file mode 100644 index ac787c26..00000000 Binary files a/source/manual/network/node2.png and /dev/null differ diff --git a/source/manual/network/p-t1.png b/source/manual/network/p-t1.png deleted file mode 100644 index 7cee9f29..00000000 Binary files a/source/manual/network/p-t1.png and /dev/null differ diff --git a/source/manual/network/p-t2.png b/source/manual/network/p-t2.png deleted file mode 100644 index 239adfc0..00000000 Binary files a/source/manual/network/p-t2.png and /dev/null differ diff --git a/source/manual/network/p2p-t1.png b/source/manual/network/p2p-t1.png deleted file mode 100644 index 69169017..00000000 Binary files a/source/manual/network/p2p-t1.png and /dev/null differ diff --git a/source/manual/network/p2p-t2.png b/source/manual/network/p2p-t2.png deleted file mode 100644 index 8368d2ae..00000000 Binary files a/source/manual/network/p2p-t2.png and /dev/null differ diff --git a/source/manual/network/p2p-t3.png b/source/manual/network/p2p-t3.png deleted file mode 100644 index 4c85d44b..00000000 Binary files a/source/manual/network/p2p-t3.png and /dev/null differ diff --git a/source/manual/network/p2p-t4.png b/source/manual/network/p2p-t4.png deleted file mode 100644 index 045cbe89..00000000 Binary files a/source/manual/network/p2p-t4.png and /dev/null differ diff --git a/source/manual/network_overview.md b/source/manual/network_overview.md deleted file mode 100644 index daf0062e..00000000 --- a/source/manual/network_overview.md +++ /dev/null @@ -1,289 +0,0 @@ -# NULS network module analysis - -## Module overview - -The network module is one of the eight basic modules of NULS, providing the lowest level of network communication, node discovery and other services. The network foundation of the blockchain is Peer to Peer, or P2P. All participants in the P2P network can be either a server or a client. Features of P2P networks: decentralized, scalable, robust, cost-effective, privacy-protected, and load-balanced. - -According to the structural relationship, the P2P system can be subdivided into four topological forms: - -- **Centralized Topology:** There is a central node that stores index information of all other nodes. The index information generally includes the node IP address, port, node resources, and so on. - - ![](network/p-t1.png) - -- **Decentralized Unstructured Topology:** The central node is removed, and a random network is established between the P2P nodes, that is, a connection node is randomly established between a newly joined node and a node in the P2P network, thereby forming a random topology. Bitcoin uses the network structure. - - ![](network/p-t2.png) - -- **Decentralized Structured Topology(also known as DHT network):** All nodes are organized in an orderly structure, such as forming a ring network or a tree network. The specific implementation of structured networks is generally based on the DHT (Distributed Hash Table) algorithm. For example, the implementation algorithm of the Ethereum network Kademlia. - -![](network/p2p-t3.png) - -- **Partially Decentralized Topology:** Take advantage of the centralized structure and fully distributed unstructured topology, and select nodes with higher performance (processing, storage, bandwidth, etc.) as super nodes (expressed as SuperNodes or Hubs in English) ), the information of other parts of the system is stored on each super node, and it is found that the algorithm only forwards between the super nodes, and the super node forwards the query request to the appropriate leaf node. The semi-distributed structure is also a hierarchical structure. The super-nodes form a high-speed forwarding layer, and the super-nodes and the common nodes responsible are composed of several levels. The EOS uses this network structure. - -![](network/p2p-t4.png) - -The NULS 1.0 version is similar to Bitcoin in the second, fully distributed unstructured topology. The nodes in the network have functions: routing, wallet, mining, blockchain database. All nodes have routing capabilities, participate in checksum broadcast transactions and block information, and discover and maintain connections with other nodes. - -**Module information** - -**Module name**: network-module - -**Module structure**: module top-level directory network-module, consesnus project for module interface definition, base directory for the network module's default implementation, implementation of the project network-base, network-protocol to achieve the relevant network protocol, network-storage network storage interface and implementation. - -**Interface definition dependent modules**: protocol-module, network-module - -**Implement additional dependency modules**: core-module, ledger-module, account-module, account-ledger-module - - - -## Module function - -This section details the functional requirements of the network module and each of the functional point constraints, as well as the default implementation of the NULS version 1.0. - -### Node discovery - -**Functional requirements: **Each node of NULS is both a server and accepts connections from other nodes. It is also a client that actively initiates connections to other nodes. Nodes ask each other more nodes and try to connect. Each node tries to ensure that it connects to more nodes and communicates with each other. - -**Implementationmode :** NULS version 1.0 is implemented by default using the Netty framework. When the node is running, the network module starts the network service (NettySever), waits for the connection of other nodes, and also actively connects to other nodes (NettyClient). Actively connected nodes, we call active nodes, the same IP address can not be repeated to initiate active connections; the new nodes received by the network services, we call passive nodes, taking into account the public network IP exposed by the nodes in the LAN is consistent, so passive A node running a unified IP address has up to 10 connections. - -After the active node is successfully connected, the other party will return more information about the connectable nodes. After receiving the node information, it will try to connect to these nodes in turn. Until the configured active connection maximum is reached. - -The NULS version 1.0 provides seven seed nodes, and the new node will connect seven seed nodes when it is first run. The seed node will return the external network IP address of the new node. The new node will attempt to actively connect to its own server through the external network IP. If the connection is successful, it will automatically send a new node message to the network. After receiving the message, other nodes will Try to connect to a new node. - -### Message reception and processing - -**Functional requirements:** The node will receive messages sent by other nodes. The received message is first filtered by the network protocol of NULS, and the filtered message is then processed by each module. - -**Implementation mode:** The message sent by NULS includes a message header (MessageHeader) and a message body (MessageBody). The message header contains a magic parameter, a module ID corresponding to the message, and a message type. After receiving the message sent by other nodes, first determine whether the magic parameters are consistent, and then determine whether the module ID and the message type exist, and the inconsistent message is directly filtered. - -The filtered message, with the protocol of the network module, is processed by the network module itself. The non-network module protocol is uniformly distributed to the distributor, distributed to other modules by the distributor, and the MessageBody is converted into business data by a custom deserialization method and then processed accordingly. - -### Message broadcast - -**Functional requirements:** The protocols (blocks, transactions, etc.) generated by the nodes are sent by the network module to other nodes that have been connected and successfully handshake. - -**Implementation mode:** The network module provides an interface for broadcasting messages. The interface adds all messages to the header of the corresponding module, and then converts it into network information through a customized serialization method and sends it to other nodes. - -### Node grouping - -**Functional requirements:** Connected peer nodes can be stored in different node groups for easy management according to different attributes and functions. For example, according to the connection situation, it can be divided into an active connection group and a passive connection group, and can be divided into a consensus node group and a common node group according to functions. - -**Implementation mode:**The network module provides node grouping functions, and provides interfaces for creating node groups, adding nodes to node groups, and acquiring node groups. The current network module creates active connection groups and passive connection groups by default. - - - -## Module interface - -io.nuls.network.service.NetworkService - -``` -/** - * 断开一个已连接的节点 - * Disconnect the connection with the node - * - * @param nodeId the id of node - */ -void removeNode(String nodeId); - -/** - * 获取一个节点 - * get node by id - * - * @param nodeId the id of node - * @return Node - */ -Node getNode(String nodeId); - -/** - * 获取所有节点 - * get all nodes - * - * @return Map - */ -Map getNodes(); - -/** - * 获取已连接的节点 - * get connected nodes - * - * @return Collection - */ -Collection getAvailableNodes(); - -/** - * 获取可连接的节点 - * get connectable nodes - * - * @return List - */ -List getCanConnectNodes(); - -/** - * 根据名字获取节点组 - * get NodeGroup by name - * - * @param groupName groupName - * @return NodeGroup - */ -NodeGroup getNodeGroup(String groupName); - -/** - * 发送消息 - * Send message to all connected nodes - * - * @param nulsData message - * @param asyn Whether or not asynchronous - * @return BroadcastResult - */ -BroadcastResult sendToAllNode(BaseNulsData nulsData, boolean asyn, int percent); - -/** - * 发送消息 - * Send message to all connected nodes - * - * @param event event - * @param excludeNode node that does not need to be send - * @param asyn Whether or not asynchronous - * @return BroadcastResult - */ -BroadcastResult sendToAllNode(BaseNulsData event, Node excludeNode, boolean asyn, int percent); - -/** - * send message to node - * - * @param event event - * @param node node - * @param asyn Whether or not asynchronous - * @return BroadcastResult - */ -BroadcastResult sendToNode(BaseNulsData event, Node node, boolean asyn); - -/** - * 发送消息给节点组 - * send message to nodeGroup - * - * @param event event - * @param groupName groupName - * @param asyn asyn - * @return BroadcastResult - */ -BroadcastResult sendToGroup(BaseNulsData event, String groupName, boolean asyn); - -/** - * 发送消息给节点组 - * send message to nodeGroup - * - * @param event event - * @param groupName groupName - * @param excludeNode node that does not need to be send - * @param asyn asyn - * @return BroadcastResult - */ -BroadcastResult sendToGroup(BaseNulsData event, String groupName, Node excludeNode, boolean asyn); - -/** - * 重置网络 - * reset network module - */ -void reset(); - -/** - * 获取网络配置信息 - * Get network configuration information - * - * @return NetworkParam - */ -NetworkParam getNetworkParam(); -``` - - - -## Module protocol - -Network module, protocol module ID = 4 - -``` -short NETWORK_MODULE_ID = 4; -``` - - - -- Node p2p Node information - -| size | field | field type | Description | -| ---- | ----------- | ---------- | ---------------------------- | -| 4 | magicNumber | uint32 | message filtering parameters | -| 2 | port | uint16 | port | -| ?? | IP | VarString | IP | - -- HandshakeMessage Node handshake message - -| size | field | field type | Description | -| ---- | --------------- | ---------- | ------------------------------- | -| 2 | handshakeType | uint16 | 1. request 2. response | -| 2 | ServerPort | uint16 | node server port | -| 4 | BestBlockHeight | uint32 | latest block height of the node | -| ?? | BestBlockHash | VarString | latest block hash of the node | -| 6 | networkTime | uint48 | time of node | -| ?? | nodeIp | VarString | ip of node | -| ?? | Version | VarString | version of node | - -- P2PNodeMessage message of node infomation - -| size | field | field type | Description | -| ---- | ----- | ---------- | ----------- | -| 2 | Port | uint16 | port | -| ?? | IP | VarString | IP | - -- NodesMessage message of many nodes - -| size | field | field type | Description | -| ---- | --------- | --------------- | ------------- | -| ?? | NodeCount | VarInt | count of node | -| ?? | Node[] | Node[NodeCount] | nodes | - -- GetVersionMessage get node version message - -| size | field | field type | Description | -| ---- | --------------- | ---------- | ------------------------------- | -| 2 | handshakeType | uint16 | 1. request 2. response | -| 2 | ServerPort | uint16 | node server port | -| 4 | BestBlockHeight | uint32 | latest block height of the node | -| ?? | BestBlockHash | VarString | latest block hash of the node | -| 6 | networkTime | uint48 | time of node | -| ?? | nodeIp | VarString | ip of node | -| ?? | Version | VarString | version of node | - -- NETWORK_VERSION message of node - -| size | field | field type | Description | -| ---- | --------------- | ---------- | ------------------------------- | -| 2 | handshakeType | uint16 | 1. request 2. response | -| 2 | ServerPort | uint16 | node server port | -| 4 | BestBlockHeight | uint32 | latest block height of the node | -| ?? | BestBlockHash | VarString | latest block hash of the node | -| 6 | networkTime | uint48 | time of node | -| ?? | nodeIp | VarString | ip of node | -| ?? | Version | VarString | version of node | - - - -## Module architecture - -![](network/network架构图.png) - - - -## Core process - -### Discovery node - -Each node of NULS is both a client and a server. Therefore, discovering a node and establishing a connection need to describe the server from actively initiating a connection to access other nodes, and passively waiting for others to connect to their own server. - -![](network/m1.png) - -![](network/m2.png) - -### Message reception and processing - -![](network/m3.png) \ No newline at end of file diff --git a/source/manual/protocol.md b/source/manual/protocol.md deleted file mode 100644 index 4b90b097..00000000 --- a/source/manual/protocol.md +++ /dev/null @@ -1,724 +0,0 @@ -# General protocol module resolution - -[TOC] - - - -## 1、Module overview - -​ The Protocol-module module was originally designed to define a common protocol format for all modules, and all modules can use these common protocols by relying on protocol modules. While defining these general-purpose protocols, the protocol module also provides a service interface for generic validators, general-purpose processors, and some important data structures associated with these protocols. - -## 2、Module function - -### 2.1 Protocol definition - -- Trading Agreement: Consensus Reward Transaction, Transfer Transaction, Stored Transaction in Data Chain, and Transaction Verifier -- Network protocol and processor: The definition and implementation of sending and acquiring cell fast, block, transaction messages and processors between nodes. - -### 2.2 Other functions - -- Block Synchronization: Get the current latest block height information from the network peer node, and download and store the block. -- Block management: Receive new block, storage block, rollback block, query block and block header information, broadcast block. -- Transaction management: receiving transactions, transaction confirmation, transaction rollback, query transactions, transaction conflict detection. - -## 3、Module interface - -### 3.1 Block interface - -Interface definition class: - -``` -io.nuls.protocol.service.BlockService -``` - -- Get the creation block - - - Method description: - Get the block with height 0 from the database, first get the block header from the database, then get the transaction in the block through LedgerService, and finally assemble the complete block and put it into the returned result. - - Parameter Description: - no - - Return value description: - Data: returns the complete block information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 获取创世块(从存储中) - * Get the creation block (from storage) - */ - Result getGengsisBlock(); - ``` - -- Get the latest block - - - Method description: - Get the maximum height from the database, query the block header according to the height, and then get the transaction in the block through LedgerService, and finally assemble the complete block and put it into the returned result. - - Parameter Description: - no - - Return value description: - Data: returns the complete block information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 获取最新的区块(从存储中) - * Get the highest block (from storage) - */ - Result getBestBlock(); - ``` - -- Get the latest block header - - - Method description: - Get the maximum height from the database, query the block header according to the height and return. - - Parameter Description: - no - - Return value description: - Data: returns the block header information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 获取最新的区块头(从存储中) - * Get the highest block header (from storage) - */ - Result getBestBlockHeader(); - ``` - -- Get block headers based on height - - - Method description: - According to the height query block hash, and then get the block header information through hash - - Parameter Description: - Block height (long) - - Return value description: - Data: returns the block header information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 根据区块高度获取区块头(从存储中) - * Get the block head (from storage) according to the block height - * - * @param height 区块高度/block height - * @return 区块头 - */ - Result getBlockHeader(long height); - ``` - -- Get the block header according to the block hash - - - Method description: - According to the hash query block header, put in the returned result. - - Parameter Description: - Block hash (NulsDigestHash) - - Return value description: - Data: returns the block header information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 根据区块摘要获取区块头(从存储中) - * Get the block head (from storage) according to the block hash - * - * @param hash 区块摘要/block hash - * @return 区块头/block header - */ - Result getBlockHeader(NulsDigestData hash); - ``` - -- Get the block according to the height - - - Method description: - According to the height query block hash, the block header information is obtained through hash, and then the transaction in the block is obtained through LedgerService, and finally the complete block is assembled and put into the returned result. - - Parameter Description: - Block height (long) - - Return value description: - Data: returns the complete block information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 根据区块高度获取区块(从存储中) - * Get the block (from storage) according to the block height - * - * @param height 区块高度/block height - * @return 区块/block - */ - Result getBlock(long height); - ``` - -- Get the block according to Hash - - - Method description: - According to the hash, the block header information is obtained, and then the transaction in the block is obtained through the LedgerService, and finally the complete block is assembled and put into the returned result. - - Parameter Description: - Block hash (NulsDigestHash) - - Return value description: - Data: returns the complete block information, and returns the failed result when the data is not queried. - - code - - ``` - /** - * 根据区块摘要获取区块(从存储中) - * Get the block (from storage) according to the block hash - * - * @param hash 区块摘要/block hash - * @return 区块/block - */ - Result getBlock(NulsDigestData hash); - ``` - -- Save block - - - Method description: - First confirm the transaction, then store the transaction, then store the block header, and finally process the local unconfirmed transaction. If any of the above steps fail, the previously processed steps will be rolled back. - - Parameter Description: - Block - - Return value description: - Success: Returns whether the block is successfully stored. - - code - - ``` - /** - * 保存区块到存储中 - * Save the block to the store. - * - * @param block 完整区块/whole block - * @return 操作结果/operating result - * @throws NulsException 保存区块有可能出现异常,请捕获后谨慎处理 - * There may be exceptions to the save block, please handle it carefully after capture. - */ - Result saveBlock(Block block) throws NulsException; - ``` - -- Rollback block - - - Method description: - Roll back the transaction first, delete the block header, and finally process the local transaction. If any of the above steps fail, the previously processed steps will be reversed. - - Parameter Description: - Block - - Return value description: - Success: Returns whether the block is successfully rolled back. - - code - - ``` - /** - * 回滚区块 - * roll back the block to the store. - * - * @param block 完整区块/whole block - * @return 操作结果/operating result - * @throws NulsException 回滚区块有可能出现异常,请捕获后谨慎处理 - * There may be exceptions to the roll back block, please handle it carefully after capture. - */ - Result rollbackBlock(Block block) throws NulsException; - ``` - -- Broadcast block - - - Method description: - The cell block is placed in the block broadcast message, and the message is sent to the network by calling the interface of the MessageBus module. - - Parameter Description: - smallBlock: cell block (SmallBlock) - - Return value description: - Success: Returns whether the block is successfully broadcast. -   Data: list of node ids sent successfully - - code - - ``` - /** - * 广播区块给连接的其他对等节点 - * The broadcast block gives the connection to other peers. - * - * @param block 完整区块/the whole block - * @return 广播结果/Broadcast the results - */ - Result broadcastBlock(SmallBlock block); - ``` - -- Forwarding block - - - Method description: - The cell block is assembled according to the block, and the cell block is placed in the forwarding message, and the message is sent to the network by calling the interface of the MessageBus module. - - Parameter Description: - Block: block (Block) -   excludeNode: Excluded node (Node) - - Return value description: - Success: Returns whether the block is successfully forwarded. -   Data: list of node ids sent successfully - - code - - ``` - /** - * 转发区块给连接的其他对等节点,允许一个列外(不转发给它) - * Forward block to other peers of the connection, allowing one column (not forward to it) - * - * @param hash 区块摘要/the hash of block - * @param excludeNode 需要排除的节点,一般是因为从该节点处接收的本区块 - * The nodes that need to be excluded are generally due to the block received from the node. - * @return 转发结果/forward results - */ - Result forwardBlock(NulsDigestData hash, Node excludeNode); - ``` - -### 3.2 trnasaction interfaces - -Interface definition class: - -``` -io.nuls.protocol.service.TransactionService -``` - -- Confirm transaction - - - Method description: - According to the type of incoming transaction, the processor of the transaction is acquired, and the onCommit method of all processors is called. If any processor returns a failure, the successfully executed processor is rolled back. - - Parameter Description: - Tx: transaction (Transaction) -   secondaryData: auxiliary data (Object) - - Return value description: - Success: Returns whether the transaction confirms success - - code - - ``` - /** - * 确认交易时调用的方法,对交易相关的业务进行提交操作 - * Identify the method that is invoked during the transaction and submit the transaction related business. - * - * @param tx 操作的交易/The transaction of the operation - * @param secondaryData 辅助数据(可以为空)/Secondary data (available for null) - * @return 操作结果/operating results - */ - Result commitTx(Transaction tx, Object secondaryData); - ``` - -- Rollback transaction - - - Method description: - According to the incoming transaction type, the processor of the transaction is acquired, the onRollback method of all processors is called, and finally the transaction is deleted. If any process returns a failure, the successful operation is rolled back. - - Parameter Description: - Tx: transaction (Transaction) -   secondaryData: auxiliary data (Object) - - Return value description: - Success: Returns whether the transaction was successfully rolled back - - code - - ``` - /** - * 回滚交易时调用的方法,对交易相关的业务进行回退操作 - * The method invoked when the transaction is rolled back and the transaction related business is returned. - * - * @param tx 操作的交易/The transaction of the operation - * @param secondaryData 辅助数据(可以为空)/Secondary data (available for null) - * @return 操作结果/operating results - */ - Result rollbackTx(Transaction tx, Object secondaryData); - ``` - -- Forwarding transaction - - - Method description: - The incoming transaction is placed in the transaction forwarding message and the transaction is sent to the network by calling the Message-Bus module interface. - - Parameter Description: - Tx: transaction (Transaction) -   excludeNode: Node to be excluded (Node) - - Return value description: - Success: Returns whether the transaction was successfully forwarded -   Data: list of node ids successfully sent - - code - - ``` - /** - * 转发交易给连接的其他对等节点,允许一个列外(不转发给它) - * Forward Transaction to other peers of the connection, allowing one column (not forward to it) - * - * @param tx 完整交易/the whole transaction - * @param excludeNode 需要排除的节点,一般是因为从该节点处接收的本交易/The nodes that need to be excluded are generally - * due to the transaction received from the node. - * @return 转发结果/forward results - */ - Result forwardTx(Transaction tx, Node excludeNode); - ``` - -- Broadcast transaction - - - Method description: - The incoming transaction is placed in the transaction broadcast message and the transaction is sent to the network by calling the Message-Bus module interface. - - Parameter Description: - Tx: transaction (Transaction) - - Return value description: - Success: Returns whether the transaction was successfully forwarded -   Data: list of node ids successfully sent - - code - - ``` - /** - * 广播交易给连接的其他对等节点 - * The broadcast transaction gives the connection to other peers. - * - * @param tx 完整交易/the whole transaction - * @return 广播结果/Broadcast the results - */ - Result broadcastTx(Transaction tx); - ``` - -- Receive new transactions - - - Method description: - Pass the incoming transaction into the consensus service. - - Parameter Description: - Tx: transaction (Transaction) - - Return value description: - Success: Whether the consensus module is successfully processed - - code - - ``` - /** - * 将交易缓存到共识交易池 - * cache the transaction for consensus - * - * @param tx transaction - * @return Result - */ - Result newTx(Transaction tx); - ``` - -- Conflict detection - - - Method description: - Get all the transaction processors, call the conflictDetect method of all processors, if any processor returns a failure, it will directly return the failed result object. - - Parameter Description: - txList: transaction (List) - - Return value description: - Success: Returns whether the transaction conflicts -   Data: the auxiliary data returned - - code - - ``` - /** - * 冲突检测,检测如果传入的交易列表中有相冲突的交易,则返回失败,写明失败原因及所有的应该舍弃的交易列表 - *

- * Conflict detection, which detects conflicting transactions in the incoming transaction list, returns failure, - * indicating the cause of failure and all the list of trades that should be discarded. - * - * @param txList 需要检查的交易列表/A list of transactions to be checked. - * @return 操作结果:成功则返回successResult,失败时,data中返回丢弃列表,msg中返回冲突原因 - * Operation result: success returns successResult. When failure, data returns the discard list, - * and MSG returns the cause of conflict. - */ - ValidateResult conflictDetect(List txList); - ``` - -- Get a transaction - - - Method description: - According to the incoming transaction hash, the interface of the consensus service is called, and the transaction data in the memory is returned. - - Parameter Description: - Hash: transaction hash (NulsDigestData) - - Return value description: - Data: transaction data - - code - - ``` - /** - * 根据交易hash获取交易信息 - * get transaction by tx hash - * @param hash - * @return - */ - Transaction getTx(NulsDigestData hash); - ``` - -### 3.3 Block synchronization service interface - -Interface definition class: - -``` -io.nuls.protocol.service.DownloadService -``` - -- Download block - - - Method description: - Download a block from the specified node according to the block hash - - Parameter Description: - Hash: block hash (NulsDigestData) -   Node: node (Node) - - Return value description: - Success: Returns whether the download was successful. -   Data: the returned block data (Block) - - code - - ``` - /** - * 从指定节点处根据hash下载一个区块,下载过程中线程是阻塞的 - * Download a block according from the node to the hash, and the download process is blocked. - * - * @param hash 区块摘要/block hash - * @param node 指定的节点/Specified node - * @return 区块及结果/ block results - */ - Result downloadBlock(NulsDigestData hash, Node node); - ``` - -- Whether the synchronization is successful - - - Method description: - Get the current synchronization status and determine if the synchronization is successful. - - Parameter Description: - no - - Return value description: - Success: Returns whether the synchronization has been successful - - code - - ``` - /** - * 返回下载是否完成的结果 - * Returns the results of the download. - * @return Result - */ - Result isDownloadSuccess(); - ``` - -- Reset block sync status - - - Method description: - Check if the current status requires downloading the block and download it if necessary. This is done by changing the download status to waiting for the download. - - Parameter Description: - no - - Return value description: - Success: Returns whether the operation was successful - - code - - ``` - /** - * 重新检查当前状态是否需要重新同步区块,如果需要则下载 - * Recheck whether the current state needs to be resynchronized, and download if necessary. - * @return Result - */ - Result reset(); - ``` - -## 4、Module architecture - -### 4.1 Module context - -a.The protocol module provides definitions of common protocols to other modules. - -b.The protocol module is responsible for receiving and synchronizing functions of blocks and transactions. - -![context](./protocol/context_en.png) - -### 4.2 Module architecture diagram - -![protocol](./protocol/design_en.png) - -## 5、Module protocol - -### 5.1 Transactions - - General transaction data structure - -- Transfer transaction -- CoinBase transaction - -| Size | Field | data type | Description | -| ---- | ---------- | --------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | ?? | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -- Data bearer transaction - -| Size | Field | data type | Description | -| ---- | ---------- | --------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | VarByte | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### 5.2 Message of module - -#### PROTOCOL_NOT_FOUND - -| Size | Field | data type | Description | -| ---- | ----- | ------------ | ------------------ | -| 1 | type | NotFoundType | 未找到的类型 | -| ?? | Hash | VarString | 请求但未找到的hash | - -#### PROTOCOL_NEW_TX - -| Size | Field | data type | Description | -| ---- | ----------- | ----------- | ----------- | -| ?? | transaction | Transaction | | - -#### PROTOCOL_GET_BLOCK - -| Size | Field | data type | Description | -| ---- | --------- | -------------- | ----------- | -| ?? | blockHash | NulsDigestData | 区块hash | - -#### PROTOCOL_BLOCK - -| Size | Field | data type | Description | -| ---- | ------------- | --------------- | ------------ | -| ?? | header | BlockHeader | 块头 | -| ?? | Transaction[] | Transaction[??] | 节点信息数组 | - -#### PROTOCOL_GET_BLOCKS_BY_HASH - -| Size | Field | data type | Description | -| ---- | ----------- | -------------- | ------------ | -| ?? | startHeight | NulsDigestData | 开始区块hash | -| ?? | endHeight | NulsDigestData | 结束区块hash | - -#### PROTOCOL_GET_BLOCKS_BY_HEIGHT - -| Size | Field | data type | Description | -| ---- | --------- | --------- | ------------ | -| 4 | startHash | uint32 | 开始区块高度 | -| 4 | endHash | uint32 | 结束区块高度 | - -#### PROTOCOL_BLOCK_HEADER - -| Size | Field | data type | Description | -| ---- | ---------- | -------------- | ------------ | -| ?? | PreHash | NulsDigestData | 上一个块摘要 | -| ?? | MerkleHash | NulsDigestData | Merkle树根 | -| 6 | time | uint48 | 时间 | -| 4 | height | uint32 | 高度 | -| 4 | txCount | uint32 | 交易数量 | -| ?? | extend | VarByte | 扩展数据 | -| ?? | scriptSign | P2PKHScriptSig | 签名 | - -#### PROTOCOL_GET_TX_GROUP - -| Size | Field | data type | Description | -| ---- | ----------- | ---------------- | ------------ | -| ?? | TXHashCount | VarInt | 交易摘要数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | - -#### PROTOCOL_TX_GROUP - -| Size | Field | data type | Description | -| ---- | --------- | -------------- | ----------- | -| ?? | BlockHash | NulsDigestData | 块摘要 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_NEW_BLOCK - -| Size | Field | data type | Description | -| ---- | ------- | ---------------- | ------------ | -| ?? | header | BlockHeader | 块头 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_GET_BLOCKS_HASH - -| Size | Field | data type | Description | -| ---- | ----- | --------- | ----------- | -| 4 | start | uint32 | 开始高度 | -| 4 | end | uint32 | 结束高度 | - -#### PROTOCOL_BLOCKS_HASH - -| Size | Field | data type | Description | -| ---- | ---------------- | ---------------- | ------------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| ?? | HeightListCount | VarInt | Hash列表数量 | -| ?? | Hash[] | NulsDigestData[] | Hash列表 | - -#### PROTOCOL_STRING - -| Size | Field | data type | Description | -| ---- | ----- | --------- | ----------- | -| ?? | Hash | VarString | | - -#### PROTOCOL_COMPLETE - -| Size | Field | data type | Description | -| ---- | ---------------- | -------------- | ----------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| 1 | success | boolean | 结果 | - -#### REQUEST_REACT - -| Size | Field | data type | Description | -| ---- | ---------------- | -------------- | ----------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | - - - -## 6、Core process - -### 6.1 Block synchronization - -``` -1, start block synchronization thread, execute once every second -2, the initialization of dependent services in the thread: block service, network services -3. Determine the synchronization status, wait or fail (before 30 seconds), then synchronize -4. Determine the network connection status. If there are too few nodes connected, the execution is terminated. -5, modify the synchronization status is: Ready -6, change the download status to: download -7, initialize two FutureTask placed separately: download thread manager and download data processor -8, waiting for the task to run: see 6.1.1, 6.1.2 -9, modify the download status according to the results -``` - -#### 6.1.1 Block download - -``` -1. Check the current block height, whether it is the latest height, whether it needs to be rolled back, and roll back if necessary (return 10 blocks each time) -2, the latest node corresponding to the height of the statistics, each node creates a download thread -3. Download 10 blocks per node per round -4, after the download fails, reorganize the node download -5, put the downloaded block into the queue -6, clean up the future, stop the thread pool running -``` - -#### 6.1.2 Downloaded block processing - -``` -1. Non-stop access to the block from the queue -2, simple check block data -3. Pass the block into the consensus module service. -4. When there is no block header in the obtained block, the thread ends. -``` - -### 6.2 New transaction processing - -![newTx](./protocol/newTx_en.png) - -### 6.3 New block processing - -![newBlock](./protocol/newBlock_en.png) - -### 6.4 Confirm transaction - -![commitTx](./protocol/commitTx_en.png) - -### 6.5 Rollback transaction - -![rollbackTx](./protocol/rollbackTx_en.png) - -### 6.6 Transaction conflict check - -![conflictDetect](./protocol/conflictDetect_en.png) - -### 6.7 Save block - -![saveBlock](./protocol/saveBlock_en.png) - -### 6.8 Rollback block - -![rollbackBlock](./protocol/rollbackBlock_en.png) - diff --git a/source/manual/protocol/UML.png b/source/manual/protocol/UML.png deleted file mode 100644 index ab4c88a4..00000000 Binary files a/source/manual/protocol/UML.png and /dev/null differ diff --git a/source/manual/protocol/UML2.png b/source/manual/protocol/UML2.png deleted file mode 100644 index f494da22..00000000 Binary files a/source/manual/protocol/UML2.png and /dev/null differ diff --git a/source/manual/protocol/bridge-inner.png b/source/manual/protocol/bridge-inner.png deleted file mode 100644 index accf6c82..00000000 Binary files a/source/manual/protocol/bridge-inner.png and /dev/null differ diff --git a/source/manual/protocol/commitTx.png b/source/manual/protocol/commitTx.png deleted file mode 100644 index caeefea9..00000000 Binary files a/source/manual/protocol/commitTx.png and /dev/null differ diff --git a/source/manual/protocol/commitTx_en.png b/source/manual/protocol/commitTx_en.png deleted file mode 100644 index 14773de3..00000000 Binary files a/source/manual/protocol/commitTx_en.png and /dev/null differ diff --git a/source/manual/protocol/conflictDetect.png b/source/manual/protocol/conflictDetect.png deleted file mode 100644 index 38f0d789..00000000 Binary files a/source/manual/protocol/conflictDetect.png and /dev/null differ diff --git a/source/manual/protocol/conflictDetect_en.png b/source/manual/protocol/conflictDetect_en.png deleted file mode 100644 index fe385d03..00000000 Binary files a/source/manual/protocol/conflictDetect_en.png and /dev/null differ diff --git a/source/manual/protocol/context.png b/source/manual/protocol/context.png deleted file mode 100644 index c98aacc1..00000000 Binary files a/source/manual/protocol/context.png and /dev/null differ diff --git a/source/manual/protocol/context_en.png b/source/manual/protocol/context_en.png deleted file mode 100644 index f7034222..00000000 Binary files a/source/manual/protocol/context_en.png and /dev/null differ diff --git a/source/manual/protocol/design.png b/source/manual/protocol/design.png deleted file mode 100644 index d3471ab3..00000000 Binary files a/source/manual/protocol/design.png and /dev/null differ diff --git a/source/manual/protocol/design_en.png b/source/manual/protocol/design_en.png deleted file mode 100644 index 6aa10573..00000000 Binary files a/source/manual/protocol/design_en.png and /dev/null differ diff --git a/source/manual/protocol/newBlock.png b/source/manual/protocol/newBlock.png deleted file mode 100644 index 83428527..00000000 Binary files a/source/manual/protocol/newBlock.png and /dev/null differ diff --git a/source/manual/protocol/newBlock_en.png b/source/manual/protocol/newBlock_en.png deleted file mode 100644 index b91767fd..00000000 Binary files a/source/manual/protocol/newBlock_en.png and /dev/null differ diff --git a/source/manual/protocol/newTx.png b/source/manual/protocol/newTx.png deleted file mode 100644 index fa260fa6..00000000 Binary files a/source/manual/protocol/newTx.png and /dev/null differ diff --git a/source/manual/protocol/newTx_en.png b/source/manual/protocol/newTx_en.png deleted file mode 100644 index 557a1a99..00000000 Binary files a/source/manual/protocol/newTx_en.png and /dev/null differ diff --git a/source/manual/protocol/rollbackBlock.png b/source/manual/protocol/rollbackBlock.png deleted file mode 100644 index d36969b3..00000000 Binary files a/source/manual/protocol/rollbackBlock.png and /dev/null differ diff --git a/source/manual/protocol/rollbackBlock_en.png b/source/manual/protocol/rollbackBlock_en.png deleted file mode 100644 index 9a6004d3..00000000 Binary files a/source/manual/protocol/rollbackBlock_en.png and /dev/null differ diff --git a/source/manual/protocol/rollbackTx.png b/source/manual/protocol/rollbackTx.png deleted file mode 100644 index db350510..00000000 Binary files a/source/manual/protocol/rollbackTx.png and /dev/null differ diff --git a/source/manual/protocol/rollbackTx_en.png b/source/manual/protocol/rollbackTx_en.png deleted file mode 100644 index b17ea90c..00000000 Binary files a/source/manual/protocol/rollbackTx_en.png and /dev/null differ diff --git a/source/manual/protocol/saveBlock.png b/source/manual/protocol/saveBlock.png deleted file mode 100644 index c89e095a..00000000 Binary files a/source/manual/protocol/saveBlock.png and /dev/null differ diff --git a/source/manual/protocol/saveBlock_en.png b/source/manual/protocol/saveBlock_en.png deleted file mode 100644 index 16d61274..00000000 Binary files a/source/manual/protocol/saveBlock_en.png and /dev/null differ diff --git a/source/manual/storage.md b/source/manual/storage.md deleted file mode 100644 index 43d70925..00000000 --- a/source/manual/storage.md +++ /dev/null @@ -1,237 +0,0 @@ -# NULS DB Module Resolution - -## 1、Overview - -The DB module plays the role of a tool module in NULS. It provides the function of storing data locally. Each module can store and retrieve its own data through the interface of the DB module. At present, the database implementation of the NULS DB module is LevelDB, and developers can also use different database implementations according to their own needs. - -## 2、Feature - -The functions of the DB module are mainly divided into saving data, deleting data, and querying data; modifying data is implemented by overwriting or saving and saving first. The implementation of the function is divided into single data operation, batch operation, serialized binary data operation, and operation of model instance data. - -## 3、Interface - -- Class that defines the interface: `io.nuls.db.service.DBService` - -```java - /** - * Create a data area - * - * @param areaName - * @return - */ - Result createArea(String areaName); - - /** - * Create a data area for the custom key comparator. - * - * @param areaName - * @param comparator Custom key comparator. - * @return - */ - Result createArea(String areaName, Comparator comparator); - - /** - * Lists all Area names in the current database - * - * @return - */ - String[] listArea(); - - /** - * Store key-value in bytes. - * - * @param area - * @param key - * @param value - * @return - */ - Result put(String area, byte[] key, byte[] value); - - /** - * Store the object - * - * @param area - * @param key - * @param value Objects that need to be stored. - * @param - * @return - */ - Result putModel(String area, byte[] key, T value); - - /** - * Delete value according to key. - * - * @param area - * @param key - * @return - */ - Result delete(String area, byte[] key); - - /** - * Get value from the key. - * - * @param area - * @param key - * @return - */ - byte[] get(String area, byte[] key); - - /** - * Gets the specified object from the key and object class. - * The premise is that this key is stored in a putModel, otherwise value is null. - * - * @param area - * @param key - * @param clazz Specifies the class of the object. - * @param - * @return - */ - T getModel(String area, byte[] key, Class clazz); - - /** - * Get the Object of Object from the key. - * - * param area - * @param key - * @return - */ - Object getModel(String area, byte[] key); - - /** - * Gets an unordered collection of all keys in the data area. - * - * @param area - * @return - */ - Set keySet(String area); - - /** - * Gets an ordered collection of all keys in the data area. - * - * @param area - * @return - */ - List keyList(String area); - - /** - * Gets an ordered collection of all values in the data area. - * - * @param area - * @return - */ - List valueList(String area); - - /** - * Gets an unordered collection of all key-value in the data area. - * - * @param area - * @return - */ - Set> entrySet(String area); - - /** - * Gets an ordered set of all key-values in the data area. - * - * @param area - * @return - */ - List> entryList(String area); - - - /** - * Gets the ordered collection of all key-value in the data area and specifies the returned value object. - * The premise is that the storage mode in this data area is the putModel, otherwise value is null. - * - * @param area - * @param clazz Specifies the class of the object. - * @param - * @return - */ - List> entryList(String area, Class clazz); - - /** - * Gets the ordered collection of all values in the data area and specifies the returned value object. - * The premise is that the storage mode in this data area is the putModel, otherwise value is null. - * - * @param area - * @param clazz 指定对象的class/Specifies the class of the object. - * @param - * @return - */ - List values(String area, Class clazz); - - /** - * Specifies the batch add, delete, update operations in the data area. - * - * @param area - * @return - */ - BatchOperation createWriteBatch(String area); - - /** - * Destroy area - * - * @param areaName - * @return - */ - Result destroyArea(String areaName); - - Result clearArea(String area); - -``` - - - -- Class that defines the batch operations interface: `io.nuls.db.service.BatchOperation` - -```java - /** - * Add or update operations. - * - * @param key - * @param value - * @return - */ - Result put(byte[] key, byte[] value); - - /** - * Add or update the object - * - * @param key - * @param value Objects that need to be added or updated. - * @return - */ - Result putModel(byte[] key, T value); - - /** - * Delete operation - * - * @param key - * @return - */ - Result delete(byte[] key); - - /** - * Perform batch operation - * - * @return - */ - Result executeBatch(); -``` - - - -## 4、Architectures - -- Module name:db-module -- Module ID:2 - -![mbarchitecture](storage/DBArchitecture.png) - - - -## 5、Core Process - -When NULS starts, each module initializes the used DB Area constant in Storage. In the module business logic, when the data is stored, the corresponding Area and data are transmitted to the corresponding storage function interface, and the DB module is Perform a single data or batch access operation. - -![DBFlow](storage/DBFlow.png) \ No newline at end of file diff --git a/source/manual/storage/DBArchitecture.png b/source/manual/storage/DBArchitecture.png deleted file mode 100644 index 92051289..00000000 Binary files a/source/manual/storage/DBArchitecture.png and /dev/null differ diff --git a/source/manual/storage/DBArchitecture.vsdx b/source/manual/storage/DBArchitecture.vsdx deleted file mode 100644 index 27ddccf7..00000000 Binary files a/source/manual/storage/DBArchitecture.vsdx and /dev/null differ diff --git a/source/manual/storage/DBFlow.png b/source/manual/storage/DBFlow.png deleted file mode 100644 index fab9428c..00000000 Binary files a/source/manual/storage/DBFlow.png and /dev/null differ diff --git a/source/manual/storage/DBFlow.vsdx b/source/manual/storage/DBFlow.vsdx deleted file mode 100644 index 425a56f5..00000000 Binary files a/source/manual/storage/DBFlow.vsdx and /dev/null differ diff --git a/source/manual/structure.md b/source/manual/structure.md deleted file mode 100644 index 187096e0..00000000 --- a/source/manual/structure.md +++ /dev/null @@ -1,96 +0,0 @@ -title: NULS Directory Structure ---- - -* NULS Website:https://nuls.io -* NULS Code URL:https://github.com/nuls-io -* Technology Forum:http://nulsforum.org/?cat=17 - -## NULS source code directory structure description -![source project](structure/1.png) - -* Nuls : NULS core underlying source code -* Nuls-explorer : NULS blockchain browser(https://nulscan.io) -* Nuls-client : NULS core wallet -* Api-server : NULS data service, NULS blockchain browser and online wallet 、 data services such as mobile wallet -* Website : NULS official website code - -## NULS core underlying directory structure description - - We will focus on the core layer of NULS, the github address is https://github.com/nuls-io/nuls。 - - The biggest feature of NULS is modular design, which is divided into network module, storage module, account module, ledger module, message bus module, general protocol module, consensus module, smart contract module, micro-kernel module, tool module, client module and sdk Module. - -* account-ledger-module : account ledger module -* account-module : account module -* client-module :client module -* consensus-module : consensus module -* contract-module :smart contract module -* core-module :microkernel module -* db-module :storage module -* ledger-module :ledger module -* message-bus-module :message bus module -* network-module : network module -* protocol-module : general protocol module -* tools-module : general tool module - -## Module directory structure - -The above describes the top-level directory of each module. The modules in NULS are divided into two categories, one is a module with very clear business, such as a consensus module; the other is a relatively clear service, and the default is a basic implementation, such as a network module. We will take these two modules for detailed explanation. - -### Network module - -![Markdown preferences pane](structure/2.png) - -* network-module : Is the top level directory of the network module (type is folder) -* network : The service interface definition provided for the network module (type is pom project) -* base :The basic implementation of the network module (can also be understood as the default implementation, the type is a folder) -* network-base : Implementation of the network interface (type is pom project) -* network-protocol : Network protocol definition project for network module (type is pom project) -* network-rpc: The rpc interface of the network module provides and implements the project (type is pom project) -* network-sdk : The sdk provided by the network module (type is pom project) -* network-storage : Network module storage implementation project (type is pom project) -* README.md : Module specification, detailing the interface definition and usage of the module (type is md file) - -### Consensus module - -![Markdown preferences pane](structure/3.png) - -* consensus-module : The top level directory of the consensus module (type is folder) -* consensus : Service interface definition of the consensus module (type is pom project) -* poc :Implementation of the poc consensus mechanism (type is folder) -* consensus-poc-base : Consensus interface implementation project based on poc consensus mechanism (type is pom project) -* consensus-poc-protocol : Network protocol definition project of poc consensus mechanism (type is pom project) -* consensus-poc-rpc: The rpc interface of the poc consensus mechanism provides and implements the project (type is pom project) -* consensus-poc-sdk : The sdk (type pom project) provided by the poc consensus mechanism -* consensus-poc-storage : Storage implementation project of poc consensus mechanism (type is pom project) -* README.md : Module specification, detailing the interface definition and usage of the module (type is md file) - -## Analysis of modules and directory structure - -The NULS system is a combination of multiple modules. The definition of the module has a set of rules: top-level directory -> interface engineering, implementation directory -> implementation project. There are also corresponding naming rules, such as a module is A, then the structure of this module is as follows: - -* A-module -* A -* base -* A-base -* A-protocol -* A-rpc -* A-sdk -* A-storage - -The change is that this module has a very clear implementation of many different ways, then named according to the corresponding implementation, more typical consensus module and ledger module. In this case, for example, if a module is M and its implementation is B, then the structure of this module is as follows: - -* M-module -* M -* B -* M-B-base -* M-B-protocol -* M-B-rpc -* M-B-sdk -* M-B-storage - -It is worth noting that not all module implementations must include these projects. For example, some modules do not need to use storage, so there is no need for storage. Some modules do not have a protocol, so no protocl is needed. - - -## to sum up: -From the naming of the directory structure of NULS, it shows the great ambition of NULS. NULS hopes that communities, enterprises and individuals can provide various modules to the NULS code base, such as pow implementation and pos implementation under the consensus module. Also hope that the same module can produce modules with higher quality, better efficiency and more complete functions, such as network modules. \ No newline at end of file diff --git a/source/manual/structure/1.png b/source/manual/structure/1.png deleted file mode 100644 index 87777181..00000000 Binary files a/source/manual/structure/1.png and /dev/null differ diff --git a/source/manual/structure/2.png b/source/manual/structure/2.png deleted file mode 100644 index 55042508..00000000 Binary files a/source/manual/structure/2.png and /dev/null differ diff --git a/source/manual/structure/3.png b/source/manual/structure/3.png deleted file mode 100644 index 74915773..00000000 Binary files a/source/manual/structure/3.png and /dev/null differ diff --git a/source/protocol/index.md b/source/protocol/index.md deleted file mode 100644 index b838d029..00000000 --- a/source/protocol/index.md +++ /dev/null @@ -1,155 +0,0 @@ -title: Package ---------- - -## Overview - -NULS uses custom messaging for communication over the TCP protocol. - -- Digital binary stream using little endian。 -- Floating point numbers convert to integers and transfer by little endian - -## Message Structre - -The message consists of a 10-byte header and payload. - -``` -*---------------------------------------------------------------* -| Header(10 Byte) | Payload | -*---------------------------------------------------------------* -``` - -## Header - -The main role of the header is to indicate the payload length, verify data integrity, and solve TCP sticky packets. - -| Len | Fields | Data Type | Remark | -| ---- | ----------------- | ------ | ---------------- | -| 4 | MagicNumber | uint32 | Packet valid flag | -| 4 | PayloadLength | uint32 | Payload length | -| 1 | Xor | uint8 | Payload valid flag | -| 1 | EncryptType | uint8 | Encryption mode | - -Remark: -> - MagicNumber In addition to being validated as a valid check, it is also used for the division of the main network and test. -> - EncryptType Currently reserved field for extended encryption. - -> Known MagicNumber - -|value|net| -|:---:|---| -|0x0133EEE8| Main-net| -|0x0133EEFA| Test-net| - -## Payload - -The payload is a variable-length binary stream, and PayloadLength in the header describes the length of the payload. - -The first 8 bytes of the payload are in a fixed format. - -| Len | Fields | Data Type | Remark | -| ---- | --------- | ------ | ---- | -| 4 | ModuleID | uint32 | Module ID | -| 4 | EventType | uint32 | Eevent ID | - -- ModuleID indicates which module the load was sent from. -- EventType is the module's custom event type - -The network layer forwards the payload to the module specified by ModuleID, and the module looks up the specific message processor for further processing according to the EventType. -Currently only two module data is sent via P2P network broadcast. - -- Network = 4 -- Protocol = 10 - -## Common Struecture - -### VarInt - -Variable-length integers that can be encoded based on the values expressed to save space. - -| Value | Len | Structure | -| ------------- | ---- | ------------- | -| < 0xfd | 1 | uint8 | -| <= 0xffff | 3 | 0xfd + uint16 | -| <= 0xffffffff | 5 | 0xfe + uint32 | -| > 0xffffffff | 9 | 0xff + uint64 | - -### VarString - -A variable-length byte stream consisting of a variable-length buffer. The string is encoded in UTF8. - -| Len | Fields | Data Type | Remark | -| ------ | ------ | ------------- | ------------- | -| ? | length | VarInt | 字符串的长度,以字节为单位 | -| length | value | uint8[length] | 字符串本身 | - -### VarByte - -Variable-length buffer, consistent with the VarString implementation. - -| Len | Fields | Data Type | Remark | -| ------ | ------ | ------------ | ------------- | -| ? | length | VarInt | 字符串的长度,以字节为单位 | -| length | data | byte[length] | 字符串本身 | - -### NulsDigestData - -Nuls Digest Data - -| Len | Fields | Data Type | Remark | -| ---- | ------------- | --------- | ---- | -| 1 | digestAlgType | Byte | 算法ID | -| ?? | digest | VarString | 摘要 | - -### NulsSignData - -Nuls Signature Data - -| Len | Fields | Data Type | Remark | -| ---- | ----------- | --------- | ---- | -| 1 | signAlgType | Byte | Algorithm ID | -| ?? | signature | VarString | Signature | - - - -### P2PKHScriptSig - -NULS transaction signature - -| Len | Fields | Data Type | Remark | -| ---- | ------------ | ------------ | ---- | -| 1 | publicKey | VarString | Public Key | -| ?? | NulsSignData | NulsSignData | Signagture Data | - -### Int48 - -6-byte timestamp. - -### Transaction - -| Len | Fields | Data Type | Remark | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | Trasaction Type | -| 6 | time | uint48 | timestamp | -| ?? | remark | VarByte | remark | -| ?? | txData | ?? | Transaction data | -| ?? | coinData | ?? | Token data | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### Node - -节点信息 - -| Len | Fields | Data Type | Remark | -| ---- | ----------- | --------- | ------ | -| 4 | magicNumber | uint32 | Magic number | -| 2 | Port | uint16 | Server Port | -| ?? | IP | VarString | Server IP String | - -### NotFoundType - -```java -short BLOCK = 1; -short BLOCKS = 2 -short TRANSACTION = 3; -short HASHES = 4; -``` diff --git a/source/protocol/network.md b/source/protocol/network.md deleted file mode 100644 index 7ed9db4c..00000000 --- a/source/protocol/network.md +++ /dev/null @@ -1,66 +0,0 @@ -title: 网络消息 ------------ - -## 消息 ID 定义 - -```java -short NETWORK_GET_VERSION = 01; -short NETWORK_VERSION = 02; -short NETWORK_NODE = 04; -short NETWORK_HANDSHAKE = 07; -short NETWORK_P2P_NODE = 08; -``` - -## 载荷定义 - -#### GET_VERSION - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### VERSION - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### NODE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | --------------- | ------ | -| ?? | NodeCount | VarInt | 节点数 | -| ?? | Node[] | Node[NodeCount] | 节点信息数组 | - -#### HANDSHAKE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### P2P_NODE - -p2p节点信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ------ | -| 2 | Port | uint16 | 服务监听端口 | -| ?? | IP | VarString | 节点IP | diff --git a/source/protocol/protocol.md b/source/protocol/protocol.md deleted file mode 100644 index e2733817..00000000 --- a/source/protocol/protocol.md +++ /dev/null @@ -1,136 +0,0 @@ -title: Protocol ---------------- - -## ID 定义 - -```java -short PROTOCOL_NOT_FOUND = 1; -short PROTOCOL_NEW_TX = 2; -short PROTOCOL_GET_BLOCK = 3; -short PROTOCOL_BLOCK = 4; -short PROTOCOL_GET_BLOCKS_BY_HASH = 5; -short PROTOCOL_GET_BLOCKS_BY_HEIGHT = 6; -short PROTOCOL_GET_BLOCK_HEADER = 7; -short PROTOCOL_BLOCK_HEADER = 8; -short PROTOCOL_GET_TX_GROUP = 9; -short PROTOCOL_TX_GROUP = 10; -short PROTOCOL_NEW_BLOCK = 11; -short PROTOCOL_GET_BLOCKS_HASH = 12; -short PROTOCOL_BLOCKS_HASH = 13; -short PROTOCOL_STRING = 14; -short PROTOCOL_COMPLETE = 15; -short REQUEST_REACT = 16; -``` - -## 载荷定义 - -#### PROTOCOL_NOT_FOUND - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | ------------ | ----------- | -| 1 | type | NotFoundType | 未找到的类型 | -| ?? | Hash | VarString | 请求但未找到的hash | - -#### PROTOCOL_NEW_TX - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ----------- | ---- | -| ?? | transaction | Transaction | | - -#### PROTOCOL_GET_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | ------ | -| ?? | blockHash | NulsDigestData | 区块hash | - -#### PROTOCOL_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------------- | --------------- | ------ | -| ?? | header | BlockHeader | 块头 | -| ?? | Transaction[] | Transaction[??] | 节点信息数组 | - -#### PROTOCOL_GET_BLOCKS_BY_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | -------------- | -------- | -| ?? | startHeight | NulsDigestData | 开始区块hash | -| ?? | endHeight | NulsDigestData | 结束区块hash | - -#### PROTOCOL_GET_BLOCKS_BY_HEIGHT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | ------ | ------ | -| 4 | startHash | uint32 | 开始区块高度 | -| 4 | endHash | uint32 | 结束区块高度 | - -#### PROTOCOL_BLOCK_HEADER - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------------- | -------- | -| ?? | PreHash | NulsDigestData | 上一个块摘要 | -| ?? | MerkleHash | NulsDigestData | Merkle树根 | -| 6 | time | uint48 | 时间 | -| 4 | height | uint32 | 高度 | -| 4 | txCount | uint32 | 交易数量 | -| ?? | extend | VarByte | 扩展数据 | -| ?? | scriptSign | P2PKHScriptSig | 签名 | - -#### PROTOCOL_GET_TX_GROUP - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ---------------- | ------ | -| ?? | TXHashCount | VarInt | 交易摘要数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | - -#### PROTOCOL_TX_GROUP -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | ---- | -| ?? | BlockHash | NulsDigestData | 块摘要 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_NEW_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------- | ---------------- | ------ | -| ?? | header | BlockHeader | 块头 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_GET_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----- | ------ | ---- | -| 4 | start | uint32 | 开始高度 | -| 4 | end | uint32 | 结束高度 | - -#### PROTOCOL_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | ---------------- | -------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| ?? | HeightListCount | VarInt | Hash列表数量 | -| ?? | Hash[] | NulsDigestData[] | Hash列表 | - -#### PROTOCOL_STRING - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ---- | -| ?? | Hash | VarString | | - -#### PROTOCOL_COMPLETE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | ------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| 1 | success | boolean | 结果 | - -#### REQUEST_REACT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | ------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | - diff --git a/source/protocol/transaction.md b/source/protocol/transaction.md deleted file mode 100644 index c213f5ca..00000000 --- a/source/protocol/transaction.md +++ /dev/null @@ -1,127 +0,0 @@ -title: Transaction ------------------- - -## ID 定义 - -|数字|交易类型|说明| -|---|---|---| -|1|TX_TYPE_COINBASE| Coinbase | -|2|TX_TYPE_TRANSFER|转账| -|3|TX_TYPE_ACCOUNT_ALIAS|设置账户别名| -|4|TX_TYPE_REGISTER_AGENT|创建共识节点| -|5|TX_TYPE_JOIN_CONSENSUS|委托| -|6|TX_TYPE_CANCEL_DEPOSIT|撤销委托| -|7|TX_TYPE_YELLOW_PUNISH|黄牌警告| -|8|TX_TYPE_RED_PUNISH|红牌警告| -|9|TX_TYPE_STOP_AGENT|注销共识节点| - -## 载荷定义 - -### TX_TYPE_COINBASE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 1 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | txData | byte[] | 0xFFFFFFFF | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_TRANSFER - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | txData | byte[] | 0xFFFFFFFF | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_ACCOUNT_ALIAS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 3 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | address | VarByte | 账户地址 | -| ?? | alias | VarString | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_REGISTER_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 4 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | uint64 | 抵押金额 | -| 23 | agentAddress | Address | 节点地址 | -| 23 | packingAddress | Address | 打包地址 | -| 23 | rewardAddress | Address | 奖励地址 | -| 8 | commissionRate | Double | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_JOIN_CONSENSUS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | byte[] | 委托金额 | -| 23 | address | byte[23] | 地址 | -| 8 | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_CANCEL_DEPOSIT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_YELLOW_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | count | VarInt | 惩罚数量 | -| ?? | addres | Address[]| 被黄牌警告的节点地址| -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_RED_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 23 | address | byte[23] | 惩罚数量 | -| 1 | reasonCode | byte | 处罚代码 | -| ?? | evidence | VarByte | 证据 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_STOP_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 停止节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | diff --git a/source/robots.txt b/source/robots.txt deleted file mode 100644 index 54260c5d..00000000 --- a/source/robots.txt +++ /dev/null @@ -1,4 +0,0 @@ -User-agent: * -Disallow: /hexo-theme-landscape/ -Disallow: /hexo-theme-light/ -Disallow: /hexo-theme-phase/ \ No newline at end of file diff --git a/source/zh-cn/chain/image/3.1.png b/source/zh-cn/chain/image/3.1.png deleted file mode 100755 index 93b21b2d..00000000 Binary files a/source/zh-cn/chain/image/3.1.png and /dev/null differ diff --git a/source/zh-cn/chain/image/4.1.jpg b/source/zh-cn/chain/image/4.1.jpg deleted file mode 100755 index 516e47b5..00000000 Binary files a/source/zh-cn/chain/image/4.1.jpg and /dev/null differ diff --git a/source/zh-cn/chain/image/4.2.png b/source/zh-cn/chain/image/4.2.png deleted file mode 100755 index 608ac453..00000000 Binary files a/source/zh-cn/chain/image/4.2.png and /dev/null differ diff --git a/source/zh-cn/chain/index.md b/source/zh-cn/chain/index.md deleted file mode 100644 index db53b834..00000000 --- a/source/zh-cn/chain/index.md +++ /dev/null @@ -1,84 +0,0 @@ -title: 跨链方案总体设计 ---- - -## 一、行业背景 - -区块链是去中心化应用的操作系统。需要跨链技术把一个个运行的操作系统连接起来,才能大力发展生态,形成区块链的互联网。 - -## 二、设计目标 - -* 定义跨链标准,实现不同区块链间的通信。 -* 搭建“卫星链”,实现不同区块链间的资产流转。 - -## 三、总体方案 - -### 3.1总体架构 - -![design](./image/3.1.png) - -说明: - -​ 一条独立的卫星链,负责和所有链对接。以开放的方式实现链间通信。 - -​ 基于NULS模块仓库实现的区块链(生态内的区块链),可以通过模块选择的方式添加跨链模块,使其在底层上可以和卫星链互通。 - -​ 以太坊和比特币等不受NULS影响的公有链,需要通过特殊的机制实现协议的转换,将公有链的协议和NULS跨链协议做适配,达到统一协议通讯的目的。 - -​ 所有区块链都只和卫星链通信,交易的验证由卫星链负责,各平行链信任卫星链的验证结果。 - -* 链间连接方式 - - 区块链上的每个节点都运行跨链模块,每个节点都连接卫星链上的部分节点。通过随机算法决定连接哪些节点,尽可能地确保节点连接的分散,保证网络的安全性。 - -* 跨链交易是如何实现的 - - 假设A链的账户a1要转移其持有的资产a到b链的账户b1中,则处理流程如下: - - * 先在A链上发起跨链交易,由A链先行确认; - * 当达到一定数量的区块确认后,交易被跨链模块推送到卫星链的节点中; - * 卫星链接收到交易后进行确认,确认的方式分为两步: - * 1、通过询问A链上的节点,确认该交易是否已被确认,并且以跨链协议发送到卫星链中的交易是正确、真实的; - * 2、在卫星链中以拜占庭容错算法对交易进行确认,若不能获得大部分节点的认同,则该交易视为无效。 - * 交易打包到卫星链的区块中; - * 节点将该跨链交易推送到B链中; - * B链节点通过连接的所有卫星链的节点,对该交易进行确认,若确认不通过则丢弃该交易; - * 若通过确认,则创建对应的资产到目标地址中; - * 在B链共识中确认该交易。 - * 完成,该资产可以在B链使用。 - -* 多算法适配 - - 卫星链支持市面上大部分数学算法,包括摘要算法、对称加密、非对称加密等,可以通过算法库提供的统一的接口进行使用。 - -* 社区化治理 - - 卫星链会内置社区治理机制,包括系统运行参数修改、协议升级、恶意链处理、社区资金使用等功能。 - - - -## 四、 卫星链设计 - -### 4.1 卫星链架构 - - ![layer](./image/4.1.jpg) - -* 卫星链使用POC共识机制,结合拜占庭容错机制实现跨链交易的确认和打包,做到去中心化与性能、安全性的兼顾。 -* 卫星链上的协议是统一定义的NULS跨链协议,每个节点都会连接多个区块链的多个节点。 -* 卫星链提供链管理机制,用来管理所有在卫星链上登记的对等区块链。登记的内容包括链信息、资产信息、跨链抵押金等。 -* 当一条区块链上收到其他链的资产时,需要在本链产生对应的资产。不同区块链上的token,都以资产的方式在其他链上存储。 -* 一条区块链中转入其他链资产的明细会在卫星链中存储。该资产转出这条区块链时会进行验证,不允许非法的资产从该区块链中产生。对有恶意的区块链,会通过社区机制进行处理,如:暂停跨链、中止跨链、没收保证金等。 -* 卫星链将提供api使用手册,任何开发者都可以根据手册开发自己的钱包、浏览器、轻钱包等工具。 -* 为了降低卫星链的业务复杂度,将不在卫星链中运行智能合约。 -* 卫星链中提供协议供应用扩展,可以使用该协议进行DApp的开发和跨链协议的优化。 - -### 4.2 卫星链的运行 - -![](./image/4.2.png) - -* 卫星链以模块化的方式架构。 -* 每个模块都是一个可以独立运行的微服务。 -* 微服务之间直接通过http协议通信。 -* 模块不限制开发语言。 -* 提供微内核模块负责服务管理、配置管理和数据共享功能。 -* 卫星链的模块在一定程度上将可以与NULS主网共用,所以卫星链的模块也会和NULS的模块一样加入到NULS模块仓库中,供“链工厂”等应用直接使用。 -* 每个模块在使用的同时都支持扩展。即如果模块仓库中的模块只能满足部分业务需求时,可以对该模块进行扩展以避免重新开发。 diff --git a/source/zh-cn/contract/CommunityVote.md b/source/zh-cn/contract/CommunityVote.md deleted file mode 100644 index abd390e8..00000000 --- a/source/zh-cn/contract/CommunityVote.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -typora-copy-images-to: communityImages ---- - -## 社区投票指南 - -### 1 投票 - -如果你想参与地址A发起的投票X,通过输入投票标题X或发起人地址A,搜索你想参与的投票。找到投票X后,在投票列表可以看到该投票的一些关键信息。 - -![img](communityImages/wpsA8AA.tmp.jpg) - -点击投票X的标题,进入投票详情,投票详情页面展示了该投票的详细信息,右上角显示了我的地址B和对应的可用票数N。可用票数由地址中NULS总额量决定,当前票数和NULS总额的比例为1:1,票数不包含总额的小数部分。 - -![img](communityImages/wpsBF9.tmp.jpg) - -若该投票出于投票中的状态,根据投票规则选择相应的选项,点击“投票”后输入密码即可完成投票。投票计算方式为:无论是单选还是多选,只要投票成功,对应的选项都会增加我的可用票数N,N可以为0,但是我的地址B中需要足够的NULS来支付手续费,保证投票成功。投票完成后,若地址B中的NULS数量发生改变,且参与过的投票出于投票中的状态,那么对应的选项得票数会随着B地址的NULS数量进行相应的增加或减少。 - -系统允许创建者创建投票时对投票结果进行设置,可设置为投票结果不可更改和投票结果可更改。若投票结果不可更改,则投票者不能对投过得选项进行更改。若投票结果可更改,且投票状态为进行中,那么投票者可以再次进入投票详情,根据投票规则选择相应的其他选项,更改自己的投票项,原来的选择项投票数减少N,新选中的选项投票数增加N。 - -投票详情的各个选项,可以点击展开详情,查看票数分布情况。 - -### 2 更新投票 - -如之前所介绍,若创建者创建投票Y时对投票结果设置为可更改,且投票状态为进行中,那么投票者可以再次进入投票Y的详情,根据投票规则选择相应的其他选项,更新自己的投票项,点击“更新投票”后输入密码即可完成。 - -![img](communityImages/wps55B5.tmp.jpg) - -同时,可以更改投票项的投票Y,在投票列表中,会有较为明显的图标展示表明该投票为结果可更改的投票。 - -![img](communityImages/wps96E5.tmp.jpg) - -### 3 查看我的投票 - -在投票列表中,点击右方“我的投票”可以进入“我”的投票列表,页面展示了“我”创建的投票和参与的投票。如果Z是我创建的投票且该投票仍未结束,则Z的地址会显示为明显的黄色。 - -![img](communityImages/wpsD101.tmp.jpg) - -点击“我”参与的投票标题,可以看到我选中的投票项,若投票结果类型为可更改,且仍然出于投票中的状态,那么可以根据投票规则选择相应的其他选项,更新自己的投票项。 - -### 4创建投票 - -在投票列表中,点击“创建投票”进入投票填写页面,填写相应的选项或设置,并选择正确的起止时间,点击“确认”即可完成创建投票。创建投票需要我的地址B中有足够的NULS来提供押金和手续费来创建投票。 - -为提高社区投票的有效性,创建投票需要收取押金100 NULS,根据投票的创建时间和结束时间计算出解锁的区块高度,当结束时间对应的区块高度达到后,押金即可解锁。 - -![img](communityImages/wpsFCF4.tmp.jpg) - -创建投票时,请仔细填写各项内容,投票一旦创建成功便不可修改。创建的投票需要约一分钟时间在NULS网络确认,投票列表页会自动刷新。 - diff --git a/source/zh-cn/contract/IdeaPlugin.md b/source/zh-cn/contract/IdeaPlugin.md deleted file mode 100644 index 35ed2191..00000000 --- a/source/zh-cn/contract/IdeaPlugin.md +++ /dev/null @@ -1,99 +0,0 @@ -# NULS IDEA插件使用手册 - -#### 1 在IDEA安装NULS插件 -- [获取NULS插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/1.1.0-beta/Docs%26plugin.zip)ZIP包,存放在磁盘 -点击File->Settings->Plugin->Install plugin from disk - -![Install](./pluginImages/Install.jpg) - -- 选择之前获取到的ZIP包,然后点击OK - -![Install](./pluginImages/Install2.jpg) - -- 勾选上NULS插件,点击Apply - -![Install](./pluginImages/Install3.jpg) - -#### 2 创建一个NULS项目 - -![create](./pluginImages/createProject.jpg) - -输入Project名,点击finish - - -![create](./pluginImages/createProject2.jpg) - -#### 3 编写智能合约 - -智能合约代码编写可查看[开发者文档](http://dev.nuls.io/contract/) - -![code](./pluginImages/code.jpg) - -#### 4 设置部署合约的节点和账户 - -- 点击右方的NULS插件,调出NULS插件面板 - - ![code](./pluginImages/Deploy.jpg) - -- 插件会自动生成一个127.0.0.1:8001节点,开发者可自主添加一个节点,用来部署合约。推荐方法为:在本地启动钱包,然后将钱包的地址添加为节点地址 - - 点击面板左上角的+号,选择Add Node - - ![code](./pluginImages/Add.jpg) - -- 输入Node地址,点击OK - - ![code](./pluginImages/Add3.jpg) - -- 点击面板左上角+号,选择Add Account,输入Account地址,然后点击OK - - ![code](./pluginImages/Add5.jpg) - -#### 5 打包合约 - -- 点击插件左上方第二个按钮,可直接将当前Project打包,打包后的输出有两种形式:Jar包和Hex编码 - - ![code](./pluginImages/package.jpg) - -- 可点击【复制编码】,将HEX编码复制到钱包的【部署合约】界面进行合约的部署(可选步骤) - - ![code](./pluginImages/package1.jpg) - -- 点击插件面板上方第三个部署按钮或当前打包页面底部的【Next】,可进入部署合约界面 - - ![code](./pluginImages/package3.jpg) - - ![code](./pluginImages/package2.jpg) - -#### 6 部署合约 - -- 在部署页面,可通过下拉列表选择部署合约的节点和账户,JarFilePath默认值为上一步的打包路径 - - ![code](./pluginImages/package4.jpg) - -- 紧接JarFilePath的参数为该合约构造函数的参数 - - ![code](./pluginImages/Deploy2.jpg) - -- 点击【高级】,设置Gas值和price值,Gas值范围为1-10000000,建议将Gas值设置较大,以免Gas不足导致部署合约失败 - - ![code](./pluginImages/Deploy3.jpg) - -- 点击【Test Deploy】,可将合约进行一次测试部署,若成功,会返回Success提示信息 - - ![code](./pluginImages/Deploy4.jpg) - -- 若测试成功,则点击【Deploy】,创建合约的交易确认成功后,则会返回交易详细信息,则表示合约部署成功 - - ![code](./pluginImages/Deploy5.jpg) - -- 可在面板上方查看已部署的合约 - - ![code](./pluginImages/Deploy6.jpg) - -- 点击部署成功的合约,可查看该合约的所有方法 - - ![code](./pluginImages/Deploy7.jpg) - - - diff --git a/source/zh-cn/contract/NRC-20_Token_Standard.md b/source/zh-cn/contract/NRC-20_Token_Standard.md deleted file mode 100644 index b95d1c7f..00000000 --- a/source/zh-cn/contract/NRC-20_Token_Standard.md +++ /dev/null @@ -1,153 +0,0 @@ -# NRC-20 Token 标准 - - -## 简述 - -token的接口标准 - - -## 摘要 - -以下标准允许在智能合约中实施标记的标记API。 该标准提供了转移token的基本功能,并允许token被批准,以便他们可以由另一个在线第三方使用。 - -## 动机 - -标准接口可以让Nuls上的任何令牌被其他应用程序重新使用:从钱包到分散式交换。 - -## 规则 - -## Token -### 方法 - -**注意**: 调用者必须处理返回`false`的`return boolean`.调用者绝对不能假设返回`false`的情况不存在。 - - -#### name - -返回令牌的名称 - 例如 `"MyToken"`. - -``` java -@View -public String name(); -``` - - -#### symbol - -返回令牌的符号 - 例如 "MT". - -``` java -@View -public String symbol(); -``` - -#### decimals - -返回令牌使用的小数位数 - 例如“8”表示将令牌数量除以“100000000”以获得其用户表示。 - -``` java -@View -public int decimals(); -``` - - -#### totalSupply - -返回总令牌供应量。 - -``` js -@View -public BigInteger totalSupply(); -``` - - - -#### balanceOf - -返回地址为“owner”的帐户余额。 - -``` java -@View -public BigInteger balanceOf(@Required Address owner); -``` - - - -#### transfer - -转移`value`的token数量到的地址`to`,并且必须触发`TransferEvent`事件。 如果`from`帐户余额没有足够的令牌来支出,该函数应该被revert。 - -创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 - -注意 0值的传输必须被视为正常传输并触发`TransferEvent`事件。 - -``` java -public boolean transfer(@Required Address to, @Required BigInteger value); -``` - - - -#### transferFrom - -从地址`from`发送数量为`value`的token到地址`to`,必须触发`TransferEvent`事件。 - -`transferFrom`方法用于提取工作流,允许合同代您转移token。这可以用于例如允许合约代您转让代币和/或以子货币收取费用。除了`from`帐户已经通过某种机制(比如调用`approve(@Required Address spender, @Required BigInteger value)`)故意地授权消息的发送者之外,否则该函数应该`revert`。 - -注意 0值的传输必须被视为正常传输并触发传输事件。 - -``` java -public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value); -``` - - - -#### approve - -允许`spender`多次支配您的帐户,最高达`value`金额。 如果再次调用此函数,它将以`value`覆盖当前的余量。 - -``` java -public boolean approve(@Required Address spender, @Required BigInteger value); -``` - - -#### allowance - -返回`spender`仍然被允许从`owner`提取的金额。 -Returns the amount which `spender` is still allowed to withdraw from `owner`. - -``` java -@View -public BigInteger allowance(@Required Address owner, @Required Address spender); -``` - - - -### Events - - -#### TransferEvent - -当token被转移(包括0值),必须被触发。 - -创建新令牌的令牌合同应该在创建令牌时将`from`地址设置为`null`触发`TransferEvent`事件。 - -``` java -public TransferEvent(Address from, @Required Address to, @Required BigInteger value) -``` - - - -#### ApprovalEvent - -当任何成功调用`approve(@Required Address spender, @Required BigInteger value)`后,必须被触发。 - -``` java -public ApprovalEvent(@Required Address owner, @Required Address spender, @Required BigInteger value) -``` - - - -## Implementation - -#### Example implementations are available at -- https://github.com/nuls-io/nuls-nrc20 diff --git a/source/zh-cn/contract/SmartContractFee.md b/source/zh-cn/contract/SmartContractFee.md deleted file mode 100644 index 5311028e..00000000 --- a/source/zh-cn/contract/SmartContractFee.md +++ /dev/null @@ -1,54 +0,0 @@ -## 智能合约手续费 - -### 1. 智能合约费用收取的规则,如何计费?接口调用方付多少钱?都是由谁收到了这些费用? - -> `背景:`由于NULS主网采用的是UTXO模型,因此交易大小也作为收费标准之一 - -在主链上,多出三个类型的交易,`创建智能合约`, `调用智能合约`, `删除智能合约` - -三个交易与其他交易如`转账`不同的地方就在于多出一个智能合约的执行,因此智能合约的执行也是收费标准之一 - -* 智能合约收费计算方式 - -```java -public static final int COMPARISON = 1;//比较字节码 -public static final int CONSTANT = 1;//简单数值类型字节码 -public static final int LDC = 1;//数值常量,字符串常量(长度 * LDC) -public static final int CONTROL = 5;//控制字节码 -public static final int TABLESWITCH = 2;//switch字节码(大小 * TABLESWITCH) -public static final int LOOKUPSWITCH = 2;//switch字节码(大小 * LOOKUPSWITCH) -public static final int CONVERSION = 1;//数值转换 -public static final int EXTENDED = 1;//null判断 -public static final int MULTIANEWARRAY = 1;//多维数组(大小 * MULTIANEWARRAY) -public static final int LOAD = 1;//把本地变量送到栈顶 -public static final int ARRAYLOAD = 5;//把数组的某项送到栈顶 -public static final int MATH = 1;//数学操作及移位操作 -public static final int REFERENCE = 10;//对象相关操作 -public static final int NEWARRAY = 1;//一维数组(大小 * NEWARRAY) -public static final int STACK = 2;//栈操作 -public static final int STORE = 1;//把栈顶的值存入本地变量 -public static final int ARRAYSTORE = 5;//把栈项的值存到数组里 -public static final int TRANSFER = 1000;//转账交易 - -``` - -* 一次智能合约总手续费 - - 一次合约交易的总手续费由三部分构成 - - 第一部分是交易大小产生的手续费,根据字节大小计算 -> 0.001NULS/KB,既是每1000个字节收取0.001个NULS,交易大小不足1000个字节的,按0.001个NULS收费 - - - 第二部分是合约执行消耗的GAS*Price,Price是单价,意思是每一个Gas值多少Na,Na是NULS的最小单位,1Nuls=1亿Na - > 举例说明,某次合约执行消耗了20000Gas,设定的单价是20Na/Gas, 那么这次消耗的Na就是`20000 * 20 = 400000`,既是0.004NULS - - - 第三部分是调用者设定的GasLimit没有被当次合约执行消耗完,剩余的Gas,这部分Gas会以共识奖励返还 - > 举例说明,延续上个栗子,当次合约设置的GasLimit是30000Gas,而合约执行消耗了20000Gas,那么剩余了10000Gas,这10000Gas换算成Na就是`10000 * 20 = 200000`,既是0.002NULS,那么这0.002NULS会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方 - -* 合约调用方付多少钱? - - 在合约交易中合约调用方付了第一、二、三部分,实际上合约调用方付了第一、二部分,因为第三部分会在当前打包区块的CoinBase交易(共识奖励)中返还给合约调用方 - -* 由谁收到了这些费用? - - > `前提:`这部分费用都体现在区块的CoinBase交易(共识奖励)中 - - 区块打包者收到了第一、二部分费用,合约调用方收到第三部分费用 \ No newline at end of file diff --git a/source/zh-cn/contract/index.md b/source/zh-cn/contract/index.md deleted file mode 100644 index 3388b94b..00000000 --- a/source/zh-cn/contract/index.md +++ /dev/null @@ -1,1124 +0,0 @@ -# NULS智能合约开发手册 - -## 1. 简介 - -NULS智能合约使用Java进行开发,合约运行在NULS虚拟机中。合约开发不能使用所有的Java特性,在第3节列出具体限制。 - -## 2. 开发环境 - -### 2.1 安装NULS钱包 - -### 2.2 安装JDK 8 - -### 2.3 安装IntelliJ IDEA - -Nuls智能合约使用的开发工具为IntelliJ IDEA。 - -### 2.4 安装NULS智能合约插件 - -[点击下载插件](https://nuls-usa-west.oss-us-west-1.aliyuncs.com/plugins/Docs%26plugin.zip) - -NULS智能合约插件提供的主要功能: - -* 新建NULS合约工程 -* 提示不支持的Java特性、Java类、Java方法 -* 编译、打包、部署合约 -* 展示、调用合约方法。 - -## 3. NULS智能合约规范与语法 - -Nuls智能合约语法是Java语法的一个子集,在Java语法上做了一些限制。 - -### 3.1 NULS智能合约规范 - -> **_合约主类必须实现Contract接口,一个智能合约只能有一个类实现Contract接口,其他类和接口都是为这个合约提供功能的。_** - -### 3.2 关键字 - -下面列出Java关键字,其中将标注NULS智能合约不支持的关键字 - -访问控制 - -* public -* protected -* private - -定义类、接口、抽象类和实现接口、继承类的关键字、实例化对象 - -* class -* interface -* abstract -* implements -* extends -* new - -包的关键字 - -* import -* package - -数据类型的关键字 - -* byte -* char -* boolean -* short -* int -* float -* long -* double -* void -* null -* true -* false - -条件循环(流程控制) - -* if -* else -* while -* for -* switch -* case -* default -* do -* break -* continue -* return -* instanceof - -错误处理 - -* catch -* try -* finally -* throw -* throws - -修饰方法、类、属性和变量 - -* static -* final -* super -* this -* native(不支持) -* strictfp(不支持) -* synchronized(不支持) -* transient(不支持) -* volatile(不支持) - -其他 - -* enum(不支持) -* assert(不支持) - -### 3.3 基本语法 - -下面的语法与Java相同,只是简单列出,具体可参考Java相关文档 - -* 标识符:由字符、下划线、美元符或数字组成,以字符、下划线、美元符开头 -* 基本数据类型:byte short int long float double char boolean -* 引用数据类型:类、接口、数组 -* 算术运算符:+ - * / % ++ -- -* 关系运算符:> < >= <= == != -* 逻辑运算符:! & | ^ && || -* 位运算符:& | ^ ~ >> << >>> -* 赋值运算符:= -* 拓展赋值运算符:+ = -= *= /= -* 字符串链接运算符:+ -* 三目条件运算符 ? : -* 流程控制语句(if,switch,for,while,do...while) - -### 3.4 支持的类 - -Nuls智能合约只能使用下面的类进行开发 - -* io.nuls.contract.sdk.Address -* io.nuls.contract.sdk.Block -* io.nuls.contract.sdk.BlockHeader -* io.nuls.contract.sdk.Contract -* io.nuls.contract.sdk.Event -* io.nuls.contract.sdk.Msg -* io.nuls.contract.sdk.Utils -* io.nuls.contract.sdk.annotation.View -* io.nuls.contract.sdk.annotation.Required -* io.nuls.contract.sdk.annotation.Payable -* java.lang.Boolean -* java.lang.Byte -* java.lang.Short -* java.lang.Character -* java.lang.Integer -* java.lang.Long -* java.lang.Float -* java.lang.Double -* java.lang.String -* java.lang.StringBuilder -* java.math.BigInteger -* java.math.BigDecimal -* java.util.Collection -* java.util.List -* java.util.ArrayList -* java.util.LinkedList -* java.util.Map -* java.util.HashMap -* java.util.LinkedHashMap -* java.util.Set -* java.util.HashSet - -### 3.5 其他限制 - -* 合约类只能有一个构造方法,其他类不限制 -* 执行一次合约方法最大的Gas消耗是1000万,包括`@View`类型的方法调用,请保证尽可能的优化合约代码 - -## 4. NULS智能合约简单示例 - -一个简单的合约 - -> **_合约主类必须实现Contract接口,其他类和接口都是为这个合约提供功能的。_** - - -```java -package contracts.examples; - -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.annotation.Payable; -import io.nuls.contract.sdk.annotation.Required; -import io.nuls.contract.sdk.annotation.View; - -public class SimpleStorage implements Contract { - - private String storedData; - - @View - public String getStoredData() { - return storedData; - } - - @Payable - public void setStoredData(@Required String storedData) { - this.storedData = storedData; - } - -} -``` - -在一个合约项目中,只需要引入jar包:contract-sdk.jar,这个包提供了获取区块信息和交易信息的类。 -项目中可以有多个类和接口。 - -合约写好后,编译打包,部署到NULS链上时候,虚拟机会执行合约的构造方法初始化这个合约,并把这个合约状态保存在链上,合约状态是合约类的所有成员变量。 -合约部署好以后,合约类的所有public方法都是能调用的,通过调用这些方法读取或修改合约状态。 - -注解说明 - -@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。 - -@Payable 标记@Payable的方法,才能在调用时候传入金额 - -@Required 标记@Required的参数,调用时候必须传入值 - -去github下载NULS源码,里面有一些合约示例。 - -## 5. NULS Contract SDK - -合约SDK提供了几个类,方便合约开发: - -### io.nuls.contract.sdk.Address - -```java -public class Address { - - private final String address; - - public Address(String address) { - valid(address); - this.address = address; - } - - /** - * 获取该地址的余额(只能获取合约地址余额) - * - * @return - */ - public native BigInteger balance(); - - /** - * 合约向该地址转账 - * - * @param value 转账金额(多少Na) - */ - public native void transfer(BigInteger value); - - /** - * 调用该地址的合约方法 - * - * @param methodName 方法名 - * @param methodDesc 方法签名 - * @param args 参数 - * @param value 附带的货币量(多少Na) - */ - public native void call(String methodName, String methodDesc, String[][] args, BigInteger value); - - /** - * 调用该地址的合约方法并带有返回值(String) - * - * @param methodName 方法名 - * @param methodDesc 方法签名 - * @param args 参数 - * @param value 附带的货币量(多少Na) - * @return 调用合约后的返回值 - */ - public native String callWithReturnValue(String methodName, String methodDesc, String[][] args, BigInteger value); - - /** - * 验证地址 - * - * @param address - * @see io.nuls.kernel.utils.AddressTool#validAddress(String) - */ - private native void valid(String address); - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Address address1 = (Address) o; - return address != null ? address.equals(address1.address) : address1.address == null; - } - - @Override - public int hashCode() { - return address != null ? address.hashCode() : 0; - } - - @Override - public String toString() { - return address; - } - -} -``` - -### io.nuls.contract.sdk.Block - -```java -public class Block { - - /** - * 给定块的区块头 - * - * @param blockNumber - * @return - */ - public static native BlockHeader getBlockHeader(long blockNumber); - - /** - * 当前块的区块头 - * - * @return - */ - public static native BlockHeader currentBlockHeader(); - - /** - * 最新块的区块头 - * - * @return 最新块的区块头 - */ - public static native BlockHeader newestBlockHeader(); - - /** - * 给定块的哈希值 - * hash of the given block - * - * @param blockNumber - * @return - */ - public static String blockhash(long blockNumber) { - return getBlockHeader(blockNumber).getHash(); - } - - /** - * 当前块矿工地址 - * current block miner’s address - * - * @return - */ - public static Address coinbase() { - return currentBlockHeader().getPackingAddress(); - } - - /** - * 当前块编号 - * current block number - * - * @return - */ - public static long number() { - return currentBlockHeader().getHeight(); - } - - /** - * 当前块时间戳 - * current block timestamp - * - * @return - */ - public static long timestamp() { - return currentBlockHeader().getTime(); - } - -} -``` - -### io.nuls.contract.sdk.BlockHeader - -```java -public class BlockHeader { - - private String hash; - private long time; - private long height; - private long txCount; - private Address packingAddress; - private String stateRoot; - - public String getHash() { - return hash; - } - - public long getTime() { - return time; - } - - public long getHeight() { - return height; - } - - public long getTxCount() { - return txCount; - } - - public Address getPackingAddress() { - return packingAddress; - } - - public String getStateRoot() { - return stateRoot; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - BlockHeader that = (BlockHeader) o; - - if (time != that.time) return false; - if (height != that.height) return false; - if (txCount != that.txCount) return false; - if (hash != null ? !hash.equals(that.hash) : that.hash != null) return false; - if (packingAddress != null ? !packingAddress.equals(that.packingAddress) : that.packingAddress != null) - return false; - return stateRoot != null ? stateRoot.equals(that.stateRoot) : that.stateRoot == null; - } - - @Override - public int hashCode() { - int result = hash != null ? hash.hashCode() : 0; - result = 31 * result + (int) (time ^ (time >>> 32)); - result = 31 * result + (int) (height ^ (height >>> 32)); - result = 31 * result + (int) (txCount ^ (txCount >>> 32)); - result = 31 * result + (packingAddress != null ? packingAddress.hashCode() : 0); - result = 31 * result + (stateRoot != null ? stateRoot.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "BlockHeader{" + - "hash='" + hash + '\'' + - ", time=" + time + - ", height=" + height + - ", txCount=" + txCount + - ", packingAddress=" + packingAddress + - ", stateRoot='" + stateRoot + '\'' + - '}'; - } - -} -``` - -### io.nuls.contract.sdk.Contract - -```java -/** - * 合约接口,合约类实现这个接口 - */ -public interface Contract { - - /** - * 直接向合约转账,会调用这个方法,默认不做任何操作,如果合约地址要接受直接转账,可以重载这个方法,并且标记`@Payable`注解。 - */ - default void _payable() { - } - -} -``` - -### io.nuls.contract.sdk.Event - -```java -/** -* 事件接口,事件类实现这个接口 -*/ -public interface Event { -} -``` - -### io.nuls.contract.sdk.Msg - -```java -public class Msg { - - /** - * 剩余Gas - * remaining gas - * - * @return - */ - public static native long gasleft(); - - /** - * 合约发送者地址 - * sender of the contract - * - * @return - */ - public static native Address sender(); - - /** - * 合约发送者转入合约地址的Nuls数量,单位是Na,1Nuls=1亿Na - * The number of Nuls transferred by the contract sender to the contract address, the unit is Na, 1Nuls = 1 billion Na - * - * @return - */ - public static native BigInteger value(); - - /** - * Gas价格 - * gas price - * - * @return - */ - public static native long gasprice(); - - /** - * 合约地址 - * contract address - * - * @return - */ - public static native Address address(); - -} -``` - -### io.nuls.contract.sdk.Utils - -```java -public class Utils { - - private Utils() { - } - - /** - * 检查条件,如果条件不满足则回滚 - * - * @param expression - */ - public static void require(boolean expression) { - if (!expression) { - revert(); - } - } - - /** - * 检查条件,如果条件不满足则回滚 - * - * @param expression - * @param errorMessage - */ - public static void require(boolean expression, String errorMessage) { - if (!expression) { - revert(errorMessage); - } - } - - /** - * 终止执行并还原改变的状态 - */ - public static void revert() { - revert(null); - } - - /** - * 终止执行并还原改变的状态 - * - * @param errorMessage - */ - public static native void revert(String errorMessage); - - /** - * 发送事件 - * - * @param event - */ - public static native void emit(Event event); - - /** - * @param seed a private seed - * @return pseudo random number (0 ~ 1) - */ - public static float pseudoRandom(long seed) { - int hash1 = Block.currentBlockHeader().getPackingAddress().toString().substring(2).hashCode(); - int hash2 = Msg.address().toString().substring(2).hashCode(); - int hash3 = Msg.sender() != null ? Msg.sender().toString().substring(2).hashCode() : 0; - int hash4 = Long.valueOf(Block.timestamp()).toString().hashCode(); - - long hash = seed ^ hash1 ^ hash2 ^ hash3 ^ hash4; - - seed = (hash * 0x5DEECE66DL + 0xBL) & ((1L << 48) - 1); - return ((int) (seed >>> 24) / (float) (1 << 24)); - } - - /** - * @return pseudo random number (0 ~ 1) - */ - public static float pseudoRandom() { - return pseudoRandom(0x5DEECE66DL); - } - - /** - * @param src source string - * @return sha3-256 hash (utf-8 encode) - */ - public static native String sha3(String src); - - /** - * @param bytes source byte array - * @return sha3-256 hash - */ - public static native String sha3(byte[] bytes); - -} -``` - -### io.nuls.contract.sdk.annotation.Payable - -`@Payable 标记@Payable的方法,才能在调用时候转入金额` - -```java -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Payable { -} -``` - -### io.nuls.contract.sdk.annotation.Required - -`@Required 标记@Required的参数,调用时候必须传入值` - -```java -@Target({ElementType.PARAMETER}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface Required { -} -``` - -### io.nuls.contract.sdk.annotation.View - -`@View 标记@View的方法,调用后合约状态不会改变,可以通过这种方法查询合约状态。` - -```java -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface View { -} -``` - -## 6. 智能合约主要的RPC接口 - -这里列举几个接口的参数结构及简单实例,其他接口请参见[Swagger UI](http://127.0.0.1:8001/docs#/) -> 测试网的`Swagger UI`的端口默认是8001,正式网的端口默认是6001 - -### 6.1 创建智能合约 - -- POST `/api/contract/create` - -|参数|类型|说明| -|:-:|:-:|:-:| -|sender* |string |交易创建者| -|password* |string| 交易创建者账户密码| -|gasLimit*| long| 最大gas消耗| -|price* | long| 执行合约单价| -|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| -|remark |string |备注| -|args |string[][]|参数列表| - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "gasLimit": 4687, - "price": 20, - "password": "xxx", - "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", - "remark": "asd", - "args": [] -} -``` - - - -### 6.2 估算创建智能合约的Gas消耗 - -- POST `/api/contract/imputedgas/create` - -|参数|类型|说明| -|:-:|:-:|:-:| -|sender* |string |交易创建者| -|password* |string| 交易创建者账户密码| -|price* | long| 执行合约单价| -|contractCode* |string| 智能合约代码(字节码的Hex编码字符串)| -|args |string[][]|参数列表| - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "price": 20, - "password": "xxx", - "contractCode": "504b03041400080808003b5aed4c000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808003b5aed4c000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800007559ed4c0000000000000000000000000d00000074657374636f6e74726163742f504b03041400080808008359ed4c0000000000000000000000001f00000074657374636f6e74726163742f54657374436f6e74726163742e636c6173737d535d53d350103d9796a684604b2cdf20c5cf365a421110f986225a2cf040c5d1b7b40d25d0264c9232e39bbfc2f147f8a03352189df107f8a31cf7b635744a310f7befeedd73f6dcdd9bdf7f7efc023083bd2e746052801ac4948824a6453cc58c8859cc75827f9f3f7de4de331e9f0fe2b9883e2c04b1c8714bdc2c0b581111c60237ab41acf1754ec0ba800d06bfa99575063973ac9d696a49338beabe6b1b66719121e07c28e7ac12434fca321d5733dd03ad54a1ec6041cf1b65ade430b0b48f44c80c425177776b5c9158bc1d9b3f6515e83494314c7db752cee97656cb956ab5adbc563ad06c83fb8da0df3d32887e24e3ea8e9bb74cd7d6f2ae9a2527d57088b28b6aee373476d37ed393e58bc5d3a429a791863c574c10d339d46dbad592611aee4a2de78041dcb72a765edf3278d5dee60293fc12120630c83074a30c868e6c56404ac2265e08d89210c34b01af24a4312e611baf25c491a1baeb6f93b3f36f2428784cd23947d63ad14d094318943082518681d6be6d548c5241b725ec609740d144b4cec210be4addcb1deb5cc89861a966a5e4a89e50a770a25e091d6c7bbee314a9535aa160eb0e752e4ad36b9bb75ecfa0b68ffeef9ccafc9b7f59738fd40da398365dbda8db848cb48bf3e958f5eb929033fec4f60ea9e5b1ed1b798662ed4ff84003dae9a96e161812b1ebcff0facb6c74781113f4aff481a11f3edad1d4f9bbe6b3a1d830ed3b282ef33179fe1802b4bf8371b2518aa8b4325a3b95ef605f6b29136403b5a082bb64a57a02eee13ead0c0f3c70a201f6c9be56e86413d4e7411fe2512b342c7f69814eb785c6bcaa330da878097f159d55045a8bcf3531881e43dc6358265e7e16228608844b745521cadd573422adc002512c3651853c2afa1d1a5456832aa95c4052e49e733045f69de3961296cf11fa89f0bb0bf42aefa9bb55c8f26d32554428eb9b576c9854032bf05367456a51989ad48f554c61ada978d22bfea4864cfc05504b070818c1191cd20200006f050000504b010214001400080808003b5aed4c0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808003b5aed4c9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800007559ed4c0000000000000000000000000d00000000000000000000000000c300000074657374636f6e74726163742f504b010214001400080808008359ed4c18c1191cd20200006f0500001f00000000000000000000000000ee00000074657374636f6e74726163742f54657374436f6e74726163742e636c617373504b05060000000004000400050100000d0400000000", - "args": [] -} -``` - - - -### 6.3 调用智能合约 - -- POST `/api/contract/call` - -|参数|类型|说明| -|:-:|:-:|:-:| -|sender* |string |交易创建者| -|password* |string| 交易创建者账户密码| -|contractAddress* |string| 智能合约地址| -|gasLimit* | long| 最大Gas消耗| -|price* | long| 执行合约单价| -|value |long| 交易创建者向合约地址转账的金额(Na - 100000000Na=1NULS)| -|methodName* |string| 方法名| -|methodDesc |string| 方法签名,如果方法名不重复,可以不传| -|remark |string| 备注| -|args |string[][]|参数列表| - - -- Example Value - -```json -{ - "sender": "Nsdz8mKKFMehRDVRZFyXNuuenugUYM7M", - "password": "", - "contractAddress": "NseBvPEzerLi3p5Me8Rbm7SeHThVGv1U", - "gasLimit": 8000, - "price": 20, - "value": 0, - "methodName": "balance", - "methodDesc": "", - "remark": "qwe" - "args": [] -} -``` - - -### 6.4 估算调用智能合约的Gas消耗(参见`Swagger UI`) - -- POST `/api/contract/imputedgas/call` - - - -### 6.5 估算智能合约的price(参见`Swagger UI`) -- POST `/api/contract/imputedprice` - - - -### 6.6 终止智能合约(参见`Swagger UI`) - -- POST `/api/contract/delete` - - - -### 6.7 调用不上链的智能合约函数(参见`Swagger UI`) - -- POST `/api/contract/view` - - - -### 6.8 获取智能合约执行结果(参见`Swagger UI`) - -- GET `/api/contract/result/{hash}` - - - -### 6.9 获取智能合约基本信息(参见`Swagger UI`) - -- GET `/api/contract/info/{address}` - - - -### 6.10 验证是否为合约地址(参见`Swagger UI`) - -- GET `/api/contract/{address}` - - - -### 6.11 获取智能合约地址的NULS余额(参见`Swagger UI`) - -- GET `/api/contract/balance/{address}` - - - -### 6.12 获取智能合约交易详情(参见`Swagger UI`) - -- GET `/api/contract/tx/{hash}` - - - -### 6.13 获取智能合约的交易列表(参见`Swagger UI`) - -- GET `/api/contract/tx/list/{address}` - - -### 6.14 根据address和limit查询合约UTXO(参见`Swagger UI`) - -- GET `/api/contract/limit/{address}/{limit}` - - - -### 6.15 根据address和amount查询合约UTXO(参见`Swagger UI`) - -- GET `/api/contract/amount/{address}/{amount}` - - -### 6.16 向智能合约转账(参见`Swagger UI`) - -- POST `/api/contract/transfer` - - - -## 7. 示例 - -### 7.1 投票智能合约代码`片段`, 如下 - -> 完整代码: `https://github.com/nuls-io/nuls-vote` - -```java -package io.nuls.vote.contract; - -import io.nuls.contract.sdk.Address; -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.Utils; -import io.nuls.contract.sdk.annotation.Payable; -import io.nuls.contract.sdk.annotation.View; -import io.nuls.vote.contract.func.BaseVote; -import io.nuls.vote.contract.func.VoteInterface; -import io.nuls.vote.contract.model.VoteConfig; -import io.nuls.vote.contract.model.VoteEntity; - -import java.math.BigInteger; -import java.util.List; -import java.util.Map; - -public class VoteContract implements Contract { - - private VoteInterface baseVote; - - public VoteContract(long minRecognizance) { - baseVote = new BaseVote(BigInteger.valueOf(minRecognizance)); - } - - @Payable - public VoteEntity create(String title, String desc, String[] items, long startTime, long endTime, boolean isMultipleSelect, int maxSelectCount, boolean voteCanModify) { - VoteEntity voteEntity = baseVote.create(title, desc, items); - - VoteConfig config = new VoteConfig(startTime, endTime, isMultipleSelect, maxSelectCount, voteCanModify); - boolean success = baseVote.init(voteEntity.getId(), config); - - Utils.require(success); - - return voteEntity; - } - - public boolean vote(long voteId, long[] itemIds) { - return baseVote.vote(voteId, itemIds); - } - - public boolean redemption(long voteId) { - return baseVote.redemption(voteId); - } - - @View - public boolean canVote(long voteId) { - return baseVote.canVote(voteId); - } - - @View - public VoteEntity queryVote(long voteId) { - return baseVote.queryVote(voteId); - } - - @View - public Map> queryVoteResult(long voteId) { - return baseVote.queryVoteResult(voteId); - } - - @View - public boolean queryAddressHasVote(long voteId, Address address) { - return baseVote.queryAddressHasVote(voteId, address); - } -} - -``` - -智能合约的方法中如果有`数组类型`的参数,请使用如下方式传递参数 -> 参考以上投票合约代码中的`create`方法 - -```javascript -{ - "sender": "NsdtydTVWskMc7GkZzbsq2FoChqKFwMf", - "password": "", - "contractAddress": "NseLt14NacjTDhXaTXUdrk6VF7aEwtW4", - "gasLimit": 200000, - "price": 1, - "value": 10000000000, - "methodName": "create", - "methodDesc": "", - "remark": "", - "args": [ - "测试投票1", - "第一个投票合约", - [ - "第一个选项", - "第二个选项", - "第三个选项" - ], - 1536044066056, 1536184066056, false, 300, false - ] -} -``` - - -### 7.2 Standard Token 智能合约代码`片段` - -> 完整代码: `https://github.com/nuls-io/nuls-nrc20` - -```java -package io.nuls.contract.token; - -import io.nuls.contract.sdk.Address; -import io.nuls.contract.sdk.Contract; -import io.nuls.contract.sdk.Msg; -import io.nuls.contract.sdk.annotation.Required; -import io.nuls.contract.sdk.annotation.View; - -import java.math.BigInteger; -import java.util.HashMap; -import java.util.Map; - -import static io.nuls.contract.sdk.Utils.emit; -import static io.nuls.contract.sdk.Utils.require; - -public class SimpleToken implements Contract, Token { - - private final String name; - private final String symbol; - private final int decimals; - private BigInteger totalSupply = BigInteger.ZERO; - - private Map balances = new HashMap(); - private Map> allowed = new HashMap>(); - - @Override - @View - public String name() { - return name; - } - - @Override - @View - public String symbol() { - return symbol; - } - - @Override - @View - public int decimals() { - return decimals; - } - - @Override - @View - public BigInteger totalSupply() { - return totalSupply; - } - - public SimpleToken(@Required String name, @Required String symbol, @Required BigInteger initialAmount, @Required int decimals) { - this.name = name; - this.symbol = symbol; - this.decimals = decimals; - totalSupply = initialAmount.multiply(BigInteger.TEN.pow(decimals));; - balances.put(Msg.sender(), totalSupply); - emit(new TransferEvent(null, Msg.sender(), totalSupply)); - } - - @Override - @View - public BigInteger allowance(@Required Address owner, @Required Address spender) { - Map ownerAllowed = allowed.get(owner); - if (ownerAllowed == null) { - return BigInteger.ZERO; - } - BigInteger value = ownerAllowed.get(spender); - if (value == null) { - value = BigInteger.ZERO; - } - return value; - } - - @Override - public boolean transferFrom(@Required Address from, @Required Address to, @Required BigInteger value) { - subtractAllowed(from, Msg.sender(), value); - subtractBalance(from, value); - addBalance(to, value); - emit(new TransferEvent(from, to, value)); - return true; - } - - @Override - @View - public BigInteger balanceOf(@Required Address owner) { - require(owner != null); - BigInteger balance = balances.get(owner); - if (balance == null) { - balance = BigInteger.ZERO; - } - return balance; - } - - @Override - public boolean transfer(@Required Address to, @Required BigInteger value) { - subtractBalance(Msg.sender(), value); - addBalance(to, value); - emit(new TransferEvent(Msg.sender(), to, value)); - return true; - } - - @Override - public boolean approve(@Required Address spender, @Required BigInteger value) { - setAllowed(Msg.sender(), spender, value); - emit(new ApprovalEvent(Msg.sender(), spender, value)); - return true; - } - - public boolean increaseApproval(@Required Address spender, @Required BigInteger addedValue) { - addAllowed(Msg.sender(), spender, addedValue); - emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); - return true; - } - - public boolean decreaseApproval(@Required Address spender, @Required BigInteger subtractedValue) { - check(subtractedValue); - BigInteger oldValue = allowance(Msg.sender(), spender); - if (subtractedValue.compareTo(oldValue) > 0) { - setAllowed(Msg.sender(), spender, BigInteger.ZERO); - } else { - subtractAllowed(Msg.sender(), spender, subtractedValue); - } - emit(new ApprovalEvent(Msg.sender(), spender, allowance(Msg.sender(), spender))); - return true; - } - - private void addAllowed(Address address1, Address address2, BigInteger value) { - BigInteger allowance = allowance(address1, address2); - check(allowance); - check(value); - setAllowed(address1, address2, allowance.add(value)); - } - - private void subtractAllowed(Address address1, Address address2, BigInteger value) { - BigInteger allowance = allowance(address1, address2); - check(allowance, value, "Insufficient approved token"); - setAllowed(address1, address2, allowance.subtract(value)); - } - - private void setAllowed(Address address1, Address address2, BigInteger value) { - check(value); - Map address1Allowed = allowed.get(address1); - if (address1Allowed == null) { - address1Allowed = new HashMap(); - allowed.put(address1, address1Allowed); - } - address1Allowed.put(address2, value); - } - - private void addBalance(Address address, BigInteger value) { - BigInteger balance = balanceOf(address); - check(value, "The value must be greater than or equal to 0."); - check(balance); - balances.put(address, balance.add(value)); - } - - private void subtractBalance(Address address, BigInteger value) { - BigInteger balance = balanceOf(address); - check(balance, value, "Insufficient balance of token."); - balances.put(address, balance.subtract(value)); - } - - private void check(BigInteger value) { - require(value != null && value.compareTo(BigInteger.ZERO) >= 0); - } - - private void check(BigInteger value1, BigInteger value2) { - check(value1); - check(value2); - require(value1.compareTo(value2) >= 0); - } - - private void check(BigInteger value, String msg) { - require(value != null && value.compareTo(BigInteger.ZERO) >= 0, msg); - } - - private void check(BigInteger value1, BigInteger value2, String msg) { - check(value1); - check(value2); - require(value1.compareTo(value2) >= 0, msg); - } - - - -} - -``` - - - - - diff --git a/source/zh-cn/contract/smartContract.md b/source/zh-cn/contract/smartContract.md deleted file mode 100644 index 88cde808..00000000 --- a/source/zh-cn/contract/smartContract.md +++ /dev/null @@ -1,137 +0,0 @@ - -# 钱包智能合约使用文档 - -## 部署合约 - -1 启动钱包,点击【合约】,点击【部署合约】tab页 - -![deploy](./smartContractImages/deploy1.jpg) - -2 在文本框中填入合约的Hex编码 - >文章底部有发行NRC-20Token的合约hex编码示例 - - -3 填写合约构造函数参数,注意必填项和值类型,否则表单校验无法通过 - -![deploy](./smartContractImages/deploy2.jpg) - -4 点击【高级选项】,可更改GasLimit和GasPrice的默认值,还可继续填写附加信息,该字段为非必填项。(此步骤为可选操作) - -![deploy](./smartContractImages/deploy3.jpg) - -5 表单填写完成后,点击【测试合约】,钱包将对该合约进行一次测试部署,验证合约的合法性。 - -![deploy](./smartContractImages/deploy4.jpg) - -6 测试通过后,点击【部署合约】,若当前账户有密码则输入密码,然后点击【确认】。无密码,则直接点击【确认】。此时系统会跳转到【我的合约】页面,可在此页面查看部署合约的确认进度。 - - -查看部署合约的确认进度 - -![deploy](./smartContractImages/deploy6.jpg) - -7 确认完成后 - -- 点击表格右方的操作【去调用】可直接进入【调用合约】页面 - -- 点击合约地址可直接进入合约概览的页面 - - -## 查看合约 - -1 启动钱包,点击【合约】,点击【查看合约】tab页 - -![access](./smartContractImages/access1.jpg) - -2 在输入框中输入合法的合约地址,点击【访问】,下方会出现一个面板 - -- 点击面板中的【下拉列表】,可以选择要调用的合约方法 -- 点击合约地址旁的星星图标,可以收藏该合约至我的合约列表 - -![access](./smartContractImages/access2.jpg) - -3 选择某一个方法后有以下两种情况 - -- 方法为只读方法,点击【调用】则会在网络请求完成后立即返回调用结果 - - ![access](./smartContractImages/access3.jpg) - -- 方法为可写方法(需上链),可点击高级选项,更改GasLimit和GasPrice的默认值,点击【调用】后,该操作会发起一个交易,需要消耗nuls,因此若设置了账户密码,则需要输入密码。交易确认后,返回调用结果。 - - [查看智能合约手续费详情](http://dev.nuls.io/zh-cn/contract/SmartContractFee.html) - - 调用合约交易确认中 - - ![access](./smartContractImages/access4.jpg) - - 调用合约交易已确认 - - ![access](./smartContractImages/access5.jpg) - -4 若调用的上链方法,可点击面板中的TxID查看本次调用合约交易的详情 - -![access](./smartContractImages/access6.jpg) - -调用合约交易详情 - -![access](./smartContractImages/access7.jpg) - -## 我的合约 - -1 我的合约列表中展示了当前账户创建的合约和收藏的合约 - -![access](./smartContractImages/myContract1.jpg) - -- 点击合约地址,可进入合约概览页面 - - ![access](./smartContractImages/myContract2.jpg) - -- 点击去调用,可进入该合约的【调用合约】页面 - - ![access](./smartContractImages/myContract3.jpg) - -- 点击【取消收藏】可将该合约从【我的合约】列表中移除 - -3 【交易记录】中展示的是该合约内部的交易,点击TxID,可查看该条交易的详情 - -![access](./smartContractImages/myContract4.jpg) - -4 【合约详情】中展示的是该合约的所有方法,对应的参数和返回值类型 - -![access](./smartContractImages/myContract5.jpg) - -5 若合约由当前账户创建,可点击合约概览右上方的【删除】图标删除该合约,合约被删除后,可继续查看合约详细信息,但无法继续调用合约的方法 - -![access](./smartContractImages/myContract6.jpg) - -## 账户多资产 - -通过智能合约发行Token或由其他账户转入不同类型Token后,账户就会出现多资产 - -1 进入钱包,可查看当前账户地址下的所有类型资产 - -![access](./smartContractImages/assets1.jpg) - -2 点击【转账】可进入该类型资产的转账界面,输入收款地址和转账金额,可进行该类型资产的转账操作 - -![access](./smartContractImages/assets2.jpg) - -3 点击【交易记录】可进入该类型资产的交易记录页面 - -![access](./smartContractImages/assets3.jpg) - -4 在【交易记录】页面可通过点击下拉列表进行切换不同类型资产的交易记录 - -![access](./smartContractImages/assets4.jpg) - -5 点击TxID可查看该条交易记录详情 - -*** - ->发行NRC-20 Token的合约hex编码示例 - -``` -504b03041400080808009184264d000000000000000000000000090004004d4554412d494e462ffeca00000300504b0708000000000200000000000000504b03041400080808009184264d000000000000000000000000140000004d4554412d494e462f4d414e49464553542e4d46f34dcccb4c4b2d2ed10d4b2d2acecccfb35230d433e0e5722e4a4d2c494dd175aa040958e819c41b9a982868f8172526e7a42a38e71715e417259600d56bf272f1720100504b07089e7c76534400000045000000504b03040a00000800002f6e264d0000000000000000000000001300000074657374636f6e74726163742f6e726332302f504b03041400080808002f6e264d0000000000000000000000002400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373b558fb7313d7153e2bad2d595ec0186cfc005b0697d87a581868420ca5186a1a27d850db3885b44dd6d2da5e90568a766542489b579b479b3469d2e6d990b4494b9226e1116c43689374a6d3ccf49fe83fc274fa9dbbabd54a48f63499fee0bb77efbde79cefbcbebbf2bffef3d9e744b49bfede40113acbc3c33c9ce3e1911045e9a70dd4423f0bd0a3210af04b841ee3e1715e7e2284e1491e7e1ea25fd0538db4919e0ed033216aa25f85e8397a9e577e1da01702f4620852bfe1e1251e5ee6eddff2ec77017a25449d2c10a1d778789d873758ed9b3cfc3e486ff1ca797e799b67ef04e90ffcfc6390de653def05e84f01fa73802e04e87d896443cd6812351f39a52ea889b46acc2526adbc6ecced95a8de3c9b99c9a6250aa6b4a49e51d3a644d2a8448d56d652d393855c2e7d56a2565b34a35af38983fadca86169735a1ee2c11915fa921aa4d6d9670a969e4e8ca9396c364cea73866a15f2303e52bebbef889e4d1885b49948660d2baf26ad84993a9d184ea5f29a69eead6e6e3f7406d4743a7b464b49647d0d8ddfd03c03d8d8d75f2d8ef2a16c4ae320e886365ec8cc68f92975262da29e4daae96935aff3bbb3285bf33a42163e6269a6e54230f2c99d3b12937a268783d9d39a01bded1305c3d233dab46eea101d360ce4c5d2b306c4b757f74275cf24a675ed0c94f8fbfa91d2b622f25bd358bf4f37746bbf44fbfb6e75aed64aa59ad1fe6989d6b0225d4d0f67b2002ed1d672fcc7d43c6ad1d2f2658e44567564427bb0a0e7b5145795a8002e3a89a6fa5649e48abb35c351973d63687989ba569647359a39cd48f15145880c178bb36e414d17346e9cb2ec9fcd152b60cda4a5264fa314c5bbcd08d002238639abe50fe7b319898e7f23f7aa7bd77f12e5372bd4fbac2cc2e974f0d159896e5fc55ecd80051c252084a20712ddb11afa9af8026a2e97cf2e405d936e24f39a6a6ac36245055185d4544a4b4ddbf16d026b55ecaf330b33c2987b28984d17a72cec26e9ff125ef44050b58f0c96a63b3db85cfb21532bbdac2b0a95b6b172b018d7af19cc690ea67dc483c0d55a979cd792a7c1327db5e51335f66a4bd48be21f2c4ee07b74451d5e6a61797fc69c9368f87fb25b5d5368325bc827b5c33ab75c93875907f8b84203945068070f83b453a15db45ba111fa40a10f69b744eb4b77c65daa398f6655e8db74bb4277f2f0173efc117dacd0277431409714ba4c5714fa94ae8299abf0faf8c4a19d3b7aa79cf61859d0981ed754bc2ba30668e4505a354dcd642ca0864585966859a16b741d0265f718aea36ad150689e34850c4a2b749a87cfe886423a692b212b76501159d9bb4229d67837dda350961087bfd2df14fa9c2e4ad4396a9885d9593da9e35cd8e9dc54d8e230f3e10585bea08b0a9d2074767c6a5e0b8baa08670aa6159ed1c273e85f5c08616b5e35c2d97c184cafa6211ede31c0e280d25566c1a19a7076d6b631c0ee7d89532bdfa5c87fa9448ece9cd292d0bca56a4f1d725e7065d68a96b8535160f2c99189a378991a19c798cb9ee15e1aadc993c14c216de9e2936aa056cbd5926dab8a758c5ba5de746ea130aef855ae2c7fae00c7f678ef793b1a7b6f5de9bf7549a28eaa068ea3224131b296d1a1bebb065b895ab27b7c4ec3b9ed556054351ac8db1f00b0d07792e51b92d94c4ecd23b72bb0173e7afc603fc4bdc87cb891fb4e56e30aeac1f773947c14a338d5533353037e0834333b882708024f1f738478820808b42ce67bf077a7e77d081fe6c830edc57c1f56127893f0ac8b5c25e99238f21d8cf562710bedc7a8d807e8bb7400cf6167f7209e12205453e4ab54b46d55458374a88a22ff47158afa5755b48bbe5745915c8928b1aaa2113aec28fa374ed4e1a94596a1ec0ad52f921cb9418113cb145ca486d23414892e9214892d922fd2222f923f12bf428d2df212294bb486a5ae52c3355acb80aed33a3fdd7b839a4e48ceca32adbf46cd975da003d4887127c94859236da2566a4329eca2ed487314491e445a8791d60924398524ef17bf0e0550c7219e0d8838f08ccbc52766dfc739bf980d0afd7761de2ee3d8a8f0fcd611e40a018ec51750c12612401c8a5ea70d3efa92368ec7bfa2000273291e73965a86e476f92b0a6291671c7e5978d585dfa604ac6b81b119285b11eead48fe6dc85b0c212f799170bd48d0111a73d2368e990fd23d7414fefb21bb868e4142a61f3809b5f7f6606f022b6bc977935a033479935a0234559664f67b8dafc2d7e334ede4fd11c090f1ec8d4491a2f832b546a21837456218db3875519e71d6e452a1b60af0f7500340af03d81640de0a40ec58c4d6e73ad64bf73a8ef5d20f85633c3b26d2c3e036f8aba603f795938e2721c299ec8dfe9302f20592fdd7a89dabac989a96b1989d9ab118e7c0ef81781cd19aa60e40e882f1add0c910c3b63e0f443bf61d14a2fb00cc27a2da48fee001e926b5550b69407291fe887eec0453874dd6dc1d412c631cc568cc892216785e11c76611abfb29480f20892ac868c603b0db05d82d222789d93101b06a5a7fe22279c041d211710c77dca0ce2288cde520d68a937348e63cba4ff700e8700174889a94c46c0500f7bb00e6d002aca2a708604b11805858a2ae1a3832c061c0cdac07478f8ba3c7c5d1031f6be2505d1c578183633c120186eea2edf1587c89c2e769bd5840e52040174829626d5d01abdfd3e126a26c017701d5b6802a7a0897d7c3e8f3739e461871b18fb8d84790e6dda2c3efa0a46804aeb706eee25e145bb09a533efe04c49c9d7ac221eb30ea0be886e448bbccdec57988c6da6578d703974a3c6b77c3a328b4c760f571da001ddde8ac1213855d9c619a7570869146bb61c34ec3065121770b26f2f147ae83e711074f97074fbc79eb326d2ba2e92d436397fd53d0f634ada76750f6cf7a9074b948ba5c245d2e922e1749ab8b447791fc033bac63c88e8597bf6db26e772eb221596cb63b7754bb1c8bdb3346e965f1e7a0ef79feb721b5d30b609017c1cf2fe1267ad98378c8453ce4221e72110f398837e2563b053e2fb1b8bdb2072b9cff20816c12607148e16783e3d139ec72b410ca25fad67824d6bc7d996e2bbad7108d23e23d25e8de74bf02c67a1557c76b08f8eb80fe86a72cb7b990b7a1e5c69c2f18bbb5eb9190fb04641fff887180980e906e07483cd6dcc7192e82e8ad046167f92da83b8f9a7b1bf17cc703c04b6e990a72ab47ac8b00f073c70170126f1ccf4db807d673d3a285df2cdd0897dde60c8963ef220aef0983adb6986b7093302389a0d791aff98024ec3ce8d8c939f74d6724ca4166dee0b2ae6ecb76f202f4bc0fbb1f801e3ff41057a76bb393f2c226cf4cf78a81f556c7bae558d71ceb6d55bc8c5da3fe4a373f863b9f784cb6b926db1c37795610df45150e2fb825e6135e6caee170bcccacedf16528ba02089fc29fab9eb46e76cd6f763ddeec78cc3306e22ff7fd8ca89887e89742b98f9ac0a2cf820d3bf17c951afe0b504b0708b86173e8da09000014180000504b03041400080808002f6e264d0000000000000000000000001e00000074657374636f6e74726163742f6e726332302f4e524332302e636c617373a5525d4f1341143d03b5cb16aa28a8e0b78490d6079710a30f3c5522491322a6451e789b6e2f657076b6cecc96f0d77cf007f8a38c776ba954ba69a29becceceb967ceb977eefdf1f3db77006fb011e05980e7015e08541bfdbe4d07527f1890f1024b4d63c8ee69e91cb9002f997164a571a764478c92910909acd6ea07e77220232d4d2f6a7bab4c6f5760bd9519af123a564e7534358c49bdf42a354e60eb40a591c9b48be2d4782b631fb9ee97488e39d1b1a20b1629bbcba4936a81852ec52a919a0fcfd7ea4d8145cf54ddcefa7d7d29b076954322fd59f45ef59ac6538f2c4b841dc989c574782af0b636ddb8d1ed5a726eb7506463b2984fd272e99eec4455af6656d5a2af99b2d465c5053fba4c817733b29a9e54fd847b7425b26fd344e0f32ca17fb409e47034b8d7a1d43abdc8af53e0e8bfdc0aafbad24e331bd3bed2ec51f9d8dadbd97e9d53b9c99e9c1f8b191bef6c47c3b8c0f29f013cec9c53ccd3b955c4defc6bd08b8913f35e16109843fe8425ee1f42de577857e67511606c690a56c5ed1bd81d2cdfc0eee21eab5fc3b0c26f909bae0e09f7f180ff73b03af71b1c871e626d145a99bf1e1a13d68bcf3ec2e329be9334263c197e9fe216af79a2b94f89cbcd0f05087f01504b070846c6797bcf01000052040000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c6173738d565b6f1b4514fec6bbde75b69bbb49d224b4e985e2d8491d42b8e6d2242681809394a435b4406163af926d9ddd74771d90a0129540ea033c801020242e2f252f790089ba0824c45390f82ffc03049c99ddb88963273cf8cc99b367e67cdf7c6746fef39f5f7e0330826b1ae2b8d0000593dc4c7133cd631915331a66f1bc8617b899c51cf7e654bca8e1182ec4f0121fb3dcccc7b010c322772f72f3b28a2515cb0c51e76ddb74194e642d276d978a5e3aefd8be6be4fdb457b8919e2a145cd3f34619546fc3b40b3c35ba69144b264347f6bab169a4d70d7f2d3d6dadced9beb96aba94aa8c59b6e54f305c4e1cbeeb115f6b6edf9f6390334e810034672ddb5c28adaf98ee2563a54891b6ac93378a39c3b5f83c0ccafe9ae531344e6d6cb80e619fd9346d9f419fb38979a668789e499f1359dff4fc0a10dbcd0f0fa5179632c34367f72d247ea7974ab66fad9b39cbb3a8c245c335d64ddf74a76cdbf10ddf726cda2f599b9c51c9492f99374b966b1668c7d8aae92f0642f425fa8f9222e655b24f1d71c2fcb434da7c79573ccddb33e1657381985d54b68e9cbc5c98753c515f1485e8184562fe50985434ecd5f4e2ca7533ef8ff65f65600e17e8c02721904182342efb46fec6bcb12174a3e6a6d26b86b716882d25fae7a808b12a152999d124e63bcbbe6bd9ab0cf15df862e7204a3b6bcb4ec9cd9bb316ef034da8799ea7e9e8c1251d1de8d4d1c5cd7174ebb88c9c8a5718cefdbf4e50f1aa8e213ca6e28a8ea7f03443673584e9925514271ddfb7f25d71e9c6755cc56bdcbc4ee006fac20b364ec406fac41d13196fe818c518434bf5c93174d7d43eec6f3ab05c20b1e87186f67d67248274445df5c832f41ed65ac4a9562b9044c60627c230983828c94195c2231aadcadfed9b43f27b1399fa9f718a9ec938a81b2121c295a6c734c2c51623e94da346df7bd04bf3876956a451a6319ebc0f964cdd432439700f5272f01ee41fc5aa13643b10257b93325d34c043137cb4a38493144d06ebd1873380f0785d263c5e39223c5e5bc259f2db25faf80839fbed393c4a96434ad3c89747933f21f24305832282ef889a7a9010d6a4770cfde1e209cae61515c1e501034d44dfa335b7c40e1d415605b512a2a637ac2610a91ac8fb3581a46a0391aa817c406b3eac03a42b043280c11a40e46a20776a02392f161d00225703f988d67c5c0708d78c17a6eb1eeef517e54834de4ea6be4754de4eeda02959463445bfbb884adba9dfa1cc73dd76a8a36818a05f19ea5768dea2db2ee294c5cf3348902826ed4d907613e41db4f281627219b12d3473ef0fa8f21664699b404882463701053e818a4fe9e43e23989f13e52ff026be14b4fa02c0155ab7318cc7059d02fdcf3843849e100daaab4dec6ff4aa7852619d0a8b6b939c3abd7021f59fc3639c09d8352605b3060e66ace564cf5ac08987a530fcd66e5c0ee244430be23d0fe0b789dbf335dda66fa879be4506dfed51632684dd4ea09fc1b30485831d84d23ac9fea55b1e21b804937c847e84b1dcfe292da2a73464718db6e58d32f22b8e5db90fbdadb14c0a0a2acd6d2d812f71bf35f0097373cbad32daca68af6ebcbb7b1a6f24041ac1b8b013381d3e350a9ea367a9e13f504b0708a7368aa198040000da090000504b03041400080808002f6e264d0000000000000000000000002c00000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c6173738d56dd531b5514ffddec6637a40be14ba0806dfa610d49208868ab7c13a14503b44063a15abb245bd836ece2ee8617c787fe1bbe2b2f3cd419491d9d717cc219ff17ff03473df7ee924248c0879c7beed973eef99df33bf74efefce797df008ce249149d986a8282692e66b898e5b6ac8ab928e671378a7b5ccc63816b0b2a3e8de212a622f88caf392e1623588a6099abf7b978a06245c52a83fcccb17718aee44c3b63954b6ea6605b9ea317bc8c5b7c919929161dc375c718429ecd10ded34b6583a12bf75cdfd3333bbab79d9935b7162ccfd8321cf252c64dcbf426191e26ce3ff082af758f1fc813dcac5d2400b19c69194be59d4dc359d3374b6469cfd905bd94d71d93ef03a3ec6d9b2e43f39aa35bee33c399db332c8f415bb02cc3c99674d735e87322e719ae570562398591e1ccd24a7664f8e6a940aaeffa4ad9f2cc1d236fba2665b8af3bfa8ee119ce8c65d99eee99b645e725eb17a7577d322bc6d765d3318a74a2ba6578f382827862e0221254f7d8f9da05fde5bd0ad3d16b9c35d75f23b4cffb04f650ae061446dcaad7e5446322142a412f51b56f054e25dddaca2c6f3e370aded8c00603b33929673e09527422a179d5d30b2f16f55dc1158d32a5ded6dd6d9f602931b04049a89672899c196d229ebdea39a6b5c5d0790c5f9cec5be9e4e8aa5d760ac6bcc9b98f0a0687b89b863eac69e842b7861e2e2ea357c343e4557cce70ebffb1afe2918661bca7625dc36ddc61e8ae85305b364b45c361e83815f90dbf62131a36f0988b2f889174dcb327a8a4745cdc28f1f14b0d63186768aded19436f5dae8369a656e57d72c54453f653dd11466a4e4fa33219facf1b25ea76bd212072f4dd5dc32a320c26ce9271969fa0396335fec713738e7f7f22dbf833aed173d8099a434808718ee9d10c719ac54a4cd31aa5ef7de8a7fddbb42bd12ad3da997c0d964c1d22944c1f424a0e1e42fe51445d21d98530c934790ea209436841061d340057c99af4e311c70d40683c2f131acf1c121acf2de126e9318904c33b27e42dbc4b92c3c9d0ca43c3c99f107a55cdaf08e3fb229fe63b04f9e8c5c240103c49de3c9b22ea78833e2aacb729e68e38a1cbf7aa225602c4f45ad50522d50219ab0b24551f88540b648a62a61b00e90980a4a9d16781c8b540b275810c89a03340e45a207729e65e03209c2f9e982e7970d65fe4c3a97b994cfd80b07c903a424bb282708a7edf232c1da47e87b2c8793ba269a2254dbf0ad4ef10db47342dece4c5fbe93b4864934e3a48c70ef211daf84236b982c83e625cfb03aabc0f593a20109228a397800239a858a4ce2d13cc0754f20abec2aa282bee03ae96f512233444bc9c22fd97b841057d208653535bd8dfe857f1a1c2ba15d6199de6a5d3bb1694fe73d0c639bfbae6a4a8ac8983196fbddab7edd7c4cd52607e7a6c977d3b9511f5ed7d6fe0b78b9bf3886ed23a0dcf06b1f9f8041b7301ec0e02fd113e26281cec2094b669f62fddf010c12598a423d0438ce54f6f29889ed1a08a27742c1f94d15f7169fd35b4f6e60a31284a89b5b7fabac4f5365f27ccb1d66f2b68afa0a376f09e9e18bcd100680813424ee27af0cc28f8849ea4a6ff00504b0708d092051588040000be090000504b010214001400080808009184264d0000000002000000000000000900040000000000000000000000000000004d4554412d494e462ffeca0000504b010214001400080808009184264d9e7c7653440000004500000014000000000000000000000000003d0000004d4554412d494e462f4d414e49464553542e4d46504b01020a000a00000800002f6e264d0000000000000000000000001300000000000000000000000000c300000074657374636f6e74726163742f6e726332302f504b010214001400080808002f6e264db86173e8da090000141800002400000000000000000000000000f400000074657374636f6e74726163742f6e726332302f53696d706c65546f6b656e2e636c617373504b010214001400080808002f6e264d46c6797bcf010000520400001e00000000000000000000000000200b000074657374636f6e74726163742f6e726332302f4e524332302e636c617373504b010214001400080808002f6e264da7368aa198040000da0900002c000000000000000000000000003b0d000074657374636f6e74726163742f6e726332302f4e5243323024417070726f76616c4576656e742e636c617373504b010214001400080808002f6e264dd092051588040000be0900002c000000000000000000000000002d12000074657374636f6e74726163742f6e726332302f4e52433230245472616e736665724576656e742e636c617373504b05060000000007000700100200000f1700000000 - - -``` diff --git a/source/zh-cn/docs/index.md b/source/zh-cn/docs/index.md deleted file mode 100644 index 275326ad..00000000 --- a/source/zh-cn/docs/index.md +++ /dev/null @@ -1,61 +0,0 @@ -title: 如何使用 ------------ - -## 需要依赖的资源 - -- JDK 1.8 -- Maven 3.3+ -- Git 2.x -- IDE ( 可选 ) -- 运行环境: 64 位系统,4G 及以上可用内存 - -## 获取源码 - -```sh -$ git clone https://github.com/nuls-io/nuls.git && cd nuls -``` - -## 编译 - -首先,请确保 maven 版本大于3.3,JDK 版本是 1.8。 - -```sh -$ mvn -v -Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00) -Maven home: /usr/local/Cellar/maven/3.5.4/libexec -Java version: 1.8.0_171, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/jre -``` - -如果你的 JDK 版本不是1.8,建议安装并设置为使用1.8版本。 - -现在,我们可以执行编译了。 - -```sh -$ mvn clean package -``` - -命令成功执行,编译出的钱包核心会保存在如下路径 - -> client-module/client/target/nuls-node.tar.gz - -## 启动 - -```shell -$ mvn clean package -$ cd client-module/client/target -$ mkdir nuls-node -$ tar -zxvf nuls-node.tar.gz -C nuls-node -$ cd nuls-node/bin -``` - -- start.sh 启动 NULS 钱包。 -- stop.sh 停止 NULS 钱包. -- cmd.sh 启动 NULS Shell. - - -## 导入 IDEA - -导入工程目录到 IDEA,并设置好启动入口,即可调试运行。 - -![图片](assert/launcher.jpg) - diff --git a/source/zh-cn/docs/manual.md b/source/zh-cn/docs/manual.md deleted file mode 100644 index 9fea8ee7..00000000 --- a/source/zh-cn/docs/manual.md +++ /dev/null @@ -1,1554 +0,0 @@ -title: CLI 使用指南 ---------------- - -### 介绍 - -​ 本文档为NULS主网Linux版全节点钱包的使用指南,阅读本文档前用户需了解Linux系统的基本操作和使用方式,本文介绍了在Linux系统中如何利用NULS钱包创建账户、导入账户、转账、建立节点、委托等操作。我们建议用户利用Linux系统服务器建立稳定的NULS节点。 - -### 版本更新记录 - -| 版本 | 更新日期 | 内容 | -| :----: | :--------: | :----------------: | -| V1.0.0 | 2018-07-12 | 主网正式版全部功能 | - -### 准备 - -#### 服务器硬件配置 - - -**建立NULS节点的服务器不低于如下配置:** - - | CPU | 内存 | 硬盘 | 宽带 | - | :---------: | :---: | :------: | :-----: | - | 四核 3.0GHz | 16G | 128G硬盘 | 20M上行 | - - -**推荐配置:** - - | CPU | 内存 | 硬盘 | 宽带 | - | :---------: | :---: | :------: | :------: | - | 八核 3.0GHz | 32G | 256G硬盘 | 100M上行 | - - - -#### 系统及内核版本 - -**Linux系统** - -- CentOS (推荐) - -Linux内核版本推荐使用 2.6.32及以上 - -### 开始 - -#### 下载 - -- 最新版本的全节点钱包NULS官网下载地址:http://nuls.io/wallet;GitHub地址:https://github.com/nuls-io/nuls-wallet-release - -- 进入[NULS官网钱包下载](http://nuls.io/wallet)界面后,选择Linux download,我们提供了MEGA和百度云盘两种下载方式,用户可自行选择。 - - Linux系统中下载v1.0.0版的钱包可以使用如下命令: - - ```shell - $ wget https://media.githubusercontent.com/media/nuls-io/nuls-wallet-release/master/NULS-Wallet-linux64-1.0.0.tar.gz - ``` - - 注:如果后续有其他版本,下载地址可能会不同。 - -#### 安装 - -- 在Linux中解压已下载的文件 - - ```shell - $ tar -zxf NULS-Wallet-linux64-1.0.0.tar.gz - ``` - -#### 运行 - -- 进入解压后的bin目录,并运行启动脚本,启动全节点钱包 - - ```shell - $ cd bin - $ ./start.sh - ``` - -### 使用钱包 - -#### 快速入门 - -- 在确定钱包已经启动后,启动钱包的命令行程序,可对钱包进行操作。 - - 进入bin目录,执行如下命令: - - ```shell - $ ./cmd.sh - ``` - - 将会出现NULS命名输入提示符`nuls>>> ` ,然后可直接输入NULS钱包操作命令,来进行操作。 - - 例如,创建账户的示例如下: - - ```shell - nuls>>> create - Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. - Enter your password:********* - Please confirm new password:********* - [ "Nse9EtaRwgVgN42pxURgZjUR33LUx1j1" ] - nuls>>> - ``` - - 执行`create`命令表示创建单个账户,然后输入密码,以及再次确认输入的密码,创建成功后将会返回账户的地址。 - - - -### 约定 - -- 设置密码规则:密码长度在8至20位,必须同时包含字母和数字。 -- 命令参数说明: <parameter> 表示必填参数;[parameter] 表示选填参数。"|" 在参数中表示或者,表示前后参数只能选其一。 - -### 钱包命令 - -#### 帮助命令 - -输出打印所有的命令, - -- **命令: help [-a] ** - -| 参数 | 说明 | -| :--- | :------------------- | -| -a | 格式化打印命令,选填 | - -返回信息 help - -```json -getaccount

--get account information -``` - -返回信息 help -a - -```json -getaccount
--get account information - OPTIONS: -
the account address - Required -``` - -示例 - -```shell -nuls>>> help -nuls>>> help -a -``` - - - -#### 创建账户 - -创建账户,返回账户地址集合 - -- **命令: create [number] ** - -| 参数 | 说明 | -| :------- | :------------------- | -| [number] | 创建账户的数量,选填 | - -创建账户时,将会提示输入密码,如果账户不需要密码可以不用输入,直接enter; - -返回账户集合 - -```json -[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] -``` - -示例 创建2个没有密码的账户 - -```shell -nuls>>> create 2 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password: -[ "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", "Nse6iqzBZsBtL5c46xaHhAhAqVDv3zQQ" ] -``` - - - -#### 备份账户 - -备份账户,将生成一个名称为账户地址,扩展名为.keystore的文件,该文件为账户的备份文件 - -- **命令:backup <address> [path]** - -| 参数 | 说明 | -| --------------- | ---------------------------------------------------- | -| <address> | 账户地址,必填 | -| [path] | 文件生成备份文件的目标文件夹,默认为当前文件夹,选填 | - -注意:备份有密码的账户时需要输入账户当前密码,将来导入此备份文件生成账户时,要验证此密码;备份一个没有密码的账户是允许的,但是是非常不安全的,我们不建议这样做。 - -返回信息 - -```shell -The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -``` - -示例 备份一个有密码的账户 - -```shell -nuls>>> backup NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -The path to the backup file is /nuls/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -``` - - - -#### 移除账户 - -根据账户地址移除本地账户,如果账户已加密,则需要输入密码 - -- **命令:remove <address> ** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | - -返回信息 - -```json -Success -``` - -示例 - -```shell -nuls>>> remove NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -Success -``` - - - -#### 设置账户密码 - -根据账户地址对未加密的账户设置密码,不能对已经有密码的账户进行设置密码的操作。 - -- **命令:setpwd <address> ** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | - -返回信息 - -```json -Success -``` - -示例 - -```shell -nuls>>> setpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Please enter the new password(8-20 characters, the combination of letters and numbers). -Enter your new password:********** -Please confirm new password:********** -Success -``` - - - -#### 修改账户密码 - -根据账户地址对已加密的账户修改密码,不能对未加密的账户进行修改密码的操作;修改密码时将会验证旧密码。 - -- **命令:resetpwd <address> ** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | - -返回信息 - -```json -Success -``` - -示例 - -```shell -nuls>>> resetpwd Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Enter your old password:********** -Please enter the new password(8-20 characters, the combination of letters and numbers). -Enter your new password:********** -Please confirm new password:********** -Success -``` - - - -#### 设置别名 - -给账户设置一个别名,如果用此账户建立节点,别名将作为节点来源显示 - -- **命令:setalias <address> <alias>** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | -| <alias> | 别名名称,必填 | - -返回信息 交易hash - -```json -"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" -``` - -示例 - -```shell -nuls>>> setalias Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT nuls_alias -"0020f94f36aefd59f9cca9bff3c018fc287dc6c0bcd7fbeb047133cadb5747e7d98d" -``` - - - -#### 导入账户keystore - -导入账户keystore文件,生成本地账户,如果本地已有该账户将无法导入。 - -- **命令:importkeystore <path> ** - -| 参数 | 说明 | -| ------------ | ------------------------------ | -| <path> | 待导入的keystore文件地址,必填 | - -注意:导入keystore文件生成账户时,如果该keystore是加密的要验证备份keystore时的密码。 - -返回信息 导入的账户地址 - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -示例 - -```shell -nuls>>> importkeystore /home/charlie/bin/NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy.keystore -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### 导入账户私钥 - -导入账户私钥,生成本地账户,如果本地已有该账户将无法导入。 - -- **命令:import <privatekey> ** - -| 参数 | 说明 | -| ------------------ | ---------------- | -| <privatekey> | 账户的私钥,必填 | - -注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。 - -返回信息 导入的账户地址 - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -示例 - -```shell -nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -Please confirm new password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### 导入账户私钥(覆盖导入) - -导入账户私钥,生成本地账户,如果本地已有该账户将执行覆盖导入。 - -- **命令:import <privatekey> ** - -| 参数 | 说明 | -| ------------------ | ---------------- | -| <privatekey> | 账户的私钥,必填 | - -注意:导入私钥时,可以设置新的密码,如果账户不需要加密则不用输入新密码。 - -覆盖导入:如果本地已存在该账户,执行覆盖导入后,导入前账户的密码将会被改为新设置的密码,如果本次导入未给账户设置密码,那账户将变成未加密账户(即使导入之前的账户是加密的)。 - -返回信息 导入的账户地址 - -```json -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - -示例 - -```shell -nuls>>> import 00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655 -Please enter the password (password is between 8 and 20 inclusive of numbers and letters), If you do not want to set a password, return directly. -Enter your password:********** -Please confirm new password:********** -"NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy" -``` - - - -#### 查询账户信息 - -根据账户地址查询账户信息 - -- **命令:getaccount <address>** - -| 参数 | 说明 | -| --------------- | :------------- | -| <address> | 账户地址,必填 | - -返回信息 - -```json -{ - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址 - "alias" : null,//别名 - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥 - "priKey" : "",//私钥(如果账户设置了密码,该项为空) - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空) - "extend" : null, - "createTime" : "2018-07-13 11:39:14",//创建时间 - "encrypted" : true//是否加密(是否设置了密码) -} -``` - -示例 - -```shell -nuls>>> getaccount NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -{ - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", - "alias" : null, - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", - "priKey" : "", - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", - "extend" : null, - "createTime" : "2018-07-13 11:39:14", - "encrypted" : true -} -``` - - - -#### 查询账户列表 - -根据分页参数查询账户列表,所有账户以创建时间倒序输出。 - -- **命令:getaccounts <pageNumber> <pageSize>** - -| 参数 | 说明 | -| ------------------ | -------------------------------- | -| <pageNumber> | 页数,需要获取第几页的数据,必填 | -| <pageSize> | 每一页显示的数据条数,必填 | - -返回信息,将输出账户集合 - -```json -[ { - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy",//账户地址 - "alias" : null,//别名 - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875",//公钥 - "priKey" : "",//私钥(如果账户设置了密码,该项为空) - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8",//加密后的私钥(如果账户没有设置了密码,该项为空) - "extend" : null, - "createTime" : "2018-07-13 11:39:14",//创建时间 - "encrypted" : true//是否加密(是否设置了密码) -}, { - "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", - "alias" : null, - "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", - "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", - "encryptedPriKey" : "", - "extend" : null, - "createTime" : "2018-07-13 11:02:23", - "encrypted" : false -} ] -``` - - - -示例 获取账户列表 显示第一页,每页显示2条 - -```shell -nuls>>> getaccounts 1 2 -[ { - "address" : "NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy", - "alias" : null, - "pubKey" : "03f364bae9bb632a9b957522f150cb501dbc950e3700cff7a3679ed8820c486875", - "priKey" : "", - "encryptedPriKey" : "712149fad00350cdfee4d20850a9e5c1e9d7e9c1562dabc593cbc9b5ac57e99f1549748ff2421b3f6830f34bff7c69d8", - "extend" : null, - "createTime" : "2018-07-13 11:39:14", - "encrypted" : true -}, { - "address" : "NsdwsD8n3GrW9Sx43eLZ3xv8C858ovE2", - "alias" : null, - "pubKey" : "035f063012385032d19082a302ba774af4e02abe32e43120d3bfe82ec72dcdeafa", - "priKey" : "3ba27d6a53fb52f52443d8d895155ca113c632fd8a1bd6e7846933d1fb378ecb", - "encryptedPriKey" : "", - "extend" : null, - "createTime" : "2018-07-13 11:02:23", - "encrypted" : false -} ] -``` - - - -#### 查询账户私钥 - -根据账户地址查询账户私钥,如果账户已加密,则需要输入密码 - -- **命令:getprikey <address> ** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | - -返回信息 导入的账户地址 - -```json -"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" -``` - -示例 - -```shell -nuls>>> getprikey NsdyM1Ls5qw8wutvAQsr93jxgq8qYAZy -Please enter the password. -Enter your password:********** -"00a166d10c2cc4cd8f76449ff699ab3eee44fe4f82b4bb866f7bba02751a6fd655" -``` - - - -#### 查询账户余额 - -根据账户地址查询账户余额 - -- **命令:getbalance <address> ** - -| 参数 | 说明 | -| --------------- | ---------------- | -| <address> | 账户的地址,必填 | - -返回信息 导入的账户地址 - -```json -{ - "balance" : "9999998.99",//余额 - "locked" : "0",//已锁定余额 - "usable" : "9999998.99"//可用余额 -} -``` - -示例 - -```shell -nuls>>> getbalance Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -{ - "balance" : "9999998.99", - "locked" : "0", - "usable" : "9999998.99" -} -``` - - - -#### 转账 - -根据账户地址将NULS转入另一账户地址中,如果转出账户有密码则需要验证密码,否则直接转出。 - -- **命令:transfer <address> <toAddress> <amount> [remark] ** - -| 参数 | 说明 | -| ----------------- | ----------------------------------------------- | -| <address> | 转出地址,必填 | -| <toAddress> | 接收地址,必填 | -| <amount> | 转账数量,最多可以有8位小数(单位:NULS),必填 | -| [remark] | 备注信息,选填 | - -返回信息 转账交易hash - -```json -"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" -``` - -示例 - -```shell -nuls>>> transfer Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 100 转账 -Please enter the password. -Enter your password:********** -"00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596" -``` - - - -#### 查询交易详情 - -根据交易hash查询交易详细信息 - -- **命令:gettx <hash>** - -| 参数 | 说明 | -| ------------ | -------------- | -| <hash> | 交易hash,必填 | - -返回信息 交易详细信息 - -```json -{ - "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash - "type" : "transfer",//交易类型(此示例为转账交易) - "time" : "2018-07-16 11:21:46",//交易时间 - "blockHeight" : 26269,//打包交易的区块高度 - "fee" : "0.001",//交易手续费 - "value" : "100",//(转账)交易数量 - "remark" : "转账",//备注 - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1",//签名 - "status" : "confirm",//交易确认状态(已确认或者未确认) - "confirmCount" : 46,//确认次数 - "size" : 254,//交易大小 - "inputs" : [ {//交易的输入 - "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979998.98", - "lockTime" : 0 - } ], - "outputs" : [ {//交易的输出 - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 0, - "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T"//交易输出的目标地址(此数据相当于转出100给目标地址) - "value" : "100", - "lockTime" : 0, - "status" : "usable" - }, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596",//交易hash - "index" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT",//交易输出的目标地址(此数据相当于找零给自己) - "value" : "9979898.979", - "lockTime" : 0, - "status" : "usable" - } ] -} -``` - -示例 查询转账交易 - -```shell -nuls>>> gettx 00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596 -{ - "hash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "type" : "transfer", - "time" : "2018-07-16 11:21:46", - "blockHeight" : 26269, - "fee" : "0.001", - "value" : "100", - "remark" : "转账", - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c530046304402202932ea77976a603b832861c64f868a34e9ad59b728d3a8eeba27269f05b4267c0220217a6e1b97fb3f65e6711434e17e399f43e168f3699edb2aba8618bdd3f410e1", - "status" : "confirm", - "confirmCount" : 46, - "size" : 254, - "inputs" : [ { - "fromHash" : "002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979998.98", - "lockTime" : 0 - } ], - "outputs" : [ { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 0, - "address" : "NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T", - "value" : "100", - "lockTime" : 0, - "status" : "usable" - }, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "index" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : "9979898.979", - "lockTime" : 0, - "status" : "usable" - } ] -} -``` - - - -#### 查询交易列表 - -根据账户地址,查询该账户的交易列表 - -- **命令:gettxlist <address> <pageNumber> <pageSize>** - -| 参数 | 说明 | -| ------------------ | -------------------------------- | -| <address> | 账户地址,必填 | -| <pageNumber> | 页数,需要获取第几页的数据,必填 | -| <pageSize> | 每一页显示的数据条数,必填 | - -返回信息 交易详细信息 - -```json -[ { - "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e",//交易hash - "blockHeight" : 26473,//交易的区块高度 - "time" : "2018-07-16 11:55:43",//交易时间 - "txType" : "transfer",//交易类型 - "status" : 1,//确认状态 - "info" : "+100"//信息 -},{ - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "blockHeight" : 26269, - "time" : "2018-07-16 11:21:46", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -} ] -``` - -示例 - -```shell -nuls>>> gettxlist NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 1 10 -[ { - "txHash" : "0020153f76bec3433676a96ef343d7e432b7de16b3175a9c5f4579338f604989996e", - "blockHeight" : 26473, - "time" : "2018-07-16 11:55:43", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -}, { - "txHash" : "00200bef73ad728c48146c8a5eb0d76fe7325b85803c61d8357c16dba09ea33b3596", - "blockHeight" : 26269, - "time" : "2018-07-16 11:21:46", - "txType" : "transfer", - "status" : 1, - "info" : "+100" -} ] -``` - - - -#### 创建节点 - -根据账户地址创建节点,创建节点时需要一个打包账户地址(打包地址不能有密码),同时需要至少20000NULS的保证金。 - -- **命令:createagent <agentAddress> <packingAddress> <commissionRate> <deposit> ** - -| 参数 | 说明 | -| ---------------------- | ------------------------------------------------------------ | -| <agentAddress> | 创建节点的账户地址,必填 | -| <packingAddress> | 节点打包账户地址,必填(注:该账户不能设置密码,否则节点不能打包出块) | -| <commissionRate> | 代理佣金比例,范围:10~100,必填 | -| <deposit> | 创建节点的保证金,不能低于20000NULS,必填 | - -返回信息 返回节点的agent hash - -```json -"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" -``` - -示例 创建一个节点,佣金比例为10%,押金20000NULS。 - -```shell -nuls>>> createagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT NsdvAnqc8oEiNiGgcp6pEusfiRFZi4vt 10 20000 -Please enter the password. -Enter your password:********** -"002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e" -``` - - - -#### 加入共识(委托节点) - -根据账户地址和节点agentHash,加入共识,至少需要2000NULS - -- **命令:deposit <address> <agentHash> <deposit> ** - -| 参数 | 说明 | -| ----------------- | -------------------------------------- | -| <address> | 账户地址,必填 | -| <agentHash> | 节点的agentHash,必填 | -| <deposit> | 加入共识保证金,不能低于2000NULS,必填 | - -返回信息 加入共识的交易hash,如果要退出这笔共识,则需要该hash。 - -```json -"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" -``` - -示例 - -```shell -nuls>>> deposit NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 002006a5b7eb1d32ed6d7d54e24e219b112d4fdb8530db5506ee953b6f65a0fdb55e 5000 -"0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0" -``` - - - -#### 退出共识(退出委托) - -根据账户地址和加入共识时的交易hash来退出共识(委托),单个账户多次委托节点时,每次委托的交易是独立的,所以退出时也要通过单次委托时的交易hash来退出对应的那一次委托,而不会一次退出所有委托。 - -- **命令:withdraw <address> <txHash> ** - -| 参数 | 说明 | -| --------------- | ---------------------- | -| <address> | 账户地址,必填 | -| <txHash> | 委托时的交易hash,必填 | - -返回信息 退出共识交易hash - -```json -"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" -``` - -示例 - -```shell -nuls>>> withdraw NsdtmV5XkgSdpBXi65ueTsrv2W5beV2T 0020d349b7ad322ff958e3abfa799d9ac76341afa6e1fb4d3857353a5adc74ba3fd0 -"00201d70ac37b53d41c0e813ad245fc42e1d3a5d174d9148fbbbaed3c18d4d67bdbf" -``` - - - -#### 停止节点 - -停止节点,所有委托给节点的NULS将被退回,节点创建者账户的保证金将会被锁定72小时。 - -- **命令:stopagent <address> ** - -| 参数 | 说明 | -| --------------- | -------------- | -| <address> | 账户地址,必填 | - -返回信息 停止节点交易hash - -```json -"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" -``` - -示例 - -```shell -nuls>>> stopagent Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -Please enter the password. -Enter your password:********** -"0020f15eecd7c85be76521ed6af4d58a3810f7df58e536481cff4a96af6d4fddec5f" -``` - - - -#### 获取节点详情 - -根据节点agentHash获取节点详情 - -- **命令:getagent <agentHash> ** - -| 参数 | 说明 | -| ----------------- | --------------------- | -| <agentHash> | 节点agentHash值,必填 | - -返回信息 - -```json -{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址 - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址 - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址) - "deposit" : "20000",//创建节点的保证金 - "commissionRate" : 60.0,//代理佣金比例 - "agentName" : null,//节点名称(来源) - "agentId" : "35024DE6",//节点ID - "time" : "2018-07-16 16:33:38",//创建节点时间 - "blockHeight" : 28141,//创建节点交易的块高度 - "delHeight" : -1, - "status" : "consensus",//状态 - "creditVal" : 0.05,//信用值 - "totalDeposit" : "208000",//节点当前委托总额 - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5//参与数 -} -``` - -示例 - -```shell -nuls>>> getagent 0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6 -{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.05, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -} -``` - - - -#### 获取节点列表 - -根据共识节点列表 - -- **命令:getagents <pageNumber> <pageSize> ** - -| 参数 | 说明 | -| ------------------ | -------------------------------- | -| <pageNumber> | 页数,需要获取第几页的数据,必填 | -| <pageSize> | 每一页显示的数据条数,必填 | - -返回信息 - -```json -[{ - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//创建节点的账户地址 - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA",//节点打包(出块)地址 - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh",//奖励地址(默认为创建节点地址) - "deposit" : "20000",//创建节点的保证金 - "commissionRate" : 60.0,//代理佣金比例 - "agentName" : null,//节点名称(来源) - "agentId" : "35024DE6",//节点ID - "time" : "2018-07-16 16:33:38",//创建节点时间 - "blockHeight" : 28141,//创建节点交易的块高度 - "delHeight" : -1, - "status" : "consensus",//状态 - "creditVal" : 0.05,//信用值 - "totalDeposit" : "208000",//节点当前委托总额 - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5//参与数 -}] -``` - -示例 - -```shell -nuls>>> getagents 1 2 -[ { - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.18, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -}, { - "agentHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", - "agentAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", - "packingAddress" : "NsdwhLzjCLJp9V7zULU9KBerqkW971K7", - "rewardAddress" : "NsdtEdrY4QWGa8VUGW83hXbZsbKhbrTN", - "deposit" : "20000", - "commissionRate" : 10.0, - "agentName" : null, - "agentId" : "5CE291D8", - "time" : "2018-07-16 16:31:12", - "blockHeight" : 28126, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : -0.16, - "totalDeposit" : "208000", - "txHash" : "00202ef1977c1eea6fde8d1bf8d75b6f5650d62933e5fccc2d8d08023dea5ce291d8", - "memberCount" : 5 -} ] -``` - - - -#### 获取全网共识总体信息 - -查询全网共识总体信息 - -- **命令:getconsensus ** - -返回信息 - -```json -{ - "agentCount" : 6,//节点数 - "totalDeposit" : "1758000",//总委托数 - "rewardOfDay" : "0",//奖励 - "consensusAccountNumber" : 6,//共识账户数量 - "packingAgentCount" : 6//打包地址数量 -} -``` - -示例 - -```shell -nuls>>> getconsensus -{ - "agentCount" : 6, - "totalDeposit" : "1758000", - "rewardOfDay" : "0", - "consensusAccountNumber" : 6, - "packingAgentCount" : 6 -} -``` - - - -#### 获取单个账户的委托总览 - -根据账户地址获取该账户参与的所有委托(共识)信息的总览 - -- **命令:getdepositedinfo <address> ** - -| 参数 | 说明 | -| --------------- | -------------- | -| <address> | 账户地址,必填 | - -返回信息 - -```json -{ - "agentCount" : 1,//创建的节点数 - "totalDeposit" : "1600000",//总共委托的数量 - "joinAgentCount" : 6,//加入委托的节点数 - "usableBalance" : "8048998.869",//可用余额 - "reward" : "219.65910271",//得到的奖励总数 - "rewardOfDay" : "219.65910271",//一天得到的奖励数 - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd"//节点hash -} -``` - -示例 - -```shell -nuls>>> getdepositedinfo Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT -{ - "agentCount" : 1, - "totalDeposit" : "1600000", - "joinAgentCount" : 6, - "usableBalance" : "8048998.869", - "reward" : "219.65910271", - "rewardOfDay" : "219.65910271", - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd" -} -``` - - - -#### 获取单个账户的委托信息列表 - -根据地址获取该账户参与的委托信息列表(返回共识信息列表),当入参中跟上agentHash可以查看账户在某一个节点下的委托信息列表 - -- **命令:getdepositeds <address> <pageNumber> <pageSize> [agentHash] ** - -| 参数 | 说明 | -| ------------------ | -------------------------------- | -| <address> | 账户地址,必填 | -| <pageNumber> | 页数,需要获取第几页的数据,必填 | -| <pageSize> | 每一页显示的数据条数,必填 | -| [agentHash] | 节点Hash,选填 | - -返回信息 - -```json -[{ - "deposit" : "2000",//委托金额 - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//委托者地址 - "time" : "2018-07-16 16:38:25",//时间 - "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221",//委托交易hash - "blockHeight" : 28148,//交易的块高度 - "delHeight" : -1, - "status" : "consensus",//节点状态 - "agentName" : "35024DE6",//节点名 - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh"//节点地址 -}] -``` - -示例 - -```shell -nuls>>> getdepositeds Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 -[ { - "deposit" : "2000", - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "time" : "2018-07-16 16:38:25", - "txHash" : "0020c93d039b57361a141470b3630c3cf6fa304b1acaeabb7a26a772f434d24de221", - "blockHeight" : 28148, - "delHeight" : -1, - "status" : "consensus", - "agentName" : "35024DE6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh" -}, { - "deposit" : "2000", - "agentHash" : "00202794351e662e53f16fe04dd9217731463c3b24a6ee6cf80c9ba2d3e5e09eb7fd", - "address" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "time" : "2018-07-16 16:38:43", - "txHash" : "00205278ce2eeaf9da7acc13ce81293a01a3f44a1de09e4e0b3ec078884a65700234", - "blockHeight" : 28149, - "delHeight" : -1, - "status" : "consensus", - "agentName" : "E09EB7FD", - "agentAddress" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT" -} ] -``` - - - -#### 获取单个账户的委托节点列表 - -根据地址查询该账户委托的节点列表(返回节点信息列表) - -- **命令:getdepositedagents <address> <pageNumber> <pageSize> ** - -| 参数 | 说明 | -| ------------------ | -------------------------------- | -| <address> | 账户地址,必填 | -| <pageNumber> | 页数,需要获取第几页的数据,必填 | -| <pageSize> | 每一页显示的数据条数,必填 | - -返回信息 - -```json -[ { - "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf",//节点hash - "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//创建节点的账户地址 - "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr",//节点打包(出块)地址 - "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto",//奖励地址(默认为创建节点地址) - "deposit" : "20000",//创建节点的保证金 - "commissionRate" : 40.0,//代理佣金比例 - "agentName" : null,//节点名称(来源) - "agentId" : "0198ACAF",//节点ID - "time" : "2018-07-16 16:32:52",//创建节点时间 - "blockHeight" : 28136,//创建节点交易的块高度 - "delHeight" : -1, - "status" : "consensus",//状态 - "creditVal" : -0.91,//信用值 - "totalDeposit" : "204000",//节点当前委托总额 - "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "memberCount" : 3//参与数 -}] -``` - -示例 获取第一页,每页显示两条 - -```shell -nuls>>> getdepositedagents Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto 1 2 -[ { - "agentHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "agentAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "packingAddress" : "Nse77VDHtiQ6WnkEhgCA7TbfNkoH9iyr", - "rewardAddress" : "Nse6UxwHXNEDsySTnZr4hNfGwFZwkDto", - "deposit" : "20000", - "commissionRate" : 40.0, - "agentName" : null, - "agentId" : "0198ACAF", - "time" : "2018-07-16 16:32:52", - "blockHeight" : 28136, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : -0.91, - "totalDeposit" : "204000", - "txHash" : "0020617f9be18306fcdf95917fad80f4d15c51426667825ad5a6968ec0ee0198acaf", - "memberCount" : 3 -}, { - "agentHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "agentAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "packingAddress" : "NsdwvEJuPC3hA5ws7VQGwXN77vqsM1PA", - "rewardAddress" : "Nsdy5AZmMkYQzQvfuEgVzwdmndnMYNmh", - "deposit" : "20000", - "commissionRate" : 60.0, - "agentName" : null, - "agentId" : "35024DE6", - "time" : "2018-07-16 16:33:38", - "blockHeight" : 28141, - "delHeight" : -1, - "status" : "consensus", - "creditVal" : 0.91, - "totalDeposit" : "208000", - "txHash" : "0020d349117a35c3b9c1e64f442d7750aae941162018f9d8d4c1db57565235024de6", - "memberCount" : 5 -} ] -``` - - - -#### 获取最新的区块头信息 - -获取最新的区块头信息 - -- **命令:getbestblockheader** - -返回信息 - -```json -{ - "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e",//区块hash - "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d",//前一区块hash - "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877",//梅克尔hash - "time" : "2018-07-17 10:25:40",//区块生成时间 - "height" : 33950,//区块高度 - "txCount" : 1,//区块打包交易数量 - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 - "roundIndex" : 668413,//共识轮次 - "consensusMemberCount" : 1,//参与共识成员数量 - "roundStartTime" : "2018-07-17 10:25:30",//当前轮次开始时间 - "packingIndexOfRound" : 1,//当前轮次打包出块的名次 - "reward" : "0",//共识奖励 - "fee" : "0",//区块的打包手续费 - "confirmCount" : 0,//确认次数 - "size" : 204,//区块大小 - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9"//签名 -} -``` - -示例 - -```shell -nuls>>> getbestblockheader -{ - "hash" : "00206c4ae1d90fdfd875ee3bf84e72615db8bc628f015db089f8a6304ed46a47db5e", - "preHash" : "00207ec8c85a6844899806f55cd9223efa091b548e5cc093ee7833f1c0208254957d", - "merkleHash" : "002019aff9431c5b409df7af48a64a50e4e9a0af24cc309d6eefa84deada2a438877", - "time" : "2018-07-17 10:25:40", - "height" : 33950, - "txCount" : 1, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 668413, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-17 10:25:30", - "packingIndexOfRound" : 1, - "reward" : "0", - "fee" : "0", - "confirmCount" : 0, - "size" : 204, - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100ece231eec6765c3d3cd7a4b74ef227eea05c3511e04ea46bc1b518a51a624e48022022208161b3064f261233bfa0c00308bf5b56421401ba7dd02232bac5077935b9" -} -``` - - - -#### 查询区块信息 - -根据区块高度或者区块hash,查询区块信息,必须并且只能选择一种参数作为查询条件。 - -- **命令:getblock <hash> | <height> ** - -| 参数 | 说明 | -| -------------- | ------------ | -| <hash> | 区块的hash值 | -| <height> | 区块的高度 | - -返回信息 - -```json -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash - "time" : "2018-07-16 16:29:30",//区块生成时间 - "height" : 28115,//区块高度 - "txCount" : 2,//区块打包交易数量 - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 - "roundIndex" : 662578,//共识轮次 - "consensusMemberCount" : 1,//参与共识成员数量 - "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间 - "packingIndexOfRound" : 1,//当前轮次打包出块的名次 - "reward" : "0.001",//共识奖励 - "fee" : "0.001",//区块的打包手续费 - "confirmCount" : 6174,//确认次数 - "size" : 507,//区块大小 - "txList" : [ {//交易集合 - "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841",//交易hash - "type" : "coinbase",//交易类型 - "time" : "2018-07-16 16:29:30",//交易时间 - "blockHeight" : 28115,//交易所在区块高度 - "fee" : "0",//交易手续费 - "value" : null, - "remark" : null, - "scriptSig" : null, - "status" : "confirm", - "confirmCount" : 6174, - "size" : 54, - "inputs" : [ ],//交易的输入 - "outputs" : [ //交易的输出 - { - "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "value" : 100000, - "lockTime" : 29115 - } - ] - }], - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名 -} -``` - -示例 根据高度获取区块 - -```shell -nuls>>> getblock 28115 -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", - "time" : "2018-07-16 16:29:30", - "height" : 28115, - "txCount" : 2, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 662578, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-16 16:29:20", - "packingIndexOfRound" : 1, - "reward" : "0.001", - "fee" : "0.001", - "confirmCount" : 6174, - "size" : 507, - "txList" : [ { - "hash" : "0020648f1d25237ba3614237a52c2121e51608f3822ac57a0e67d6a53e84c867e841", - "type" : "coinbase", - "time" : "2018-07-16 16:29:30", - "blockHeight" : 28115, - "fee" : "0", - "value" : null, - "remark" : null, - "scriptSig" : null, - "status" : "confirm", - "confirmCount" : 6174, - "size" : 54, - "inputs" : [ ], - "outputs" : [ { - "address" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "value" : 100000, - "lockTime" : 29115 - } ] - }, { - "hash" : "0020217945b6804801e0860913d24bf1ca500f9b77518a2be190c1afe63334b3ee2b", - "type" : "transfer", - "time" : "2018-07-16 16:29:27", - "blockHeight" : 28115, - "fee" : "0.001", - "value" : null, - "remark" : null, - "scriptSig" : "2103f68aeb83f3a4fdf9b49259a6e8eae97cf73c7a0a1c52da8a1f9c09312a6d3c53004730450221008a78bd954ea2f0f5be72217f0858faaf408b2e70f8d4d5aebc9ead9eb6e3aa22022015305c46eab978b08fbc23608c064306ea150be6552bb51cc83badef68217663", - "status" : "confirm", - "confirmCount" : 6174, - "size" : 249, - "inputs" : [ { - "fromHash" : "0020f98434eb71e62bfda9a2708689c2f44b58f5b22299490f5956c35d54f2d48459", - "fromIndex" : 1, - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : 972899896100000 - } ], - "outputs" : [ { - "address" : "NsdxeBuwQBStXHQ6mcaHyDpnTKijD5ne", - "value" : 3000000000000, - "lockTime" : 0 - }, { - "address" : "Nse2TpVsJd4gLoj79MAY8NHwEsYuXwtT", - "value" : 969899896000000, - "lockTime" : 0 - } ] - } ], - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" -} -``` - - - -#### 查询区块头信息 - -根据区块高度或者区块hash,查询区块头信息,必须并且只能选择一种参数作为查询条件。 - -- **命令:getblockheader <hash> | <height> ** - -| 参数 | 说明 | -| -------------- | ------------ | -| <hash> | 区块的hash值 | -| <height> | 区块的高度 | - -返回信息 - -```json -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817",//区块hash - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954",//前一区块hash - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158",//梅克尔hash - "time" : "2018-07-16 16:29:30",//区块生成时间 - "height" : 28115,//区块高度 - "txCount" : 2,//区块打包交易数量 - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw",//打包地址 - "roundIndex" : 662578,//共识轮次 - "consensusMemberCount" : 1,//参与共识成员数量 - "roundStartTime" : "2018-07-16 16:29:20",//当前轮次开始时间 - "packingIndexOfRound" : 1,//当前轮次打包出块的名次 - "reward" : "0.001",//共识奖励 - "fee" : "0.001",//区块的打包手续费 - "confirmCount" : 6174,//确认次数 - "size" : 507,//区块大小 - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf"//签名 -} -``` - -示例 根据高度获取区块头 - -```shell -nuls>>> getblockheader 28115 -{ - "hash" : "0020c40f471756c88e7487fcc0d428545232120071b58f35e450891237d7b41eb817", - "preHash" : "0020fb1fd03cda7e2b6585256f4da85bdac7d8fc8bafa0740b8eb0ed577f3020b954", - "merkleHash" : "0020474c5a353f235e8e8514328e1e98d6b653d4a5445473d160691e39121cd8b158", - "time" : "2018-07-16 16:29:30", - "height" : 28115, - "txCount" : 2, - "packingAddress" : "NsdyF8gBxAfxCyiNbLzsENUvbJZ27mWw", - "roundIndex" : 662578, - "consensusMemberCount" : 1, - "roundStartTime" : "2018-07-16 16:29:20", - "packingIndexOfRound" : 1, - "reward" : "0.001", - "fee" : "0.001", - "confirmCount" : 6280, - "size" : 204, - "scriptSig" : "210381e44e0c2fffadc94603a41514f3e5b1c5fd53166be73eb8f49ce8c297059e5600473045022100d25b815fa30376247692fad856d3984acf45c9b49edd3d222e3afdab3169520c02200565a486e33358301848bf3d704c187ff8b2d1e859c93b704f713abb984584bf" -} -``` - - - -#### 查询网络信息 - -查询网络基本信息 - -- **命令:getnetinfo ** - -返回信息 - -```json -{ - "localBestHeight" : 35317,//本地最新区块高度 - "netBestHeight" : 35317,//网络最新区块高度 - "timeOffset" : "0ms",//网络时间偏移值 - "inCount" : 0,//被动连接节点数量 - "outCount" : 1//主动连接节点数量 -} -``` - -示例 - -```shell -nuls>>> getnetinfo -{ - "localBestHeight" : 35317, - "netBestHeight" : 35317, - "timeOffset" : "0ms", - "inCount" : 0, - "outCount" : 1 -} -``` - - - -#### 查询网络节点IP - -查询网络节点IP - -- **命令:getnetnodes ** - -返回信息 - -```json -[ "192.168.1.223" ] -``` - -示例 根据高度获取区块 - -```shell -nuls>>> getnetnodes -[ "192.168.1.223" ] -``` - - - -#### 查询当前版本信息 - -查询当前版本号 - -- **命令:version ** - -返回信息 - -```json -[ "192.168.1.223" ] -``` - -示例 - -```shell -nuls>>> version -{ - "myVersion" : "1.0.0", - "newestVersion" : "0.9.11", - "upgradable" : false, - "infromation" : "地址格式修改,Change the format of address,节点发现逻辑优化,Peer discovery logic optimization,区块下载逻辑优化,Block download logic optimization,性能、稳定性优化,Performance and stability optimization" -} -``` - - - -#### 版本更新 - -查询当前版本号 - -- **命令:upgrade <version> ** - -示例 - -```shell -nuls>>> version 1.0.0 -``` - - - -#### 退出钱包命令程序 - -退出操作钱包的命令行程序,不会退出已启动的钱包节点。 - -- **命令:exit** - -示例 - -```shell -nuls>>> exit -``` diff --git a/source/zh-cn/docs/sdk.md b/source/zh-cn/docs/sdk.md deleted file mode 100644 index d980adad..00000000 --- a/source/zh-cn/docs/sdk.md +++ /dev/null @@ -1,2800 +0,0 @@ -title: NULS-SDK ---- - -## 介绍 -本文档是NULS Java SDK的用户指南,描述了NULS服务提供的账户、交易、区块等相关基础功能接口的使用说明。 -### 约定 -- 所有SDK接口统一返回Result(说明见文末附件数据解释) -- 每个接口描述的返回对象是指Result中data属性的内容 -- 除特别注明外,本文档NULS都以Na为单位 1NULS = 100,000,000Na -- 运行SDK前,需要确认NULS节点服务已经启动并工作正常 -- 推荐使用JDK1.8+ - -### 版本更新记录 - - - -| 版本 | 更新日期 | 更新内容 | -| :-------: | :--------: | :----------------------------------------------------------: | -| v0.9.11.0 | 2018-06-19 | 对接NULS服务各项基础功能的接口 | -| v0.9.11.1 | 2018-06-22 | 新增获取最新区块的高度和hash的接口(3.6,3.7),修改2.1 | -| v0.9.14 | 2018-07-04 | 修改快速入门中SDK初始化方法改为init,以及SDK的使用方式, 修改返回封装对象名称(去掉Dto等) | -| v0.9.15 | 2018-07-07 | 新增4个共识接口,4.1——4.4 | -| v0.9.16 | 2018-07-11 | 新增接口4.5 | -| v1.0.1 | 2018-07-13 | 新增错误码 | -| v1.1.0 | 2018-09-28 | 新增多账户转账接口 | - - - -## 快速入门 -### 1.引入文件 -使用构建工具导入jar包 - -- maven方式 - -```xml - - io.nuls.sdk - sdk-all - 1.0.1 - -``` - -### 2.创建SDK实例 -首先添加SDK命名空间 - -```java -//SDK启动类命名空间 -import io.nuls.sdk.SDKBootstrap; -import io.nuls.sdk.model.Result; -//引入SDK调用工具的命名空间 -import io.nuls.sdk.tool.NulsSDKTool; -``` - -引入后 使用下列代码生成一个实例client - -- 初始化SDK -- 初始化方法不传参数时,默认PRC ip和端口分别为`127.0.0.1`,`8001` - -```java -//默认 -SDKBootstrap.init(); -//传入NULS服务的ip,port -SDKBootstrap.init("192.168.1.88", "8001"); -``` - -- 使用工具类调用接口方法 - - -```java -Result result = NulsSDKTool.createAccount("nuls123456"); -``` - *e.g 创建一个带密码的账户的完整示例* - -```java -import io.nuls.sdk.SDKBootstrap; -import io.nuls.sdk.model.Result; -//根据需求引入对应模块的命名空间 -import io.nuls.sdk.tool.NulsSDKTool; - -public static void main(String[] args) { - SDKBootstrap.init(); - Result result = NulsSDKTool.createAccount("nuls123456"); -} -``` --- -### 账户 AccountService -#### 1.1 创建账户 -接口 - -**`Result createAccount(int count, String password);`** - -说明 -> 创建账户可根据传入的参数创建单个或多个,有密码或没有密码的账户; -> 成功创建的账户信息将被持久化至NULS服务本地数据库中。 -> -> 返回成功创建的账户地址集合 - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "list": [ //返回创建账户的地址集合 - "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv", - "2Cbkwxu34iCjsiHKBjqZDNjoVbLMcJv" - ] - } -} -``` - - -*e.g 示例代码* - -```java -//创建一个没有密码的账户 -createAccount(); -//创建一个有密码的账户 -createAccount("nuls123456"); -//创建3个没有密码的账户 -createAccount(3); -//创建3个有密码的账户 -createAccount(3, "nuls123456"); -``` ---- - -#### 1.2 创建离线账户 -接口 - -**`Result createOfflineAccount(int count, String password)`** - -说明 - -> 直接离线创建一个账户并完整返回, 不会和NULS底层交互,不会进行持久化操作 -> Create encrypted off-line accounts (Not saved to the database) -> -> Result.data `List` - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
countint非必填创建账户的数量(默认1)
passwordString非必填设置账户密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "list":[ - { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - }, - { - "address": "2CiBQg72BCLmLqttRpPfp8ECRCBwbdD", - "alias": null, - "pubKey": "020159dc5cc74463f346b71c08dd934a823e9e6fe727d8d3c577e7d462e1a364bb", - "extend": null, - "createTime": 1529314943624, - "encrypted": true, - "priKey": "", - "encryptedPriKey": "5664f746654fb111e967bb3922910b16340f1e60ff1b281c7a333179d7b82d6220bb12d1c058d9cd06099d4f443a4cb0" - } - ] - } -} -``` - -*e.g 示例代码* - -```java -//创建一个没有密码的离线账户 -createOfflineAccount(); -//创建一个有密码的离线账户 -createOfflineAccount("nuls123456"); -//创建3个没有密码的离线账户 -createOfflineAccount(3); -//创建3个有密码的离线账户 -createOfflineAccount(3, "nuls123456"); -``` - ---- - -#### 1.3 获取账户 - -接口 - -**`Result getAccount(String address)`** - -说明 - -> 根据账户地址获取一个账户的信息 -> -> Result.data `AccountInfo` - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - } -} -``` - -*e.g 示例代码* - -```java -getAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.4 获取设置别名的手续费 -接口 - -**`Result getAliasFee(String address, String alias)`** - -说明 - -> 根据账户地址和待设置的别名名称获取设置该别名所需要的手续费(不包含设置别名固定1NULS的花费) -> -> Result.data `double`, unit is `NULS` - -**注意!** 此接口返回的手续费单位为`NULS` - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "value": 0.01 //(单位为NULS) - } -} -``` - -*e.g 示例代码* - -```java -getAliasFee("2ChqBTvFXttQsghj8zQpcdv76TQU8G5","factory666"); -``` ---- - -#### 1.5 获取账户列表 -接口 - -**`Result getAccountList(int pageNumber, int pageSize)`** - -说明 - -> 根据分页参数获取账户列表 -> -> Result.data Page `List` - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
pageNumberint必填页码,必须大于0
pageSizeint必填每页返回数据记录数量, 取值范围1~100
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "pageNumber": 1, - "pageSize": 10, - "total": 100, - "pages": 10, - "list": [ - { - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) - }, - { - "address": "2Cid96JrTGA2XaNG6zXrRKh18kLUbLP", - "alias": null, - "pubKey": "033da2433ef4ca111bfeefaadd9fe0f5874f3aac5186109f9de10a9eed6f48f184", - "extend": null, - "createTime": 1529311250627, - "encrypted": true, - "priKey": null, - "encryptedPriKey": null - } - ... - - ] - } -} -``` - -*e.g 示例代码* - -```java -getAccountList(1, 10); -``` ---- - -#### 1.6 根据账户别名获取账户地址 -接口 - -**`Result getAddressByAlias(String alias)`** - -说明 -> 根据账户别名获取账户地址字符串 -> -> Result.data `String` - - - - - - - - - - - - - - -
参数类型是否必填说明
aliasString必填账户别名
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "2ChDcC1nvki521xXhYAUzYXt4RLNULS" - } -} -``` -*e.g 示例代码* - -```java - getAddressByAlias("factory666"); -``` ---- - -#### 1.7 获取账户私钥 -接口 - -**`Result getPrikey(String address, String password)`** - -说明 -> 根据账户地址和密码获取账户私钥,返回私钥字符串 -> -> Result.data `String` - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24" - } -} -``` -*e.g 示例代码* - -```java -//有密码的账户调用方式 -getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -//无密码的账户调用方式 -getPrikey("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.8 验证别名是否可以使用 -接口 - -**`Result isAliasUsable(String alias)`** - -说明 -> 根据别名名称验证别名是否可用(是否没有被使用) -> -> Result - - - - - - - - - - - - - - -
参数类型是否必填说明
aliasString必填别名名称
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示别名可以使用 - "success": true, - "data": { - "value":true - } -} -``` -- 返回 别名不可用的情况 - -```json -{ //表示别名不可以使用 - "success": true, - "data":{ - "value": false - } -} -``` -- 返回错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -isAliasUsable("factory666"); -``` ---- - -#### 1.9 备份账户 -接口 - -**`Result backupAccount(String address, String path, String password)`** - -说明 - -> 根据账户地址,密码以及输出地址备份账户(导出.keystore文件),如果账户是加密的则导出的keystore是由当前密码加密的,导入时需要验证此时账户的密码 -> -> Result 返回生成的文件地址 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
pathString必填将要存放备份文件的文件夹,传null时,将备份到NULS服务的当前目录
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "/Users/lichao/Downloads/2ChDcC1nvki521xXhYAUzYXt4RLNULS.accountkeystore" - } -} -``` -*e.g 示例代码* - -```java -//备份一个没有密码的账户至当前目录 -backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", null); -//备份一个有密码的账户至/backup目录 -backupAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "/backup", "nuls123456"); -``` ---- - -#### 1.10 导入账户 -接口 - -**`Result importAccountByKeystore`** - -说明 - -> 根据keystore文件导入账户, 如果keystore文件是由加密的account备份生成的,则需要验证备份时账户的密码。 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
path/fileReaderString/FileReader必填待导入的.keystore文件的url,或者由.keystore文件生成的FileReader对象
passwordString非必填.keystore文件对应的账户密码,如果导出.keystore时对应账户没有加密则不填
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"2ChDcC1nvki521xXhYAUzYXt4RLNULS" - } -} -``` -*e.g 示例代码* - -```java -//导入一个有密码的账户 -importAccountByKeystore("/backup/XXXXXX.keystore", "nuls123456", true); -importAccountByKeystore(fileReader, "nuls123456", true); -//导入一个没有密码的账户 -importAccountByKeystore("/backup/XXXXXX.keystore", false); -importAccountByKeystore(fileReader, false); -``` ---- - -#### 1.11 导入账户(私钥) -接口 - -**`Result importAccountByPriKey(String privateKey, String password, boolean overwrite)`** - -说明 - -> 根据私钥导入账户 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
privateKeyString必填账户私钥
passwordString非必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
overwriteboolean必填true: 执行覆盖导入; false: 如果该账户已经在钱包里存在,将不执行导入操作,并返回错误提示。
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"2CiU1CmB6c9jmSLDNBe6PouA7NgNULS" - } -} -``` -*e.g 示例代码* - -```java -//导入账户时设置密码 -importAccountByPriKey("1f9d3ad044e0e120......", "nuls123456", true); -//导入账户时不设置密码 -importAccountByPriKey("1f9d3ad044e0e120......", true); -``` ---- - -#### 1.12 验证账户是否加密 -接口 - -**`Result isEncrypted(String address)`** - -说明 - -> 验证账户是否加密 -> -> Result - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示已加密 - "success": true, - "data": { - "value":true - } -} -``` -- 返回 未加密 - -```json -{ - "success": true, - "data":{ - "value": false - } -} -``` -- 返回错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` - -*e.g 示例代码* - -```java -isEncrypted("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -``` ---- - -#### 1.13 移除账户 -接口 - -**`Result removeAccount(String address, String password)`** - -说明 - -> 移除账户 -> -> Result - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString非必填账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5"); -removeAccount("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -``` ---- - -#### 1.13 设置密码 -接口 - -**`Result setPassword(String address, String password)`** - -说明 - -> 为未加密的账户设置密码,已加密账户不能调用此接口 -> -> Result - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString必填设置新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -setPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456"); -``` ---- - -#### 1.14 修改密码 -接口 - -**`Result resetPassword(String address, String password, String newPassword)`** - -说明 - -> 为已加密的账户修改密码,未加密账户不能调用此接口 -> -> Result - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
passwordString必填账户当前密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ //表示成功 - "success": true, - "data": { - "value":true - } -} -``` - -- 返回不成功 以及错误的情况,例如参数错误 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` -*e.g 示例代码* - -```java -resetPassword("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "nuls123456", "NULS111111"); -``` ---- - -#### 1.15 设置别名 -接口 - -**`Result setAlias(String address, String alias, String password)`** - -说明 - -> 为账户设置一个别名 -> -> Result 返回设置别名的交易hash - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
aliasString必填待设置的别名名称
passwordString密码账户密码,如果账户没有加密则不填
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data":{ - "value":"0020d7a69747778f6f02e2b0171640bc98aa19c53700988b7765c195ae691f3202c6" - } -} -``` -- 错误示例 - -```json -{ - "success": false, - "data":{ - "code": "ACT007", - "msg": "The account already set an alias" - } -} -``` -*e.g 示例代码* - -```java -setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666", "NULS111111"); -setAlias("2ChqBTvFXttQsghj8zQpcdv76TQU8G5", "factory666"); -``` ---- - -#### 1.16 设置离线账户密码 -接口 - -**`Result setPasswordOffline(String address, String priKey, String password)`** - -说明 - -> 设置离线账户密码, sdk中独立加密,不与NULS服务交互 -> -> Result 返回加密后的私钥(encryptedPriKey) - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
priKeyString必填账户的私钥
passwordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" - } -} -``` -*e.g 示例代码* - -```java -setPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a","nuls123456"); -``` ---- - -#### 1.17 修改离线账户密码 -接口 - -**`Result resetPasswordOffline(String address, String encryptedPriKey, String password, String newPassword)`** - -接口 - -> 修改离线账户密码, sdk中独立修改, 不与NULS服务交互 -> -> Result 返回新密码生成的加密后的私钥(encryptedPriKey) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户的地址
encryptedPriKeyString必填加密后的私钥
passwordString必填原密码
newPasswordString必填新密码, 密码长度8~20,需同时包含字母和数字,不能输入空格
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"a770c1886f566c973b6eb99543ef03825a89ed16e20d8dbe320aed64a85d5863ca23df43ef16ce0475424a49e192b6f9" - } -} -``` -*e.g 示例代码* - -```java -resetPasswordOffline("2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr","25368dbc0ff7eea4fc6da22bc37e85d7976a3846f8b58d4dc0cf484e740ba1b61f96395fbe1ddf70ece9fd21fcd95e7a","NULS111111", "nuls123456"); -``` ---- - -### 交易 AccountLedgerService - -#### 2.1 创建转账交易 -接口 - -**`Result createTransaction(List inputs, List outputs, String remark)`** - -说明 - -> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
remarkString非必填交易备注
- -*e.g 示例代码* - -```java -String remark = "create transaction demo"; -long fee = 100000; -List inputs = new ArrayList<>(); -List outputs = new ArrayList<>(); - -//组装交易的inputs,示例中的input属性均必填 -Input input = new Input(); -input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); -input.setFromIndex(1); -input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") -input.setValue(1000000000L); -input.setLockTime(0); -inputs.add(input); - -//组装交易的outputs,示例中的output属性均必填 -Output output = new Output(); -output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); -output.setValue(1000000L); -output.setLockTime(0L); -outputs.add(output); - -output = new Output(); -output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); -output.setValue(1000000000L - 1000000 - fee); -output.setLockTime(0L); -outputs.add(output); - -Result result = NulsSDKTool.createTransaction(inputs, outputs, remark); -``` ---- - - -> **交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:100000 NA/1KB -> -> **交易大小的计算**:(124 + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 -> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 2.2 交易签名 - -接口 - -**`Result signTransaction(String txHex, String priKey, String address, String password)`** - -说明 - -> 通过私钥,给交易签名 -> -> Result.data `String` 签名后的交易,16进制后的序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
priKeyString必填交易的私钥
addressString必填私钥对应的地址,用于验证私钥合法性
passwordString非必填私钥的密码,如果私钥未加密可不传
- -*e.g 示例代码* - -```java -String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; -String priKey ="252f6d9d55b7ef539ea58df99ebaf71c9929bd9d0054338baf7a59c9b85b4fa631f816907c8"; -String address = "2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"; -String password = "NULS6352s!f"; -Result result = NulsSDKTool.signTransaction(txHex, priKey, address, password); -``` - -> - ---- - -#### 2.3 根据交易hash查询交易详情 -接口 - -**`Result getTxByHash(String hash)`** - -说明 - -> 根据交易hash查询交易详情 -> -> Result.data `Transaction` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填交易的hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 99900000000, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 1, - "confirmCount": 14, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9999899000000 - } - ], - "outputs": [ - { - "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "index": 0, - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0, - "status": 0 - }, - { - "txHash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "index": 1, - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0, - "status": 0 - } - ] - } -} -``` -*e.g 示例代码* - -```java -getTxByHash("041f3d2ceed........"); -``` ---- - -#### 2.4 转账 -接口 - -**`Result transfer(String address, String toAddress, String password, long amount, String remark)`** - -说明 - -> 发起转账交易 -> -> Result 返回交易hash - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填转出者账户的地址
toAddressString必填接收者账户的地址
passwordString非必填转出者账户的密码,如果账户没有加密则不填
amountlong必填转账金额(单位:Na)
remarkString必填备注
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value":"00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2" - } -} -``` -*e.g 示例代码* - -```java - //账户有密码 -transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgXXXX", "nuls123456", 8888800000000, "备注1NULS=10000000Na"); -//账户没有密码 -transfer("2ChDcC1nvki521xXhYAUzYXt4RLNULS", "2CiU1CmB6c9jmSLDNBe6PouA7NgNULS", 8888800000000, "备注1NULS=10000000Na"); -``` ---- - -#### 2.5 查询账户余额 -接口 - -**`Result getBalance(String address)`** - -说明 - -> 获取账户余额 -> -> Result.data `BalanceInfo ` - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填账户地址
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "balance": 1009899998900000, - "usable": 1009899998900000, - "locked": 0 - } -} -``` -*e.g 示例代码* - -```java -getBalance("2ChDcC1nvki521xXhYAUzYXt4RLNULS"); -``` ---- - -#### 2.6 广播交易 -接口 - -**`Result broadcastTransaction(String txHex);`** - -说明 - -> 广播交易 -> -> Result.data String 返回交易hash - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制交易序列化数据
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "002023c66d10cf9047dbcca12aee2235ff9dfe0f13db3c921a2ec22e0dd63331cb85" - } -} - -``` -*e.g 示例代码* - -```java -String txHex = "1f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d241f9d3ad044e0e1201e117b041f3d2ceedacb44688e57969620f3ad7a4d6e9d24"; -Result result = service.broadcastTransaction(txHex); -if(result.isSuccess()) { - String txHash = (String)result.getData(); -} -``` ---- - -#### 2.7 创建多地址转账交易 - -接口 - -**`Result createMultipleInputAddressTransaction(List inputs, List outputs, String remark)`** - -说明 - -> 通过用户传入的交易输入\输出,组装交易。传入的参数为json对象,详见e.g示例。**示例中input和output的属性都为必填项**。交易手续费为inputs和outputs总额的差值,手续费会根据交易大小存在一个最小值,低于最小值时,交易不会被打包。**有关手续费的计算会在后面详细说明** -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
inputsList<Input>必填交易引用的未花费输出
outputsList<Output>必填交易新生成的未花费输出
nInputAccountint必填输入账户数
remarkString非必填交易备注
- -*e.g 示例代码* - -```java -String remark = "create transaction demo"; -long fee = 100000; -List inputs = new ArrayList<>(); -List outputs = new ArrayList<>(); -int nInputAccount = 2; - -//组装交易的inputs,示例中的input属性均必填 -Input input = new Input(); -input.setFromHash("002023c66d10cf9047dbcca12aee3db3c921a2ec22e0dd63331cb85"); -input.setFromIndex(1); -input.setAddress("2ejPVMKST7h4Qsd5Dqa8Q9Psr47mj5") -input.setValue(1000000000L); -input.setLockTime(0); -inputs.add(input); - -//组装交易的outputs,示例中的output属性均必填 -Output output = new Output(); -output.setAddress("2CjPVMKST7h4Q5Dqa8Q9P9CwYSmN7mG"); -output.setValue(1000000L); -output.setLockTime(0L); -outputs.add(output); - -output = new Output(); -output.setAddress("2CXJEuoXZMajeTEgL6TgiSxTRRMwiMM"); -output.setValue(1000000000L - 1000000 - fee); -output.setLockTime(0L); -outputs.add(output); - -Result result = NulsSDKTool.createMultipleInputAddressTransaction(inputs,nInputAccount, outputs, remark); -``` - ------- - -> **交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:100000 NA/1KB -> -> **交易大小的计算**:(124*nInputAccount + 50 * inputs.length + 38 * outputs.length + remark.bytes.length )/1024 -> 124为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 2.8 多地址转账交易签名 - -接口 - -**`Result signMultipleAddressTransaction(String txHex, List privKeys, List passwords)`** - -说明 - -> 通过私钥,给交易签名 -> -> Result.data `String` 签名后的交易,16进制后的序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
txHexString必填十六进制的交易序列化数据
privKeysList必填交易的私钥
passwordsList必填私钥对应的密码(多个账户密码必须一样)
- -*e.g 示例代码* - -```java -String txHex ="020197320f96301001a78cb7fb8bb7b1710b4afa390d8341080fba7a47e8d030000000000000000"; -List priKeys = Arrays.asList("08a605b754bd1be1ba765fabd5cd218a545eb38b54ad26a7eb8a3378f724e5be", "00a710f9679fb6b5953bcfbea67a198e9c0d8888c43bad78a7241258e36aeaf65d"); -List passwords = Arrays.asList("123456","123456"); -Result result = NulsSDKTool.signMultiTransaction(txHex, priKeys, passwords); -``` - -> - -### 区块 BlockService - -#### 3.1 根据区块高度获取区块头 -接口 - -**`Result getblockHeader(int height)`** - -说明 - -> 根据区块高度获取区块头信息 -> -> Result.data `BlockHeader ` - - - - - - - - - - - - - - -
参数类型是否必填说明
heightint必填区块高度
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} -``` -*e.g 示例代码* - -```java -getblockHeader(10); -``` ---- - -#### 3.2 根据区块hash获取区块头 -接口 - -**`Result getblockHeader(String hash)`** - -说明 - -> 根据区块hash获取区块头 -> -> Result.data `BlockHeader` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填区块hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} -``` -*e.g 示例代码* - -```java -getblockHeader("041f3d2ceed........"); -``` ---- - -#### 3.3 根据区块高度获取区块 -接口 - -**`Result getBlock(int height)`** - -说明 - -> 根据区块高度获取区块 -> -> Result.data `Block ` - - - - - - - - - - - - - - -
参数类型是否必填说明
heightint必填区块高度
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", - "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", - "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", - "time": 1529323210000, - "height": 1884, - "txCount": 1884, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", - "roundIndex": 420416, - "consensusMemberCount": 5, - "roundStartTime": 1529323170000, - "packingIndexOfRound": 4, - "confirmCount": 33, - "reward": 100000, - "fee": 100000, - "size": 5, - "txList": [ - { - "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", - "type": 1, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 54, - "inputs": [], - "outputs": [ - { - "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "value": 100000, - "lockTime": 2884 - } - ] - }, - { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 0, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 0, - "confirmCount": 33, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": null, - "value": 9999899000000 - } - ], - "outputs": [ - { - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0 - }, - { - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0 - } - ] - }, - { - "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", - "type": 7, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 38, - "inputs": [], - "outputs": [] - } - ] - } -} -``` -*e.g 示例代码* - -```java -getBlock(10); -``` ---- - -#### 3.4 根据区块hash获取区块 -接口 - -**`Result getBlock(String hash)`** - -说明 - -> 根据区块hash获取区块 -> -> Result.data `Block ` - - - - - - - - - - - - - - -
参数类型是否必填说明
hashString必填区块hash值
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "00209bbcd98110b57f1ecd66c9d94d1a2381e6c03c3b9aa77db25b6eb5955bb658d3", - "preHash": "00201c0fa53c98595c7f9ba817fca6367aa2da1c1e480f801766b7a4a16b39c54b67", - "merkleHash": "00200c2dfa0560229ef728cd6bdc858334ef4072d8e25c3b0831c8366f4d4cb0c168", - "time": 1529323210000, - "height": 1884, - "txCount": 1884, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d73004730450221009d1015b7cab19ac8099245390ae41ca14da9f47d5c28b3b7780a53bd8adcccd802202bf74bb764f9de248dfb892d98e9ff91bad25daa107cfdf4effd3fb1c266e5ae", - "roundIndex": 420416, - "consensusMemberCount": 5, - "roundStartTime": 1529323170000, - "packingIndexOfRound": 4, - "confirmCount": 33, - "reward": 100000, - "fee": 100000, - "size": 5, - "txList": [ - { - "hash": "00202b9737b15bf7e4ebc74a58554e461fbed6fedf3e289c6ef41afa80d83f67babc", - "type": 1, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 54, - "inputs": [], - "outputs": [ - { - "address": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "value": 100000, - "lockTime": 2884 - } - ] - }, - { - "hash": "00203a169b42e5e142e20b273ac925e55f773b5a38c5f5c907efdbc43abb7d7a67b2", - "type": 2, - "time": 1529323198461, - "blockHeight": 1884, - "fee": 100000, - "value": 0, - "remark": "转账", - "scriptSig": "21036dd27c9fa786a1e83df204e9b31ddc24745c378f1f6b42731d07f05347167c0000473045022100ff3372711d78eb554be331aa40cd7af246641ecd3bc06f2fdca7faefb25f74e50220743a2f2d9d01b5a77a878349b996cbe4953af5d1a946519a5ce4d1129cf99848", - "status": 0, - "confirmCount": 33, - "size": 255, - "inputs": [ - { - "fromHash": "0020ab020707282932e6ec701f0b64e22e937fdd03ce9b37aab498aed2e00b6fa8e7", - "fromIndex": 0, - "address": null, - "value": 9999899000000 - } - ], - "outputs": [ - { - "address": "2CiVA3n1VoNQobAax4d7qNEBZAfehLN", - "value": 99900000000, - "lockTime": 0 - }, - { - "address": "2ChDcC1nvki521xXhYAUzYXt4RLNULS", - "value": 9899998900000, - "lockTime": 0 - } - ] - }, - { - "hash": "002040370fcb2ad080abdcd2d91f952826c8f6e55bda7231c1c15f25d9d74dc8ad7f", - "type": 7, - "time": 1529323210000, - "blockHeight": 1884, - "fee": 0, - "value": 0, - "remark": null, - "scriptSig": null, - "status": 0, - "confirmCount": 33, - "size": 38, - "inputs": [], - "outputs": [] - } - ] - } -} -``` -*e.g 示例代码* - -```java -getBlock("041f3d2ceed........"); -``` ---- - -#### 3.5 获取最新区块头 -接口 - -**`Result getNewestBlockHash()`** - -说明 - -> 获取最新的区块头 -> -> Result.data `BlockHeader` - - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "hash": "002078656b6e32f4f1e9e881e7b6c4c5de036ae81ec5bf78861bde9480f5ff3a1b33", - "preHash": "0020ee5d28fde669adb0ad16f3ed426f1ee8df40560bed0ab30bb99cbf95df276d64", - "merkleHash": "0020cc37658e2d110c1d42f64c7fd3dcb56d9653d4edc4d3a8406cb263a41f9f5488", - "time": 1529299160000, - "height": 4, - "txCount": 4, - "packingAddress": "2CWsZb9w8XXTE58TUhBGczxf4U6NULS", - "scriptSig": "2102e18d02154e0f68900898efea7ba72d6d14e37d7d173a62146df2871f40996d7300473045022100d4d92a9518ffd855441c7712f4b31bd003291dc108fa2b455fe26d51e54625f102202ae8375bd69bf1928f9967edac82619ff78f30550c17797cc489d5effd3202bf", - "roundIndex": 419517, - "consensusMemberCount": 1, - "roundStartTime": 1529299150000, - "packingIndexOfRound": 1, - "confirmCount": 1909, - "reward": 0, - "fee": 0, - "size": 1 - } -} - -``` -*e.g 示例代码* - -```java -getNewestBlockHash(); -``` ---- - -#### 3.6 获取最新区块的高度 -接口 - -**`Result getNewestBlockHight()`** - -说明 - -> 获取最新区块的高度 -> -> Result.data 高度(Long) - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": 5210 - } -}} - -``` -*e.g 示例代码* - -```java -getNewestBlockHight(); -``` ---- - -#### 3.7 获取最新区块的块Hash -接口 - -**`Result getNewestBlockHash()`** - -说明 - -> 获取最新区块的块Hash -> -> Result.data Hash值(String) - -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success": true, - "data": { - "value": "0020a2e1c99951184700927472c431a5a65847c7974cac0bbb97b242c7adf56ad27b" - } -}} - -``` -*e.g 示例代码* - -```java -getNewestBlockHash(); -``` ---- - - - -### 共识 ConsensusService - -#### 4.1 离线组装创建节点交易 - -接口 - -**` Result createAgentTransaction(AgentInfo agentInfo, List inputs, Na fee) `** - -说明 - -> 离线组装创建节点交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
agentInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
- -*e.g 示例代码* - -```java -//组装交易的inputs,示例中的input属性均必填 -List inputs = new ArrayList<>(); -Input input = new Input(); -input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -input.setFromIndex(1); -input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -input.setValue(999998760000000L); -inputs.add(input); - -//创建节点信息,示例总AgentInfo的属性均必填 -AgentInfo info = new AgentInfo(); -info.setAgentAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //申请共识节点的地址 -info.setPackingAddress("NsdwUo8XU52DtB9Zqjo2YkuLBW8VhGaQ"); //实际打包区块的地址 -info.setDeposit(200000 * 100000000L);//创建节点的保证金, 最低20000NULS,最高200000NULS -info.setCommissionRate(10.0); //佣金比例 1-100 - -//创建节点的手续费 -Na fee = Na.valueOf(1000000L); - -Result result = NulsSDKTool.createAgentTransaction(info, inputs, fee); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - ------- - -> **创建共识节点交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:1000000 NA/1KB -> -> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , -> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 4.2 离线组装委托共识交易 - -接口 - -**` Result createDepositTransaction(DepositInfo depositInfo, List inputs, Na fee) `** - -说明 - -> 离线组装委托共识交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
depositInfoObject必填创建节点信息
inputsList必填输入信息
feeObject必填交易手续费
- -*e.g 示例代码* - -```java -//组装交易的inputs,示例中的input属性均必填 -List inputs = new ArrayList<>(); -Input input = new Input(); -input.setFromHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -input.setFromIndex(1); -input.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -input.setValue(999998760000000L); -inputs.add(input); - -//委托共识信息,示例中DepositInfo的属性均必填 -DepositInfo info = new DepositInfo(); -info.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); //委托共识的地址 -info.setDeposit(300000 * 100000000L);//委托代币数量:2000NULS —— 500000NULS -info.setAgentHash("0020a467827d5f06feb3e78b4603eb03677711219cb5232d145b3e9d4ab48a3eb366");//创建共识节点的交易id - -//创建节点的手续费 -Na fee = Na.valueOf(1000000L); - -Result result = NulsSDKTool.createDepositTransaction(info, inputs, fee); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - ------- - -> **创建委托交易手续费的计算**:手续费单价 \* 交易大小 -> -> **手续费单价(min)**:1000000 NA/1KB -> -> **交易大小的计算**:(288 + 50 * inputs.length)/1024 , -> 其中210为基本信息的固定长度,50为单条input的长度,38为单条output的长度,remark为非必填字段,有需要传入时,按照UTF-8字符编码计算字节长度。交易大小用KB作为单位,最大值为300KB,不足1KB的部分,记为1KB。 -> 出块节点在验证每笔交易时,将输入与输出的差值视为用户发送此交易时所支付的手续费,再根据交易的大小计算出手续费的最小值。如果用户的手续费小于最小值,则视为不合法交易,不予打包。因此,在创建交易的时候,手续费的计算应谨慎处理,避免交易失败。 - - - -#### 4.3 离线组装退出委托共识交易 - -接口 - -**` Result createCancelDepositTransaction(Output output) `** - -说明 - -> 离线组装退出委托共识交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - -
参数类型是否必填说明
outputObject必填参与共识时被锁定的那条output
- -*e.g 示例代码* - -```java -//参与委托共识交易被打包后,有一条lockTime = -1的output记录,就是用户委托共识后被锁定的委托金额, -//将output作为参数,生成退出委托共识交易 -Output output = new Output(); -output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -output.setIndex(0); -output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -output.setValue(20000000000000L); -output.setLockTime(-1); - -Result result = NulsSDKTool.createCancelDepositTransaction(output); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - - - -#### 4.4 离线组装删除共识节点交易 - -接口 - -**` Result createStopAgentTransaction(Output output) `** - -说明 - -> 离线组装删除共识节点交易 -> -> Result.data `String` 16进制后的交易序列化字符串 - - - - - - - - - - - - - - -
参数类型是否必填说明
outputObject必填创建节点时被锁定的那条output
- -*e.g 示例代码* - -```java -//创建节点交易被打包后,有一条lockTime = -1的output记录,就是用户创建节点被锁定的保证金, -//将output作为参数,生成退出委托共识交易 -Output output = new Output(); -output.setTxHash("0020b0a75a26caad17b4ea6cec7f059ac0e426d71696a6096f75bb2e9f30c11c60d6"); -output.setIndex(0); -output.setValue(20000000000000L); -output.setAddress("Nse5x9foSzFjuwkwZLSvSjAHHLVf3MKJ"); -output.setLockTime(-1); - -Result result = NulsSDKTool.createStopAgentTransaction(output); -Map map = (Map) result.getData(); -String txHex = (String) map.get("value"); -``` - - - -#### 4.5 获取委托共识列表 - -接口 - -**` Result getDeposits(String address, int pageNumber, int pageSize) `** - -说明 - -> 获取地址的委托共识列表 -> -> Result.data List委托列表信息 - - - - - - - - - - - - - - - - - - - - - - - - - - -
参数类型是否必填说明
addressString必填委托地址
pageNumberInt必填页码
pageSizeInt必填每页显示条数,1-100之间
- -返回结果 - -- 返回结果为`Result`对象,格式如下: - -```json -{ - "success":true, - "data":{ - "pageNumber":1, - "pageSize":10, - "total":1, - "pages":1, - "list":[ - { - "deposit":20000010000000, - "agentHash":"00207654b3371e9c99295a4b3d0371a6cfec48ee31684825dabc04dc5ea314da0a0c", - "address":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA", - "txHash":"002029411a2e6797e2d3bec54c48008f73275c8208a240b4835be534a137452bc29e", - "blockHeight":98, - "agentAddress":"NsdyD94pXWpxZudbtJ4zpkBHhh8XmBQA" - } - ] - } -} -``` - -*e.g 示例代码* - -```java -Result result = NulsSDKTool.getDeposits(address, 1, 10); -``` - - - - - -### 附录 - -#### 接口返回Result示例 -##### Result - -- 表示接口访问正常,业务返回具体的数据 - -```json -{ - "success": true,//接口执行的正确性 - "data": data -} -``` -- 表示接口访问正常,业务返回true - -```json -{ //表示接口访问正常,业务返回true - "success": true,//接口执行的正确性 - "data": { - "value":true //接口业务功能的返回结果 - } -} -``` -- 表示接口访问正常,业务返回false - -```json -{ - "success": true, //接口执行的正确性 - "data":{ - "value": false //接口业务功能的返回结果 - } -} -``` -- 返回错误的情况,例如参数错误,异常等 - -```json -{ //表示错误的情况 - "success": false, - "data":{ - "code": "ACT005", - "msg": "xxxxxx...." - } -} -``` - -- 这是创建一个带密码的离线账户的完整返回结果 - -```json -{ - "success": true, - //data为List - "data": { - "list":[ - { - "address": "2CacFwqMwcJiGNNBwiwV7bCL7bjwNBr", - "alias": null, - "pubKey": "030d4e752b5aa5d784f19a1fcc73b02afb6f756752fd00ebc2fcaabc8d0979c4f0", - "extend": null, - "createTime": 1529041525794, - "encrypted": false, - "priKey": "00e4bfd347351ea899b5f0ae2c0a3e7a6951b202eaf72432d1a63a2dc85c59c82a", - "encryptedPriKey": "" - } - ] - } -} -``` ---- - -##### Account -```json -{ - "address": String, 账户地址 - "alias": String, 账户别名 - "pubKey": String, 公钥 - "extend": String, 扩展 - "createTime": Long, 创建时间 - "encrypted": boolean, 是否加密 - "priKey": String, 私钥(创建无密码离线账户时才会有值) - "encryptedPriKey": String, 加密私钥(创建有密码离线账户时才会有值) -} -``` ---- - -##### Input -```json - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - "lockTime": Long 锁定时间 -} -``` ---- - -##### Output -```json - { - "txHash": String, 交易hash - "index": Integer, 索引 - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) -} -``` ---- - -##### Transaction - -```json -{ - "hash": String, 交易的hash值 - "type": Integer, 交易类型 - "time": Long, 交易发起时间 - "blockHeight": Long, 区块高度 - "fee": Long, 交易手续费 - "value": Long, 交易金额 - "remark": String, 备注 - "scriptSig": String, 签名 - "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) - "confirmCount": Long, 确认次数 - "size": int, 大小 - "inputs": [ - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - } - ], - "outputs": [ - { - "txHash": String, 交易hash - "index": Integer, 索引 - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - "status": Integer 状态 0:usable(未花费), 1:timeLock(高度锁定), 2:consensusLock(参与共识锁定), 3:spent(已花费) - } - ] -} -``` ---- - -##### BalanceInfo -```json -{ - "balance": long, 余额 - "usable": long, 可用余额 - locked": long 锁定余额 -} -``` ---- - -##### BlockHeader - -```json -{ - "hash": String, 区块的hash值 - "preHash": String, 上一个区块的hash值 - "merkleHash": String, 梅克尔hash - "time": Long, 区块生成时间 - "height": Long, 区块高度 - "txCount": Long, 区块打包交易数量 - "packingAddress": String, 打包地址 - "scriptSig": String, 签名 - "roundIndex": Long, 共识轮次 - "consensusMemberCount": Integer, 参与共识成员数量 - "roundStartTime": Long, 当前共识轮开始时间 - "packingIndexOfRound": Integer, 当前轮次打包出块的名次 - "confirmCount": Long, 确认次数 - "reward": Long, 共识奖励 - "fee": Long, 获取的打包手续费 - "size": int, 大小 -} -``` ---- - -##### Block - -```json -{ - "hash": String, 区块的hash值 - "preHash": String, 上一个区块的hash值 - "merkleHash": String, 梅克尔hash - "time": Long, 区块生成时间 - "height": Long, 区块高度 - "txCount": Long, 区块打包交易数量 - "packingAddress": String, 打包地址 - "scriptSig": String, 签名 - "roundIndex": Long, 共识轮次 - "consensusMemberCount": Integer, 参与共识成员数量 - "roundStartTime": Long, 当前共识轮开始时间 - "packingIndexOfRound": Integer, 当前轮次打包出块的名次 - "confirmCount": Long, 确认次数 - "reward": Long, 共识奖励 - "fee": Long, 获取的打包手续费 - "size": int, 大小 - "txList": [ - { - "hash": String, 交易的hash值 - "type": Integer, 交易类型 - "time": Long, 交易发起时间 - "blockHeight": Long, 区块高度 - "fee": Long, 交易手续费 - "value": Long, 交易金额 - "remark": String, 备注 - "scriptSig": String, 签名 - "status": Integer, 交易状态 0:unConfirm(待确认), 1:confirm(已确认) - "confirmCount": Long, 确认次数 - "size": int, 大小 - "inputs": [ 输入 - { - "fromHash": String, 来源output的txHash - "fromIndex": Integer, 来源output的outIndex - "address": String, 转入地址 - "value": Long 转入金额 - } - ], - "outputs": [ 输出 - { - "address": String, 地址 - "value": Long, 数量 - "lockTime": Long, 锁定时间 - } - ] - } - ] -} -``` diff --git a/source/zh-cn/index.jade b/source/zh-cn/index.jade deleted file mode 100644 index c2fb886e..00000000 --- a/source/zh-cn/index.jade +++ /dev/null @@ -1,57 +0,0 @@ -layout: index -description: Hexo is a fast, simple & powerful blog framework powered by Node.js. -subtitle: 快速、简洁且高效的博客框架 -comments: false ---- -#content-index - .inner-index - .flexible-outer - .flexible-inner - .text - .text1 最灵活的区块链基础设施 - .text2 - .text3 NULS是一个可定制的区块链基础设施,是全球性区块链开源社区项目。NULS 由微内核和功能模块组成,以弱化主链的全新思维,通过事件和服务的剥离,实现高度模块化的底层架构,提供智能合约、多链并行、跨链共识等运行机制,降低开发和使用的成本,推动区块链商业应用进程。 - .features - .title.title-common 功能介绍 - .line(style="margin-left:375px") - .bg-img - .bg-text1.bg-text - p 模板架构 - p 适用不断升级 - .bg-text2.bg-text - p 信用证明 - p 共识 - .bg-text3.bg-text - p 多链机制 - p - .bg-text4.bg-text - p 智能合约 - p 逻辑容器 - img(src="../img/index/main/tech_introduction_icon.png") - .modular - .title.title-common 模块化 - .line(style="margin-left:50px") - .bg-img - img(src="../img/index/main/modular_chinese_icon.png") - .text - p NULS 设计遵循“一切皆为模块”的原则,用模块化支持技术更新和应用适配。Nuls使用微内核管理所有模块,模块间通过事件总线和服务总线交互。 - p NULS开发者可以通过模块说明书理解和使用模块,不用关心模块的细节。 - .contract - .title.title-common 智能合约 - .line(style="margin-left:375px") - .bg-img - .text - p NULS智能合约模块名为NVM(Nuls Virtual Machine),支持智能资产发行和流通。 - p Nuls智能合约基于JVM,开发者可以使用基于Java的开发语言(如:Java、 Groovy、JRudy、Jython、Clojure、Clojure、Kotlin、Rhino、Ceylon)开发智能合约。 - img(src="../img/index/main/smart contract_icon.png") - .chain - .title.title-common 多链并行 - .line(style="margin-left:520px") - .bg-img-chain - .text - p Nuls是一套多链基础设施,包含Nuls主链、资产链、应用链、审计链、兄弟链。 - p 资产链是Nuls生态的经济中心,Nuls生态所有token将在这里实现跨链传输和交换; - p 应用链承载Dapp和智能资产; - p 审计链为私有链和联盟链提供数据公开审计服务; - p 兄弟链由社区开发者使用Nuls模块仓库搭建新的独立区块链,兄弟链将自带与Nuls其他链资产跨链传输和交换的功能; - img(src="../img/index/main/Parallel Multi-Chains_chinese_icon.png") \ No newline at end of file diff --git a/source/zh-cn/manual/account.md b/source/zh-cn/manual/account.md deleted file mode 100644 index 45973ce0..00000000 --- a/source/zh-cn/manual/account.md +++ /dev/null @@ -1,460 +0,0 @@ -title: 账户模块 ---- - -# NULS账户模块解析 - -## 1、模块概述 - -NULS账户模块是为NULS主链提供关于账户各项功能的基础性模块。主要对账户的生成、安全和保管、信息的获取等几个方面的功能提供支持,其他模块可以根据账户模块提供的接口来使用账户的各种功能以及获取账户信息,用户或者其他应用可以根据RPC接口对账户进行更加实用性和个性化的操作。账户是NULS的基础模块,也是用户数据的载体(展示窗口),随着NULS的发展,账户模块也将更加完备。 - - - -## 2、模块功能 - -账户模块的功能比较丰富,相同功能也会提供多个接口的重载,方便不同场景下的使用,主要有以下几个方面。 - -#### 2.1 账户的生成 - -账户的生成方面包含创建账户、导入账户;而导入账户分为导入私钥生成账户、导入Keystore备份文件生成账户。 - -#### 2.2 账户的安全和保管 - -账户安全方面的功能包含账户的备份、设置账户密码、修改账户密码、移除账户;备份账户分为生成Keystore备份文件、获取私钥来备份。 - -#### 2.3 账户信息的获取 - -账户信息的获取方面的功能主要有查询单个账户信息、获取多个账户信息、获取账户地址、查询账户余额、查询账户别名等。 - -#### 2.4 其他实用性和个性化功能 - -账户的功能还包括一些特殊的工具功能、个性化功能,主要有设置账户别名、设置账户备注、验证账户是否加密、签名、验证签名、验证账户地址格式、验证账户密码是否正确等功能。 - -#### 2.5 账户本地数据的存取 - -除账户别名的数据外账户的数据都会进行本地的持久化,所以账户模块有对账户数据的存取的功能,功能的最终实现是调用数据存储模块的接口来实现。 - - - -## 3、模块接口 - -- 接口定义类 `io.nuls.account.service.AccountService` - -```java - - /** - * 创建指定个数的账户(包含地址) - * - * Create a specified number of accounts,and encrypt the accounts, - * all the accounts are encrypted by the same password - * if the password is NULL or "", the accounts will be unencrypted. - * - * @param count 想要创建的账户个数 - * @param count the number of account you want to create. - * @param password the password of the accounts. - * @return the account list created. - */ - Result> createAccount(int count, String password); - - /** - * 创建指定个数的账户(包含地址) - * Create unencrypted accounts. - * - * @param count 想要创建的账户个数 - * @param count the number of account you want to create. - * @return the account list created. - */ - Result> createAccount(int count); - - /** - * 创建指定个数的账户(包含地址) - * - * Create an account and encrypt it, - * if the password is NULL or "", the accounts will be unencrypted. - * - * @param password the password of the accounts(only one account in the list). - * @return the account list created. - */ - Result> createAccount(String password); - - /** - * 创建一个账户 - * - * Create an unencrypted account - * - * @return the account list created(only one account in the list). - */ - Result> createAccount(); - - /** - * 根据账户标识删除对应的账户 - * - * delete an account by address. - * - * @param address the address of the account you want to delete. - * @param password the password of the account. - * @return the result of the operation. - */ - Result removeAccount(String address, String password); - - - /** - * 根据keyStore重置密码 - * - * Reset password by keyStore. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result updatePasswordByAccountKeyStore(AccountKeyStore keyStore, String password); - - /** - * 从keyStore导入账户(密码用来验证keystore) - * 1.从keyStore获取明文私钥(如果没有明文私钥,则通过密码从keyStore中的encryptedPrivateKey解出来) - * 2.通过keyStore创建新账户,加密账户 - * 3.从数据库搜索此账户的别名,没有搜到则不设置(别名不从keyStore中获取,因为可能被更改) - * 4.保存账户 - * 5.导入账户账本交易等信息 - * - * import an account form account key store. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result importAccountFormKeyStore(AccountKeyStore keyStore, String password); - - /** - * 从keyStore导入账户 - * 1.从keyStore获取明文私钥 - * 2.通过keyStore创建新账户,不加密账户 - * 3.从数据库搜索此账户的别名,没有搜到则不设置(别名不从keyStore中获取,因为可能被更改) - * 4.保存账户 - * 5.导入账户账本交易等信息 - * - * import an account form account key store. - * - * @param keyStore the keyStore of the account. - * @return the result of the operation. - */ - Result importAccountFormKeyStore(AccountKeyStore keyStore); - - - /** - * 根据私钥和密码导入账户 - * import an account from plant private key and encrypt the account. - */ - Result importAccount(String prikey, String password); - - /** - * 据私钥和密码导入账户 - * import an unencrypted account by plant private key. - */ - Result importAccount(String prikey); - - /** - * 导出账户到keyStore - * - * export an account to an account key store. - * - * @param address the address of the account. - * @param password the password of the account key store. - * @return the account key store object. - */ - Result exportAccountToKeyStore(String address, String password); - - /** - * 根据账户地址byte[]获取完整的账户信息 - * - * Query account information by address. - * - * @param address the address of the account you want to query. - * @return the account. - */ - Result getAccount(byte[] address); - - /** - * 根据账户地址字符串获取完整的账户信息 - * - * Query account by address. - * - * @param address the address of the account you want to query. - * @return the account. - */ - Result getAccount(String address); - - /** - * 根据账户地址类对象获取完整的账户信息 - * Query account by account address. - * - * @param address the address of the account you want to query; - * @return the account. - */ - Result getAccount(Address address); - - /** - * 根据账户公钥获取账户地址对象 - * Query account address by public key. - * - * @param pubKey public key string. - * @return the account address. - */ - Result
getAddress(String pubKey); - - /** - * 根据账户二进制公钥获取账户地址对象 - * Gets the account address object from the account binary public key. - * - * @param pubKey public key binary array. - * @return the account address. - */ - Result
getAddress(byte[] pubKey); - - /** - * 根据账户验证账户是否加密 - * Verify weather the account is encrypted according to the account. - * - * @param account the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(Account account); - - /** - * 根据账户的地址对象验证账户是否加密 - * Verify weather the account is encrypted according to the account's address object. - * - * @param address The address of the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(Address address); - - /** - * 根据账户的地址字符串验证账户是否加密 - * Verify weather the account is encrypted according to the account's address string. - * - * @param address The address of the account to be verified. - * @return the result of the operation. - */ - Result isEncrypted(String address); - - /** - * Verify the account password. - * - * @param account - * @param password - * @return - */ - Result validPassword(Account account, String password); - - /** - * 验证地址字符串的格式 - * Verify the format of the address string. - * - * @param address To verify the address string. - * @return the result of the operation. - */ - Result verifyAddressFormat(String address); - - /** - * 获取所有账户集合 - * Query all account collections. - * - * @return account list of all accounts. - */ - Result> getAccountList(); - - /** - * 数据签名 - * Sign data. - * - * @param data Data to be signed. - * @param account Signed account - * @param password Account password - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, Account account, String password) throws NulsException; - - /** - * 数据签名(无密码) - * Sign data.(no password) - * - * @param data Data to be signed. - * @param account Signed account - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, Account account) throws NulsException; - - /** - * 数据签名 - * Sign data. - * - * @param data Data to be signed. - * @param ecKey eckey. - * @return The NulsSignData object. - */ - NulsSignData signData(byte[] data, ECKey ecKey) throws NulsException; - - /** - * 数据签名 - * Sign data. - * - * @param digest data digest. - * @param account account to sign. - * @param password password of account. - * @return the NulsSignData object. - */ - NulsSignData signDigest(byte[] digest, Account account, String password) throws NulsException; - - /** - * 数据签名 - * Sign data digest - * - * @param digest to be signed. - * @param ecKey eckey - * @return The NulsSignData object. - */ - NulsSignData signDigest(byte[] digest, ECKey ecKey); - - /** - * 验证签名 - * Verify the signature. - * - * @param data data to be validated. - * @param signData signature. - * @param pubKey dublic key of account. - * @return the result of the opration - */ - Result verifySignData(byte[] data, NulsSignData signData, byte[] pubKey); - - /** - * 获取所有的账户的余额 - * Query the balance of all accounts. - * - * @return Balance object. - */ - Result getBalance() throws NulsException; - - /** - * 根据账户获取账户余额 - * Query the balance of an account. - * - * @param account the account. - * @return Balance object. - */ - Result getBalance(Account account) throws NulsException; - - /** - * 根据账户地址对象获取账户余额 - * Query the balance of an account. - * - * @param address the address of the account. - * @return Balance object. - */ - Result getBalance(Address address) throws NulsException; - - /** - * 根据账户地址字符串获取账户余额 - * Query the balance of an account. - * - * @param address the address of the account. - * @return Balance object. - */ - Result getBalance(String address) throws NulsException; - - - /** - * 根据账户地址字节数组获取账户别名 - * Get an account alias based on the array of account address bytes - * - * @param address - * @return alias string - */ - Result getAlias(byte[] address); - - /** - * 根据账户地址获取账户别名 - * Get account alias according to account address - * - * @param address - * @return alias string - */ - Result getAlias(String address); - - /** - * 获取设置别名交易手续费 - * Gets to set the alias transaction fee - * - * @param address - * @param aliasName - * @return - */ - Result getAliasFee(String address, String aliasName); - -``` - - - -## 4、模块架构 - -- 模块名称:account -- 模块ID:5 - -![AccountArchitecture](account/AccountArchitecture.png) - -## 5、模块协议 - -##### 5.1 通用交易数据结构 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | ?? | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -##### 5.2 别名交易 - -- txData:Alias - -**Alias** - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------- | -------- | ------------------ | -| 2 | address | VarByte | 设置别名的账户地址 | -| ?? | alias | String | 别名名称 | - -## 6、核心流程 - -#### 6.1 账户生成 - -##### 6.1.1 创建账户 - -NULS的账户地址是通过NULS的默认Chain ID、以及NULS默认地址类型、ECKey(椭圆曲线加密算法)的组合生成的,固定长度为23。生成的Byte数组通过Base58算法得到NULS账户的地址字符串。创建新的账户时ECKey是通过随机种子生成的ECKey实例,通过ECKey得到账户的公钥和私钥以及账户地址即可生成一个新账户。 - -##### 6.1.2 备份 - -生成账户后即可通过接口得到账户的明文私钥,即可对私钥进行妥善的保管(即备份),同时也可以通过备份Keystore文件的接口来生成一个备份文件进行备份。 - -备份Keystore时要分两种情况: - -1、账户没有密码时备份 - -账户没有密码时直接调用接口生成备份文件,文件已账户地址命名,文件后缀为`.keystore`。并且Keystore中的私钥为明文私钥(prikey有值,encryptedPrivateKey没有值)。 - -2、账户有密码时备份 - -备份已加密账户时需要验证当前账户密码,并且使用该密码为Keystore中的私钥加密,在生成的文件中加密后的私钥有值(encryptedPrivateKey有值),明文私钥时没有值的(prikey无值)。 - -##### 6.1.3 导入账户(私钥、Keystore文件) - -导入账户是用户出于某种原因想要在本地重新生成自己的账户信息,用户需要持有对应账户的私钥或者Keystore备份文件。私钥和Keystore的区别在于,Keystore(在账户设置有密码的情况下)可以保存加密后的私钥,而不用保存明文私钥,所以安全性更高。在这种情况下导入Keystore文件时会同时验证在生成该Keystore文件时账户的密码,通过该密码和加密后的私钥,可以计算出明文私钥,然后进行下一步导入流程。 - -而不管用户用什么方式导入,最终都是通过账户的私钥来生成对应的ECKey实例,然后和创建账户相同的方式生成账户信息,与创建账户不同的是得到ECkey实例的方式不一样。像这样通过同一个私钥来生成的账户,信息都是一致的,然后会通过账户账本从区块链中获取该账户的转账、设置别名、创建节点、委托等交易数据到同步到本地,从而实现了导入账户的功能。 - -虽然Keystore文件中存有账户的别名,不过由于Keystore文件可能被串改和伪造,所以在导入账户时仍然需要通过从区块链中获取账户设置别名交易的信息来还原账户的别名信息,这正是利用了区块链信息不可篡改的特性。 - -![accountflow](account/AccountFlow.png) - -##### 6.1.4 设置账户别名 - -设置账户别名会花费1NULS,这1NULS会被转到固定的空洞地址燃烧掉,账户设置的别名会被保存在区块链中,并且别名在区块链中是唯一的,通过这些验证后会发起一笔交易,并且会发送到其他节点进行验证、打包、确认,之后设置别名就算成功。 \ No newline at end of file diff --git a/source/zh-cn/manual/account/AccountArchitecture.png b/source/zh-cn/manual/account/AccountArchitecture.png deleted file mode 100644 index 095e8e9a..00000000 Binary files a/source/zh-cn/manual/account/AccountArchitecture.png and /dev/null differ diff --git a/source/zh-cn/manual/account/AccountFlow.png b/source/zh-cn/manual/account/AccountFlow.png deleted file mode 100644 index a9ada2f4..00000000 Binary files a/source/zh-cn/manual/account/AccountFlow.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus.md b/source/zh-cn/manual/consensus.md deleted file mode 100644 index d94cb822..00000000 --- a/source/zh-cn/manual/consensus.md +++ /dev/null @@ -1,743 +0,0 @@ -title: NULS共识模块解析 ---- - -## 1、模块概述 -​ 众所周知,区块链的核心是共识机制。和传统互联网的cliet-server架构不同,区块链的节点是对等的,没有中心,大家权利一样;所以为了使数据达到一致性,让一个没有中心的网络维护一套大家都认同的账本,这就是共识机制的作用。 -​ -​ -​ 公链共识机制有多种,NULS主网采用自主原创的POC(Proof Of Credit)共识机制,一种继承了Dpos共识机制的安全性和高效率,同时在协作方面进行了非常大的改进,可以看成是一种升级版的Dpos。 -​ -​ -​ NULS的共识模块,在接口层进行了高度抽象,提炼出了一些必须的功能接口,其实现为POC共识。在NULS的模块化架构基础上,可以实现其它任何可能的共识机制。期待社区、个人或者机构实现其需要的共识机制,并贡献代码到NULS的主仓库,未来可供选择的共识机制除POC外,会有POW、POS、DPOS、PBTF等多种共识算法。 -​ -​ -​ 本章节重点介绍NULS的共识模块接口定义,以及默认POC共识机制的实现细节。 -​ -​ -​ **模块信息** -​ -​ 模块名称:consensus-module -​ -​ 模块结构:模块顶级目录consensus-module,consesnus工程为模块接口定义,poc实现目录poc,poc实现工程consensus-poc-base,consensus-poc-protocol共识实现相关网络协议,consensus-poc-storage共识存储接口和实现工程 -​ -​ 接口定义依赖模块:**protocol-module、network-module** -​ -​ 实现额外依赖模块:**core-module、ledger-module、account-module、account-ledger-module** - -## 2、模块功能 -​ 本小节从两个层面来介绍NULS的共识模块功能。第一层面从对外提供的接口功能角度进行描述,外部接口是多种共识算法可能需要的共用抽象接口;第二层面从POC实现的功能需求进行概括阐述。 - -### 2.1 外部接口 - -* 新交易:节点接收到的网络上的新交易,验证通过之后,需要放到一个统一的内存池里,以供共识模块确认这些交易(也就是打包交易到区块里);同时接收到新的区块时,通过查找这些现场的交易,快速组装成一个完整的区块(因为新区块产生,广播给对等节点的是区块头信息和交易哈希列表)。 - -* 获取内存池交易:共识模块对外提供一个查询待确认交易列表的方法,以供其它模块有需要的时候调用。 - -* 获取单笔交易:查询一笔交易,实际上NULS系统的交易,是应该账本模块提供,但账本模块提供的交易都是已经确认的交易,未确认的交易在共识模块的内存池中,所以共识模块对外提供一个查找单笔交易的功能接口,同时包含查找未确认的交易。 - -* 新区块: - - 下载过程中接收到下载的目标区块:一个节点刚启动,节点的本地区块数据很可能不是最新的数据,需要从其它对等节点下载增量区块,下载到的区块需要进入共识模块,通过相应的共识规则,则认为下载的区块无误,添加到主链并保存。 - - 运行过程中接收到的新产生的区块:收到网络发来的一个新诞生的区块,通用协议模块会得到完整的区块信息(采取组装交易的方式,若本地找不到某些交易,则向对应的节点下载),然后把完整的区块交给共识模块进行验证--入库等操作。 - - 以上两种场景,是否采用同一个业务逻辑进行处理,取决于共识机制的选择,比如POC共识,唯一不同的地方在于验证时的轮次信息不一致,前者是采用计算历史轮次来验证,后者是采用当前共识论处进行验证;如果POW共识的实现,完全可以使用同一个业务逻辑。也就是具体的实现可以自己决定是否复用代码。 - -* 回滚区块:区块的回滚,是指当节点发现网络上有一条比本地主链更长的链可选择时,接受网络上的这条更长的链作为本地新的主链,这时需要把本地主链中,没有包含在网络上这条更长链里的区块统统删掉,相应的区块里面的交易也要进行删除(同时相应的业务逻辑也要倒退,专业术语叫做回滚)。理论上绝大部分时候,是否有分叉,是否需要分叉处理,取决于共识机制的实现方式和选择,大部分时候共识机制实现内部进行了相关的处理,共识模块提供此接口功能,以供其它模块需要时调用(比如初次启动下载,就可能需要回滚区块)。特别说明一下,不是所有的共识机制都需要回滚。 - -### 2.2 POC功能需求分析 -要实现POC,首先需要知道POC的设计理念和业务规则,以下内容摘自NULS白皮书POC共识介绍部分,如果熟悉可直接跳过。 - -``` -共识机制——POC - NULS 的模块化设计,支持共识机制在内的所有核心功能模块的替换与插拔。 -NULS 主链默认采用信用共识机制 POC(Proof-Of-Credit)。节点信用达标的情 -况下,锁定一定保证金即可加入共识,共识节点重新排序后每轮轮流出块,退出 -共识时保证金解锁。 -1、共识进入与退出机制 -任何人都可以随时加入 NULS 的共识之中,只要满足条件,遵守规则,即可 -持续获得 NULS 代币奖励。POC 的加入分为硬性指标和软性指标。硬性指标指 -的是信用分值必须达到一定标准线,排除掉一部分曾经作恶的节点。软性指标指 -的是必须冻结一定量的 NULS 代币作为保证金,为杜绝节点的泛滥,同时让整 - 一个可定制的区块链基础设施 -9 / 15 -个系统更加公平,保证金的数量除了有一个最低值的限制外,任何人可自由选择 -保证金的数量,保证金的数量会和最终的奖励挂钩。 -1.1黄牌警告 - 由于节点硬件配置或者网络原因,造成的共识期间掉线、死机等无法出块的, -不属于违规情况,但对整个系统会造成一定影响,所以对这类情况,系统有一个 -轻度的警告机制:冻结保证金 72 小时,且会影响信用的评定。 -1.2红牌警告 - 对于一些双花、尝试分叉系统、不遵守系统规则的恶意人为破坏情况,NULS -系统坚决抵制,所有节点都可以检测到这类情况的发生;一旦有恶意节点确实试 -图挑战系统,那么对应的保证金将会被锁定 1 个月,且再次信用评级,将永远达 -不到共识门槛。 -2、信用评级 -在 NULS 系统里,信用是账户在系统中的诚信系数,所有账户的信用会在区 -间[-1,1]内,通过信用评级算法公式自动计算。 -信用评估公式: -信用基数=能力系数+责任系数 -能力系数:根据历史出块数量计算 -责任系数:根据违规情况和出块正确性计算 -3、共识奖励 -为了整个 NULS 系统的平衡与公平,共识奖励根据所有共识节点所提交保证 -金与共识节点信用综合计算。 -共识奖励计算公式: - 一个可定制的区块链基础设施 -10 / 15 -fee:本块手续费 -rnc:本轮共识节点数 -bti:出块间隔时间(秒) -spy:一年总时间(秒) -cmc:共识抵押代币数 -cr:信用基数 -4、子链共识机制 -接入 NULS 的子链分为两种类型,第一种是通过 NULS 系统的标准接口协议 -接入,第二种是通过 NULS 的程序部署接入。 -NULS 是一套通用的区块链底层基础设施,在其主链上不运行任何应用业务, -所有应用业务由子链运行。通过 NULS 的系统,能快速的部署基于 NULS 的子 -链,且可灵活定制子链的各种运行参数,包括是否支持基础代币、加密算法、共 -识机制、存储机制等。 -NULS 定义了标准共识模块,以提供接口兼容不同的共识机制。NULS 社区 -会陆续开发 POW、DPOS、POS、PBFT、POOL 验证池等共识机制,以供用户 -自由选择。 - -``` - - -##### 在POC系统中,有代理人、委托人、打包人、奖励人这四个角色。 - * 代理人————即节点创建人,发起一笔创建共识节点的交易,记录到链中,告诉所有人我要做共识节点。节点创建的基本条件是需要锁定2万个NULS,设立这个基本条件的目的是证明你是真心实意的想维护好NULS的基础网络。 - - * 委托人————NULS持有人,可根据代理人的信用值情况,以及代理人的影响力等等因素,把自己所持有的NULS委托给该代理人进行共识,同时享受相应的共识收益,若发现代理人节点质量或者诚信有所下降,委托人可随时撤掉其委托改投他人。 - - * 打包人————代理人在创建共识节点时,可指定一个打包人,这个打包人可以是自己的其他账户,也可以是懂技术的朋友,最重要的是打包人可以不持有任何NULS,即使参与共识的服务器被黑客攻破,用户也不会有巨大损失,损失的仅仅是被攻击后的收益影响 - - * 奖励人————代理人在创建共识节点时,不仅仅可以指定一个打包人,还可以指定一个受益人,指定谁可以获得共识所产出的奖励 - -##### 在POC系统中,有创建代理(创建共识节点)、停止代理节点(退出共识)、委托共识、取消委托四种业务逻辑。 - -* 创建代理(创建共识节点):锁定2万个NULS,发起一笔注册代理交易,打包之后全网可见,其它人可锁定NULS委托到该代理人节点之上。 - -* 停止代理节点(退出共识):代理人可随时停止其代理资格,发起交易删除代理节点,交易被打包确认之后,很快就会退出共识,不再参与新区块的生产。注册代理时锁定的2万个NULS会72小时之后解锁,其余委托人委托到该节点的NULS立即解锁。 - -* 委托共识:持有2000及以上NULS的用户,可以选择一个代理节点进行委托,获得相应的出块收益。在退出之前,相应委托的NULS将被锁定不可用。 - -* 取消委托:用户可对之前进行的委托进行撤销,撤销之后锁定的NULS马上解释,不再享受相应的共识收益。 - -##### POC系统的两种处罚机制 - * 黄牌处罚:当出块节点因断网,卡机等各种不确定原因,导致该出块时没有出块,或者出的块没有被采用,那么将在下一轮获得黄牌处罚。黄牌处罚会影响节点的收益;当连续获得100个黄牌处罚时,会被进行红牌处罚。 - - * 红牌处罚:当出块节点作出恶意分叉、双花等严重危害网络稳定的行为时,或者连续获得100个黄牌处罚时,系统会给予红牌处罚。获得红牌处罚的节点会被强制停止共识,创建代理时的押金被冻结3个月,且永远不可再次创建节点;获得红牌处罚的节点对应的委托立即解锁。 - - -##### POC内部系统的隐藏功能需求 -* 维护一张代理人信息表,并根据实时接收到的以上四种交易进行更新。 - -* 维护一个轮次信息表,让每个轮次符合出块条件的代理人随机排队出块。 - -* 符合出块条件的代理节点,对内存池的交易进行验证打包,组装成新区块并广播到全网。 - -* 分叉处理。 - -以上是对共识模块POC共识机制实现的功能分析,在[**核心流程**] (#core-processer)小节中会介绍每个功能实现的细节。 - -## 3、模块接口 - -共识模块的外部接口定义类为io.nuls.consensus.service.ConsensusService -,处于consensus工程下面。 - -* **新交易** - * 方法名称: newTx - * 方法说明: - - - 节点接收到的网络上或本地产生的新交易,经过初步验证,通过之后放入交易内存池,等待确认。 - - * 参数说明: - - - tx : 交易(Transaction) - - - * 返回值说明: - - - 类型:Result - - 字段: - * success : 返回是否处理成功 - - * 代码 - -``` - /** - * receive a new transaction, add in memory pool after verify success - * @param tx - * @return Result - */ - Result newTx(Transaction tx); -``` - -* **新区块诞生** - * 方法名称: newBlock - * 方法说明: - - - 收到网络发来的一个新诞生的区块,通用协议模块会得到完整的区块信息(采取组装交易的方式,若本地找不到某些交易,则向对应的节点下载),然后把完整的区块交给共识模块进行验证--入库等操作。 - - 在接口类里有两个重载方法,是否明确知道是从哪个对等节点接收到的新区块。 - - * 参数说明: - - - block : 完整的区块信息(Block) - - node : 接收到的对等节点信息(Node) - - - * 返回值说明: - - - 类型:Result - - 字段: - * success : 返回是否处理成功 - - * 代码 - -``` - /** - * receive block from other peers - * @param block - * @return Result - */ - Result newBlock(Block block); - - /** - * receive block from other peers - * @param block - * @param node - * @return Result - */ - Result newBlock(Block block, Node node); -``` - -* **添加一个区块到主链之上** - * 方法名称: addBlock - * 方法说明: - - - 当本地区块低于网络最新高度时,需要从网络下载最新的增量区块,下载到区块之后调用该方法进行添加,把区块连接到本地主链之上。 - - * 参数说明: - - - block : 完整的区块信息(Block) - - - * 返回值说明: - - - 类型:Result - - 字段: - * success : 返回是否处理成功 - - * 代码 - -``` - /** - * synchronous block from other peers - * @param block - * @return Result - */ - Result addBlock(Block block); -``` - - -* **回滚区块** - * 方法名称: rollbackBlock - * 方法说明: - - - 撤销本地主链中的最新一个区块,当传入的区块不是本地主链最新区块时,会返回失败;在POC的实现中,会优先回滚内存中主链的最优区块,成功之后再进行数据库的相应地回滚。 - - * 参数说明: - - - block : 完整的区块信息(Block) - - - * 返回值说明: - - - 类型:Result - - 字段: - * success : 返回是否处理成功 - - * 代码 - -``` - /** - * Roll back the latest block and roll back the status of the chain in the consensus service memory - * - * 回滚最新区块,同时回滚共识服务内存中链的状态 - * @return Result - */ - Result rollbackBlock(Block block) throws NulsException; -``` - -* **获取内存池的交易列表** - * 方法名称: getMemoryTxs - * 方法说明: - - - 获取内存池中的所有交易 - - * 参数说明: - - - 没有参数 - - - * 返回值: - - - 类型:List\ - - 说明:交易集合 - - * 代码 - -``` - /** - * Get all the transactions in the memory pool - * - * 获取内存池里面的所有交易 - * @return List - */ - List getMemoryTxs(); -``` - - -* **获取单笔交易** - * 方法名称: getTx - * 方法说明: - - - 查询一笔交易,实际上NULS系统的交易,是应该账本模块提供,但账本模块提供的交易都是已经确认的交易,未确认的交易在共识模块的内存池中,所以共识模块对外提供一个查找单笔交易的功能接口,同时包含查找未确认的交易。 - - * 参数说明: - - - hash : 交易hash(NulsDigestData) - - - * 返回值: - - - 类型:Transaction - - 说明:交易对象,如果没有则为null - - * 代码 - -``` - Transaction getTx(NulsDigestData hash); -``` - -## 4、模块架构 - -![tips](consensus/1.png) - - -## 5、模块协议 - -### TX_TYPE_REGISTER_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 4 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | uint64 | 抵押金额 | -| 23 | agentAddress | Address | 节点地址 | -| 23 | packingAddress | Address | 打包地址 | -| 23 | rewardAddress | Address | 奖励地址 | -| 8 | commissionRate | Double | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_JOIN_CONSENSUS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | byte[] | 委托金额 | -| 23 | address | byte[23] | 地址 | -| 8 | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_CANCEL_DEPOSIT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_STOP_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 停止节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_YELLOW_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | count | VarInt | 惩罚数量 | -| ?? | addres | Address[]| 被黄牌警告的节点地址| -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_RED_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 23 | address | byte[23] | 惩罚数量 | -| 1 | reasonCode | byte | 处罚代码 | -| ?? | evidence | VarByte | 证据 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - - - -## 6、核心流程 - -#### 创建代理 - -* 简述 - * 任何持有2万及以上NULS的用户,都可以通过钱包共识界面的创建委托(Linux通过命令行命令,或者可以通过rpc命令)功能进行创建代理。创建之后验证交易并广播到全网等待确认。 - * 该笔创建代理交易被确认之后,打包地址所在的节点,会在2轮之后开始共识。 - -* 流程图 -![tips](consensus/2.png) - -* 代码解释 - * 入口为consensus-poc-rpc工程下的io.nuls.consensus.poc.rpc.resource.PocConsensusResource类,对应的createAgent方法。 - - * PocConsensusResource里的createAgent方法,先验证参数的合法性(包括地址不能重复,不能为空,创建账户要在本地账户中能找到,账户密码的正确性等),再组装交易然后调用txProcessing方法进行签名验证并广播。 - - * 对应的网络协议定义在consensus-poc-protocol工程下的io.nuls.consensus.poc.protocol.tx.CreateAgentTransaction; - - * 与协议绑定的处理器在consensus-poc-base工程下的io.nuls.consensus.poc.tx.processor.CreateAgentTxProcessor; - - * 验证器有3个,分别是consensus-poc-base工程下的io.nuls.consensus.poc.tx.validator.AgentAddressesValidator、io.nuls.consensus.poc.tx.validator.AgentCountValidator、io.nuls.consensus.poc.tx.validator.CreateAgentTxValidator - - * CreateAgentTransaction在打包时会调用verify方法进行验证,也就是分别调用3个绑定的验证,都返回true代表验证成功;打包成功之后会调用CreateAgentTxProcessor保存到数据库。 - - * 该笔交易被打包进区块之后,会通过io.nuls.consensus.poc.process.BlockProcess里的addBlock方法进行保存区块,保存区块时,首先会做一些基本的验证,验证区块头是否合法,该区块是否包含双花的交易等,接着会验证打包人是否合法,代码为 - - ``` - boolean verifyAndAddBlockResult = chainManager.getMasterChain().verifyAndAddBlock(block, isDownload); - ``` - - 运行到这里之后,一旦成功,该笔创建委托的交易就放在了主链ChainContainer对应Chain的agentList里,下次计算轮次的时候,就会包含这条数据。 - - **同理下面的委托共识、停止代理、取消共识交易在打包进区块之后,也是一样的处理流程** - -#### 委托共识 - -* 简述 - * 持有2000NULS以上的用户,可以选择委托支持代理节点进行共识,获取相应的收益。 - -* 流程图 - -![tips](consensus/3.png) - -* 代码解释 - * 入口为consensus-poc-rpc工程下的io.nuls.consensus.poc.rpc.resource.PocConsensusResource类,对应的depositToAgent方法。 - - * PocConsensusResource里的depositToAgent方法,先验证参数的合法性(包括代理hash不能为空并且存在,委托账户不能为空且要在本地账户中能找到,账户密码的正确性等),再组装DepositTransaction交易然后调用txProcessing方法进行签名验证并广播。 - - * 对应的网络协议定义在consensus-poc-protocol工程下的io.nuls.consensus.poc.protocol.tx.DepositTransaction; - - * 与协议绑定的处理器在consensus-poc-base工程下的io.nuls.consensus.poc.tx.processor.DepositTxProcessor; - - * 验证器是consensus-poc-base工程下的io.nuls.consensus.poc.tx.validator.DepositTxValidator - - * DepositTransaction在打包时会调用verify方法进调用绑定的验证器行验证,返回true代表验证成功;打包成功之后会调用DepositTxProcessor保存到数据库。 - - -#### 停止代理 - -* 简述 - * 成功注册代理的节点,可随时选择停止代理,但保证金会被锁定72小时,委托到该代理节点的立即解锁。 - -* 流程图 -![tips](consensus/4.png) - -* 代码解释 - * 入口为consensus-poc-rpc工程下的io.nuls.consensus.poc.rpc.resource.PocConsensusResource类,对应的stopAgent方法。 - - * PocConsensusResource里的stopAgent方法,先验证参数的合法性(包括代理hash不能为空并且存在,并且是自己创建的代理,账户不能为空且要在本地账户中能找到,账户密码的正确性等),再组装StopAgentTransaction交易然后调用txProcessing方法进行签名验证并广播。 - - * 在组装StopAgentTransaction时,会把之前创建代理时锁定的保证金当作本次输入,输出一个对应锁定时间的output,相当于把之前的保证金花费掉,重新锁定一定的时间。 - - - * 对应的网络协议定义在consensus-poc-protocol工程下的io.nuls.consensus.poc.protocol.tx.StopAgentTransaction; - - * 与协议绑定的处理器在consensus-poc-base工程下的io.nuls.consensus.poc.tx.processor.StopAgentTxProcessor; - - * 验证器是consensus-poc-base工程下的io.nuls.consensus.poc.tx.validator.StopAgentTxValidator - - * StopAgentTransaction在打包时会调用verify方法调用绑定的验证器进行验证,返回true代表验证成功;打包成功之后会调用StopAgentTxProcessor保存到数据库;在StopAgentTxProcessor执行的时候,会把该代理节点对应的所有委托,都取消并解锁。 - -#### 取消委托 - -* 简述 - * 委托人随时可对代理节点的委托进行撤销,锁定的保证金立即解锁。 - -* 流程图 - -![tips](consensus/5.png) - -* 代码解释 - * 入口为consensus-poc-rpc工程下的io.nuls.consensus.poc.rpc.resource.PocConsensusResource类,对应的withdraw方法。 - - * PocConsensusResource里的withdraw方法,先验证参数的合法性(包括代理hash不能为空并且存在,并且是自己创建的代理,账户不能为空且要在本地账户中能找到,账户密码的正确性等),再组装CancelDepositTransaction交易然后调用txProcessing方法进行签名验证并广播。 - - * 在组装CancelDepositTransaction时,会把之前委托时锁定的保证金当作本次输入,输出一个马上可用的output,相当于把之前的保证金花费掉,付给自己。 - - * 对应的网络协议定义在consensus-poc-protocol工程下的io.nuls.consensus.poc.protocol.tx. CancelDepositTransaction; - - * 与协议绑定的处理器在consensus-poc-base工程下的io.nuls.consensus.poc.tx.processor.CancelDepositTxProcessor; - - * 验证器是consensus-poc-base工程下的io.nuls.consensus.poc.tx.validator.CancelDepositTxValidator - - * CancelDepositTransaction在打包时会调用verify方法调用绑定的验证器进行验证,返回true代表验证成功;打包成功之后会调用CancelDepositTxProcessor保存到数据库。 - - -#### 共识轮次 - -* 简述 - * NULS系统初始,会内置5个种子共识节点,网络的最初期由这5个种子共识节点负责维护初期网络数据;这5个种子节点没有锁定的保证金,故这5个种子节点不参与共识奖励(手续费除外)。 - * 一旦NULS系统开始运行,则后续注册的共识节点,会陆续加入到NULS的网络维护中,代理节点注册成功之后,只需满足20万NULS委托额,即可参与共识。 - * 所有满足共识条件的代理节点(包括5个种子节点),维护网络的权重相当(也就是代理节点之间的权限一样,不存在委托额大的权限大),具有相同的出块机会,大家通过共识算法轮流随机进行出块。 - * 所有满足共识条件的代理人,每人出一个块的这个周期,就叫做共识轮次;一个轮次里,每人拥有一次出块机会,且不同的轮次出块的顺序是随机的。 - -* 流程图 -![tips](consensus/6.png) - -* 代码解释 - * 流程入口为consensus-poc-base工程下的io.nuls.consensus.poc.scheduler.ConsensusScheduler类,里面的initDatas方法会io.nuls.consensus.poc.manager.CacheManager的load方法进行数据的初始化。 - - * CacheManager的load方法会先从数据库加载系统所需要的数据(包括最近100轮的区块头、最近10个完整的区块、所有的代理、委托、停止代理和取消委托记录、红黄牌记录),接着组装一个io.nuls.consensus.poc.container.ChainContainer为主链,设置到chainManager之中。 - - * ```chainManager.getMasterChain().initRound();``` - - 接着会调用io.nuls.consensus.poc.manager.RoundManager的initRound方法初始化最近的轮次信息。初始化成功之后会放到RoundManager的roundList里。 - - * 轮次的使用: - - io.nuls.consensus.poc.container.ChainContainer的verifyBlock方法。首先会通过roundManager.getCurrentRound()获取当前的轮次信息,和区块头里面的轮次信息对比,如果不是想要的轮次,那么再次调用roundManager.getRoundByIndex方法获取想要的轮次;或者调用roundManager.getNextRound获取当前轮次的下一个轮次(在RoundManager里面没有最新轮次的情况下)。 - - * 轮次的变换: - - 轮次的变换有两个途径,第一种就是上面结束的roundManager.getNextRound。第二种在io.nuls.consensus.poc.process.ConsensusProcess的doWork里,代码为 - - ``` MeetingRound round = chainManager.getMasterChain().getOrResetCurrentRound(); ``` - - 系统每1000毫秒会执行一次doWork方法,最终会调用RoundManager的resetRound(true)方法获取轮次,如果当前轮次已经结束,那么会返回新一轮的轮次信息。 - - -#### 打包区块 - -* 简述 - * 满足共识条件的代理人,对应设置的出块地址所在节点,每一轮都拥有一次出块机会。 - * 在节点启动之后,共识模块的任务调度器会启动一个打包区块的任务器,这个任务器会实时监控当前节点所有未加密账户是否成为打包节点。 - * 如果节点有未加密账户成为了代理节点的出块节点,那么打包区块的任务器会监控代理节点是否满足共识出块条件,一旦满足,则在下一轮启动共识,按共识规则进行打包出块。 - - -* 流程图 - -![tips](consensus/7.png) - -* 代码解释 - * 共识打包器的启动,在io.nuls.consensus.poc.scheduler.ConsensusScheduler的start方法里。 - - ```java - ConsensusProcess consensusProcess = new ConsensusProcess(chainManager); - threadPool.scheduleAtFixedRate(new ConsensusProcessTask(consensusProcess), 1000L, 1000L, TimeUnit.MILLISECONDS); - ``` - - * io.nuls.consensus.poc.task.ConsensusProcessTask每一秒钟会调用一次ConsensusProcess的process方法。 - - ```java - @Override - public void run() { - try { - consensusProcess.process(); - } catch (Exception e) { - Log.error(e); - } - } - ``` - - * io.nuls.consensus.poc.process.ConsensusProcess会先根据共识模块的状态、配置是否打包、网络情况等,判断是否继续处理打包。 - - * 进入doWork方法之后,先获取轮次信息,再通过获取到的轮次信息判断是否有需要出块的账户所对应的出块信息(包括出块时间,顺序索引,奖励地址、委托列表、信用值等),如果没有,则代表该节点不需要出块,那么调用clearTxMemoryPool方法定期清除内存池里面的交易。 - - * 如果需要打包,则判断当前时间是否达到了应该出块的时间,如果达到了,就调用packing方法进行打包。 - - * packing会先调用waitReceiveNewestBlock进行等待上一个块的接收,若上一个节点正常出块并正常及时接收到,那么就开始打包,若上一个节点没能及时打包或者网络传输太差的情况,那么最多等待出块时间间隔的1/2也就是5秒,超时之后就算没有接收到上一个块,也需要进行打包。 - - * 调用doPacking进行打包区块的操作;流程依次是组装区块轮次信息 -> 验证内存池里面的交易 -> 时间结束或者区块大小达到上限 -> 验证区块里的交易(包括业务冲突检测)-> 调用addConsensusTx方法组装coinbase交易(奖励)和红黄牌处罚交易组装 -> 调用ConsensusTool.createBlock组装完整的区块。 - - * 如果上一个块在打包之前没有受到,那么再次检测上一个区块是否收到,如果收到了,那么就再次重新打包,因为交易有可能重复了。 - - * 最后就是保存区块(saveBlock方法),广播区块(broadcastSmallBlock方法)。 - - -#### 区块验证 - -* 简述 - * 任何NULS节点,收到来自网络上其它对等节点发来的新区块时,都会对区块进行校验,只有合法的区块才能被正确的添加到主链之中,不合法的区块则沦为孤块。 - * 验证区块除了验证区块的基本信息之外(比如区块上限,签名,上一区块hash引用等),最重要的是验证区块的签名者是否合法。 - * 要验证区块的签名者是否合法,需要验证区块签名者是否有对应的代理节点,对应的代理节点是否满足共识出块条件,该区块的时间段是否应该对应的代理节点出块。 - -* 流程图 -![tips](consensus/8.png) - -* 代码解释 - * io.nuls.consensus.poc.service.impl.ConsensusPocServiceImpl为共识模块对外接口io.nuls.consensus.service.ConsensusService的实现。 - - ```java - @Override - public Result newBlock(Block block) { - return newBlock(block, null); - } - - @Override - public Result newBlock(Block block, Node node) { - BlockContainer blockContainer = new BlockContainer(block, node, BlockContainerStatus.RECEIVED); - boolean success = blockQueueProvider.put(blockContainer); - return new Result(success, null); - } - - @Override - public Result addBlock(Block block) { - BlockContainer blockContainer = new BlockContainer(block, BlockContainerStatus.DOWNLOADING); - boolean success = blockQueueProvider.put(blockContainer); - return new Result(success, null); - } - - ``` - - - * 当共识模块接收到一个新区块的请求时,会把这个块存放到一个区块队列提供器里,也就是blockQueueProvider进行异步处理。 - - * io.nuls.consensus.poc.task.BlockProcessTask为ConsensusScheduler启动的一个区块处理任务,这个任务每300ms执行一次;当区块队列里面有新的区块时,BlockProcessTask会把新的区块交给io.nuls.consensus.poc.process.BlockProcess的addBlock方法进行处理。 - - * BlockProcess的addBlock方法会首先验证区块的时,如果比当前的时间大,那么直接丢弃,接着验证区块的基本信息(区块是否合法),对应的区块验证器在protocol工程里,分别是: - - io.nuls.protocol.model.validator.BlockFieldValidator - - io.nuls.protocol.model.validator.BlockHeaderValidator - - io.nuls.protocol.model.validator.BlockMaxSizeValidator - - io.nuls.protocol.model.validator.BlockMerkleValidator - - io.nuls.protocol.model.validator.HeaderFieldValidator - - io.nuls.protocol.model.validator.HeaderSignValidator - - * 接着bifurcationUtil.validate(block.getHeader())验证区块对应打包人是否存在恶意分叉情况(在同一轮里打出了多个块),如果存在恶意情况则给出红牌处罚。 - - * ledgerService.verifyDoubleSpend(block)验证本区块是否存在双花交易,如果存在给出红牌处罚。 - - * **chainManager.getMasterChain().verifyAndAddBlock(block, isDownload)** 验证区块的打包人是否合法,同时验证区块的coinbase交易和处罚交易(如果存在的话),都验证通过那么就把本区块加入到内存中的主链之上(同时处理该区块包含的创建代理、委托、停止代理、取消委托、红黄牌处罚交易)。 - - * 上述成功的情况下,继续验证本区块的交易,先验证交易签名(为提供效率,多线程异步验证),再验证交易的utxo是否合法 **ledgerService.verifyCoinData(tx, toMaps, fromSet)**,最后验证交易的业务逻辑冲突 **tansactionService.conflictDetect(block.getTxs())**。 - - * 交易验证通过之后,保存区块 **blockService.saveBlock(block)**。 - - * 最后设置系统最新区块,并转发给其它对等节点。 - - * 如果上述步骤失败的区块下,会回滚内存主链的数据 **chainManager.getMasterChain().rollback(block)**。 - - -#### 分叉处理 - -* 简述 - * 由于区块的开放特性,有可能网络上的某些对等节点是恶意的(有可能修改程序代码,因为开源),也有可能某些诚信节点因为网络、服务器等各种不稳定因素,造成错误区块,区块没有及时同步等情况; - * 出现这样的情况,有可能区块是恶意的,需要丢弃,也有可能区块是正确的,只是本节点接收时间延迟;那么最终判断这个区块是否被纳入主链的标准,则是看下一个出块节点是否接着本区块出块。 - * 所以系统需要一个分叉处理器来处理节点运行过程中遇到的各种问题,保证全网主链的统一。 - -* 流程图 - -![tips](consensus/9.png) - -* 代码解释 - * 调度器ConsensusScheduler会启动一个分叉处理任务 - - ```java - ForkChainProcess forkChainProcess = new ForkChainProcess(chainManager); - threadPool.scheduleAtFixedRate(new ForkChainProcessTask(forkChainProcess), 1000L, 1000L, TimeUnit.MILLISECONDS); - ``` - - 该任务每秒执行一次,检测处理分叉区块。 - - * io.nuls.consensus.poc.task.ForkChainProcessTask直接调用io.nuls.consensus.poc.process.ForkChainProcess的doProcess方法。 - - * ForkChainProcess的doProcess方法会首先调用monitorOrphanChains方法对孤儿链进行处理,检测孤儿链的区块是否与主链或者分叉链相连,如果相连则合并,如果连不上则不做任务处理。 - - * 接下来检查分叉链,代码如下: - - ```java - - long newestBlockHeight = chainManager.getBestBlockHeight() + PocConsensusConstant.CHANGE_CHAIN_BLOCK_DIFF_COUNT; - - ChainContainer newChain = chainManager.getMasterChain(); - if (null == newChain) { - return false; - } - Iterator iterator = chainManager.getChains().iterator(); - while (iterator.hasNext()) { - ChainContainer forkChain = iterator.next(); - if (forkChain.getChain() == null || forkChain.getChain().getStartBlockHeader() == null || forkChain.getChain().getEndBlockHeader() == null) { - iterator.remove(); - continue; - } - long newChainHeight = forkChain.getChain().getEndBlockHeader().getHeight(); - if (newChainHeight > newestBlockHeight || (newChainHeight == newestBlockHeight && forkChain.getChain().getEndBlockHeader().getTime() < newChain.getChain().getEndBlockHeader().getTime())) { - newChain = forkChain; - newestBlockHeight = newChainHeight; - } - } - - ``` - - 检查所有的分叉链,是否有比主链高出3个块以上的,并且选出一条最长的分叉链出来,如果都没有,那么newChain依然为主链,否则为对应的分叉链。 - - * 检测newChain是否为主链,如果不为主链,说明找到了更长的分叉链 - - ```java - - if (!newChain.equals(chainManager.getMasterChain())) { - - ChainContainer resultChain = verifyNewChain(newChain); - - if (resultChain == null) { - chainManager.getChains().remove(newChain); - } else { - //Verify pass, try to switch chain - //验证通过,尝试切换链 - boolean success = changeChain(resultChain, newChain); - if (success) { - chainManager.getChains().remove(newChain); - } - } - } - - ``` - - * verifyNewChain方法为验证新的分叉链是否合法,主要是验证新链的区块打包人与区块里的coinbase交易、红黄牌处罚交易是否合法,如果不合法则删除该条分叉链。 - - * changeChain方法为切换这个更长的分叉链为主链,首先找到分叉点,回滚主链上分叉点之后的所有区块及交易;然后把新的分叉链的区块从分叉点处逐个验证并保存(包含区块头与交易)。如果成功,则设置分叉链为新的主链,如果失败则撤销。 - - * 链切换成功之后删除分叉链集合里的本条分叉链。 - - * 最后调用clearExpiredChain方法清除过期的孤立链、分叉链等,释放内存。 \ No newline at end of file diff --git a/source/zh-cn/manual/consensus/1.png b/source/zh-cn/manual/consensus/1.png deleted file mode 100644 index b78c11cc..00000000 Binary files a/source/zh-cn/manual/consensus/1.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/2.png b/source/zh-cn/manual/consensus/2.png deleted file mode 100644 index e8ff3716..00000000 Binary files a/source/zh-cn/manual/consensus/2.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/3.png b/source/zh-cn/manual/consensus/3.png deleted file mode 100644 index 3c1b9c38..00000000 Binary files a/source/zh-cn/manual/consensus/3.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/4.png b/source/zh-cn/manual/consensus/4.png deleted file mode 100644 index 42434806..00000000 Binary files a/source/zh-cn/manual/consensus/4.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/5.png b/source/zh-cn/manual/consensus/5.png deleted file mode 100644 index 6aa8541d..00000000 Binary files a/source/zh-cn/manual/consensus/5.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/6.png b/source/zh-cn/manual/consensus/6.png deleted file mode 100644 index f3fd9a2d..00000000 Binary files a/source/zh-cn/manual/consensus/6.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/7.png b/source/zh-cn/manual/consensus/7.png deleted file mode 100644 index 5a29107d..00000000 Binary files a/source/zh-cn/manual/consensus/7.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/8.png b/source/zh-cn/manual/consensus/8.png deleted file mode 100644 index 19e1ccaf..00000000 Binary files a/source/zh-cn/manual/consensus/8.png and /dev/null differ diff --git a/source/zh-cn/manual/consensus/9.png b/source/zh-cn/manual/consensus/9.png deleted file mode 100644 index 9885bd4f..00000000 Binary files a/source/zh-cn/manual/consensus/9.png and /dev/null differ diff --git a/source/zh-cn/manual/contract.md b/source/zh-cn/manual/contract.md deleted file mode 100644 index 397335d7..00000000 --- a/source/zh-cn/manual/contract.md +++ /dev/null @@ -1,4 +0,0 @@ -title: 智能合约 ---- - -Coming Soon. \ No newline at end of file diff --git a/source/zh-cn/manual/index.md b/source/zh-cn/manual/index.md deleted file mode 100644 index 770fe04f..00000000 --- a/source/zh-cn/manual/index.md +++ /dev/null @@ -1,93 +0,0 @@ -title: 总体架构 ------------ - -## 1、架构图 - -![总体架构图](index/structure.png) - -### 1.1 存储和工具层 - -#### 1.1.1 工具 - -​ NULS底层代码中独立了tools-module模块,提供各种底层相关的工具代码,包括密码学工具、http工具、缓存工具、数学计算工具、配置文件操作工具、命令行工具等,便于上层模块使用 - -#### 1.1.2 存储层 - -​ db-module模块定义了数据存储服务的接口、用于存储各类型的数据,当前实现的版本基于LevelDB进行key-value式的存储,可以将任意序列化数据存入数据库中,高效、节省空间。 - -### 1.2 网络层 - -​ network-module模块定义了网络服务的接口,用于与对等节点建立连接和互相通信。当前实现的版本基于Netty实现,定义了一系列通讯协议,实现节点和连接的管理。模块功能包括节点发现、数据传输、定时握手、节点管理等功能 - -### 1.3 共识层 - -​ 共识层定义了token,激励机制,区块打包机制,基础数据协议,和核心业务流程,当前实现采用POC共识实现。 - -### 1.4 接口层 - -​ NULS的接口层分为两个部分,智能合约和RPC接口服务,智能合约基于NVM运行,支持Java语法。RPC由各个功能模块实现,每个模块可以提供自己的RPC接口,所有RPC接口汇总组成了NULS RPC接口服务。 - -### 1.5 应用层 - -​ NULS生态中的业务应用。 - -## 2、 模块关系 - -![模块关系](index/relationship.png) - -### 2.1 Tools模块 - -​ 工具模块,内置一些基础工具供其他模块使用。 - -### 2.2 Core模块 - -​ 微内核模块,负责模块的管理,线程的管理,上下文的管理,配置信息的管理。 - -### 2.3 Account模块 - -​ 账户模块负责地址、公私钥对、账户token余额的管理 - -### 2.4 Network模块 - -​ 网络模块负责接收和发送对等节点间的消息,其中业务消息会通过接口调用的方式发送给message-bus模块。 - -### 2.5 Message-Bus模块 - -​ 该模块当前实现使用Disruptor环形队列来进行数据的缓冲,并将消息分发给对应的订阅者(Handlers)。 - -### 2.6 Protocol模块 - -​ 当前实现的Protocol模块,定义了大部分通用业务的协议,并且实现了大部分协议的处理器,包括区块处理、交易处理,数据同步等内容。 - -### 2.7 consensus模块 - -​ 共识模块负责token的创建、管理,打包,数据验证,数据存储,区块打包的业务逻辑管理,节点惩罚等内容。 - -### 2.8 Ledger模块 - -​ 该模块负责存储交易及交易中的token数据记录,验证token使用是否合法。 - -### 2.9 Storage模块 - -​ db-module存储模块支持所有类型的数据存储,当前采用LevelDB进行存储。 - -### 2.10 Contract模块 - -​ 合约模块主要用于与NVM(NULS虚拟机)通讯,可以进行智能合约相关业务的调用、查询操作。 - -更详细模块介绍参见后续章节 - -## 3、核心业务关系 - -![区块链](index/blockchain.png) - -说明: - -* 系统启动后通过节点发现功能,寻找并连接对等节点,实现节点间通讯。 -* 接收到的外部消息统一进入ConnectionManager中处理,如果是网络模块自身的消息,则放入网络消息处理器中,否则统一通过Message-Bus的分发,传入对应消息的处理器中进行处理 -* 消息分为3个类型,区块、交易和其他业务消息,处理的方式各有不同 -* 交易放入缓冲池,然后进行校验,供共识模块进行打包 -* 区块验证后直接进行存储 -* 其他业务消息在handler中处理并调用网络返回处理结果 -* 应用通过调用RPC来实现数据交互,可以像网络广播一条交易,也可以从收到的区块中获取需要的数据。 -* 各个模块调用存储模块时,会把业务数据准备好,存储模块只负责增删改查操作,不进行任何业务处理。 \ No newline at end of file diff --git a/source/zh-cn/manual/index/blockchain.png b/source/zh-cn/manual/index/blockchain.png deleted file mode 100644 index 06caa7ba..00000000 Binary files a/source/zh-cn/manual/index/blockchain.png and /dev/null differ diff --git a/source/zh-cn/manual/index/relationship.png b/source/zh-cn/manual/index/relationship.png deleted file mode 100644 index def24ab5..00000000 Binary files a/source/zh-cn/manual/index/relationship.png and /dev/null differ diff --git a/source/zh-cn/manual/index/structure.png b/source/zh-cn/manual/index/structure.png deleted file mode 100644 index 0893266b..00000000 Binary files a/source/zh-cn/manual/index/structure.png and /dev/null differ diff --git a/source/zh-cn/manual/kernel/bootstrap.png b/source/zh-cn/manual/kernel/bootstrap.png deleted file mode 100644 index 9a3fbc86..00000000 Binary files a/source/zh-cn/manual/kernel/bootstrap.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger.md b/source/zh-cn/manual/ledger.md deleted file mode 100644 index 6b671739..00000000 --- a/source/zh-cn/manual/ledger.md +++ /dev/null @@ -1,326 +0,0 @@ -title: 账本模块解析 ---- - -## 1、模块概述 - -`Legder-module`模块保存了全网所有的交易以及`UTXO`,数据完整、公开、透明。 -> 正因如此,账本模块的主要作用是验证交易的合法性,如交易发出者必须拥有当前UTXO、UTXO未锁定即可用、输出不能大于输入、不能双花即不能重复支付。 - ->> 另账本模块可为回滚区块提供数据支撑。 - -## 2、模块协议 - -### 2.1 交易中`CoinData`数据结构[UTXO模型在NULS中的设计应用] - -*以转账为例* - -* **`CoinData`** - - List froms - - > 表示转账发出者可用于转出的UTXO(可用资金) - - List tos - - > 新生成的UTXO,表示转账金额以及找零给转账发出者的UTXO - - eg. - - 账户A向账户B转账5个NULS,账户A有一个6NULS的UTXO,那么CoinData在不考虑手续费的情况下 - - > froms: - - >> utxo-6-nuls-sender - - > tos: - - >> utxo-5-nuls-receiver - - >> utxo-1-nuls-sender - -* **`Coin`** - - byte[] owner - - > 在*`List froms`*中`owner`保存的是上一笔交易的txHash+index[tos这个List的index],如何理解呢,概述为这个UTXO的来源,是某一笔交易中的`List tos`其中之一,具体是第几个,由index来定位。 - - >> - - - > 在*`List tos`*中`owner`保存的是转账接收者的账户地址 - - Na na - - > 这笔UTXO所含资金 - - long lockTime - - > 是否锁定,可按时间、区块高度锁定,例如创建交易后1小时后解锁,或者区块高度增加1000块后解锁 - -## 3、模块功能 - -### 3.1 验证交易 - -验证逻辑:*交易发出者必须拥有当前UTXO、UTXO未锁定即可用、输出不能大于输入、不能双花即不能重复支付* - -* 本地钱包节点:创建交易后保存未确认交易时验证交易 -* 出块节点:打包交易时验证交易 -* 共识节点:接收区块后验证区块时验证交易 - -### 3.2 保存交易 - -保存逻辑:*维护交易中的`UTXO`,删除`from`中的`UTXO`即已花费,保存`to`中的`UTXO`即未花费,保存交易* - -* 共识节点:区块验证通过后保存交易。 - -### 3.3 验证区块双花或者一个交易列表双花 - -验证逻辑:*把所有交易中的`fromUtxo`拿出来,查找是否存在重复,有则为双花* - -* 共识节点:区块验证时 -* 其他情况:需要对一个交易列表验证时 - -### 3.4 回滚交易 - -回滚逻辑:*保存交易的反向操作* - -* 链分叉需要回滚区块时 - -### 3.5 查询功能 - -* 根据`txHash`获取交易 -* 获取全网`UTXO`资金之和 -* 根据`key`[txhash+index]获取UTXO - - -## 4、模块接口 - -### 4.1 接口定义类 - -```java -io.nuls.ledger.service.LedgerService -``` - -### 4.2 接口方法概述 - -* #### **_验证交易_** - - - - - * 代码 - - ```java - public ValidateResult verifyCoinData(Transaction transaction, Map temporaryToMap, Set temporaryFromSet); - - - public ValidateResult verifyCoinData(Transaction transaction, Map temporaryToMap, Set temporaryFromSet, Long bestHeight); - - ``` - - * 方法说明: - - 验证交易发出者必须拥有当前UTXO、UTXO未锁定即可用、输出不能大于输入、不能双花即不能重复支付。 - - * 参数说明: - - `Transaction transaction` -> 待验证交易 - - `Map temporaryToMap` -> 本次打包的交易所产生的`UTXO(List tos)`依次装进`temporaryToMap`中,用于验证一个区块中连续交易所使用的`UTXO`的合法性,即在同一个区块中上一笔交易产生的`UTXO`在下一笔交易里被花费,由于待打包区块的交易还未保存进全账本中,所以在验证交易使用的`UTXO`是否存在时,先检查全账本中是否存在,若不存在,再检查`temporaryToMap`,若也不存在,则说明使用的`UTXO`是非法的。 -> -> 每个交易验证通过后,把本次交易产生的UTXO也装进`temporaryToMap`中,用于下一笔交易的验证。 - - `Set temporaryFromSet` -> 本次打包的交易所花费的`UTXO(List froms)`依次装进`temporaryFromSet`中,用于验证本区块中交易使用的UTXO是否双花即重复支付。 -> -> 每个交易验证通过后,把本次花费的`UTXO(List froms)`也装进`temporaryFromSet`中,用于下一笔交易的验证。 - - `Long bestHeight` -> 验证`UTXO(List froms)`里的`UTXO`的锁定状态时,指定当前解锁的最高区块高度 - - - * 返回值说明: - - 验证通过则返回成功,不附带数据 - - 验证失败则返回失败错误码,不附带数据 - -* #### **_保存交易_** - - - - - * 代码 - - ```java - Result saveTx(Transaction tx) throws NulsException; - ``` - - * 方法说明: - - 验证区块通过后保存交易,维护交易中的`UTXO`,删除`from`中的`UTXO`即已花费,保存`to`中的`UTXO`即未花费,保存交易 - - - * 参数说明: - - `Transaction tx` -> 待保存交易 - - * 返回值说明: - - 保存成功则返回成功,不附带数据 - - 保存失败则返回失败错误码,不附带数据 - -* #### **_验证区块双花或者一个交易列表双花_** - - - - - * 代码 - - ```java - ValidateResult> verifyDoubleSpend(Block block); - - ValidateResult> verifyDoubleSpend(List txList); - ``` - - * 方法说明: - - 把所有交易中的`fromUtxo`拿出来,查找是否存在重复,有则为双花 - - * 参数说明: - - `Block block` -> 待验证区块 - - `List txList` -> 待验证交易列表 - - * 返回值说明: - - 验证成功则返回成功,不附带数据 - - 验证失败则返回失败错误码,同时附带数据data, 即双花的两条交易 -* #### **_回滚交易_** - - - - - * 代码 - - ```java - Result rollbackTx(Transaction tx) throws NulsException; - ``` - - * 方法说明: - - 链分叉需要回滚区块时回滚交易 - - * 参数说明: - - `Transaction tx` -> 待回滚交易 - - * 返回值说明: - - 回滚成功则返回成功,不附带数据 - - 回滚失败则返回失败错误码,不附带数据 - - -* #### **_查询交易_** - - - - - * 代码 - - ```java - Transaction getTx(NulsDigestData hash); - Transaction getTx(byte[] txHashBytes); - ``` - - * 方法说明: - - 根据交易hash查询交易 - - * 参数说明: - - `NulsDigestData hash` -> 交易hash对象 - - `byte[] txHashBytes` -> 交易hash字节数组 - - * 返回值说明: - - 返回交易对象或者空 - -* #### **_查询全网UTXO资金之和_** - - - - - * 代码 - - ```java - long getWholeUTXO(); - ``` - - * 方法说明: - - 查询全网所有未花费的资金之和 - - * 参数说明: - - 无 - - * 返回值说明: - - 返回nuls的最小单位na - -* #### **_根据key[txHash+index]查询UTXO_** - - - - - * 代码 - - ```java - Coin getUtxo(byte[] owner); - ``` - - * 方法说明: - - 根据key[txHash+index]查询UTXO - - * 参数说明: - - `byte[] owner` -> 产生这个UTXO的交易的txHash+index - - - * 返回值说明: - - 返回Coin对象或者空 - -## 5、模块架构 - -![architecture](ledger/5.png) - - -## 6、核心流程 - -### 6.1 系统核心流程概览 - -> 账本模块的接口作为组件运用在系统其它流程中 - -![core_processes](ledger/core_processes.png) - - -### 6.2 账本模块核心流程 - -* 保存交易 - -![save_transaction](ledger/6.png) - - -* 验证UTXO - - -![verify_coindata](ledger/7.png) \ No newline at end of file diff --git a/source/zh-cn/manual/ledger/10.png b/source/zh-cn/manual/ledger/10.png deleted file mode 100644 index 1fb7385a..00000000 Binary files a/source/zh-cn/manual/ledger/10.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/5.png b/source/zh-cn/manual/ledger/5.png deleted file mode 100644 index cc189feb..00000000 Binary files a/source/zh-cn/manual/ledger/5.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/6.png b/source/zh-cn/manual/ledger/6.png deleted file mode 100644 index fe99a1c4..00000000 Binary files a/source/zh-cn/manual/ledger/6.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/7.png b/source/zh-cn/manual/ledger/7.png deleted file mode 100644 index c04eb31c..00000000 Binary files a/source/zh-cn/manual/ledger/7.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/8.png b/source/zh-cn/manual/ledger/8.png deleted file mode 100644 index 00d0fbdf..00000000 Binary files a/source/zh-cn/manual/ledger/8.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/9.png b/source/zh-cn/manual/ledger/9.png deleted file mode 100644 index 5bfa9165..00000000 Binary files a/source/zh-cn/manual/ledger/9.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/AccountLedgerService.png b/source/zh-cn/manual/ledger/AccountLedgerService.png deleted file mode 100644 index 310c20ae..00000000 Binary files a/source/zh-cn/manual/ledger/AccountLedgerService.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/account-ledger-processes.png b/source/zh-cn/manual/ledger/account-ledger-processes.png deleted file mode 100644 index 51a87935..00000000 Binary files a/source/zh-cn/manual/ledger/account-ledger-processes.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/class_pic.png b/source/zh-cn/manual/ledger/class_pic.png deleted file mode 100644 index 5ad4443c..00000000 Binary files a/source/zh-cn/manual/ledger/class_pic.png and /dev/null differ diff --git a/source/zh-cn/manual/ledger/core_processes.png b/source/zh-cn/manual/ledger/core_processes.png deleted file mode 100644 index 0ebbc718..00000000 Binary files a/source/zh-cn/manual/ledger/core_processes.png and /dev/null differ diff --git a/source/zh-cn/manual/message_bus.md b/source/zh-cn/manual/message_bus.md deleted file mode 100644 index f6ee124f..00000000 --- a/source/zh-cn/manual/message_bus.md +++ /dev/null @@ -1,98 +0,0 @@ -# NULS消息总线模块解析 ---- - -## 1、模块概述 - -消息总线模块是NULS专门用来处理消息的功能性模块,管理着所有的网络消息和协议消息,并且提供消息的订阅、接收、发送等功能,是NULS各个节点的数据中转站。 - -## 2、模块功能 - -消息总线模块通过MessageManager消息管理器对NULS中所有消息进行统一的管理,提供了消息的订阅、取消订阅、广播消息、点对点发送消息、接收消息、创建消息示例等功能。 - -## 3、模块接口 - -- 接口定义类 `io.nuls.message.bus.service.MessageBusService` - -```java - - /** - * 订阅消息 - * Subscribe to message - * - * @param messageClass 需要订阅消息的 class对象 - * @param messageClass The class object that needs to subscribe to the message. - * @param messageHandler 消息处理器 - * @param messageHandler The message message - * @return The id of the subscription message. - */ - String subscribeMessage(Class messageClass, NulsMessageHandler messageHandler); - - - /** - * 取消订阅消息 - * unsubscribe - * - * @param subscribeId 订阅消息的id. - * @param subscribeId The id of the message message. - */ - void unsubscribeMessage(String subscribeId); - - /** - * 接收消息, 把消息放至消息总线 - * Receive the message and place the message on the message bus. - * - * @param message 接收到的消息 - * @param message Received message. - * @param node 节点, 该消息来自哪个节点. - * @param node The message comes as to which node. - */ - void receiveMessage(BaseMessage message, Node node); - - /** - * 广播消息 - * broadcast to nodes except "excludeNode" - * - * @param message The message was broadcast. - * @param excludeNode 不会广播的节点 The node that is not passed. - * @param aysn 是否异步 Asynchronous execution - * @return Return all broadcasted node id list - */ - Result> broadcast(BaseMessage message, Node excludeNode, boolean aysn, int percent); - - - /** - * 发送消息到一个节点 - * send msg to one node - * - * @param message The message you want to sent - * @param node The node that received the message - * @param aysn 是否异步 Asynchronous execution - * @return Return whether sent successfully - */ - Result sendToNode(BaseMessage message, Node node, boolean aysn); - - /** - * 根据消息类型和模块标识实例化一个消息对象 - * Instantiate a message object based on message type and module identity. - */ - Result getMessageInstance(short moduleId, int type); -``` - -## 4、模块架构 - -- 模块名称:message-bus-module -- 模块ID:6 - -![mbarchitecture](message_bus/Architecture.png) - -## 5、核心流程 - -#### 5.1 模块启动-订阅消息 - -![MessageBus流程1](message_bus/Diagram_1.png) - - - -#### 5.2 接收消息-分类处理器处理-分发到具体消息handler进行处理 - -![MessageBus流程2](message_bus/Diagram_2.png) diff --git a/source/zh-cn/manual/message_bus/Architecture.png b/source/zh-cn/manual/message_bus/Architecture.png deleted file mode 100644 index cbae0f59..00000000 Binary files a/source/zh-cn/manual/message_bus/Architecture.png and /dev/null differ diff --git a/source/zh-cn/manual/message_bus/Diagram_1.png b/source/zh-cn/manual/message_bus/Diagram_1.png deleted file mode 100644 index 2631d3e6..00000000 Binary files a/source/zh-cn/manual/message_bus/Diagram_1.png and /dev/null differ diff --git a/source/zh-cn/manual/message_bus/Diagram_2.png b/source/zh-cn/manual/message_bus/Diagram_2.png deleted file mode 100644 index b60aa9c7..00000000 Binary files a/source/zh-cn/manual/message_bus/Diagram_2.png and /dev/null differ diff --git a/source/zh-cn/manual/micro_kernel.md b/source/zh-cn/manual/micro_kernel.md deleted file mode 100644 index 39309a61..00000000 --- a/source/zh-cn/manual/micro_kernel.md +++ /dev/null @@ -1,250 +0,0 @@ -# 第三章 微内核模块解析 - -[TOC] - -## 1、模块概述 - -微内核模块是NULS的核心模块,负责系统的模块管理、对象管理、线程管理、服务管理、配置管理等核心功能, - -## 2、模块功能 - -### 2.1 配置管理 - -微内核模块负责系统配置文件的读取和存储,各个模块需要使用时,只需要调用配置管理器来获取需要的配置项信息。 - -配置支持properties和ini两种格式。 - -### 2.2 上下文管理 - -微内核模块提供了系统的上下文容器NulsContext,通过上下文容器可以获取到最新区块、创世块、网络高度、链id、默认地址类型,上下文中还提供了服务管理器的获取服务对象的快捷访问方式。 - -### 2.3 模块管理 - -微内核模块定义了模块启动器的抽象类BaseModuleBootstrap,模块需要继承该抽象类才能把模块加入到管理中。模块管理器管理所有模块的生命周期,包括加载、初始化、运行、停止、销毁。微内核模块还要维护模块的依赖关系,控制模块的启动顺序。 - -### 2.4 对象管理 - -类似spring-framework的IOC容器,通过注解的方式实现对象的实例化,并对对象进行管理。对对应的方法进行拦截验证,如果调用的对象所在的模块尚未运行,则不允许执行。 - -### 2.5 线程管理 - -微内核模块提供线程管理器TaskManager,可以创建并允许线程或线程池。提供默认的线程创建工厂NulsThreadFactory,所有线程都应该用该工厂进行创建。 - -### 2.6 服务管理 - -NULS中的所有的服务,都注册到服务管理器中,服务间相互依赖可以通过注解的方式进行引用,也可以通过NulsContext上下文管理器来获取。 - -### 2.7 国际化 - -微内核模块提供了基础的国际化方案,通过不同的配置文件(zh-CN.properties,en.properties)实现语言的切换,任意语言都可以通过配置文件的方式加入nuls系统中。 - -## 3、模块接口 - -### 3.1 设置语言 - -接口定义类: - -``` -io.nuls.kernel.service.KernelService -``` - -- 获取创世块 - - - 方法说明: - - 设置系统语言, - - - 参数说明: - - lang(String):国际化配置文件的前缀,如英文en.properties配置的key就是"en" - - - 返回值说明: - - success(boolean):操作是否成功 - - - 代码 - - ``` - /** - * 设置系统语言 - * set language of system - * - * @param lang zhe name of the language properties file - * @return success or not - */ - public Result setLanguage(String lang); - ``` - -### 3.2 线程接口 - -接口定义类: - -``` -io.nuls.kernel.thread.manager.TaskManager -``` - -- 创建线程池 - - - 方法说明: - - 根据传入的参数创建一个线程池,并返回 - - - 参数说明: - - threadCount(int):线程数量 - - queueSize(int):队列数量 - - factory(NulsThreadFactory):线程创建工厂对象 - - - 返回值说明: - - data:返回创建的线程池对象 - - - 代码 - - ``` - /** - * 创建一个线程池,并返回 - * create a thread pool and return it; - * @param threadCount the max count of thread - * @param queueSize the max size of the queue - * @param factory which create all the threads - * @return the thread pool - */ - public static final ThreadPoolExecutor createThreadPool(int threadCount, int queueSize, NulsThreadFactory factory) - ``` - -- 创建定时任务线程池 - - - 方法说明: - - 根据传入的参数创建一个定时任务线程池,并返回 - - - 参数说明: - - threadCount(int):线程数量 - - factory(NulsThreadFactory):线程创建工厂对象 - - - 返回值说明: - - data:返回创建的线程池对象 - - - 代码 - - ``` - /** - * 创建一个定时执行的线程池,并返回 - * create a scheduled thread pool and return it; - * @param threadCount the max count of thread - * @param factory which create all the threads - * @return the thread pool - */ - public static final ScheduledThreadPoolExecutor createScheduledThreadPool(int threadCount, NulsThreadFactory factory) ; - ``` - -- 异步方法执行 - - - 方法说明: - - 异步的方式调用一个run方法,所有以这种方式调用的方法共用同一个线程池。 - - - 参数说明: - - runnable(Runnable):run - - - 返回值说明: - - void - - - 代码 - - ``` - /** - * 异步执行一个方法,该方法会在系统中一个特定的线程池中异步执行, - * 该线程池为系统中所有该类的调用者共享。 - * A method is executed asynchronously, which is executed asynchronously in a specific - * thread pool in the system, which is shared by all callers of this class in the system. - * @param runnable 可以行的run方法对象,Run method object - */ - public static final void asynExecuteRunnable(Runnable runnable) - ``` - -- 创建独立线程并运行 - - - 方法说明: - - 根据传入的参数创建一个线程, - - - 参数说明: - - moduleId(short):模块id - - threadName(String):线程名称 - - runnable(Runnable):执行方法对象 - - deamon(boolean):是否创建守护进程 - - - 返回值说明: - - void - - - 代码 - - ``` - /** - * 创建一个独立的线程,并执行runnable的run方法 - * Create a separate thread and execute the runnable run method - * @param moduleId 模块id - * @param threadName 线程名称 - * @param runnable 方法对象 - * @param deamon 是否是守护线程 - */ - public static final void createAndRunThread(short moduleId, String threadName, Runnable runnable, boolean deamon) - ``` - -- 停止一个模块的所有线程 - - - 方法说明: - - 根据传入的模块id停止该模块的所有线程 - - - 参数说明: - - moduleId(short):模块id - - - 返回值说明: - - void - - - 代码 - - ``` - /** - * 停止一个模块的所有线程 - * stop all the threads of the module - * @param moduleId 模块id - */ - public static void shutdownByModuleId(short moduleId) - ``` - -## 4、模块架构 - -``` -1、微内核模块是整个NULS系统的“主板”,所有模块都是插在主板上的 -2、模块间通信、功能调用都依赖于“主板” -3、“主板”提供管理和协同的作用 -``` - -## 5、模块协议 - -略 - -## 6、核心流程 - -### 6.1 系统启动 - -![](./kernel/bootstrap.png) - diff --git a/source/zh-cn/manual/modular_overview.md b/source/zh-cn/manual/modular_overview.md deleted file mode 100644 index 74056a9b..00000000 --- a/source/zh-cn/manual/modular_overview.md +++ /dev/null @@ -1,26 +0,0 @@ -title: NULS 模块组织结构 ---- - -NULS系统是以多个模块组合而成,模块的定义有一套规则:顶级目录—>接口工程、实现目录—>实现工程。也有相应的命名规则,比如一个模块为A,那么这个模块的结构如下: - -* A-module -* A -* base -* A-base -* A-protocol -* A-rpc -* A-sdk -* A-storage - -有变化的地方在于,这个模块有很明确的多种不同的实现方式,那么按照相应的实现方式来命名,比较典型的有共识模块和账本模块。这种情况下,比如一个模块为M,其实现方式为B,那么这个模块的结构如下: - -* M-module -* M -* B -* M-B-base -* M-B-protocol -* M-B-rpc -* M-B-sdk -* M-B-storage - -值得注意的是,不是所有模块的实现都必须包含这些工程,比如有的模块不需要用到存储,那么就不需要有storage,有的模块没有协议,那么就不需要protocl。 \ No newline at end of file diff --git a/source/zh-cn/manual/modularity.md b/source/zh-cn/manual/modularity.md deleted file mode 100644 index 23179585..00000000 --- a/source/zh-cn/manual/modularity.md +++ /dev/null @@ -1,21 +0,0 @@ -title: 为什么强调使用模块化 ---- - -自比特币诞生起,早期区块链应用都是一个单体应用,为某个特定目的服务。 - -任何人想要复用比特币的相关代码,只能深入整个比特币工程,了解所有细节。 -根据自己的实际情况调整代码并实现功能。 - -NULS 自诞生起,它是为商业而生的 PaaS。它的目标只有一个:降低企业使用区块链技术的成本。只有使用模块化的底层设计,才能让区块链变得具有可重塑性。 - -## 为什么这样设计 -商业需求瞬息万变,NULS 开发者们根本不可能提前写出一个可以覆盖 100% 环境的商业区块链系统。使用最小化的功能模块, 搭积木式的拼凑起一条区块链体系。可以尽可能的以最低成本满足尽可能多的商业需求。 - -## 带来的价值 -目前 NULS 开源的模块都基于 MIT 协议,为常用的几种区块链组网模型提供了良好的支撑。企业使用基于这些模块的代码是无需付费的。同时,得益于 NULS 的全球开发者计划。企业可以选择使用社区提供的免费或者付费授权模块。甚至可以从开发者中筛选雇佣熟悉 NULS 底层,便于企业快速搭建满足自己商业需求的,商用区块链网络。 - -## 还有么? - -NULS 希望建立起企业与开发者的桥梁,连接全球 NULS 用户参与共识。 -企业只需要将侧链的摘要存证到 NULS 主网,可在不牺牲敏感数据安全性的前提下,显著提高闭源企业的数据可信度。 - diff --git a/source/zh-cn/manual/network/message.png b/source/zh-cn/manual/network/message.png deleted file mode 100644 index 51e7767a..00000000 Binary files a/source/zh-cn/manual/network/message.png and /dev/null differ diff --git "a/source/zh-cn/manual/network/network\346\236\266\346\236\204\345\233\276.png" "b/source/zh-cn/manual/network/network\346\236\266\346\236\204\345\233\276.png" deleted file mode 100644 index 55551e64..00000000 Binary files "a/source/zh-cn/manual/network/network\346\236\266\346\236\204\345\233\276.png" and /dev/null differ diff --git "a/source/zh-cn/manual/network/network\346\265\201\347\250\213\345\233\276.png" "b/source/zh-cn/manual/network/network\346\265\201\347\250\213\345\233\276.png" deleted file mode 100644 index 736dd35f..00000000 Binary files "a/source/zh-cn/manual/network/network\346\265\201\347\250\213\345\233\276.png" and /dev/null differ diff --git "a/source/zh-cn/manual/network/network\347\261\273\345\233\2761.png" "b/source/zh-cn/manual/network/network\347\261\273\345\233\2761.png" deleted file mode 100644 index de8781df..00000000 Binary files "a/source/zh-cn/manual/network/network\347\261\273\345\233\2761.png" and /dev/null differ diff --git "a/source/zh-cn/manual/network/network\347\261\273\345\233\2762.png" "b/source/zh-cn/manual/network/network\347\261\273\345\233\2762.png" deleted file mode 100644 index 359ebf0c..00000000 Binary files "a/source/zh-cn/manual/network/network\347\261\273\345\233\2762.png" and /dev/null differ diff --git a/source/zh-cn/manual/network/node1.png b/source/zh-cn/manual/network/node1.png deleted file mode 100644 index 7525a238..00000000 Binary files a/source/zh-cn/manual/network/node1.png and /dev/null differ diff --git a/source/zh-cn/manual/network/node2.png b/source/zh-cn/manual/network/node2.png deleted file mode 100644 index ac787c26..00000000 Binary files a/source/zh-cn/manual/network/node2.png and /dev/null differ diff --git a/source/zh-cn/manual/network/p2p-t1.png b/source/zh-cn/manual/network/p2p-t1.png deleted file mode 100644 index 69169017..00000000 Binary files a/source/zh-cn/manual/network/p2p-t1.png and /dev/null differ diff --git a/source/zh-cn/manual/network/p2p-t2.png b/source/zh-cn/manual/network/p2p-t2.png deleted file mode 100644 index 8368d2ae..00000000 Binary files a/source/zh-cn/manual/network/p2p-t2.png and /dev/null differ diff --git a/source/zh-cn/manual/network/p2p-t3.png b/source/zh-cn/manual/network/p2p-t3.png deleted file mode 100644 index 4c85d44b..00000000 Binary files a/source/zh-cn/manual/network/p2p-t3.png and /dev/null differ diff --git a/source/zh-cn/manual/network/p2p-t4.png b/source/zh-cn/manual/network/p2p-t4.png deleted file mode 100644 index 045cbe89..00000000 Binary files a/source/zh-cn/manual/network/p2p-t4.png and /dev/null differ diff --git a/source/zh-cn/manual/network_overview.md b/source/zh-cn/manual/network_overview.md deleted file mode 100644 index 581bbee1..00000000 --- a/source/zh-cn/manual/network_overview.md +++ /dev/null @@ -1,285 +0,0 @@ -title: 网络模块 ---- - -## 模块概述 - -​ 网络模块为NULS八大基础模块之一,提供最底层的网络通信、节点发现等服务。区块链的网络基础就是Peer to Peer,即P2P。P2P网络中的所有参与者,可以是提供服务(server),也可以是资源使用者(client)。P2P网络的特点:非中心化、可扩展性、健壮性、高性价比、隐私保护、负载均衡。 - -根据结构关系可以将P2P系统细分为四种拓扑形式: - -- 中心化拓扑(Centralized Topology):即存在一个中心节点保存了其他所有节点的索引信息,索引信息一般包括节点 IP 地址、端口、节点资源等; - - ![](network/p2p-t1.png) - -- 全分布式非结构化拓扑(Decentralized Unstructured Topology):移除了中心节点,在 P2P 节点之间建立随机网络,就是在一个新加入节点和 P2P 网络中的某个节点间随机建立连接通道,从而形成一个随机拓扑结构。比特币采用的是该网络结构; - - ![](network/p2p-t2.png) - -- 全分布式结构化拓扑(Decentralized Structured Topology,也称作DHT网络):将所有节点按照某种结构进行有序组织,比如形成一个环状网络或树状网络。而结构化网络的具体实现上,普遍都是基于 DHT(Distributed Hash Table,分布式哈希表) 算法思想。比如以太坊网络的实现算法Kademlia; - - ![](network/p2p-t3.png) - -- 半分布式拓扑(Partially Decentralized Topology):吸取了中心化结构和全分布式非结构化拓扑的优点,选择性能较高(处理、存储、带宽等方面性能)的结点作为超级结点(英文表达为SuperNodes或者Hubs),在各个超级结点上存储了系统中其他部分结点的信息,发现算法仅在超级结点之间转发,超级结点再将查询请求转发给适当的叶子结点。半分布式结构也是一个层次式结构,超级结点之间构成一个高速转发层,超级结点和所负责的普通结点构成若干层次。EOS采用的就是该网络结构。 - - ![](network/p2p-t4.png) - -​ NULS1.0版本类似于比特币采用的是第二种,全分布式非结构化拓扑。网络中的节点具有功能有:路由、钱包、挖矿、区块链数据库。所有的节点都具有路由功能,参与校验和广播交易及区块信息,且会发现和维持与其他节点的连接。 - - - -**模块信息** -​ -​ 模块名称:network-module -​ -​ 模块结构:模块顶级目录network-module,consesnus工程为模块接口定义,base目录下为网络模块的默认实现,实现工程network-base,network-protocol实现相关网络协议,network-storage网络存储接口和实现。 -​ -​ 接口定义依赖模块:**protocol-module、network-module** -​ -​ 实现额外依赖模块:**core-module、ledger-module、account-module、account-ledger-module** - -## 二 模块功能 - -本小节会详细描述网络模块的功能需求和每一个功能点限制条件,以及NULS1.0版本的默认实现方式。 - -### 1.节点发现 - -​ 功能需求:NULS的每一个节点既是服务器,可接受其他节点的连接;同时也是客户端,会主动向其他节点发起连接。节点之间会相互询问更多的节点,并尝试连接,每个节点都尽量保证自己连接到更多的节点且相互通信。 - -​ 实现方式:NULS1.0版本默认采用Netty框架实现。运行节点时,网络模块会启动网络服务(NettySever),等待其他节点的连接,同时也会主动连接其他节点(NettyClient)。主动连接的节点,我们称为主动节点,同一IP地址不能重复发起主动连接;网络服务接收到的新节点,我们称为被动节点,考虑到有局域网内节点对外暴露的公网IP一致,因此被动节点运行统一IP地址最多有10个连接。 - -​ 主动节点连接成功后,对方会返回更多其他可连接节点信息,收到节点信息后,再依次尝试主动连接这些节点。直到达到配置的主动连接最大值为止。 - -​ NULS1.0版本提供了7个种子节点,有新节点第一次运行时会连接7个种子节点。种子节点会返回新节点的外网IP地址,新节点会尝试通过外网IP主动连接自己的服务器,如果连接成功,则会主动发送一条新节点消息到网络中,其他节点收到消息后,会尝试连接新节点。 - -### 2.消息接收与处理 - -​ 功能需求:节点会收到其他节点的发送的消息。收到的消息首先通过NULS的网络协议过滤,过滤后的消息再交由各个模块处理。 - -​ 实现方式:NULS所发送的消息包含消息头(MessageHeader)和消息体(MessageBody),消息头内包含魔法参数,消息对应的模块ID和消息类型。在接收到其他节点发送的消息后,首先判断魔法参数是否一致,再判断模块ID和消息类型是否存在,不一致的消息直接过滤。 - -​ 过滤后的消息,有网络模块的协议,则由网络模块自己处理。非网络模块协议,统一放到分发器里,由分发器分发给其他模块,通过自定义的反序列化方法将MessageBody转换成业务数据再做相应处理。 - -### 3.消息广播 - -​ 功能需求:由节点产生的协议(区块、交易等)会通过网络模块发送到已连接并握手成功的其他节点。 - -​ 实现方式:网络模块提供了广播消息的接口,接口会将所有消息都添加上对应模块的消息头,再通过自定义的序列化方法转换成网络信息,发送到其他节点。 - -### 4.节点分组 - -​ 功能需求:已连接的对等节点,可根据不同的属性与功能,存放在不同的节点组里方便管理。例如按照连接情况分为主动连接组、被动连接组、按照功能可分为共识节点组、普通节点组。 - -​ 实现方式:网络模块提供了节点分组功能,并提供了创建节点组、添加节点到节点组、获取节点组等接口。当前网络模块默认创建了主动连接组和被动连接组。 - - - -## 三 模块接口 - -网络模块的外部接口定义类为io.nuls.network.service.NetworkService - -``` -/** -* 断开一个已连接的节点 -* Disconnect the connection with the node -* -* @param nodeId the id of node -*/ -void removeNode(String nodeId); - -/** -* 获取一个节点 -* get node by id -* -* @param nodeId the id of node -* @return Node -*/ -Node getNode(String nodeId); - -/** -* 获取所有节点 -* get all nodes -* -* @return Map -*/ -Map getNodes(); - -/** -* 获取已连接的节点 -* get connected nodes -* -* @return Collection -*/ -Collection getAvailableNodes(); - -/** -* 获取可连接的节点 -* get connectable nodes -* -* @return List -*/ -List getCanConnectNodes(); - -/** -* 根据名字获取节点组 -* get NodeGroup by name -* -* @param groupName groupName -* @return NodeGroup -*/ -NodeGroup getNodeGroup(String groupName); - -/** -* 发送消息 -* Send message to all connected nodes -* -* @param nulsData message -* @param asyn Whether or not asynchronous -* @return BroadcastResult -*/ -BroadcastResult sendToAllNode(BaseNulsData nulsData, boolean asyn, int percent); - -/** -* 发送消息 -* Send message to all connected nodes -* -* @param event event -* @param excludeNode node that does not need to be send -* @param asyn Whether or not asynchronous -* @param percent percent of nodes count -* @return BroadcastResult -*/ -BroadcastResult sendToAllNode(BaseNulsData event, Node excludeNode, boolean asyn, int percent); - -/** -* send message to node -* -* @param event event -* @param node node -* @param asyn Whether or not asynchronous -* @return BroadcastResult -*/ -BroadcastResult sendToNode(BaseNulsData event, Node node, boolean asyn); - -/** -* 发送消息给节点组 -* send message to nodeGroup -* -* @param event event -* @param groupName groupName -* @param asyn asyn -* @return BroadcastResult -*/ -BroadcastResult sendToGroup(BaseNulsData event, String groupName, boolean asyn); - -/** -* 重置网络 -* reset network module -*/ -void reset(); - -/** -* 获取网络配置信息 -* Get network configuration information -* -* @return NetworkParam -*/ -NetworkParam getNetworkParam(); -``` - - - -## 四 模块协议 - -网络模块,协议模块ID = 4 - -``` -short NETWORK_MODULE_ID = 4; -``` - - - -- Node p2p节点信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | --------- | ------ | -| 4 | magicNumber | uint32 | 魔法参数 | -| 2 | port | uint16 | 服务监听端口 | -| ?? | IP | VarString | 节点IP | - -- HandshakeMessage 节点握手信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -- P2PNodeMessage 新节点广播信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ------ | -| 2 | Port | uint16 | 服务监听端口 | -| ?? | IP | VarString | 节点IP | - -- NodesMessage 节点集合信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | --------------- | ------ | -| ?? | NodeCount | VarInt | 节点数 | -| ?? | Node[] | Node[NodeCount] | 节点信息数组 | - -- GetVersionMessage 获取节点版本信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -- NETWORK_VERSION - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - - - -## 五 模块架构 - -![网络模块架构图](network/network架构图.png) - -## 六 核心流程 - -#### 6.1发现节点、建立连接 - -​ NULS的每个节点既是客户端又是服务器,因此发现节点、建立连接需要从主动发起连接访问其他节点的服务器,和被动等待其他人连接自己的服务器两个方面进行描述。 - -![](network/node1.png) - -![](network/node2.png) - - - -#### 7.2消息的接收与处理 - -​ ![](network/message.png) - -## 7 模块类图 - -![](network/network类图1.png) - -![](network/network类图2.png) \ No newline at end of file diff --git a/source/zh-cn/manual/protocol.md b/source/zh-cn/manual/protocol.md deleted file mode 100644 index 0d4794e5..00000000 --- a/source/zh-cn/manual/protocol.md +++ /dev/null @@ -1,860 +0,0 @@ -title: 通用协议 ------------ - -## 1、模块概述 - -​ Protocol-module模块的设计初衷是为所有模块定义通用的协议格式,所有的模块可以通过依赖协议模块来使用这些通用的协议。在定义这些通用协议的同时,协议模块还提供了这些协议相关的通用验证器、通用处理器和一些重要数据结构的服务接口。 - -## 2、模块功能 - -### 2.1 协议定义 - -* 交易协议:共识奖励交易、转账交易、数据链上存储交易,以及交易的验证器 -* 网络协议及处理器:节点间发送、获取小区快、区块、交易的消息和处理器的定义与实现。 - -### 2.2 其他功能 - -* 区块同步:从网络对等节点处获取当前最新区块高度信息,并下载和存储区块。 -* 区块管理:接收新区块、存储区块、回滚区块、查询区块和区块头信息、广播区块。 -* 交易管理:接收交易、交易确认、交易回滚、查询交易、交易冲突检测。 - -## 3、模块接口 - -### 3.1 区块接口 - -接口定义类: - -``` -io.nuls.protocol.service.BlockService -``` - -* 获取创世块 - - * 方法说明: - - 从数据库中获取高度为0的区块,先从数据库中获取区块头,再通过LedgerService获取区块中的交易,最后组装完整的区块,放入返回结果中。 - - * 参数说明: - - 无 - - * 返回值说明: - - data:返回完整的区块信息,当查询不到数据时,返回失败的结果 - - * 代码 - - ``` - /** - * 获取创世块(从存储中) - * Get the creation block (from storage) - */ - Result getGengsisBlock(); - ``` - -* 获取最新块 - - - 方法说明: - - 从数据库中获取最大高度,根据高度查询区块头,再通过LedgerService获取区块中的交易,最后组装完整的区块,放入返回结果中。 - - - 参数说明: - - 无 - - - 返回值说明: - - data:返回完整的区块信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 获取最新的区块(从存储中) - * Get the highest block (from storage) - */ - Result getBestBlock(); - ``` - -* 获取最新区块头 - - - 方法说明: - - 从数据库中获取最大高度,根据高度查询区块头并返回。 - - - 参数说明: - - 无 - - - 返回值说明: - - data:返回区块头信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 获取最新的区块头(从存储中) - * Get the highest block header (from storage) - */ - Result getBestBlockHeader(); - ``` - -* 根据高度获取区块头 - - - 方法说明: - - 根据高度查询区块hash,再通过hash获取区块头信息 - - - 参数说明: - - 区块高度(long) - - - 返回值说明: - - data:返回区块头信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 根据区块高度获取区块头(从存储中) - * Get the block head (from storage) according to the block height - * - * @param height 区块高度/block height - * @return 区块头 - */ - Result getBlockHeader(long height); - ``` - -* 根据区块Hash获取区块头 - - - 方法说明: - - 根据hash查询区块头,放入返回结果中。 - - - 参数说明: - - 区块hash(NulsDigestHash) - - - 返回值说明: - - data:返回区块头信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 根据区块摘要获取区块头(从存储中) - * Get the block head (from storage) according to the block hash - * - * @param hash 区块摘要/block hash - * @return 区块头/block header - */ - Result getBlockHeader(NulsDigestData hash); - ``` - -* 根据高度获取区块 - - - 方法说明: - - 根据高度查询区块hash,再通过hash获取区块头信息,再通过LedgerService获取区块中的交易,最后组装完整的区块,放入返回结果中。 - - - 参数说明: - - 区块高度(long) - - - 返回值说明: - - data:返回完整的区块信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 根据区块高度获取区块(从存储中) - * Get the block (from storage) according to the block height - * - * @param height 区块高度/block height - * @return 区块/block - */ - Result getBlock(long height); - ``` - -* 根据Hash获取区块 - - - 方法说明: - - 根据hash获取区块头信息,再通过LedgerService获取区块中的交易,最后组装完整的区块,放入返回结果中。 - - - 参数说明: - - 区块hash(NulsDigestHash) - - - 返回值说明: - - data:返回完整的区块信息,当查询不到数据时,返回失败的结果 - - - 代码 - - ``` - /** - * 根据区块摘要获取区块(从存储中) - * Get the block (from storage) according to the block hash - * - * @param hash 区块摘要/block hash - * @return 区块/block - */ - Result getBlock(NulsDigestData hash); - ``` - -* 保存区块 - - - 方法说明: - - 先确认交易、再存储交易,再存储区块头,最后处理本地未确认交易。上述步骤任何一步失败,都会将前面已处理的步骤回滚。 - - - 参数说明: - - 区块(Block) - - - 返回值说明: - - success:返回区块是否存储成功 - - - 代码 - - ``` - /** - * 保存区块到存储中 - * Save the block to the store. - * - * @param block 完整区块/whole block - * @return 操作结果/operating result - * @throws NulsException 保存区块有可能出现异常,请捕获后谨慎处理 - * There may be exceptions to the save block, please handle it carefully after capture. - */ - Result saveBlock(Block block) throws NulsException; - ``` - -* 回滚区块 - - - 方法说明: - - 先回滚交易,在删除区块头,最后处理本地交易。上述步骤任何一步失败,都会将前面已处理的步骤反向操作。 - - - 参数说明: - - 区块(Block) - - - 返回值说明: - - success:返回区块是否回滚成功 - - - 代码 - - ``` - /** - * 回滚区块 - * roll back the block to the store. - * - * @param block 完整区块/whole block - * @return 操作结果/operating result - * @throws NulsException 回滚区块有可能出现异常,请捕获后谨慎处理 - * There may be exceptions to the roll back block, please handle it carefully after capture. - */ - Result rollbackBlock(Block block) throws NulsException; - ``` - -* 广播区块 - - - 方法说明: - - 将小区块放在区块广播消息中,通过调用MessageBus模块的接口将消息发送到网络中。 - - - 参数说明: - - smallBlock:小区块(SmallBlock) - - - 返回值说明: - - success:返回区块是否广播成功 - - data:发送成功的节点id列表 - - - 代码 - - ``` - /** - * 广播区块给连接的其他对等节点 - * The broadcast block gives the connection to other peers. - * - * @param block 完整区块/the whole block - * @return 广播结果/Broadcast the results - */ - Result broadcastBlock(SmallBlock block); - ``` - -* 转发区块 - - - 方法说明: - - 根据区块组装小区块,并将小区块放在转发消息中,通过调用MessageBus模块的接口将消息发送到网络中。 - - - 参数说明: - - block:区块(Block) - - excludeNode:除外的节点(Node) - - - 返回值说明: - - success:返回区块是否转发成功 - - data:发送成功的节点id列表 - - - 代码 - - ``` - /** - * 转发区块给连接的其他对等节点,允许一个列外(不转发给它) - * Forward block to other peers of the connection, allowing one column (not forward to it) - * - * @param hash 区块摘要/the hash of block - * @param excludeNode 需要排除的节点,一般是因为从该节点处接收的本区块 - * The nodes that need to be excluded are generally due to the block received from the node. - * @return 转发结果/forward results - */ - Result forwardBlock(NulsDigestData hash, Node excludeNode); - ``` - -### 3.2 交易接口 - -接口定义类: - -``` -io.nuls.protocol.service.TransactionService -``` - -* 确认交易 - - - 方法说明: - - 根据传入的交易类型,获取交易的处理器(processor),调用所有处理器的onCommit方法,任何一个处理器返回失败,则回滚已成功的处理器。 - - - 参数说明: - - tx:交易(Transaction) - - secondaryData:辅助数据(Object) - - - 返回值说明: - - success:返回交易是否确认成功 - - - 代码 - - ``` - /** - * 确认交易时调用的方法,对交易相关的业务进行提交操作 - * Identify the method that is invoked during the transaction and submit the transaction related business. - * - * @param tx 操作的交易/The transaction of the operation - * @param secondaryData 辅助数据(可以为空)/Secondary data (available for null) - * @return 操作结果/operating results - */ - Result commitTx(Transaction tx, Object secondaryData); - ``` - -* 回滚交易 - - * 方法说明: - - 根据传入的交易类型,获取交易的处理器(processor),调用所有处理器的onRollback方法,最后再删除该交易。任何一个流程返回失败,则回滚已成功的操作。 - - * 参数说明: - - tx:交易(Transaction) - - secondaryData:辅助数据(Object) - - * 返回值说明: - - success:返回交易是否回滚成功 - - * 代码 - - ``` - /** - * 回滚交易时调用的方法,对交易相关的业务进行回退操作 - * The method invoked when the transaction is rolled back and the transaction related business is returned. - * - * @param tx 操作的交易/The transaction of the operation - * @param secondaryData 辅助数据(可以为空)/Secondary data (available for null) - * @return 操作结果/operating results - */ - Result rollbackTx(Transaction tx, Object secondaryData); - ``` - -* 转发交易 - - - 方法说明: - - 将传入的交易,放入交易转发消息中,通过调用Message-Bus模块接口,将交易发送到网络中。 - - - 参数说明: - - tx:交易(Transaction) - - excludeNode:需要排除的节点(Node) - - - 返回值说明: - - success:返回交易是否转发成功 - - data:成功发送的节点id列表 - - - 代码 - - ``` - /** - * 转发交易给连接的其他对等节点,允许一个列外(不转发给它) - * Forward Transaction to other peers of the connection, allowing one column (not forward to it) - * - * @param tx 完整交易/the whole transaction - * @param excludeNode 需要排除的节点,一般是因为从该节点处接收的本交易/The nodes that need to be excluded are generally - * due to the transaction received from the node. - * @return 转发结果/forward results - */ - Result forwardTx(Transaction tx, Node excludeNode); - ``` - -* 广播交易 - - - 方法说明: - - 将传入的交易,放入交易广播消息中,通过调用Message-Bus模块接口,将交易发送到网络中。 - - - 参数说明: - - tx:交易(Transaction) - - - 返回值说明: - - success:返回交易是否转发成功 - - data:成功发送的节点id列表 - - - 代码 - - ``` - /** - * 广播交易给连接的其他对等节点 - * The broadcast transaction gives the connection to other peers. - * - * @param tx 完整交易/the whole transaction - * @return 广播结果/Broadcast the results - */ - Result broadcastTx(Transaction tx); - ``` - -* 接收新交易 - - - 方法说明: - - 将传入的交易,传入共识服务中。 - - - 参数说明: - - tx:交易(Transaction) - - - 返回值说明: - - success:共识模块是否处理成功 - - - 代码 - - ``` - /** - * 将交易缓存到共识交易池 - * cache the transaction for consensus - * - * @param tx transaction - * @return Result - */ - Result newTx(Transaction tx); - ``` - -* 冲突检测 - - - 方法说明: - - 获取所有的交易处理器(processor),调用所有处理器的conflictDetect方法,任何一个处理器返回失败,则直接返回失败的结果对象 - - - 参数说明: - - txList:交易(List) - - - 返回值说明: - - success:返回交易是否冲突 - - data:返回的辅助数据 - - - 代码 - - ``` - /** - * 冲突检测,检测如果传入的交易列表中有相冲突的交易,则返回失败,写明失败原因及所有的应该舍弃的交易列表 - *

- * Conflict detection, which detects conflicting transactions in the incoming transaction list, returns failure, - * indicating the cause of failure and all the list of trades that should be discarded. - * - * @param txList 需要检查的交易列表/A list of transactions to be checked. - * @return 操作结果:成功则返回successResult,失败时,data中返回丢弃列表,msg中返回冲突原因 - * Operation result: success returns successResult. When failure, data returns the discard list, - * and MSG returns the cause of conflict. - */ - ValidateResult conflictDetect(List txList); - ``` - -* 获取交易 - - - 方法说明: - - 根据传入的交易hash,调用共识服务的接口,返回内存中的交易数据。 - - - 参数说明: - - hash:交易hash(NulsDigestData) - - - 返回值说明: - - data:交易数据 - - - 代码 - - ``` - /** - * 根据交易hash获取交易信息 - * get transaction by tx hash - * @param hash - * @return - */ - Transaction getTx(NulsDigestData hash); - ``` - - - -### 3.3 区块同步服务接口 - -接口定义类: - -``` -io.nuls.protocol.service.DownloadService -``` - -- 下载区块 - - - 方法说明: - - 根据区块hash从指定节点处下载一个区块 - - - 参数说明: - - hash:区块hash(NulsDigestData) - - node:节点(Node) - - - 返回值说明: - - success:返回是否下载成功 - - data:返回的区块数据(Block) - - - 代码 - - ``` - /** - * 从指定节点处根据hash下载一个区块,下载过程中线程是阻塞的 - * Download a block according from the node to the hash, and the download process is blocked. - * - * @param hash 区块摘要/block hash - * @param node 指定的节点/Specified node - * @return 区块及结果/ block results - */ - Result downloadBlock(NulsDigestData hash, Node node); - ``` - -- 是否同步成功 - - - 方法说明: - - 获取当前同步状态,并判断是否是同步成功。 - - - 参数说明: - - 无 - - - 返回值说明: - - success:返回是否已同步成功 - - - 代码 - - ``` - /** - * 返回下载是否完成的结果 - * Returns the results of the download. - * @return Result - */ - Result isDownloadSuccess(); - ``` - -- 重置区块同步状态 - - - 方法说明: - - 检查当前状态是否需要下载区块,如果需要就下载。实现方式是将下载状态改为等待下载。 - - - 参数说明: - - 无 - - - 返回值说明: - - success:返回操作是否成功 - - - 代码 - - ``` - /** - * 重新检查当前状态是否需要重新同步区块,如果需要则下载 - * Recheck whether the current state needs to be resynchronized, and download if necessary. - * @return Result - */ - Result reset(); - ``` - -## 4、模块架构 - -### 4.1 模块上下文 - -a. 协议模块给其他模块提供通用协议的定义 - -b. 协议模块负责区块和交易的接收和同步功能 - -![context](protocol/context.png) - -### 4.2 模块架构图 - -![protocol](protocol/design.png) - -## 5、模块协议 - -### 5.1 模块交易 - - 通用交易数据结构 - -- 转账交易 -- CoinBase交易 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | ?? | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -- 数据承载交易 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | VarByte | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### 5.2 模块消息 - -#### PROTOCOL_NOT_FOUND - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | ------------ | ------------------ | -| 1 | type | NotFoundType | 未找到的类型 | -| ?? | Hash | VarString | 请求但未找到的hash | - -#### PROTOCOL_NEW_TX - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ----------- | ---- | -| ?? | transaction | Transaction | | - -#### PROTOCOL_GET_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | -------- | -| ?? | blockHash | NulsDigestData | 区块hash | - -#### PROTOCOL_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------------- | --------------- | ------------ | -| ?? | header | BlockHeader | 块头 | -| ?? | Transaction[] | Transaction[??] | 节点信息数组 | - -#### PROTOCOL_GET_BLOCKS_BY_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | -------------- | ------------ | -| ?? | startHeight | NulsDigestData | 开始区块hash | -| ?? | endHeight | NulsDigestData | 结束区块hash | - -#### PROTOCOL_GET_BLOCKS_BY_HEIGHT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------- | ------------ | -| 4 | startHash | uint32 | 开始区块高度 | -| 4 | endHash | uint32 | 结束区块高度 | - -#### PROTOCOL_BLOCK_HEADER - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------------- | ------------ | -| ?? | PreHash | NulsDigestData | 上一个块摘要 | -| ?? | MerkleHash | NulsDigestData | Merkle树根 | -| 6 | time | uint48 | 时间 | -| 4 | height | uint32 | 高度 | -| 4 | txCount | uint32 | 交易数量 | -| ?? | extend | VarByte | 扩展数据 | -| ?? | scriptSign | P2PKHScriptSig | 签名 | - -#### PROTOCOL_GET_TX_GROUP - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ---------------- | ------------ | -| ?? | TXHashCount | VarInt | 交易摘要数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | - -#### PROTOCOL_TX_GROUP - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | -------- | -| ?? | BlockHash | NulsDigestData | 块摘要 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_NEW_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------- | ---------------- | ------------ | -| ?? | header | BlockHeader | 块头 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_GET_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----- | -------- | -------- | -| 4 | start | uint32 | 开始高度 | -| 4 | end | uint32 | 结束高度 | - -#### PROTOCOL_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | ---------------- | ------------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| ?? | HeightListCount | VarInt | Hash列表数量 | -| ?? | Hash[] | NulsDigestData[] | Hash列表 | - -#### PROTOCOL_STRING - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ---- | -| ?? | Hash | VarString | | - -#### PROTOCOL_COMPLETE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | -------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| 1 | success | boolean | 结果 | - -#### REQUEST_REACT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | -------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | - - - -## 6、核心流程 - -### 6.1 区块同步 - -``` -1、启动区块同步线程,每一秒执行一次 -2、线程中初始化依赖的服务:区块服务、网络服务 -3、判断同步状态,等待或者失败(30秒前),才进行同步 -4、判断网络连接状态,如果连接的节点过少,则本次执行终止 -5、修改同步状态为:Ready -6、更改下载状态为:下载中 -7、初始化两个FutureTask里面分别放置:下载线程管理器和下载数据处理器 -8、等待task运行:参见6.1.1,6.1.2 -9、根据结果修改下载状态 -``` - -#### 6.1.1 区块下载 - -``` -1、检查当前区块高度,是否已经是最新高度、是否需要回滚,若需要则回滚(每次回滚10个块) -2、统计的最新高度相对应的节点,每个节点创建一个下载线程 -3、每一轮每一个节点下载10个块 -4、下载失败后,重新组织节点下载 -5、将下载的区块放入队列中 -6、清理future,停止线程池运行 -``` - -#### 6.1.2 下载到的区块处理 - -``` -1、不停的的从队列中获取区块 -2、简单校验区块数据 -3、将区块传入共识模块服务中 -4、当获取到的区块里没有区块头时,结束线程 -``` - -### 6.2 新交易处理 - -![newTx](protocol/newTx.png) - -### 6.3 新区块处理 - -![newBlock](protocol/newBlock.png) - -### 6.4 确认交易 - -![commitTx](protocol/commitTx.png) - -### 6.5 回滚交易 - -![rollbackTx](protocol/rollbackTx.png) - -### 6.6 交易冲突检查 - -![conflictDetect](protocol/conflictDetect.png) - -### 6.7 保存区块 - -![saveBlock](protocol/saveBlock.png) - -### 6.8 回滚区块 - -![rollbackBlock](protocol/rollbackBlock.png) - diff --git a/source/zh-cn/manual/protocol/UML.png b/source/zh-cn/manual/protocol/UML.png deleted file mode 100644 index ab4c88a4..00000000 Binary files a/source/zh-cn/manual/protocol/UML.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/UML2.png b/source/zh-cn/manual/protocol/UML2.png deleted file mode 100644 index f494da22..00000000 Binary files a/source/zh-cn/manual/protocol/UML2.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/commitTx.png b/source/zh-cn/manual/protocol/commitTx.png deleted file mode 100644 index caeefea9..00000000 Binary files a/source/zh-cn/manual/protocol/commitTx.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/conflictDetect.png b/source/zh-cn/manual/protocol/conflictDetect.png deleted file mode 100644 index 38f0d789..00000000 Binary files a/source/zh-cn/manual/protocol/conflictDetect.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/context.png b/source/zh-cn/manual/protocol/context.png deleted file mode 100644 index c98aacc1..00000000 Binary files a/source/zh-cn/manual/protocol/context.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/design.png b/source/zh-cn/manual/protocol/design.png deleted file mode 100644 index d3471ab3..00000000 Binary files a/source/zh-cn/manual/protocol/design.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/newBlock.png b/source/zh-cn/manual/protocol/newBlock.png deleted file mode 100644 index 83428527..00000000 Binary files a/source/zh-cn/manual/protocol/newBlock.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/newTx.png b/source/zh-cn/manual/protocol/newTx.png deleted file mode 100644 index fa260fa6..00000000 Binary files a/source/zh-cn/manual/protocol/newTx.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/rollbackBlock.png b/source/zh-cn/manual/protocol/rollbackBlock.png deleted file mode 100644 index d36969b3..00000000 Binary files a/source/zh-cn/manual/protocol/rollbackBlock.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/rollbackTx.png b/source/zh-cn/manual/protocol/rollbackTx.png deleted file mode 100644 index db350510..00000000 Binary files a/source/zh-cn/manual/protocol/rollbackTx.png and /dev/null differ diff --git a/source/zh-cn/manual/protocol/saveBlock.png b/source/zh-cn/manual/protocol/saveBlock.png deleted file mode 100644 index c89e095a..00000000 Binary files a/source/zh-cn/manual/protocol/saveBlock.png and /dev/null differ diff --git a/source/zh-cn/manual/storage.md b/source/zh-cn/manual/storage.md deleted file mode 100644 index 663cc6c1..00000000 --- a/source/zh-cn/manual/storage.md +++ /dev/null @@ -1,263 +0,0 @@ -title: NULS存储模块解析 ---- - -## 1、模块概述 - -存储模块在NULS中扮演着一个工具模块的角色,它提供了在本地存储数据的功能,各个模块都可以通过存储模块的接口对自己的数据进行存储和取出。目前NULS存储模块的数据库实现是LevelDB,开发者们也可以根据自己的需求使用不同的数据库实现。 - -## 2、模块功能 - -存储模块的功能主要分为保存数据、删除数据、查询数据;修改数据由覆盖保存或者先删除后保存来实现。而功能的实现分为单条数据的操作、批量操作,对序列化的二进制数据的操作、对model实例数据的操作等。 - -## 3、模块接口 - -- 接口定义类 `io.nuls.db.service.DBService` - -```java - /** - * 创建一个数据区域 - * Create a data area - * - * @param areaName - * @return - */ - Result createArea(String areaName); - - /** - * 创建一个自定义key比较器的数据区域 - * Create a data area for the custom key comparator. - * - * @param areaName - * @param comparator 自定义key比较器/Custom key comparator. - * @return - */ - Result createArea(String areaName, Comparator comparator); - - /** - * 列出当前数据库中所有Area名称 - * Lists all Area names in the current database - * - * @return - */ - String[] listArea(); - - /** - * 按字节存储key-value - * Store key-value in bytes. - * - * @param area - * @param key - * @param value - * @return - */ - Result put(String area, byte[] key, byte[] value); - - /** - * 存储对象 - * Store the object - * - * @param area - * @param key - * @param value 需要存储的对象/Objects that need to be stored. - * @param - * @return - */ - Result putModel(String area, byte[] key, T value); - - /** - * 根据key删除value - * Delete value according to key. - * - * @param area - * @param key - * @return - */ - Result delete(String area, byte[] key); - - /** - * 根据key获取value - * Get value from the key. - * - * @param area - * @param key - * @return - */ - byte[] get(String area, byte[] key); - - /** - * 根据key和对象class获取指定对象 - * 前提是这个key的存储方式是putModel,否则value为null - * Gets the specified object from the key and object class. - * The premise is that this key is stored in a putModel, otherwise value is null. - * - * @param area - * @param key - * @param clazz 指定对象的class/Specifies the class of the object. - * @param - * @return - */ - T getModel(String area, byte[] key, Class clazz); - - /** - * 根据key获取Object对象 - * Get the Object of Object from the key. - * - * param area - * @param key - * @return - */ - Object getModel(String area, byte[] key); - - /** - * 获取数据区域的所有key的无序集合 - * Gets an unordered collection of all keys in the data area. - * - * @param area - * @return - */ - Set keySet(String area); - - /** - * 获取数据区域的所有key的有序集合 - * Gets an ordered collection of all keys in the data area. - * - * @param area - * @return - */ - List keyList(String area); - - /** - * 获取数据区域的所有value的有序集合 - * Gets an ordered collection of all values in the data area. - * - * @param area - * @return - */ - List valueList(String area); - - /** - * 获取数据区域的所有key-value的无序集合 - * Gets an unordered collection of all key-value in the data area. - * - * @param area - * @return - */ - Set> entrySet(String area); - - /** - * 获取数据区域的所有key-value的有序集合 - * Gets an ordered set of all key-values in the data area. - * - * @param area - * @return - */ - List> entryList(String area); - - - /** - * 获取数据区域的所有key-value的有序集合,并指定返回的value对象 - * 前提是这个数据区域的存储方式是putModel,否则value为null - * Gets the ordered collection of all key-value in the data area and specifies the returned value object. - * The premise is that the storage mode in this data area is the putModel, otherwise value is null. - * - * @param area - * @param clazz 指定对象的class/Specifies the class of the object. - * @param - * @return - */ - List> entryList(String area, Class clazz); - - /** - * 获取数据区域的所有value的有序集合,并指定返回的value对象 - * 前提是这个数据区域的存储方式是putModel,否则value为null - * Gets the ordered collection of all values in the data area and specifies the returned value object. - * The premise is that the storage mode in this data area is the putModel, otherwise value is null. - * - * @param area - * @param clazz 指定对象的class/Specifies the class of the object. - * @param - * @return - */ - List values(String area, Class clazz); - - /** - * 指定数据区域的批量增删改操作 - * Specifies the batch add, delete, update operations in the data area. - * - * @param area - * @return - */ - BatchOperation createWriteBatch(String area); - - /** - * 清除Area - * - * @param areaName - * @return - */ - Result destroyArea(String areaName); - - Result clearArea(String area); - -``` - - - -- 批量操作接口定义类 `io.nuls.db.service.BatchOperation` - -```java - - /** - * 增加或者更新操作 - * Add or update operations. - * - * @param key - * @param value - * @return - */ - Result put(byte[] key, byte[] value); - - /** - * 存储或者更新对象 - * Add or update the object - * - * @param key - * @param value 需要存储或者更新的对象/Objects that need to be added or updated. - * @return - */ - Result putModel(byte[] key, T value); - - /** - * 删除操作 - * Delete operation - * - * @param key - * @return - */ - Result delete(byte[] key); - - /** - * 执行批量操作 - * Perform batch operation - * - * @return - */ - Result executeBatch(); -``` - - - -## 4、模块架构 - -- 模块名称:db-module -- 模块ID:2 - -![mbarchitecture](storage/DBArchitecture.png) - - - -## 5、模块流程 - -NULS启动时,各模块进行初始化时会在Storage中初始化使用到的DB Area常量,在模块业务逻辑中,存储数据时会时会将对应的Area和数据传给对应的存储功能接口,DB模块再执行单条数据或批量的存取操作。 - -![DBFlow](storage/DBFlow.png) \ No newline at end of file diff --git a/source/zh-cn/manual/storage/DBArchitecture.png b/source/zh-cn/manual/storage/DBArchitecture.png deleted file mode 100644 index 92051289..00000000 Binary files a/source/zh-cn/manual/storage/DBArchitecture.png and /dev/null differ diff --git a/source/zh-cn/manual/storage/DBFlow.png b/source/zh-cn/manual/storage/DBFlow.png deleted file mode 100644 index 25eb6108..00000000 Binary files a/source/zh-cn/manual/storage/DBFlow.png and /dev/null differ diff --git a/source/zh-cn/manual/structure.md b/source/zh-cn/manual/structure.md deleted file mode 100644 index f5cec34d..00000000 --- a/source/zh-cn/manual/structure.md +++ /dev/null @@ -1,97 +0,0 @@ -title: NULS 源码目录结构 ---- - -* NULS官网:https://nuls.io -* NULS开源地址:https://github.com/nuls-io -* NULS技术论坛:http://nulsforum.org/?cat=17 - -## NULS源代码目录结构说明 -![source project](structure/1.png) - -* Nuls : NULS核心底层源代码 -* Nuls-explorer : NULS区块链浏览器(https://nulscan.io) -* Nuls-client : NULS核心钱包 -* Api-server : NULS数据服务,为NULS区块链浏览器以及在线钱包 -* 移动端钱包等提供数据服务 -* Website : NULS 官网代码 - -## NULS核心底层目录结构说明 - - 我们会重点介绍NULS核心底层,github地址为https://github.com/nuls-io/nuls。 - - NULS最大的特点就是模块化设计,分为网络模块、存储模块、账户模块、账本模块、消息总线模块、通用协议模块、共识模块、智能合约模块、微内核模块、工具模块、客户端模块以及sdk模块。 - -* account-ledger-module : 账户账本模块 -* account-module : 账户模块 -* client-module :客户端模块 -* consensus-module : 共识模块 -* contract-module :智能合约模块 -* core-module :微内核模块 -* db-module :存储模块 -* ledger-module :账本模块 -* message-bus-module :消息总线模块 -* network-module : 网络通信模块 -* protocol-module : 通用协议模块 -* tools-module : 通用工具模块 - -## 模块目录结构 - -上面介绍的为各模块的顶级目录,NULS中的模块分为两类,一类是业务非常清晰的模块,比如共识模块;一类是业务相对明确,默认为基础实现,比如网络模块。我们将拿这两个模块进行详细的说明。 - -### 网络模块 - -![Markdown preferences pane](structure/2.png) - -* network-module : 是网络模块的顶级目录(类型为文件夹) -* network : 为网络模块提供的服务接口定义(类型为pom工程) -* base :网络模块的基础实现(也可以理解为默认实现,类型为文件夹) -* network-base : network接口的实现工程(类型为pom工程) -* network-protocol : 网络模块的网络协议定义工程(类型为pom工程) -* network-rpc: 网络模块的rpc接口提供和实现工程(类型为pom工程) -* network-sdk : 网络模块对外提供的sdk(类型为pom工程) -* network-storage : 网络模块的存储实现工程(类型为pom工程) -* README.md : 模块说明书,详细阐述模块的接口定义与使用方法(类型为md文件) - -### 共识模块 - -![Markdown preferences pane](structure/3.png) - -* consensus-module : 共识模块的顶级目录(类型为文件夹) -* consensus : 共识模块的服务接口定义(类型为pom工程) -* poc :poc共识机制的实现(类型为文件夹) -* consensus-poc-base : 基于POC共识机制的共识接口实现工程(类型为pom工程) -* consensus-poc-protocol : POC共识机制的网络协议定义工程(类型为pom工程) -* consensus-poc-rpc: POC共识机制的rpc接口提供和实现工程(类型为pom工程) -* consensus-poc-sdk : POC共识机制对外提供的sdk(类型为pom工程) -* consensus-poc-storage : POC共识机制的存储实现工程(类型为pom工程) -* README.md : 模块说明书,详细阐述模块的接口定义与使用方法(类型为md文件) - -## 对模块及目录结构的分析 - -NULS系统是以多个模块组合而成,模块的定义有一套规则:顶级目录—>接口工程、实现目录—>实现工程。也有相应的命名规则,比如一个模块为A,那么这个模块的结构如下: - -* A-module -* A -* base -* A-base -* A-protocol -* A-rpc -* A-sdk -* A-storage - -有变化的地方在于,这个模块有很明确的多种不同的实现方式,那么按照相应的实现方式来命名,比较典型的有共识模块和账本模块。这种情况下,比如一个模块为M,其实现方式为B,那么这个模块的结构如下: - -* M-module -* M -* B -* M-B-base -* M-B-protocol -* M-B-rpc -* M-B-sdk -* M-B-storage - -值得注意的是,不是所有模块的实现都必须包含这些工程,比如有的模块不需要用到存储,那么就不需要有storage,有的模块没有协议,那么就不需要protocl。 - - -## 总结: -从NULS的目录结构命名来看,就显示出了NULS最初的巨大野心,NULS希望社区、企业、个人提供各种各样的模块到NULS的代码库,比如共识模块下的pow实现、pos实现等;也希望同一个模块能够出现质量更高、效率更好、功能更完善的模块,比如网络模块。 diff --git a/source/zh-cn/manual/structure/1.png b/source/zh-cn/manual/structure/1.png deleted file mode 100644 index 87777181..00000000 Binary files a/source/zh-cn/manual/structure/1.png and /dev/null differ diff --git a/source/zh-cn/manual/structure/2.png b/source/zh-cn/manual/structure/2.png deleted file mode 100644 index 55042508..00000000 Binary files a/source/zh-cn/manual/structure/2.png and /dev/null differ diff --git a/source/zh-cn/manual/structure/3.png b/source/zh-cn/manual/structure/3.png deleted file mode 100644 index 74915773..00000000 Binary files a/source/zh-cn/manual/structure/3.png and /dev/null differ diff --git a/source/zh-cn/protocol/index.md b/source/zh-cn/protocol/index.md deleted file mode 100644 index 740dff94..00000000 --- a/source/zh-cn/protocol/index.md +++ /dev/null @@ -1,156 +0,0 @@ -title: 总览 ---------- - -## 概述 - -NULS 通过 TCP 协议,使用自定义报文通讯。 - -- 数字二进制流使用小端序。 -- 浮点数移位为整数并遵循小端序传输 - -## 报文结构 - -报文由10字节的包头与载荷组成。 - -``` -*---------------------------------------------------------------* -| Header(10 Byte) | Payload | -*---------------------------------------------------------------* -``` - -## 包头 - -包头主要作用是指出有效载荷长度,校验数据完整性,解决 TCP 粘包等问题。 - -| 字节 | 字段 | 数据类型 | 说明 | -| ---- | ----------------- | ------ | ---------------- | -| 4 | MagicNumber | uint32 | 魔法参数,报文有效标志 | -| 4 | PayloadLength | uint32 | 有效载荷长度 | -| 1 | Xor | uint8 | 载荷奇偶校验位 | -| 1 | EncryptType | uint8 | 加密方式,网络层数据加密扩展 | - -Remark: -> - MagicNumber 除了作为报文有效校验外,还用于主网与测试的划分 -> - EncryptType 当前为保留字段,用于扩展加密方式 - -> 已知 MagicNumber - -|值|网络| -|:---:|---| -|0x0133EEE8|主网| -|0x0133EEFA|测试网| - -## 载荷 - -载荷是不定长二进制流,包头中的 PayloadLength 描述了本次载荷长度。 - -有效载荷前8个字节为固定格式 - -| 字节 | 字段 | 数据类型 | 说明 | -| ---- | --------- | ------ | ---- | -| 4 | ModuleID | uint32 | 模块ID | -| 4 | EventType | uint32 | 事件ID | - -- ModuleID 指出本次载荷由哪个模块发出 -- EventType 是模块自定义的事件类型 - -网络层将该载荷转发给 ModuleID 指定的模块,模块根据 EventType 查找具体的消息处理器做进一步的处理。 -当前只有两个模块数据会通过 P2P 网络广播发送。 - -- Network = 4 -- Protocol = 10 - -## 公共结构体 - -### VarInt - -变长整数,可以根据表达的值进行编码以节省空间。 - -| 值 | 长度 | 格式 | -| ------------- | ---- | ------------- | -| < 0xfd | 1 | uint8 | -| <= 0xffff | 3 | 0xfd + uint16 | -| <= 0xffffffff | 5 | 0xfe + uint32 | -| > 0xffffffff | 9 | 0xff + uint64 | - -### VarString - -变长字节流,由一个变长缓冲区构成。字符串采用UTF8编码。 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ------ | ------ | ------------- | ------------- | -| ? | length | VarInt | 字符串的长度,以字节为单位 | -| length | value | uint8[length] | 字符串本身 | - -### VarByte - -变长缓冲区,与VarString实现一致。 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ------ | ------ | ------------ | ------------- | -| ? | length | VarInt | 字符串的长度,以字节为单位 | -| length | data | byte[length] | 字符串本身 | - -### NulsDigestData - -摘要结构体 - -| 字节 | 字段 | 数据类型 | 说明 | -| ---- | ------------- | --------- | ---- | -| 1 | digestAlgType | Byte | 算法ID | -| ?? | digest | VarString | 摘要 | - -### NulsSignData - -签名结构体 - -| 字节 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | --------- | ---- | -| 1 | signAlgType | Byte | 算法ID | -| ?? | signature | VarString | 签名 | - - - -### P2PKHScriptSig - -交易签名结构体 - -| 字节 | 字段 | 数据类型 | 说明 | -| ---- | ------------ | ------------ | ---- | -| 1 | publicKey | VarString | 公钥 | -| ?? | NulsSignData | NulsSignData | 签名结构 | - -### Int48 - -6字节时间戳。 - -### Transaction - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 交易类型 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注 | -| ?? | txData | ?? | 交易数据 | -| ?? | coinData | ?? | 代币数据 | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - - -### Node - -节点信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | --------- | ------ | -| 4 | magicNumber | uint32 | 魔法数 | -| 2 | Port | uint16 | 服务监听端口 | -| ?? | IP | VarString | 节点IP | - -### NotFoundType - -```java -short BLOCK = 1; -short BLOCKS = 2 -short TRANSACTION = 3; -short HASHES = 4; -``` diff --git a/source/zh-cn/protocol/network.md b/source/zh-cn/protocol/network.md deleted file mode 100644 index 7ed9db4c..00000000 --- a/source/zh-cn/protocol/network.md +++ /dev/null @@ -1,66 +0,0 @@ -title: 网络消息 ------------ - -## 消息 ID 定义 - -```java -short NETWORK_GET_VERSION = 01; -short NETWORK_VERSION = 02; -short NETWORK_NODE = 04; -short NETWORK_HANDSHAKE = 07; -short NETWORK_P2P_NODE = 08; -``` - -## 载荷定义 - -#### GET_VERSION - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### VERSION - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### NODE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | --------------- | ------ | -| ?? | NodeCount | VarInt | 节点数 | -| ?? | Node[] | Node[NodeCount] | 节点信息数组 | - -#### HANDSHAKE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------------- | --------- | ------------- | -| 2 | handshakeType | uint16 | 1. 请求 2. 响应 | -| 2 | ServerPort | uint16 | 服务监听端口 | -| 4 | BestBlockHeight | uint32 | 最高高度 | -| ?? | BestBlockHash | VarString | 最高块Hash字符串 | -| 6 | networkTime | uint48 | 网络时间 | -| ?? | nodeIp | VarString | 对方网络地址 | -| ?? | Version | VarString | 版本字符串 | - -#### P2P_NODE - -p2p节点信息 - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ------ | -| 2 | Port | uint16 | 服务监听端口 | -| ?? | IP | VarString | 节点IP | diff --git a/source/zh-cn/protocol/protocol.md b/source/zh-cn/protocol/protocol.md deleted file mode 100644 index e2733817..00000000 --- a/source/zh-cn/protocol/protocol.md +++ /dev/null @@ -1,136 +0,0 @@ -title: Protocol ---------------- - -## ID 定义 - -```java -short PROTOCOL_NOT_FOUND = 1; -short PROTOCOL_NEW_TX = 2; -short PROTOCOL_GET_BLOCK = 3; -short PROTOCOL_BLOCK = 4; -short PROTOCOL_GET_BLOCKS_BY_HASH = 5; -short PROTOCOL_GET_BLOCKS_BY_HEIGHT = 6; -short PROTOCOL_GET_BLOCK_HEADER = 7; -short PROTOCOL_BLOCK_HEADER = 8; -short PROTOCOL_GET_TX_GROUP = 9; -short PROTOCOL_TX_GROUP = 10; -short PROTOCOL_NEW_BLOCK = 11; -short PROTOCOL_GET_BLOCKS_HASH = 12; -short PROTOCOL_BLOCKS_HASH = 13; -short PROTOCOL_STRING = 14; -short PROTOCOL_COMPLETE = 15; -short REQUEST_REACT = 16; -``` - -## 载荷定义 - -#### PROTOCOL_NOT_FOUND - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | ------------ | ----------- | -| 1 | type | NotFoundType | 未找到的类型 | -| ?? | Hash | VarString | 请求但未找到的hash | - -#### PROTOCOL_NEW_TX - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ----------- | ---- | -| ?? | transaction | Transaction | | - -#### PROTOCOL_GET_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | ------ | -| ?? | blockHash | NulsDigestData | 区块hash | - -#### PROTOCOL_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------------- | --------------- | ------ | -| ?? | header | BlockHeader | 块头 | -| ?? | Transaction[] | Transaction[??] | 节点信息数组 | - -#### PROTOCOL_GET_BLOCKS_BY_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | -------------- | -------- | -| ?? | startHeight | NulsDigestData | 开始区块hash | -| ?? | endHeight | NulsDigestData | 结束区块hash | - -#### PROTOCOL_GET_BLOCKS_BY_HEIGHT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | ------ | ------ | -| 4 | startHash | uint32 | 开始区块高度 | -| 4 | endHash | uint32 | 结束区块高度 | - -#### PROTOCOL_BLOCK_HEADER - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | -------------- | -------- | -| ?? | PreHash | NulsDigestData | 上一个块摘要 | -| ?? | MerkleHash | NulsDigestData | Merkle树根 | -| 6 | time | uint48 | 时间 | -| 4 | height | uint32 | 高度 | -| 4 | txCount | uint32 | 交易数量 | -| ?? | extend | VarByte | 扩展数据 | -| ?? | scriptSign | P2PKHScriptSig | 签名 | - -#### PROTOCOL_GET_TX_GROUP - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----------- | ---------------- | ------ | -| ?? | TXHashCount | VarInt | 交易摘要数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | - -#### PROTOCOL_TX_GROUP -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | --------- | -------------- | ---- | -| ?? | BlockHash | NulsDigestData | 块摘要 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_NEW_BLOCK - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ------- | ---------------- | ------ | -| ?? | header | BlockHeader | 块头 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | NulsDigestData[] | 交易摘要数组 | -| ?? | TXCount | VarInt | 交易数 | -| ?? | TXHash | Transaction[] | 交易数组 | - -#### PROTOCOL_GET_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ----- | ------ | ---- | -| 4 | start | uint32 | 开始高度 | -| 4 | end | uint32 | 结束高度 | - -#### PROTOCOL_BLOCKS_HASH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | ---------------- | -------- | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| ?? | HeightListCount | VarInt | Hash列表数量 | -| ?? | Hash[] | NulsDigestData[] | Hash列表 | - -#### PROTOCOL_STRING - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---- | --------- | ---- | -| ?? | Hash | VarString | | - -#### PROTOCOL_COMPLETE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | ------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | -| 1 | success | boolean | 结果 | - -#### REQUEST_REACT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------------- | -------------- | ------ | -| ?? | requestEventHash | NulsDigestData | 请求Hash | - diff --git a/source/zh-cn/protocol/transaction.md b/source/zh-cn/protocol/transaction.md deleted file mode 100644 index c213f5ca..00000000 --- a/source/zh-cn/protocol/transaction.md +++ /dev/null @@ -1,127 +0,0 @@ -title: Transaction ------------------- - -## ID 定义 - -|数字|交易类型|说明| -|---|---|---| -|1|TX_TYPE_COINBASE| Coinbase | -|2|TX_TYPE_TRANSFER|转账| -|3|TX_TYPE_ACCOUNT_ALIAS|设置账户别名| -|4|TX_TYPE_REGISTER_AGENT|创建共识节点| -|5|TX_TYPE_JOIN_CONSENSUS|委托| -|6|TX_TYPE_CANCEL_DEPOSIT|撤销委托| -|7|TX_TYPE_YELLOW_PUNISH|黄牌警告| -|8|TX_TYPE_RED_PUNISH|红牌警告| -|9|TX_TYPE_STOP_AGENT|注销共识节点| - -## 载荷定义 - -### TX_TYPE_COINBASE - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 1 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | txData | byte[] | 0xFFFFFFFF | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_TRANSFER - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | txData | byte[] | 0xFFFFFFFF | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_ACCOUNT_ALIAS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 3 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | address | VarByte | 账户地址 | -| ?? | alias | VarString | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_REGISTER_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 4 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | uint64 | 抵押金额 | -| 23 | agentAddress | Address | 节点地址 | -| 23 | packingAddress | Address | 打包地址 | -| 23 | rewardAddress | Address | 奖励地址 | -| 8 | commissionRate | Double | 昵称 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_JOIN_CONSENSUS - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 8 | deposit | byte[] | 委托金额 | -| 23 | address | byte[23] | 地址 | -| 8 | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_CANCEL_DEPOSIT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 委托节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_YELLOW_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | count | VarInt | 惩罚数量 | -| ?? | addres | Address[]| 被黄牌警告的节点地址| -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_RED_PUNISH - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| 23 | address | byte[23] | 惩罚数量 | -| 1 | reasonCode | byte | 处罚代码 | -| ?? | evidence | VarByte | 证据 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | - -### TX_TYPE_STOP_AGENT - -| 尺寸 | 字段 | 数据类型 | 说明 | -| ---- | ---------- | ------- | -------------- | -| 2 | type | uint16 | 2 | -| 6 | time | uint48 | 时间戳 | -| ?? | remark | VarByte | 备注数据 | -| ?? | agentHash | NulsDigestData | 停止节点地址 | -| ?? | coinData | CoinData| 交易 UTXO | -| ?? | scriptSign | VarByte | P2PKHScriptSig | diff --git a/themes/nuls/languages/en.yml b/themes/nuls/languages/en.yml deleted file mode 100644 index 4bd782d1..00000000 --- a/themes/nuls/languages/en.yml +++ /dev/null @@ -1,64 +0,0 @@ -menu: - docs: Documents - protocol: Protocol - contract: Smart Contract - chain: Cross-Chain - manual: Manual - news: News - -index: - get_started: Get started - -page: - contents: Contents - back_to_top: Back to Top - improve: Improve this doc - prev: Prev - next: Next - last_updated: "Last updated: %s" - -sidebar: - docs: - started: Getting Started - overview: Guide - manual: Manual - sdk: SDK - - protocol: - started: Protocol - overview: Overview - network: Network - protocol: Protocol - transaction: Transaction - - contract: - started: Getting Started - Development_manual: Development Manual - NRC_20: NRC-20 - IDEA_plugin: IDEA Plugin Manual - Community_vote: Guide to Community Voting - Contract_manual: Smart Contract Manual - Smart_contract_fee: Smart Contract Fee - - chain: - started: Getting Started - overview: Overview - - manual: - started: Getting Started - architecture: Architecture - modularity: Modularity - structure: Structure - modularoverview: Modular Overview - kernel: Micro Kernel - message_bus: Message Bus - - module: Module Overview - network: Network - storage: Storage - account: Account - protocol: Protocol - ledger: Ledger - consensus: Consensus - contract: Smart Contract - diff --git a/themes/nuls/languages/zh-cn.yml b/themes/nuls/languages/zh-cn.yml deleted file mode 100644 index 6df87fea..00000000 --- a/themes/nuls/languages/zh-cn.yml +++ /dev/null @@ -1,61 +0,0 @@ -menu: - docs: 文档 - protocol: 协议 - contract: 智能合约 - chain: 跨链 - manual: 参考手册 - news: 新闻 - -page: - contents: 目录 - back_to_top: 回到顶部 - improve: 改进本文 - prev: 上一页 - next: 下一页 - last_updated: 上次更新:%s - -sidebar: - docs: - started: 开始使用 - overview: 预览 - manual: 手册 - sdk: SDK - - protocol: - started: 概述 - overview: 模块说明 - network: 网络 - protocol: 协议 - transaction: 交易 - - contract: - started: Get Started - Development_manual: 开发者手册 - NRC_20: NRC-20 - IDEA_plugin: IDEA插件操作手册 - Community_vote: 社区投票指南 - Contract_manual: 钱包智能合约操作手册 - Smart_contract_fee: 智能合约手续费 - - chain: - started: 概述 - overview: 总体设计 - - manual: - started: 基础 - architecture: 总体架构 - modularity: 为什么模块化 - structure: 源码结构 - modularoverview: 模块说明 - kernel: 微内核 - message_bus: 消息总线 - - module: 模块说明 - network: 网络模块 - storage: 存储模块 - account: 账户模块 - protocol: 通用协议 - ledger: 账本模块 - consensus: 共识模块 - contract: 智能合约 - diff --git a/themes/nuls/layout/archive.swig b/themes/nuls/layout/archive.swig deleted file mode 100644 index e7a256a4..00000000 --- a/themes/nuls/layout/archive.swig +++ /dev/null @@ -1,19 +0,0 @@ -{% set page.title = 'News' %} -

-
-
- {% for post in page.posts %} - {% if loop.index == 1 %} - {{ partial('partial/post', {post: post}) }} - {% else %} - - {% endif %} - {% endfor %} -
-
-
\ No newline at end of file diff --git a/themes/nuls/layout/index.swig b/themes/nuls/layout/index.swig deleted file mode 100644 index ffa420d3..00000000 --- a/themes/nuls/layout/index.swig +++ /dev/null @@ -1,2 +0,0 @@ - {{ page.content }} - diff --git a/themes/nuls/layout/layout.swig b/themes/nuls/layout/layout.swig deleted file mode 100644 index 52df3444..00000000 --- a/themes/nuls/layout/layout.swig +++ /dev/null @@ -1,14 +0,0 @@ - - -{{ partial('partial/head') }} - -
- {{ partial('partial/header') }} - {{ body }} - {{ partial('partial/footer') }} -
-
- {{ partial('partial/mobile_nav') }} - {{ partial('partial/after_footer') }} - - \ No newline at end of file diff --git a/themes/nuls/layout/page.swig b/themes/nuls/layout/page.swig deleted file mode 100644 index bb901ab2..00000000 --- a/themes/nuls/layout/page.swig +++ /dev/null @@ -1,33 +0,0 @@ -
-
-
-
-
-
-
-
-

{{ page.title }}

- -
-
- {{ page_anchor(page.content) }} -
-
- - {{ page_nav() }} -
-
-
- -
-
- {{ partial('partial/sidebar') }} -
-
-
diff --git a/themes/nuls/layout/partial/after_footer.swig b/themes/nuls/layout/partial/after_footer.swig deleted file mode 100644 index c5d4689e..00000000 --- a/themes/nuls/layout/partial/after_footer.swig +++ /dev/null @@ -1,7 +0,0 @@ - - -{{ js('js/lang_select') }} -{{ js('js/toc') }} -{{ js('js/mobile_nav') }} -{{ js('js/common') }} - diff --git a/themes/nuls/layout/partial/carbonads.swig b/themes/nuls/layout/partial/carbonads.swig deleted file mode 100644 index 4349890e..00000000 --- a/themes/nuls/layout/partial/carbonads.swig +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/themes/nuls/layout/partial/footer.swig b/themes/nuls/layout/partial/footer.swig deleted file mode 100644 index 1fcb292f..00000000 --- a/themes/nuls/layout/partial/footer.swig +++ /dev/null @@ -1,35 +0,0 @@ - \ No newline at end of file diff --git a/themes/nuls/layout/partial/head.swig b/themes/nuls/layout/partial/head.swig deleted file mode 100644 index 03fc0138..00000000 --- a/themes/nuls/layout/partial/head.swig +++ /dev/null @@ -1,40 +0,0 @@ - - - {% if page.title %}{{ page.title }} | {% endif %}{{ config.title }} - - - - - - {% if page.layout == 'page' or page.layout == 'index' %} - {% for lang in site.data.languages %} - - {% endfor %} - {% endif %} - - - - - - - - - - - - - - - - - - - - {{ css('css/nuls') }} - - - - - - {{ feed_tag('atom.xml') }} - diff --git a/themes/nuls/layout/partial/header.swig b/themes/nuls/layout/partial/header.swig deleted file mode 100644 index 9a014348..00000000 --- a/themes/nuls/layout/partial/header.swig +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/themes/nuls/layout/partial/mobile_nav.swig b/themes/nuls/layout/partial/mobile_nav.swig deleted file mode 100644 index 22fac03b..00000000 --- a/themes/nuls/layout/partial/mobile_nav.swig +++ /dev/null @@ -1,21 +0,0 @@ - \ No newline at end of file diff --git a/themes/nuls/layout/partial/plugin.swig b/themes/nuls/layout/partial/plugin.swig deleted file mode 100644 index 776231d6..00000000 --- a/themes/nuls/layout/partial/plugin.swig +++ /dev/null @@ -1,9 +0,0 @@ -
  • - {{ plugin.name }} -

    {{ plugin.description }}

    -
    - {% for tag in plugin.tags %} - {{ tag }} - {% endfor %} -
    -
  • \ No newline at end of file diff --git a/themes/nuls/layout/partial/post.swig b/themes/nuls/layout/partial/post.swig deleted file mode 100644 index b30441d5..00000000 --- a/themes/nuls/layout/partial/post.swig +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/themes/nuls/layout/partial/sidebar.swig b/themes/nuls/layout/partial/sidebar.swig deleted file mode 100644 index a46f4afb..00000000 --- a/themes/nuls/layout/partial/sidebar.swig +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/themes/nuls/layout/partial/theme.swig b/themes/nuls/layout/partial/theme.swig deleted file mode 100644 index 6ca98d17..00000000 --- a/themes/nuls/layout/partial/theme.swig +++ /dev/null @@ -1,18 +0,0 @@ -
  • -
    - - {{ plugin.name }} - {% if plugin.preview %} - - {% endif %} -
    - {{ plugin.name }} -

    {{ plugin.description }}

    -
    - {% for tag in plugin.tags %} - {{ tag }} - {% endfor %} -
    -
  • \ No newline at end of file diff --git a/themes/nuls/layout/post.swig b/themes/nuls/layout/post.swig deleted file mode 100644 index a2c545a4..00000000 --- a/themes/nuls/layout/post.swig +++ /dev/null @@ -1,7 +0,0 @@ -
    -
    -
    - {{ partial('partial/post', {post: page}) }} -
    -
    -
    \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/archive.styl b/themes/nuls/source/css/_partial/archive.styl deleted file mode 100644 index 4c4d7ca9..00000000 --- a/themes/nuls/source/css/_partial/archive.styl +++ /dev/null @@ -1,24 +0,0 @@ -.archive-post - padding: 1em 0 - border-top: 1px solid color-border - &:last-child - padding-bottom: 40px - -.archive-post-link - clearfix() - display: block - color: color-default - text-decoration: none - line-height: line-height - &:hover - color: color-link-hover - -.archive-post-title - font-family: font-title - float: left - font-weight: bold - -.archive-post-date - color: color-gray - float: right - font-size: 0.9em \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/base.styl b/themes/nuls/source/css/_partial/base.styl deleted file mode 100644 index 699e6f79..00000000 --- a/themes/nuls/source/css/_partial/base.styl +++ /dev/null @@ -1,53 +0,0 @@ -global-reset() - -html - box-sizing: border-box - -*, *:before, *:after - box-sizing: inherit - -button -input[type="reset"] -input[type="button"] -input[type="submit"] - &::-moz-focus-inner - padding: 0 - margin: 0 - border: 0 - -input, button, select - margin: 0 - padding: 0 - border: 0 - -html, body - @media screen - height: 100% - // overflow: hidden - -body - background: #fff - font-size: font-size - font-family: font-sans - color: color-default - text-rendering: optimizeLegibility - -webkit-font-smoothing: antialiased - -moz-osx-font-smoothing: grayscale - overflow-x: hidden - -.wrapper - clearfix() - @media screen - max-width: max-width - min-width: min-width - margin: 0 auto - -.inner - clearfix() - @media screen - padding: 0 gutter-width - -#content-wrap - background: #fff - margin: -1px 0 - min-height: 789px diff --git a/themes/nuls/source/css/_partial/carbonads.styl b/themes/nuls/source/css/_partial/carbonads.styl deleted file mode 100644 index 503a2da5..00000000 --- a/themes/nuls/source/css/_partial/carbonads.styl +++ /dev/null @@ -1,32 +0,0 @@ -#carbonads - display: block - overflow: hidden - margin-top: 40px - max-width: 130px - text-align: left - font-size: 13px - line-height: 1.5 - a - color: inherit - text-decoration: none - &:hover - color: inherit - span - display: block - overflow: hidden - -.carbon-img - display: block - margin: 0 auto 8px - line-height: 1 - -.carbon-text - display: block - margin-bottom: 8px - -.carbon-poweredby - display: block - text-transform: uppercase - letter-spacing: 1px - font-size: 9px - line-height: 1 \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/footer.styl b/themes/nuls/source/css/_partial/footer.styl deleted file mode 100644 index 8a662cf5..00000000 --- a/themes/nuls/source/css/_partial/footer.styl +++ /dev/null @@ -1,69 +0,0 @@ -.footer-index - background: #f0f0f0 - //position: fixed - //bottom: 0 - width: 100% - .footer-index-inner - width: 1200px - min-width:1200px - height: 90px - margin: 0 auto - display: flex - justify-content: space-between - align-items: center - - .footer-left - div - margin-bottom: 3px - font-size: 12px - a - text-decoration: none - color: #666 - &:hover - color: #333 - .footer-middle - display: flex - justify-content: center - div - margin-left: 40px - &:first-child - margin-left: 0 - a - i - display: inline-block - width: 35px - height: 35px - background-size: 35px 35px - background-repeat: no-repeat - i.footer-icon1 - background-image: url("/img/index/footer/twitter_gray_icon.png") - &:hover - background-image: url("/img/index/footer/twitter_green_icon.png") - i.footer-icon2 - background-image: url("/img/index/footer/reddit_gray_icon.png") - &:hover - background-image: url("/img/index/footer/reddit_green_icon.png") - i.footer-icon3 - background-image: url("/img/index/footer/telegram_gray_icon.png") - &:hover - background-image: url("/img/index/footer/telegram_green_icon.png") - i.footer-icon4 - background-image: url("/img/index/footer/steemit_gray_icon.png") - &:hover - background-image: url("/img/index/footer/steemit_green_icon.png") - i.footer-icon5 - background-image: url("/img/index/footer/github_gray_icon.png") - &:hover - background-image: url("/img/index/footer/github_green_icon.png") - i.footer-icon6 - background-image: url("/img/index/footer/facebook_gray_icon.png") - &:hover - background-image: url("/img/index/footer/facebook_green_icon.png") - i.footer-icon7 - background-image: url("/img/index/footer/slack_gray_icon.png") - &:hover - background-image: url("/img/index/footer/slack_green_icon.png") - i.footer-icon8 - background-image: url("/img/index/footer/gitter_gray_icon.png") - &:hover - background-image: url("/img/index/footer/gitter_green_icon.png") diff --git a/themes/nuls/source/css/_partial/header.styl b/themes/nuls/source/css/_partial/header.styl deleted file mode 100644 index ccae9b3d..00000000 --- a/themes/nuls/source/css/_partial/header.styl +++ /dev/null @@ -1,93 +0,0 @@ -header-padding-normal = 10px -header-padding-max = 30px -logo-size = 50px - -#header - position: relative - padding: header-padding-normal 0 - background:#fff - @media print - display: none - -#header-inner - display: flex - flex-flow: row nowrap - align-items: center - padding:0 - @media mq-mobile - justify-content: center - -#logo-wrap - flex: 0 logo-size - -#logo - hide-text() - background: url("/logo.svg") - width: 50px - height: 50px - background-size: 50px 50px - display: block - -#main-nav - display: none - flex: 1 auto - @media mq-normal - display: block - -.main-nav-link - color: #333 - text-decoration: none - line-height: logo-size - transition: 0.2s - font-family: font-title - display: inline-block - padding: 0 24px - &:hover - color: color-link - -.main-nav-link:nth-child(7),.main-nav-link:nth-child(7) - display:none - -#search-input-wrap - display: none - padding-left: 6px - padding-bottom: 8px - border-bottom: 1px solid color-gray - &.on - display: inline-block - -#search-input-icon - color: #fff - padding-right: 0.5em - display: inline-block - -#search-input - background: none - font-size: inherit - font-family: font-title - color: #fff - outline: none - -webkit-appearance: none - -#lang-select-wrap - display: none - position: relative - @media mq-normal - display: block - -#lang-select-label - color: #333 - font-family: font-title - line-height: logo-size - span - padding-left: 8px - -#lang-select - opacity: 0 - position: absolute - top: 0 - left: 0 - width: 100% - height: 100% - -webkit-appearance: menulist-button - font-size: inherit diff --git a/themes/nuls/source/css/_partial/highlight.styl b/themes/nuls/source/css/_partial/highlight.styl deleted file mode 100644 index 61bb6d64..00000000 --- a/themes/nuls/source/css/_partial/highlight.styl +++ /dev/null @@ -1,106 +0,0 @@ -// https://github.com/chriskempson/tomorrow-theme -highlight-background = #fff -highlight-current-line = #efefef -highlight-selection = #d6d6d6 -highlight-foreground = #999 -highlight-comment = #8e908c -highlight-red = #c82829 -//highlight-orange = #f5871f -highlight-orange = #94c45a -highlight-yellow = #eab700 -highlight-green = #718c00 -highlight-aqua = #3e999f -highlight-blue = #4271ae -highlight-purple = #8959a8 - -pre, code - font-family: font-mono - color: highlight-foreground - background: #eee - font-size: 0.95em - -code - padding: 0 5px - -pre - padding: 10px 15px - line-height: 22px - code - border: none - display: block - padding: 0 - -.highlight - background: #eee - padding: 10px 15px - color: highlight-foreground - overflow: auto - margin: 0 - table - margin: 0 !important - border: 0 - th, td - padding: 0 - figcaption - clearfix() - margin: -5px 0 5px - font-size: 0.9em - color: color-gray - a - float: right - pre - padding: 0 - border: none - background: none - .line - height: 22px - -pre - .comment - .title - color: highlight-comment - .variable - .attribute - .tag - .regexp - .ruby .constant - .xml .tag .title - .xml .pi - .xml .doctype - .html .doctype - .css .id - .css .class - .css .pseudo - color: highlight-red - .number - .preprocessor - .built_in - .literal - .params - .constant - color: highlight-orange - .class - .ruby .class .title - .css .rules .attribute - color: highlight-green - .string - .value - .inheritance - .header - .ruby .symbol - .xml .cdata - color: highlight-green - .css .hexcolor - color: highlight-aqua - .function - .python .decorator - .python .title - .ruby .function .title - .ruby .title .keyword - .perl .sub - .javascript .title - .coffeescript .title - color: highlight-blue - .keyword - .javascript .function - color: highlight-purple \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/index.styl b/themes/nuls/source/css/_partial/index.styl deleted file mode 100644 index 883ed667..00000000 --- a/themes/nuls/source/css/_partial/index.styl +++ /dev/null @@ -1,161 +0,0 @@ -#container - background: #fff - -#inner-index - padding: 0 - -.inner-index - background: url("../../img/index/background/background_icon.png") no-repeat - width: 100%; - height: 100%; - -.flexible-outer - width: 100% - height: 100% - background-size: auto - -.inner-index > .flexible-outer > .flexible-inner - width: 1200px - min-width: 1200px - margin: auto - -.inner-index > .flexible-outer > .flexible-inner - .title - display: flex - justify-content space-around - height: 64px - line-height: 64px - .title-left > i - background: url("/img/index/header/NULS_logo_icon.png") no-repeat - display: inline-block - width: 107px - height: 48px - background-size: 107px 48px - .title-right - a - text-decoration: none - margin-left: 56px - color: #333 - &:hover - color: #82bd39 - .text - padding-top: 200px; - margin-bottom: 210px - width: 616px - .text1 - font-size: 56px - color: #388206 - .text2 - font-size: 40px - color: #fff - padding: 16px 0 40px - .text3 - font-size: 18px - color: #f2f2f2 - line-height: 35px - -.line - width: 125px; - margin: 20px 0 80px 4px - -.title-common - font-size: 40px - color: #333 - text-align: center - -.features - width: 1200px - min-width: 1200px - margin: 108px auto - text-align: center - .bg-img - position: relative - div - position: absolute - .bg-text1 - top: 20px - right: 856px - text-align: right - .bg-text2 - top: 4px - left: 852px - .bg-text3 - top: 317px - right: 856px - text-align: right - .bg-text4 - top: 317px - left: 852px - .bg-text > p:first-child - font-size: 18px - color: #333 - margin-bottom: 10px - font-weight: bold - - .bg-text > p:last-child - font-size: 14px - color: #666 - text-align: left - -.modular - width: 1200px - min-width: 1200px - margin: 0 auto 108px - .title - text-align: left - .line - margin-left: 83px - .bg-img - display: flex - justify-content: space-around - align-items: center - padding-right: 80px; - .text - text-align: right - margin-left: 80px - p - font-size: 16px - color: #666666 - line-height: 24px - &:first-child - margin-bottom: 32px - -.contract - width: 1200px - min-width: 1200px - margin: auto - .line - margin-left: 326px - margin-bottom: 50px - .bg-img - display: flex - justify-content: start - align-items: center - .text - text-align: left - width:780px - padding-right: 70px - p - font-size: 16px - color: #666666 - line-height: 24px - &:first-child - margin-bottom: 32px - -.chain - width: 1200px - min-width: 1200px - margin: 108px auto 135px - text-align: center - .line - margin-left: 632px - .bg-img-chain - .text - font-size: 16px - color: #666666 - line-height: 24px - margin-bottom: 50px - text-align: center - - - diff --git a/themes/nuls/source/css/_partial/mobile_nav.styl b/themes/nuls/source/css/_partial/mobile_nav.styl deleted file mode 100644 index cce42685..00000000 --- a/themes/nuls/source/css/_partial/mobile_nav.styl +++ /dev/null @@ -1,136 +0,0 @@ -toggle-width = 25px -toggle-height = toggle-width * 0.8 -toggle-line = 2px -transition-duration = 0.4s -lang-select-height = 40px - -#mobile-nav - position: fixed - top: 0 - width: mobile-nav-width - left: @width * -1 - height: 100% - background: color-navy - transition: transition-duration - font-family: font-title - .mobile-nav-on & - transform: translateX(100%) - -#mobile-nav-inner - overflow-y: auto - padding: 10px 0 - position: absolute - top: 0 - bottom: lang-select-height - left: 0 - right: 0 - -webkit-overflow-scrolling: touch - -#mobile-nav-toggle - position: absolute - top: 0 - bottom: 0 - left: gutter-width - width: toggle-width - height: toggle-height - margin: auto - opacity: 0.5 - cursor: pointer - transition: 0.2s - &:active, .mobile-nav-on & - opacity: 1 - @media mq-normal - display: none - -.mobile-nav-toggle-bar - background: #fff - position: absolute - left: 0 - width: 100% - height: toggle-line - transition: transition-duration - transform-origin: 0 - border-radius: toggle-line - &:first-child - top: 0 - .mobile-nav-on & - transform: rotate(45deg) - &:nth-child(2) - top: (toggle-height - toggle-line) * 0.5 - .mobile-nav-on & - opacity: 0 - &:last-child - top: toggle-height - toggle-line - .mobile-nav-on & - transform: rotate(-45deg) - -.mobile-nav-link - color: #fff - text-decoration: none - display: block - padding: 10px 15px - line-height: 1 - white-space: nowrap - overflow: hidden - text-overflow: ellipsis - -.mobile-nav-title - color: color-link - font-weight: bold - padding: 10px 15px - line-height: 1 - display: block - border-top: 1px solid #444 - margin-top: 10px - white-space: nowrap - overflow: hidden - text-overflow: ellipsis - -#mobile-lang-select-wrap - position: absolute - bottom: 0 - left: 0 - width: 100% - background: color-navy - border-top: 1px solid #444 - -#mobile-lang-select-label - line-height: lang-select-height - color: #fff - padding: 10px 15px - i - opacity: 0.7 - span - padding-left: 8px - -#mobile-lang-select - -webkit-appearance: menulist-button - opacity: 0 - position: absolute - top: 0 - left: 0 - width: 100% - height: 100% - -#container - transition: transition-duration - height: 100% - // overflow: auto - -webkit-overflow-scrolling: touch - .mobile-nav-on & - transform: translateX(mobile-nav-width) - overflow: hidden - -#mobile-nav-dimmer - position: absolute - top: 0 - left: 100% - height: 100% - background: #000 - opacity: 0 - transition: opacity transition-duration, transform 0s transition-duration - .mobile-nav-on & - width: 100% - opacity: 0.7 - transform: translateX(-100%) - transition: opacity transition-duration diff --git a/themes/nuls/source/css/_partial/page.styl b/themes/nuls/source/css/_partial/page.styl deleted file mode 100644 index 93c23695..00000000 --- a/themes/nuls/source/css/_partial/page.styl +++ /dev/null @@ -1,250 +0,0 @@ -//note-tip = hsl(40, 100%, 50%) -//note-info = hsl(200, 100%, 50%) -//note-warn = hsl(0, 100%, 50%) - -note-tip = #94c45a -note-info = #94c45a -note-warn = #85bd43 - -#content - clearfix() - position: relative - -#content-inner - clearfix() - @media mq-normal - margin-left: sidebar-width - -.article-container - @media mq-normal - float: right - width: 100% - -.article-inner - clearfix() - @media mq-normal - margin-right: sidebar-width - -.article - float: left - width: 100% - padding: 40px 0 - @media print - padding: 0 - -#article-toc - display: none - float: right - width: sidebar-width - margin-right: sidebar-width * -1 - @media mq-normal - display: block - &.fixed - position: absolute - top: 0 - bottom: 0 - right: sidebar-width - -#article-toc-inner - @extend .inner - overflow-x: hidden - overflow-y: auto - width: sidebar-width - .fixed & - position: fixed - top: 0 - bottom: 0 - -.toc-link - @extend .sidebar-link - -.toc-child - padding-left: 1em - font-size: 0.9em - -#article-toc-top - margin-top: 2em - font-size: 0.9em - text-decoration: none - color: color-default - display: block - margin-bottom: 40px - font-family: font-title - &:hover - color: color-link-hover - -.article-header - clearfix() - padding-bottom: 15px - -.article-title - float: left - font-family: font-title - font-size: 28px - font-weight: 300 - text-decoration: none - color: color-article-title - transition: 0.2s - a&:hover - color: color-link-hover - .post & - float: none - -.article-date - color: color-gray - text-decoration: none - display: inline-block - margin-top: 1em - &:hover - color: color-link-hover - -.article-edit-link - float: right - color: #bbb - font-size: 24px - line-height: 36px - transition: 0.2s - display: none - &:hover - color: color-link-hover - @media mq-normal - display: block - -.article-anchor - margin-left: 10px - display: none - &:before - content: "#" - @media print - display: none !important - .article-heading:hover & - display: inline-block - -.article-content - line-height: line-height - color: color-default - @media print - font-size: 12pt - p, ol, ul, dl, table, blockquote, iframe, .highlight - margin: 1em 0 - h1 - font-size: 2em - h2 - font-size: 1.5em - h3 - font-size: 1.375em - h1, h2, h3, h4, h5, h6 - line-height: 1em - font-weight: normal - margin: 1em 0 - a - color: color-link - text-decoration: none - &:hover - color: color-link-hover - text-decoration: underline - @media print - color: color-default - text-decoration: underline - &:after - content: " (" attr(href) ")" - font-size: 80% - strong - font-weight: bold - em - font-style: italic - ul, ol, dl - margin-left: 20px - ul, ol, dl - margin-top: 0 - margin-bottom: 0 - ul - list-style: disc - ol - list-style: decimal - dl - list-style: square - li - p - margin: 0 - table, blockquote, iframe, .highlight - margin: 1em 0 - img, video - max-width: 100% - blockquote - padding: 0 20px - position: relative - border: 1px solid color-border - border-left: 5px solid #ddd - footer - margin: 1em 0 - font-style: italic - cite - &:before - content: "—" - padding: 0 0.3em - a - color: color-grey - .note - &.tip - border-left-color: note-tip - &.info - border-left-color: note-info - &.warn - border-left-color: note-warn - .note-title - margin: 1.125em 0 - display: block - font-size: 1.125em - font-weight: bold - table - max-width: 100% - border: 1px solid color-border - th - font-weight: bold - th, td - padding: 5px 15px - tr - &:nth-child(2n) - background: #eee - -.article-footer - clearfix() - margin: 1em 0 - border-top: 1px solid color-border - text-align: center - color: color-gray - line-height: 1em - padding-top: 1em - position: relative - @media print - display: none - -$article-footer-link - color: color-link - text-decoration: none - font-weight: bold - font-family: font-title - text-transform: uppercase - position: absolute - &:hover - color: color-link-hover - @media print - display: none - span - padding: 0 6px - -.article-footer-prev - @extend $article-footer-link - left: 0 - -.article-footer-next - @extend $article-footer-link - right: 0 - -.article-footer-updated - font-size: 0.9em - -#comments - @media print - display: none \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/plugins.styl b/themes/nuls/source/css/_partial/plugins.styl deleted file mode 100644 index d1869cda..00000000 --- a/themes/nuls/source/css/_partial/plugins.styl +++ /dev/null @@ -1,130 +0,0 @@ -#plugin-list-header - clearfix() - margin: 40px 0 - -#plugin-list-title - font-family: font-title - font-size: 36px - font-weight: 300 - line-height: 1 - float: left - -#plugin-list-count - color: color-gray - padding-top: 1em - text-align: right - @media mq-normal - float: right - line-height: 40px - padding-top: 0 - padding-right: 15px - -#plugin-search-input - font-size: 16px - font-family: inherit - -webkit-appearance: none - border: 1px solid color-border - padding: 10px 10px - width: 100% - margin-top: 25px - @media mq-normal - float: right - width: 50% - margin-top: 0 - -#plugin-list - margin: 40px -20px - display: flex - flex-flow: column - @media mq-tablet - flex-flow: row wrap - -.plugin - display: none - padding: 20px - @media mq-tablet - flex: 0 0 50% - @media mq-normal - flex: 0 0 (100 / 3)% - &.on - display: block - -.plugin-name - font-family: font-title - font-weight: bold - color: color-link - font-size: 20px - text-decoration: none - line-height: 1 - &:hover - color: color-link-hover - -.plugin-desc - line-height: line-height - margin: 1em 0 - -.plugin-tag-list - clearfix() - line-height: 1.3 - -.plugin-tag - color: color-gray - font-size: 0.9em - text-decoration: none - float: left - margin-right: 10px - &:hover - color: color-link-hover - &:before - content: "#" - -.plugin-screenshot - margin-bottom: 15px - position: relative - padding-top: (10 / 16 * 100)% // 16:10 ratio - height: 0 - overflow: hidden - -.plugin-screenshot-img - position: absolute - top: 0 - left: 0 - width: 100% - height: 100% - transition: opacity 0.3s - &.lazyload - &.lazyloading - opacity: 0 - &.lazyloaded - opacity: 1 - -.plugin-preview-link - position: absolute - top: 0 - left: 0 - width: 100% - height: 100% - background: rgba(0, 0, 0, 0.7) - color: #fff - text-align: center - opacity: 0 - transition: 0.15s - &:hover - opacity: 1 - .fa - opacity: 1 - transform: scale(1) - .fa - position: absolute - top: 0 - left: 0 - bottom: 0 - right: 0 - margin: auto - font-size: 50px - width: @font-size - height: @font-size - opacity: 0 - transform: scale(6) - transition: 0.2s - transition-delay: 0.15s \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/post.styl b/themes/nuls/source/css/_partial/post.styl deleted file mode 100644 index f97045e7..00000000 --- a/themes/nuls/source/css/_partial/post.styl +++ /dev/null @@ -1,5 +0,0 @@ -.post - margin: 0 auto - float: none - @media screen - max-width: 800px \ No newline at end of file diff --git a/themes/nuls/source/css/_partial/sidebar.styl b/themes/nuls/source/css/_partial/sidebar.styl deleted file mode 100644 index a29b566f..00000000 --- a/themes/nuls/source/css/_partial/sidebar.styl +++ /dev/null @@ -1,37 +0,0 @@ -#sidebar - width: sidebar-width - float: left - padding-bottom: 40px - margin-left: sidebar-width * -1 - display: none - @media mq-normal - display: block - -.sidebar-title - margin-top: 40px - padding-top: 18px - font-family: font-title - font-weight: lighter - color: color-link - display: inline-block - border-top: 1px solid color-border - line-height: 1 - font-size:18px - -.sidebar-link - font-family: font-title - display: block - color: color-default - text-decoration: none - padding-top: 16px - line-height: 1 - position: relative - width: 100% - text-overflow: ellipsis - overflow: hidden - white-space: nowrap - font-size: 16px - &.current - color: color-link - &:hover - color: color-link-hover \ No newline at end of file diff --git a/themes/nuls/source/css/_variables.styl b/themes/nuls/source/css/_variables.styl deleted file mode 100644 index 860fad47..00000000 --- a/themes/nuls/source/css/_variables.styl +++ /dev/null @@ -1,32 +0,0 @@ -// Config -support-for-ie = false -vendor-prefixes = webkit moz ms official - -// Colors -color-default = #666 -color-gray = #999 -color-border = #e8e8e8 -color-navy = #2e5ddf -color-link = #8fc848 -color-link-hover = lighten(color-link, 10%) -color-article-title = #333 - -// Typography -font-sans = Helvetica, Gothom,"Microsoft YaHei","Helvetica Neue", Arial, sans-serif -font-serif = Helvetica,Gothom,"Microsoft YaHei",Garamond, Georgia, "Times New Roman", serif -font-mono = Helvetica,Gothom,"Microsoft YaHei","Source Code Pro", Monaco, Menlo, Consolas, monospace -font-title = Helvetica,Gothom,"Microsoft YaHei",Lato, font-sans -font-size = 100% -line-height = 1.6em - -// Layout -max-width = 1200px -min-width = 1200px -gutter-width = 20px -sidebar-width = 200px -mobile-nav-width = 260px - -// Media queries -mq-mobile = "screen and (max-width: 768px)" -mq-normal = "screen and (min-width: 769px)" -mq-tablet = "screen and (min-width: 480px)" diff --git a/themes/nuls/source/css/nuls.styl b/themes/nuls/source/css/nuls.styl deleted file mode 100644 index c4b520c4..00000000 --- a/themes/nuls/source/css/nuls.styl +++ /dev/null @@ -1,15 +0,0 @@ -@import "nib" -@import "_variables" - -@import "_partial/base" -@import "_partial/header" -@import "_partial/index" -@import "_partial/sidebar" -@import "_partial/page" -@import "_partial/post" -@import "_partial/plugins" -@import "_partial/archive" -@import "_partial/mobile_nav" -@import "_partial/footer" -@import "_partial/highlight" -@import "_partial/carbonads" \ No newline at end of file diff --git a/themes/nuls/source/img/index/background/background_icon.png b/themes/nuls/source/img/index/background/background_icon.png deleted file mode 100644 index 767ea13b..00000000 Binary files a/themes/nuls/source/img/index/background/background_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/banner/banner_right_icon.png b/themes/nuls/source/img/index/banner/banner_right_icon.png deleted file mode 100644 index e9be33cc..00000000 Binary files a/themes/nuls/source/img/index/banner/banner_right_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/facebook_gray_icon.png b/themes/nuls/source/img/index/footer/facebook_gray_icon.png deleted file mode 100755 index 3523f6f0..00000000 Binary files a/themes/nuls/source/img/index/footer/facebook_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/facebook_green_icon.png b/themes/nuls/source/img/index/footer/facebook_green_icon.png deleted file mode 100755 index 321a0e5f..00000000 Binary files a/themes/nuls/source/img/index/footer/facebook_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/github_gray_icon.png b/themes/nuls/source/img/index/footer/github_gray_icon.png deleted file mode 100755 index 46b09bb8..00000000 Binary files a/themes/nuls/source/img/index/footer/github_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/github_green_icon.png b/themes/nuls/source/img/index/footer/github_green_icon.png deleted file mode 100755 index f0f29257..00000000 Binary files a/themes/nuls/source/img/index/footer/github_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/gitter_gray_icon.png b/themes/nuls/source/img/index/footer/gitter_gray_icon.png deleted file mode 100755 index 35e0a6ad..00000000 Binary files a/themes/nuls/source/img/index/footer/gitter_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/gitter_green_icon.png b/themes/nuls/source/img/index/footer/gitter_green_icon.png deleted file mode 100755 index 94085976..00000000 Binary files a/themes/nuls/source/img/index/footer/gitter_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/reddit_gray_icon.png b/themes/nuls/source/img/index/footer/reddit_gray_icon.png deleted file mode 100755 index 3911cfc3..00000000 Binary files a/themes/nuls/source/img/index/footer/reddit_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/reddit_green_icon.png b/themes/nuls/source/img/index/footer/reddit_green_icon.png deleted file mode 100755 index 5ce3989b..00000000 Binary files a/themes/nuls/source/img/index/footer/reddit_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/slack_gray_icon.png b/themes/nuls/source/img/index/footer/slack_gray_icon.png deleted file mode 100755 index d67c9716..00000000 Binary files a/themes/nuls/source/img/index/footer/slack_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/slack_green_icon.png b/themes/nuls/source/img/index/footer/slack_green_icon.png deleted file mode 100755 index 3cc228e3..00000000 Binary files a/themes/nuls/source/img/index/footer/slack_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/steemit_gray_icon.png b/themes/nuls/source/img/index/footer/steemit_gray_icon.png deleted file mode 100755 index cf11c705..00000000 Binary files a/themes/nuls/source/img/index/footer/steemit_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/steemit_green_icon.png b/themes/nuls/source/img/index/footer/steemit_green_icon.png deleted file mode 100755 index 3c8764f2..00000000 Binary files a/themes/nuls/source/img/index/footer/steemit_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/telegram_gray_icon.png b/themes/nuls/source/img/index/footer/telegram_gray_icon.png deleted file mode 100755 index ef22ce6b..00000000 Binary files a/themes/nuls/source/img/index/footer/telegram_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/telegram_green_icon.png b/themes/nuls/source/img/index/footer/telegram_green_icon.png deleted file mode 100755 index c6b5b701..00000000 Binary files a/themes/nuls/source/img/index/footer/telegram_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/twitter_gray_icon.png b/themes/nuls/source/img/index/footer/twitter_gray_icon.png deleted file mode 100755 index a9820b04..00000000 Binary files a/themes/nuls/source/img/index/footer/twitter_gray_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/footer/twitter_green_icon.png b/themes/nuls/source/img/index/footer/twitter_green_icon.png deleted file mode 100755 index a2a3b38b..00000000 Binary files a/themes/nuls/source/img/index/footer/twitter_green_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/Parallel Multi-Chains_chinese_icon.png b/themes/nuls/source/img/index/main/Parallel Multi-Chains_chinese_icon.png deleted file mode 100644 index 79d7bca4..00000000 Binary files a/themes/nuls/source/img/index/main/Parallel Multi-Chains_chinese_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/Parallel Multi-Chains_icon.png b/themes/nuls/source/img/index/main/Parallel Multi-Chains_icon.png deleted file mode 100644 index b4368bf0..00000000 Binary files a/themes/nuls/source/img/index/main/Parallel Multi-Chains_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/modular_chinese_icon.png b/themes/nuls/source/img/index/main/modular_chinese_icon.png deleted file mode 100644 index afbf4bff..00000000 Binary files a/themes/nuls/source/img/index/main/modular_chinese_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/modular_icon.png b/themes/nuls/source/img/index/main/modular_icon.png deleted file mode 100644 index fd7d94bd..00000000 Binary files a/themes/nuls/source/img/index/main/modular_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/smart contract_icon.png b/themes/nuls/source/img/index/main/smart contract_icon.png deleted file mode 100644 index 9d00b969..00000000 Binary files a/themes/nuls/source/img/index/main/smart contract_icon.png and /dev/null differ diff --git a/themes/nuls/source/img/index/main/tech_introduction_icon.png b/themes/nuls/source/img/index/main/tech_introduction_icon.png deleted file mode 100644 index e490b83d..00000000 Binary files a/themes/nuls/source/img/index/main/tech_introduction_icon.png and /dev/null differ diff --git a/themes/nuls/source/js/common.js b/themes/nuls/source/js/common.js deleted file mode 100644 index f0a4023c..00000000 --- a/themes/nuls/source/js/common.js +++ /dev/null @@ -1,14 +0,0 @@ -(function() { - 'use strict'; - //页面内容较少时,给content-wrap赋一个最小高度,撑开内容 - var clientHeight=document.documentElement.clientHeight || document.body.clientHeight; - var headerHeight=document.getElementById('header').offsetHeight; - var footerHeight=document.getElementById('footer').offsetHeight; - var contentWrapHeight=document.getElementById('content-wrap').style.minHeight; - contentWrapHeight=clientHeight-headerHeight-footerHeight+'px'; - //右侧边栏动态添加title - var tocText=document.getElementsByClassName("toc-text"); - for(var i=0;i headerHeight) { - toc.classList.add('fixed'); - } else { - toc.classList.remove('fixed'); - } - } - - window.addEventListener('scroll', function() { - window.requestAnimationFrame(updateSidebarPosition); - }); - - updateSidebarPosition(); - - tocTop.addEventListener('click', function(e) { - e.preventDefault(); - document.scrollingElement.scrollTop = 0; - }); -}()); diff --git a/yarn.lock b/yarn.lock index 2a0e8507..70fc3f79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,300 +2,1383 @@ # yarn lockfile v1 -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" +"@babel/code-frame@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.47.tgz#d18c2f4c4ba8d093a2bcfab5616593bfe2441a27" + integrity sha512-W7IeG4MoVf4oUvWfHUx9VG9if3E0xSUDf1urrnNYtC2ow1dz2ptvQ6YsJfyVXDuPTFXz66jkHhzMW7a5Eld7TA== + dependencies: + "@babel/highlight" "7.0.0-beta.47" + +"@babel/core@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.47.tgz#b9c164fb9a1e1083f067c236a9da1d7a7d759271" + integrity sha512-7EIuAX0UVnCgZ0E9tz9rFK0gd+aovwMA9bul+dnkmBQYLrJdas2EHMUSmaK67i1cyZpvgVvXhHtXJxC7wo3rlQ== + dependencies: + "@babel/code-frame" "7.0.0-beta.47" + "@babel/generator" "7.0.0-beta.47" + "@babel/helpers" "7.0.0-beta.47" + "@babel/template" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + babylon "7.0.0-beta.47" + convert-source-map "^1.1.0" + debug "^3.1.0" + json5 "^0.5.0" + lodash "^4.17.5" + micromatch "^2.3.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.47.tgz#1835709f377cc4d2a4affee6d9258a10bbf3b9d1" + integrity sha512-fJP+9X+gqgTTZzTqrKJHwebPwt6S/e/4YuyRyKyWHAIirGgUwjRoZgbFci24wwGYMJW7nlkCSwWG7QvCVsG0eg== + dependencies: + "@babel/types" "7.0.0-beta.47" + jsesc "^2.5.1" + lodash "^4.17.5" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.47.tgz#354fb596055d9db369211bf075f0d5e93904d6f6" + integrity sha512-Pjxb/PrxyKWc7jcAXlawvNAQMxxY+tSSNC5wxJstJjpO10mocmGzBOqNYjxdvVhMb3d0BEPQ8mR+D65fFpZ+TA== dependencies: - "@babel/highlight" "^7.0.0" + "@babel/types" "7.0.0-beta.47" -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "http://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" +"@babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.47.tgz#d5917c29ee3d68abc2c72f604bc043f6e056e907" + integrity sha512-nv8d6TcDBb1CJMQzwab/e0rqyqoP9d2AQBjr4GdSiVRpJX4aiLEiLBm2XprdEb/sVIRmmBnVxPXJaHDsS/K2fw== + dependencies: + "@babel/helper-explode-assignable-expression" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-call-delegate@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.47.tgz#96b7804397075f722a4030d3876f51ec19d8829b" + integrity sha512-Rx9TRmCCEP0pWau9gfR6ubcbbX3nVc4ImNY143ftC70jrKdSv5rS20yz2cmCilDzhexwGZQ3PFwOLKe3C/5aEg== + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-define-map@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.47.tgz#43a9def87c5166dc29630d51b3da9cc4320c131c" + integrity sha512-pLB9RY7GZKcc/frzgfDY/HwdqxWPe60qMAvNUef1V1bDZ8i4AUgxAANgltFzj61t100WGhqaS0xGkALD+9VA+g== + dependencies: + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/helper-explode-assignable-expression@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.47.tgz#56b688e282a698f4d1cf135453a11ae8af870a19" + integrity sha512-1mwk27zmhSuMUcVWxw5ZKiPYfuWXviZNqgA4OvFBloPf9R+dKDhNgP2uUrkHh68ltVVc3Bup1nsbd/2KM5AxEw== + dependencies: + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-function-name@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.47.tgz#8057d63e951e85c57c02cdfe55ad7608d73ffb7d" + integrity sha512-0LSvt95XCYaOrDA5K68KkTyldKXizDwBnKACdYzQszp1GdbtzmSeGwFU5Ecw86fU6bkYXtDvkFTOQwk/WQSJPw== + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.47" + "@babel/template" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-get-function-arity@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.47.tgz#2de04f97c14b094b55899d3fa83144a16d207510" + integrity sha512-63j0i3YUW8CO//uQc3ACffJdIlYcIlysuHjMF0yzQhqKoQ/CUPv0hf3nBwdRGjiWrr3JcL6++NF4XmXdwSU+fA== + dependencies: + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-hoist-variables@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.47.tgz#ce295d1d723fe22b2820eaec748ed701aa5ae3d0" + integrity sha512-5BcKFhyzrsInlrfO/tGoe6khUuJzGfROD7oozF/5MWsKo/c3gVJfQ5y83lZ4XoTKJt/x4PQlLU0aHd/SJpYONA== + dependencies: + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-member-expression-to-functions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0-beta.47.tgz#35bfcf1d16dce481ef3dec66d5a1ae6a7d80bb45" + integrity sha512-gpipslnZw2hcVGADUtqQII9KF8FPpRZsVUXwKP/0EnWwtujRFSVL+u2Fh+VXODRAxFmTLo6eGcOr/Vfan0MqYw== + dependencies: + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-module-imports@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.47.tgz#5af072029ffcfbece6ffbaf5d9984c75580f3f04" + integrity sha512-Rk43Ty+a6npu9znK22IqFlseStRGWxEHi2cjmLbbi63VGiseofdUtIJI65F9MTCuMTXAX7VbY/ghef1Jp5qpvw== + dependencies: + "@babel/types" "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/helper-module-transforms@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.47.tgz#7eff91fc96873bd7b8d816698f1a69bbc01f3c38" + integrity sha512-CziMe30ZunAhe6j05oNOFOg7im1lcv3dYuMxrwBYVe9YdP4NHPU7a1wrDBUhaPmyqTIZDwGnFne7k1KP79SeGQ== + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.47" + "@babel/helper-simple-access" "7.0.0-beta.47" + "@babel/helper-split-export-declaration" "7.0.0-beta.47" + "@babel/template" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/helper-optimise-call-expression@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.47.tgz#085d864d0613c5813c1b7c71b61bea36f195929e" + integrity sha512-NhnGhjwrhzGas4A/PoBDEtEPCGJHrzhaT6qGmo1hmkA2orG4UNi7KENC38DhJII0n2oUrKUuzTwgCvxKOTiHbw== + dependencies: + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-plugin-utils@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0-beta.47.tgz#4f564117ec39f96cf60fafcde35c9ddce0e008fd" + integrity sha512-GR67o8boOKVJRKM5Nhk7oVEHpxYy8R00lwu0F82WxxBH+iiT26DqW1e/4w/mo7Bdn1A6l0pNaOlNk1PdM2Hgag== + +"@babel/helper-regex@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0-beta.47.tgz#b8e3b53132c4edbb04804242c02ffe4d60316971" + integrity sha512-dafidvVkjJP5AIWkJspV+7RGj1jeNts0qYvlmVzqAGb6BmQzEldJr6ZPzrmlpW/AW1YJGdw7br2yiwvlCRqDvQ== + dependencies: + lodash "^4.17.5" + +"@babel/helper-remap-async-to-generator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.47.tgz#444dc362f61470bd61a745ebb364431d9ca186c2" + integrity sha512-Nmj3lUHQscD160asav2bZ3sMIjGwGY9r6Vrriy9TqH7bmaClKUKUs5Twv0htFWfOKNFLEeY/MaqiAXylr1GS2w== + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.47" + "@babel/helper-wrap-function" "7.0.0-beta.47" + "@babel/template" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-replace-supers@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.47.tgz#310b206a302868a792b659455ceba27db686cbb7" + integrity sha512-yf2JAD1+xNTjavqazqknRgPfd6MbGfvfIcAkxWsPURynAwOMSs4zThED8ImT2d5a97rGPysRJcq1jNh2L0WYxg== + dependencies: + "@babel/helper-member-expression-to-functions" "7.0.0-beta.47" + "@babel/helper-optimise-call-expression" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-simple-access@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.47.tgz#234d754acbda9251a10db697ef50181eab125042" + integrity sha512-sd2t3QDKjd+hHkJKaC2AX39l6oIil1N548oMZAtV5YHlVGoWWkAVGnPMxRg7ICEjIftCU3ZI6UeaogyEhF8t7Q== + dependencies: + "@babel/template" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/helper-split-export-declaration@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.47.tgz#e11277855472d8d83baf22f2d0186c4a2059b09a" + integrity sha512-jx8GmxryT6Qy4+24W6M6TnVL9T8bxqdyg5UKHjxBdw0Y2Sano1n0WphUS2seuOugn04W2ZQLqGc0ut8nGe/taA== + dependencies: + "@babel/types" "7.0.0-beta.47" + +"@babel/helper-wrap-function@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.47.tgz#6528b44a3ccb4f3aeeb79add0a88192f7eb81161" + integrity sha512-SAasvh80Mz5q9x15dqH6z8jpM0WTBmxQSNZATSwJwhmWdme6r2gxpufIMr8LwQIJHmXmgNLmvh0zdWSbE/PR4Q== + dependencies: + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/template" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/helpers@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.0.0-beta.47.tgz#f9b42ed2e4d5f75ec0fb2e792c173e451e8d40fd" + integrity sha512-uWk7gIua2COEWLwZGxfF5Wq1bgXOt1V6xzWxqeFznrA6F1TUPiAhkK5zORiZEa5RAILp6Mswsn3xFjDyCpp3rQ== + dependencies: + "@babel/template" "7.0.0-beta.47" + "@babel/traverse" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + +"@babel/highlight@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.47.tgz#8fbc83fb2a21f0bd2b95cdbeb238cf9689cad494" + integrity sha512-d505K3Hth1eg0b2swfEF7oFMw3J9M8ceFg0s6dhCSxOOF+07WDvJ0HKT/YbK/Jk9wn8Wyr6HIRAUPKJ9Wfv8Rg== dependencies: chalk "^2.0.0" esutils "^2.0.2" - js-tokens "^4.0.0" + js-tokens "^3.0.0" -"@types/babel-types@*", "@types/babel-types@^7.0.0": - version "7.0.4" - resolved "http://registry.npm.taobao.org/@types/babel-types/download/@types/babel-types-7.0.4.tgz#bfd5b0d0d1ba13e351dff65b6e52783b816826c8" +"@babel/plugin-proposal-async-generator-functions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.47.tgz#571142284708c5ad4ec904d9aa705461a010be53" + integrity sha512-TQMLYVIqQ0MqVS1Z7jsuv3HlEetLo/7EnDY9mGBZ4c4/WLD/mu+tFuLiK2/2QH5wgi5viRfJGs/+L5TaDzxWng== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.47" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.47" -"@types/babylon@^6.16.2": - version "6.16.3" - resolved "http://registry.npm.taobao.org/@types/babylon/download/@types/babylon-6.16.3.tgz#c2937813a89fcb5e79a00062fc4a8b143e7237bb" +"@babel/plugin-proposal-class-properties@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.0.0-beta.47.tgz#08c1a1dfc92d0f5c37b39096c6fb883e1ca4b0f5" + integrity sha512-6yuCiF+ZZHPLgAa+0a6/teNeAMsWqY6AVtZA4NhCWnwP4OH0JrRaY7rwvFCJSqNGurf8rF65W9IucM/l0+HOCg== dependencies: - "@types/babel-types" "*" + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-replace-supers" "7.0.0-beta.47" + "@babel/plugin-syntax-class-properties" "7.0.0-beta.47" -JSONStream@^1.0.7: - version "1.3.4" - resolved "http://registry.npm.taobao.org/JSONStream/download/JSONStream-1.3.4.tgz#615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e" +"@babel/plugin-proposal-decorators@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.0.0-beta.47.tgz#5e8943c8f8eb3301f911ef0dcd3ed64cf28c723e" + integrity sha512-sI+cO1okrlOyV4I63HDXf/SFsCr492HLjzNsMsd7Lk9WrViA+eQIboIiI9wHicozdgD1WrpZGJTjz7Z3xwl2Qw== dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-decorators" "7.0.0-beta.47" -a-sync-waterfall@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/a-sync-waterfall/download/a-sync-waterfall-1.0.0.tgz#38e8319d79379e24628845b53b96722b29e0e47c" +"@babel/plugin-proposal-export-namespace-from@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.0.0-beta.47.tgz#38171dd0fd5f54aee377d338ed41bb92e25d6720" + integrity sha512-tTYnPZzCrOm8NK+7lRi4LGxPaw6lErDsozNInM/FWOXGe7s2EpQnTa40S7/gLLNGvpNshYHdykJtKgfiar9qkA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-export-namespace-from" "7.0.0-beta.47" -abbrev@1, abbrev@^1.0.7: - version "1.1.1" - resolved "http://registry.npm.taobao.org/abbrev/download/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" +"@babel/plugin-proposal-function-sent@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.0.0-beta.47.tgz#3ad46c04a277a887731f21843013292d254f7ba9" + integrity sha512-253O7PlXtV1LjJkRSMCzG7L16JaQE62AWFVUbbd/8LZI7evyGE5pP90d4R7V+ir/Ra17tL+nk9GfUpEKG7KT4A== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-wrap-function" "7.0.0-beta.47" + "@babel/plugin-syntax-function-sent" "7.0.0-beta.47" -accepts@~1.3.5: - version "1.3.5" - resolved "http://registry.npm.taobao.org/accepts/download/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" +"@babel/plugin-proposal-numeric-separator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.0.0-beta.47.tgz#3ace5cbacb62c3fa223c3c0b66c0c16e63a8e259" + integrity sha512-WSS8EVGwHF1g0nQ7IFjiCtBOSyONLqVA3yOriJR1oJS+0HVjfvbee5XwfwsIvdtEIh6YKEnHik5yh54qu7C/PQ== dependencies: - mime-types "~2.1.18" - negotiator "0.6.1" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-numeric-separator" "7.0.0-beta.47" -acorn-globals@^1.0.3: - version "1.0.9" - resolved "http://registry.npm.taobao.org/acorn-globals/download/acorn-globals-1.0.9.tgz#55bb5e98691507b74579d0513413217c380c54cf" +"@babel/plugin-proposal-object-rest-spread@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.47.tgz#e1529fddc88e948868ee1d0edaa27ebd9502322d" + integrity sha512-ujUjQUyTxUWHfixRD7Y5Nm8VCgHSf6YgbM37LEnojKp5lPahZO42qJfDty+Kh0tEanpI5H8BLPkJbFSzx6TNEw== dependencies: - acorn "^2.1.0" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.47" -acorn-globals@^3.0.0: - version "3.1.0" - resolved "http://registry.npm.taobao.org/acorn-globals/download/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" +"@babel/plugin-proposal-optional-catch-binding@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.47.tgz#8c6453919537517ea773bb8f3fceda4250795efa" + integrity sha512-XMZavW6uior8KD4BeMavxF3PGrwVpIFlZk/GJQGkd3lOeOHil8nhHDuTWvsbsJptKFWMPkhGR18boNdxgmxyFQ== dependencies: - acorn "^4.0.4" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.47" -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "http://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" +"@babel/plugin-proposal-throw-expressions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.0.0-beta.47.tgz#9a67f8b0852b4b0b255eff5d6d25fa436928424f" + integrity sha512-BGJ96kIVi9NlojyZkpJNkdkxABt+VQT6hLQfILpNfFBJUzdOnZbVecXJUmoTAzg56Wse29XbY9bpNmocdNmtFQ== dependencies: - acorn "^5.0.3" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-syntax-throw-expressions" "7.0.0-beta.47" -acorn@^1.0.1: - version "1.2.2" - resolved "http://registry.npm.taobao.org/acorn/download/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" +"@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.47.tgz#34d7e4811bdc4f512400bb29d01051842528c8d5" + integrity sha512-TCQqSmPrgVB0Txr6WzCpxJyLuVTb9KoT0+oECKELtF717bvHOI4woR7o8D8DFkXzVQeb7Kqfu5w05gsvPq591g== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-regex" "7.0.0-beta.47" + regexpu-core "^4.1.4" -acorn@^2.1.0: - version "2.7.0" - resolved "http://registry.npm.taobao.org/acorn/download/acorn-2.7.0.tgz#ab6e7d9d886aaca8b085bc3312b79a198433f0e7" +"@babel/plugin-syntax-async-generators@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.47.tgz#8ab94852bf348badc866af85bd852221f0961256" + integrity sha512-LCNGYTLpQAsvTmVmT/I2pz7dIh3Bu+9BLxqL7b3QfplsMQxNsoBBMend33Arb4EtPt5dX7KeeVof8tL0trDRRA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" -acorn@^3.1.0: - version "3.3.0" - resolved "http://registry.npm.taobao.org/acorn/download/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +"@babel/plugin-syntax-class-properties@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0-beta.47.tgz#de52bed12fd472c848e1562f57dd4a202fe27f11" + integrity sha512-vLoAuLSjHSenX3TQmri6ttQWZp3rEtGcRp4LgYEBQ012fN5h+KmcssvkCAqm6V6ozS5KzUWpBlZ6t7YhZG6oBw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-decorators@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.0.0-beta.47.tgz#a42f10fcd651940bc475d93b3ac23432b4a8a293" + integrity sha512-Lv10BM3C+0Ki53lI7T9xZsSsgzQqfoQZq4pZj0F6tkK54E5BBSFfUxGavRE43CFXHbK0Hd9uMqmpGWPGtCvgAw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-dynamic-import@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0-beta.47.tgz#ee964915014a687701ee8e15c289e31a7c899e60" + integrity sha512-J2y7RAH2NwQ+ahJahj2eS1PqS2NWNWTDaEibqrE55VTJU7nPL8AhthRwIQfQkCH+8UIeL/T3Jh1iHIRkvJ6dXA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-export-namespace-from@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0-beta.47.tgz#fd446c76c59849f15e6cde235b5b8e153413f21e" + integrity sha512-mCNj425dtBdO95z1jMKoW0H3nZnTy9tjsdIuLw94uS+y97hvmFkFQtffqH+WIwEGxGBWq1Pn0OGfk3E8GfkhgQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-function-sent@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.0.0-beta.47.tgz#8d15536f55b21acdf9bfaa177c46591a589fe8b0" + integrity sha512-S/jMyfNd+a/MbtUCvQ3wDC/Wt9Cftj/Q59bVROOX79DrWpKE9VL/kEeiIJzCNKetvDesUdDH+4xcXt3D0/5Rog== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-import-meta@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.0.0-beta.47.tgz#8ab5174209a954b91e327004a7d16737bcc4774d" + integrity sha512-ISVXJZw9Q2Q0pwcXNv3nfA1p9Ia0clDMTtYxlqIGE5/3WaIQoHkkeaOYsckBKiIIL0hfU+GEjL1g5hRBYPlMUA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-jsx@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0-beta.47.tgz#f3849d94288695d724bd205b4f6c3c99e4ec24a4" + integrity sha512-5scuJzIYZY8M+A1ra8mcKANIwB5TtsRD6Aw94xZxfvnjhhVMFR5RYE9HshVlBrZVY+r3cJDNIQLJMC/fGJHImA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-numeric-separator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.0.0-beta.47.tgz#9f06cb770a94f464b3b2889d2110080bc302fc80" + integrity sha512-qAGv7jHtZWNWy4n23OzKLrVk+xfaEO4LYRK3zCMyudXRfB3FPaer6NJNjU5rebvJzC4wB2EVb2nPwVENNNh2jQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-object-rest-spread@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.47.tgz#21da514d94c138b2261ca09f0dec9abadce16185" + integrity sha512-UOGQCmzvNlZMQOuys7xPiTa2EjTT3xHuhUghcdJnYikqGV43obpIIaP+VDCWPvIT8g0QDIvmRWx5UefvkWXN+w== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-optional-catch-binding@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.47.tgz#0b1c52b066aa36893c41450773a5adb904cd4024" + integrity sha512-Dmq+REMR95Syg+VjV3bh63DD/tDxdraNQ4ErAOXFobfSCDbfov9YGkqSJ4K61LHTQwinQ0+dIUlgdFL2kbedIw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-syntax-throw-expressions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.0.0-beta.47.tgz#8ca197bab3534f443eecd7eb79da47e199dafaf7" + integrity sha512-v9DcO3cmp0maysKG7MMjHqHeGTY0/UY4cOuPckIZK3HHmUtQliSLeAw6eaLXGRUv4ZgaqX/T3dbi8YH7YeK4YQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-arrow-functions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.47.tgz#d6eecda4c652b909e3088f0983ebaf8ec292984b" + integrity sha512-xiU+7RJAsqx+iZqWSQQWBu9ZDTruWimkg4puDSdRVfEwgZQdOtiU2LuO0+xGFyitJPHkKuje0WvK1tFu1dmxCw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-async-to-generator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.47.tgz#5723816ea1e91fa313a84e6ee9cc12ff31d46610" + integrity sha512-/TXK3v6ipvmhMO81Y2Vjc7RYROkS2PcmRc+kvmU3CWA7r5I73KWg10UEW/fpWqCuoTCHHHXu1ZcZ5u+nduJeFw== + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.47" + +"@babel/plugin-transform-block-scoped-functions@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.47.tgz#e422278e06c797b43c45f459d83c7af9d6237002" + integrity sha512-8KPxKyE6kb9VRbHwQ8XKsg/IPlxHaOMRyg2WfyV5C4dCmXbRdHDJy4hZKB3o4rGxjggmC/Bx8Fh51/P7UNtTcA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-block-scoping@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.47.tgz#b737cc58a81bea57efd5bda0baef9a43a25859ad" + integrity sha512-V/u3Zdy40KjVQeyYUaQnCGiHQbRNJoc6IEtNDERltuW9vYPHS1n6YGc+EHKi8JVYT4kE6UHOjD+BrbCCV4kjRw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/plugin-transform-classes@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.47.tgz#7aff9cbe7b26fd94d7a9f97fa90135ef20c93fb6" + integrity sha512-hzW/jL6TPBMHJXeXwzuxMN0PFAfjVD0UzATHrFSejY5A7SvhWWrv1cZ3K0/SzCXJ9LpMdxCNiREvVjeD/Tyx2g== + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.47" + "@babel/helper-define-map" "7.0.0-beta.47" + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/helper-optimise-call-expression" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-replace-supers" "7.0.0-beta.47" + "@babel/helper-split-export-declaration" "7.0.0-beta.47" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.47.tgz#56ef2a021769a2b65e90a3e12fd10b791da9f3e0" + integrity sha512-V78qyzmjj4aq/tjpkMFbV5gPtrx7xdclW1Rn6vV9hIwMSMbtstYEXF4msy614MofvYj6gYbPbNfyhXFIUvz/xw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-destructuring@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.47.tgz#452b607775fd1c4d10621997837189efc0a6d428" + integrity sha512-3AaXC9H7qPybJbSs/QMhhj9EZF9MYrb/HRytwki1tckaYifqCJquENIZxDAYmwsWIGIHiq34WqwPRMIsz/b5uQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-dotall-regex@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0-beta.47.tgz#d8da9b706d4bfc68dec9d565661f83e6e8036636" + integrity sha512-ofB5GwipMoaOH3Qyr5g5FpXWePhIAaD4zMDOoAHDYBPuLWxzAME8YQCa0S3HJf3eTu/HTN/c/G1gDwDB8Z/gKQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-regex" "7.0.0-beta.47" + regexpu-core "^4.1.3" + +"@babel/plugin-transform-duplicate-keys@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.47.tgz#4aabeda051ca3007e33a207db08f1a0cf9bd253b" + integrity sha512-r3xNVYTLVasjqTowIr6s+27oc5n7A5TKbB0/4u9FHjF7ONTWaggO8UFbbj07DOJ4Ll2RkigrZA8/D+w2nJ+XlA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-exponentiation-operator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.47.tgz#930e1abf5db9f4db5b63dbf97f3581ad0be1e907" + integrity sha512-vyGG3kLIXpMuaPL485aqowdWFrxCxXtbzMXy9p1QTK5Q/+9UHpK9XoAVJZGknnsm091m0Ss7spo8uHaxbzYVog== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-for-of@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.47.tgz#527d5dc24e4a4ad0fc1d0a3990d29968cb984e76" + integrity sha512-tfH5OMzV9fWLYJTzWDhoRJKr8kvBZWH26jiCgM0ayNq75ES/X947MqMNAgBjJdTAVEV2kOyks2ItgNAJT4rOUw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-function-name@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.47.tgz#fb443c81cc77f3206a863b730b35c8c553ce5041" + integrity sha512-/5I/f8NCouugsRT6ORB1UjCP3N+Rgv/OB6SzmaeIUEpYYPM6D7WQ+4BaRYXQn4eqtOJmTgxDXYa8FgYtoeqP9A== + dependencies: + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-literals@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.47.tgz#448fad196f062163684a38f10f14e83315892e9c" + integrity sha512-PxBw+52qWypwR76YfS2FlW4wZfp61SjIyt3OSPZeWnf0zVQWNVrlRRunJ7lBYudDYvyMwStAE/VynZ0fHtPgng== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-modules-amd@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.47.tgz#84564419b11c1be6b9fcd4c7b3a6737f2335aac4" + integrity sha512-zW84YqQ5Kt8+t5pYrnFhjWQP2w2wq6Nxz9pozxpnvXP+lhqyJPqNdWM1lcVApORpWL1BF7BlgP08yk+5MVRfGA== + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-modules-commonjs@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.47.tgz#dfe5c6d867aa9614e55f7616736073edb3aab887" + integrity sha512-MYoLyexybBJ9ODWWMsMFzxAQey68RzhQNPjfNAYPhPPB3X160EZ5qOjWxRS2rYNvuYAxs6guy5OdrDpESqFSrQ== + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-simple-access" "7.0.0-beta.47" + +"@babel/plugin-transform-modules-systemjs@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.47.tgz#8514dbcdfca3345abd690059e7e8544e16ecbf05" + integrity sha512-bMQy3/jEZRpoUg7RdOouphBO8+7Sfjl7XrO84PtgBx4ck+ZPc4xOlBQyr2rkmsJNmmGLi42nnMI1cZZJT3LVnQ== + dependencies: + "@babel/helper-hoist-variables" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-modules-umd@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.47.tgz#6dcfb9661fdd131b20b721044746a7a309882918" + integrity sha512-rG7KioAFCLxZ33wNBqUoxPhtXOmVEvnZNIy9wv0fSbNIQr8lO1avZ7SeBL3OZduNvLocqrESt9Xhh1nzb/zOvA== + dependencies: + "@babel/helper-module-transforms" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-new-target@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.47.tgz#4b5cb7ce30d7bffa105a1f43ed07d6ae206a4155" + integrity sha512-2IRZtdoPXJn7KSwrmp0xtLTZ0PnhlQxhcTZ0XZ5wfFXmsZ9vi6AK4whIZ2IXI/c2qrYK9FEYLwR5QRfL5Qe6eQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-object-super@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.47.tgz#ca8e5f326c5011c879f3a6ed749e58bd10fff05d" + integrity sha512-JN6ox2rH1xe6hlsd6/7d2kPjZSA97wH4oOdNOSaNqaFGEFuaP/Je4+ojHMgyHKU2nx9QHNBCTxHEj+ko+Ij6HQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-replace-supers" "7.0.0-beta.47" + +"@babel/plugin-transform-parameters@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.47.tgz#46a4236040a6552a5f165fb3ddd60368954b0ddd" + integrity sha512-UzQG8draO+30Y8eNEREuGBfmEHLL7WFxOjmTBbaTrbdOrm/znCUThqcuNz8cyn2nrZbln7M/loQ3stjf9Pt9fQ== + dependencies: + "@babel/helper-call-delegate" "7.0.0-beta.47" + "@babel/helper-get-function-arity" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-regenerator@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.47.tgz#86500e1c404055fb98fc82b73b09bd053cacb516" + integrity sha512-JEPIiJyqYRfjOYUTZguLkb2HTwudReqLyOljpOXnJ/1ymwsiof4D6ul611DGlMxJMZJGQ6TBi59iY9GoJ6j4Iw== + dependencies: + regenerator-transform "^0.12.3" + +"@babel/plugin-transform-runtime@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.0.0-beta.47.tgz#1700938fa8710909cbf28f7dd39f9b40688b09fd" + integrity sha512-RhnhjYsOxmKDGa1ePM5RQWFBYe1PnEZAhXTNEeIwtw1jluEoLL+PCTZDbt/aAcAkZvqwIWccjkNM/FwKTd5Sxw== + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-shorthand-properties@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.47.tgz#00be44c4fad8fe2c00ed18ea15ea3c88dd519dbb" + integrity sha512-+o7/yb0Nrk4Gg/tnBgfBf+G1uGZbtkSluUnj8RyD37ajpDlWmysDjFEHSfktKcuD8YHeGz2M9AYNGcClk1fr/g== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-spread@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.47.tgz#3feadb02292ed1e9b75090d651b9df88a7ab5c50" + integrity sha512-LFAozFdfT4bE2AQw2BnjzLufTX4GBsTUHUGRhT8XNoDYuGnV+7k9Yj6JU3/7csJc9u6W91PArYgoO+D56CMw6Q== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-sticky-regex@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.47.tgz#c0aa347d76b5dc87d3b37ac016ada3f950605131" + integrity sha512-+Rc6NihGoXcwAqAxbiumvzOYxRR0aUg1ZExfyHnI5QnQf0sf4xAfgT/YpGvEgLd5Ci0rka+IWSj54PhzZkhuTg== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-regex" "7.0.0-beta.47" + +"@babel/plugin-transform-template-literals@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.47.tgz#5f7b5badf64c4c5da79026aeab03001e62a6ee5f" + integrity sha512-ORfrfN/gQoRuI+xf+kOa2i/yvXfedFRgH+KtgoIrpUQom7OhexxzD280x80LMCIkdaVGzYhvlC3kdJkFMWAfUg== + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-typeof-symbol@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.47.tgz#03c612ec09213eb386a81d5fa67c234ee4b2034c" + integrity sha512-PhPy5NUY5MT++fEr7/sxN1/ERSM2siHSbGgdkbqgDlyvf1NlU1HeqyfomHJEFE1Y4PX0hj+XmtjSAali/6XqYA== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + +"@babel/plugin-transform-unicode-regex@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.47.tgz#efed0b2f1dfbf28283502234a95b4be88f7fdcb6" + integrity sha512-44nWn421tMVZ/A4+1uppzoAO7nrlwWzefMr9JUi5G+tXl0DLEtWy+F7L6zCVw19C4OAOA6WlolVro5CEs6g6AQ== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/helper-regex" "7.0.0-beta.47" + regexpu-core "^4.1.3" + +"@babel/preset-env@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.0.0-beta.47.tgz#a3dab3b5fac4de56e3510bdbcb528f1cbdedbe2d" + integrity sha512-ZFUgKdQDqw2H5TCMaWq6iDDO9+16RZPdDfOuoPID8Agm8I2MBlrqTI1MKWwqgEHICdZIOXkVszAMuuDTBwdzHA== + dependencies: + "@babel/helper-module-imports" "7.0.0-beta.47" + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.47" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.47" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.47" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.47" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.47" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.47" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.47" + "@babel/plugin-transform-arrow-functions" "7.0.0-beta.47" + "@babel/plugin-transform-async-to-generator" "7.0.0-beta.47" + "@babel/plugin-transform-block-scoped-functions" "7.0.0-beta.47" + "@babel/plugin-transform-block-scoping" "7.0.0-beta.47" + "@babel/plugin-transform-classes" "7.0.0-beta.47" + "@babel/plugin-transform-computed-properties" "7.0.0-beta.47" + "@babel/plugin-transform-destructuring" "7.0.0-beta.47" + "@babel/plugin-transform-dotall-regex" "7.0.0-beta.47" + "@babel/plugin-transform-duplicate-keys" "7.0.0-beta.47" + "@babel/plugin-transform-exponentiation-operator" "7.0.0-beta.47" + "@babel/plugin-transform-for-of" "7.0.0-beta.47" + "@babel/plugin-transform-function-name" "7.0.0-beta.47" + "@babel/plugin-transform-literals" "7.0.0-beta.47" + "@babel/plugin-transform-modules-amd" "7.0.0-beta.47" + "@babel/plugin-transform-modules-commonjs" "7.0.0-beta.47" + "@babel/plugin-transform-modules-systemjs" "7.0.0-beta.47" + "@babel/plugin-transform-modules-umd" "7.0.0-beta.47" + "@babel/plugin-transform-new-target" "7.0.0-beta.47" + "@babel/plugin-transform-object-super" "7.0.0-beta.47" + "@babel/plugin-transform-parameters" "7.0.0-beta.47" + "@babel/plugin-transform-regenerator" "7.0.0-beta.47" + "@babel/plugin-transform-shorthand-properties" "7.0.0-beta.47" + "@babel/plugin-transform-spread" "7.0.0-beta.47" + "@babel/plugin-transform-sticky-regex" "7.0.0-beta.47" + "@babel/plugin-transform-template-literals" "7.0.0-beta.47" + "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.47" + "@babel/plugin-transform-unicode-regex" "7.0.0-beta.47" + browserslist "^3.0.0" + invariant "^2.2.2" + semver "^5.3.0" + +"@babel/preset-stage-2@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-2/-/preset-stage-2-7.0.0-beta.47.tgz#deb930c44d7d6e519a33174bba121a2a630ed654" + integrity sha512-IabxIY3AAAHRy3GCGJQ3KBfRMR59OZJSMLke24Kwpwlvk09WEP5ERReRbfmUGJeEPeZK3rAt0oZBdF83Ri+C5Q== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-proposal-decorators" "7.0.0-beta.47" + "@babel/plugin-proposal-export-namespace-from" "7.0.0-beta.47" + "@babel/plugin-proposal-function-sent" "7.0.0-beta.47" + "@babel/plugin-proposal-numeric-separator" "7.0.0-beta.47" + "@babel/plugin-proposal-throw-expressions" "7.0.0-beta.47" + "@babel/preset-stage-3" "7.0.0-beta.47" + +"@babel/preset-stage-3@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-3/-/preset-stage-3-7.0.0-beta.47.tgz#17028f3b5dddc548d80404c86ed62622f601597b" + integrity sha512-JOOsIaC3sbcBPbRpELUij3xLE8ObIr7TjanKTExlMwc/Hvz0YG3/ioXmDbphvR9L2cb9a+QNIdjAyOebqDyaFw== + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.47" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.47" + "@babel/plugin-proposal-class-properties" "7.0.0-beta.47" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.47" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.47" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.47" + "@babel/plugin-syntax-dynamic-import" "7.0.0-beta.47" + "@babel/plugin-syntax-import-meta" "7.0.0-beta.47" + +"@babel/runtime@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.0.0-beta.47.tgz#273f5e71629e80f6cbcd7507503848615e59f7e0" + integrity sha512-3IaakAC5B4bHJ0aCUKVw0pt+GruavdgWDFbf7TfKh7ZJ8yQuUp7af7MNwf3e+jH8776cjqYmMO1JNDDAE9WfrA== + dependencies: + core-js "^2.5.3" + regenerator-runtime "^0.11.1" + +"@babel/template@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.47.tgz#0473970a7c0bee7a1a18c1ca999d3ba5e5bad83d" + integrity sha512-mAzrOCLwOb4jAobHi0kTwIkoamP1Do28c6zxvrDXjYSJFZHz6KGuzMaT0AV7ZCq7M3si7QypVVMVX2bE6IsuOg== + dependencies: + "@babel/code-frame" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + babylon "7.0.0-beta.47" + lodash "^4.17.5" + +"@babel/traverse@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.47.tgz#0e57fdbb9ff3a909188b6ebf1e529c641e6c82a4" + integrity sha512-kYGGs//OnUnei+9TTldxlgf7llprj7VUeDKtG50+g+0k1g0yZyrkEgbyFheYFdnudR8IDEHOEXVsUuY82r5Aiw== + dependencies: + "@babel/code-frame" "7.0.0-beta.47" + "@babel/generator" "7.0.0-beta.47" + "@babel/helper-function-name" "7.0.0-beta.47" + "@babel/helper-split-export-declaration" "7.0.0-beta.47" + "@babel/types" "7.0.0-beta.47" + babylon "7.0.0-beta.47" + debug "^3.1.0" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.17.5" + +"@babel/types@7.0.0-beta.47": + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.47.tgz#e6fcc1a691459002c2671d558a586706dddaeef8" + integrity sha512-MOP5pOosg7JETrVGg8OQyzmUmbyoSopT5j2HlblHsto89mPz3cmxzn1IA4UNUmnWKgeticSwfhS+Gdy25IIlBQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.5" + to-fast-properties "^2.0.0" + +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== + +"@shellscape/koa-send@^4.1.0": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@shellscape/koa-send/-/koa-send-4.1.3.tgz#1a7c8df21f63487e060b7bfd8ed82e1d3c4ae0b0" + integrity sha512-akNxJetq2ak8aj7U6ys+EYXfWY4k8keleDZJbHWvpuVDj0/PUbbOuPkeBYaie7C6d5fRNLK+0M1Puu8ywTlj3w== + dependencies: + debug "^2.6.3" + http-errors "^1.6.1" + mz "^2.6.0" + resolve-path "^1.3.3" + +"@shellscape/koa-static@^4.0.4": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@shellscape/koa-static/-/koa-static-4.0.5.tgz#b329b55bfd41056a6981c584ae6bace30b5b6b3b" + integrity sha512-0T2g2NtaO2zhbqR8EBACIGtBy+haodKb8PuJ17RGDXAJwhjkgghUKLrLEnm05zuiwupfYm2APIax6D2TwLoflA== + dependencies: + "@shellscape/koa-send" "^4.1.0" + debug "^2.6.8" + +"@vue/babel-preset-app@3.0.0-beta.11": + version "3.0.0-beta.11" + resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-3.0.0-beta.11.tgz#c8b889aa73464050f9cd3f9dc621951d85c24508" + integrity sha1-yLiJqnNGQFD5zT+dxiGVHYXCRQg= + dependencies: + "@babel/plugin-syntax-jsx" "7.0.0-beta.47" + "@babel/plugin-transform-runtime" "7.0.0-beta.47" + "@babel/preset-env" "7.0.0-beta.47" + "@babel/preset-stage-2" "7.0.0-beta.47" + "@babel/runtime" "7.0.0-beta.47" + babel-helper-vue-jsx-merge-props "^2.0.3" + babel-plugin-dynamic-import-node "^1.2.0" + babel-plugin-transform-vue-jsx "^4.0.1" + +"@vue/component-compiler-utils@^2.0.0": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.3.1.tgz#d1c2623f02ad3fe6b6fc9c3762be55c9c61e3977" + integrity sha512-8VuzMhHTf5UU7+HvBeEbBmYiNLvRxIXtDpvxUl5x26WBPgKmQuuJVFY3dN3GFgnWK9Rveh/u/8NF4quhdUUQ1Q== + dependencies: + consolidate "^0.15.1" + hash-sum "^1.0.2" + lru-cache "^4.1.2" + merge-source-map "^1.1.0" + postcss "^6.0.20" + postcss-selector-parser "^3.1.1" + prettier "1.13.7" + source-map "^0.5.6" + vue-template-es2015-compiler "^1.6.0" + +"@webassemblyjs/ast@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.7.11.tgz#b988582cafbb2b095e8b556526f30c90d057cace" + integrity sha512-ZEzy4vjvTzScC+SH8RBssQUawpaInUdMTYwYYLh54/s8TuT0gBLuyUnppKsVyZEi876VmmStKsUs28UxPgdvrA== + dependencies: + "@webassemblyjs/helper-module-context" "1.7.11" + "@webassemblyjs/helper-wasm-bytecode" "1.7.11" + "@webassemblyjs/wast-parser" "1.7.11" + +"@webassemblyjs/floating-point-hex-parser@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.7.11.tgz#a69f0af6502eb9a3c045555b1a6129d3d3f2e313" + integrity sha512-zY8dSNyYcgzNRNT666/zOoAyImshm3ycKdoLsyDw/Bwo6+/uktb7p4xyApuef1dwEBo/U/SYQzbGBvV+nru2Xg== + +"@webassemblyjs/helper-api-error@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.7.11.tgz#c7b6bb8105f84039511a2b39ce494f193818a32a" + integrity sha512-7r1qXLmiglC+wPNkGuXCvkmalyEstKVwcueZRP2GNC2PAvxbLYwLLPr14rcdJaE4UtHxQKfFkuDFuv91ipqvXg== + +"@webassemblyjs/helper-buffer@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.7.11.tgz#3122d48dcc6c9456ed982debe16c8f37101df39b" + integrity sha512-MynuervdylPPh3ix+mKZloTcL06P8tenNH3sx6s0qE8SLR6DdwnfgA7Hc9NSYeob2jrW5Vql6GVlsQzKQCa13w== + +"@webassemblyjs/helper-code-frame@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.7.11.tgz#cf8f106e746662a0da29bdef635fcd3d1248364b" + integrity sha512-T8ESC9KMXFTXA5urJcyor5cn6qWeZ4/zLPyWeEXZ03hj/x9weSokGNkVCdnhSabKGYWxElSdgJ+sFa9G/RdHNw== + dependencies: + "@webassemblyjs/wast-printer" "1.7.11" + +"@webassemblyjs/helper-fsm@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-fsm/-/helper-fsm-1.7.11.tgz#df38882a624080d03f7503f93e3f17ac5ac01181" + integrity sha512-nsAQWNP1+8Z6tkzdYlXT0kxfa2Z1tRTARd8wYnc/e3Zv3VydVVnaeePgqUzFrpkGUyhUUxOl5ML7f1NuT+gC0A== + +"@webassemblyjs/helper-module-context@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-module-context/-/helper-module-context-1.7.11.tgz#d874d722e51e62ac202476935d649c802fa0e209" + integrity sha512-JxfD5DX8Ygq4PvXDucq0M+sbUFA7BJAv/GGl9ITovqE+idGX+J3QSzJYz+LwQmL7fC3Rs+utvWoJxDb6pmC0qg== + +"@webassemblyjs/helper-wasm-bytecode@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.7.11.tgz#dd9a1e817f1c2eb105b4cf1013093cb9f3c9cb06" + integrity sha512-cMXeVS9rhoXsI9LLL4tJxBgVD/KMOKXuFqYb5oCJ/opScWpkCMEz9EJtkonaNcnLv2R3K5jIeS4TRj/drde1JQ== + +"@webassemblyjs/helper-wasm-section@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.7.11.tgz#9c9ac41ecf9fbcfffc96f6d2675e2de33811e68a" + integrity sha512-8ZRY5iZbZdtNFE5UFunB8mmBEAbSI3guwbrsCl4fWdfRiAcvqQpeqd5KHhSWLL5wuxo53zcaGZDBU64qgn4I4Q== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-buffer" "1.7.11" + "@webassemblyjs/helper-wasm-bytecode" "1.7.11" + "@webassemblyjs/wasm-gen" "1.7.11" + +"@webassemblyjs/ieee754@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.7.11.tgz#c95839eb63757a31880aaec7b6512d4191ac640b" + integrity sha512-Mmqx/cS68K1tSrvRLtaV/Lp3NZWzXtOHUW2IvDvl2sihAwJh4ACE0eL6A8FvMyDG9abes3saB6dMimLOs+HMoQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.7.11.tgz#d7267a1ee9c4594fd3f7e37298818ec65687db63" + integrity sha512-vuGmgZjjp3zjcerQg+JA+tGOncOnJLWVkt8Aze5eWQLwTQGNgVLcyOTqgSCxWTR4J42ijHbBxnuRaL1Rv7XMdw== + dependencies: + "@xtuc/long" "4.2.1" + +"@webassemblyjs/utf8@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.7.11.tgz#06d7218ea9fdc94a6793aa92208160db3d26ee82" + integrity sha512-C6GFkc7aErQIAH+BMrIdVSmW+6HSe20wg57HEC1uqJP8E/xpMjXqQUxkQw07MhNDSDcGpxI9G5JSNOQCqJk4sA== + +"@webassemblyjs/wasm-edit@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.7.11.tgz#8c74ca474d4f951d01dbae9bd70814ee22a82005" + integrity sha512-FUd97guNGsCZQgeTPKdgxJhBXkUbMTY6hFPf2Y4OedXd48H97J+sOY2Ltaq6WGVpIH8o/TGOVNiVz/SbpEMJGg== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-buffer" "1.7.11" + "@webassemblyjs/helper-wasm-bytecode" "1.7.11" + "@webassemblyjs/helper-wasm-section" "1.7.11" + "@webassemblyjs/wasm-gen" "1.7.11" + "@webassemblyjs/wasm-opt" "1.7.11" + "@webassemblyjs/wasm-parser" "1.7.11" + "@webassemblyjs/wast-printer" "1.7.11" + +"@webassemblyjs/wasm-gen@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.7.11.tgz#9bbba942f22375686a6fb759afcd7ac9c45da1a8" + integrity sha512-U/KDYp7fgAZX5KPfq4NOupK/BmhDc5Kjy2GIqstMhvvdJRcER/kUsMThpWeRP8BMn4LXaKhSTggIJPOeYHwISA== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-wasm-bytecode" "1.7.11" + "@webassemblyjs/ieee754" "1.7.11" + "@webassemblyjs/leb128" "1.7.11" + "@webassemblyjs/utf8" "1.7.11" + +"@webassemblyjs/wasm-opt@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.7.11.tgz#b331e8e7cef8f8e2f007d42c3a36a0580a7d6ca7" + integrity sha512-XynkOwQyiRidh0GLua7SkeHvAPXQV/RxsUeERILmAInZegApOUAIJfRuPYe2F7RcjOC9tW3Cb9juPvAC/sCqvg== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-buffer" "1.7.11" + "@webassemblyjs/wasm-gen" "1.7.11" + "@webassemblyjs/wasm-parser" "1.7.11" + +"@webassemblyjs/wasm-parser@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.7.11.tgz#6e3d20fa6a3519f6b084ef9391ad58211efb0a1a" + integrity sha512-6lmXRTrrZjYD8Ng8xRyvyXQJYUQKYSXhJqXOBLw24rdiXsHAOlvw5PhesjdcaMadU/pyPQOJ5dHreMjBxwnQKg== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-api-error" "1.7.11" + "@webassemblyjs/helper-wasm-bytecode" "1.7.11" + "@webassemblyjs/ieee754" "1.7.11" + "@webassemblyjs/leb128" "1.7.11" + "@webassemblyjs/utf8" "1.7.11" + +"@webassemblyjs/wast-parser@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-parser/-/wast-parser-1.7.11.tgz#25bd117562ca8c002720ff8116ef9072d9ca869c" + integrity sha512-lEyVCg2np15tS+dm7+JJTNhNWq9yTZvi3qEhAIIOaofcYlUp0UR5/tVqOwa/gXYr3gjwSZqw+/lS9dscyLelbQ== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/floating-point-hex-parser" "1.7.11" + "@webassemblyjs/helper-api-error" "1.7.11" + "@webassemblyjs/helper-code-frame" "1.7.11" + "@webassemblyjs/helper-fsm" "1.7.11" + "@xtuc/long" "4.2.1" + +"@webassemblyjs/wast-printer@1.7.11": + version "1.7.11" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.7.11.tgz#c4245b6de242cb50a2cc950174fdbf65c78d7813" + integrity sha512-m5vkAsuJ32QpkdkDOUPGSltrg8Cuk3KBx4YrmAGQwCZPRdUHXxG4phIOuuycLemHFr74sWL9Wthqss4fzdzSwg== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/wast-parser" "1.7.11" + "@xtuc/long" "4.2.1" + +"@webpack-contrib/config-loader@^1.1.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@webpack-contrib/config-loader/-/config-loader-1.2.1.tgz#5b3dd474e207437939d294d200c68b7b00008e04" + integrity sha512-C7XsS6bXft0aRlyt7YCLg+fm97Mb3tWd+i5fVVlEl0NW5HKy8LoXVKj3mB7ECcEHNEEdHhgzg8gxP+Or8cMj8Q== + dependencies: + "@webpack-contrib/schema-utils" "^1.0.0-beta.0" + chalk "^2.1.0" + cosmiconfig "^5.0.2" + is-plain-obj "^1.1.0" + loud-rejection "^1.6.0" + merge-options "^1.0.1" + minimist "^1.2.0" + resolve "^1.6.0" + webpack-log "^1.1.2" + +"@webpack-contrib/schema-utils@^1.0.0-beta.0": + version "1.0.0-beta.0" + resolved "https://registry.yarnpkg.com/@webpack-contrib/schema-utils/-/schema-utils-1.0.0-beta.0.tgz#bf9638c9464d177b48209e84209e23bee2eb4f65" + integrity sha512-LonryJP+FxQQHsjGBi6W786TQB1Oym+agTpY0c+Kj8alnIw+DLUJb6SI8Y1GHGhLCH1yPRrucjObUmxNICQ1pg== + dependencies: + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chalk "^2.3.2" + strip-ansi "^4.0.0" + text-table "^0.2.0" + webpack-log "^1.1.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.1": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.1.tgz#5c85d662f76fa1d34575766c5dcd6615abcd30d8" + integrity sha512-FZdkNBDqBRHKQ2MEbSC17xnPFOhZxeJ2YGSfr2BKf3sujG49Qe3bB+rGCwQfIaA7WHnGeGkSijX4FuBCdrzW/g== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +accepts@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.5.tgz#eb777df6011723a3b14e8a72c0805c8e86746bd2" + integrity sha1-63d99gEXI6OxTopywIBcjoZ0a9I= + dependencies: + mime-types "~2.1.18" + negotiator "0.6.1" -acorn@^4.0.4, acorn@~4.0.2: - version "4.0.13" - resolved "http://registry.npm.taobao.org/acorn/download/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" +acorn-dynamic-import@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz#901ceee4c7faaef7e07ad2a47e890675da50a278" + integrity sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg== + dependencies: + acorn "^5.0.0" -acorn@^5.0.3, acorn@^5.6.0: - version "5.7.2" - resolved "http://registry.npm.taobao.org/acorn/download/acorn-5.7.2.tgz#91fa871883485d06708800318404e72bfb26dcc5" +acorn@^5.0.0, acorn@^5.6.2: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -ajv-keywords@^3.0.0: +agentkeepalive@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-2.2.0.tgz#c5d1bd4b129008f1163f236f86e5faea2026e2ef" + integrity sha1-xdG9SxKQCPEWPyNvhuX66iAm4u8= + +ajv-errors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d" + integrity sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ== + +ajv-keywords@^3.0.0, ajv-keywords@^3.1.0: version "3.2.0" - resolved "http://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" + integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= -ajv@^6.0.1, ajv@^6.5.3: - version "6.5.3" - resolved "http://registry.npm.taobao.org/ajv/download/ajv-6.5.3.tgz#71a569d189ecf4f4f321224fecb166f071dd90f9" +ajv@^6.0.1, ajv@^6.1.0, ajv@^6.5.5: + version "6.6.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.6.2.tgz#caceccf474bf3fc3ce3b147443711a24063cc30d" + integrity sha512-FBHEW6Jf5TB9MGBgUUA9XHkTbjXYfAUjY43ACMfmdMRHniyoMHjHjzD50OK8LGDWQwp4rWEsIq5kEqq7rvIM1g== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "http://registry.npm.taobao.org/align-text/download/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" +algoliasearch@^3.24.5: + version "3.31.0" + resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-3.31.0.tgz#c4083375ff02538ef50d9ec73e6a72e5e19ed96f" + integrity sha512-RJ3m8bQEitEQvWVfJa8WCTM4B9WSt0D4PPEYoqOga7Q0GAfBOqXTWeFYyDO46o085SWBSBWBInVuKyr5BIFP3A== dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" + agentkeepalive "^2.2.0" + debug "^2.6.8" + envify "^4.0.0" + es6-promise "^4.1.0" + events "^1.1.0" + foreach "^2.0.5" + global "^4.3.2" + inherits "^2.0.1" + isarray "^2.0.1" + load-script "^1.0.0" + object-keys "^1.0.11" + querystring-es3 "^0.2.1" + reduce "^1.0.1" + semver "^5.1.0" + tunnel-agent "^0.6.0" + +alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" + integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= amdefine@>=0.0.4: version "1.0.1" - resolved "http://registry.npm.taobao.org/amdefine/download/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= + +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + integrity sha1-w2rsy6VjuJzrVW82kPCx2eNUf38= + dependencies: + string-width "^2.0.0" + +ansi-colors@^3.0.0: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== ansi-escapes@^3.0.0: version "3.1.0" - resolved "http://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== ansi-regex@^2.0.0: version "2.1.1" - resolved "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" - resolved "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^2.2.1: version "2.2.1" - resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.1: version "3.2.1" - resolved "http://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" -anymatch@^1.3.0: - version "1.3.2" - resolved "http://registry.npm.taobao.org/anymatch/download/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" +any-promise@^1.0.0, any-promise@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= anymatch@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/anymatch/download/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" -aproba@^1.0.3: +app-root-path@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.1.0.tgz#98bf6599327ecea199309866e8140368fd2e646a" + integrity sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo= + +aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" - resolved "http://registry.npm.taobao.org/aproba/download/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== -archy@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/archy/download/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" +arch@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.1.tgz#8f5c2731aa35a30929221bb0640eed65175ec84e" + integrity sha512-BLM56aPo9vLLFVa8+/+pJLnrZ7QGGTVHWsCwieAWT9o9K8UeGaQbzZbGoabWLOo2ksBCztoXdqBZBplqLDDCSg== are-we-there-yet@~1.1.2: version "1.1.5" - resolved "http://registry.npm.taobao.org/are-we-there-yet/download/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" argparse@^1.0.7: version "1.0.10" - resolved "http://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" arr-diff@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/arr-diff/download/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/arr-diff/download/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/arr-flatten/download/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" - resolved "http://registry.npm.taobao.org/arr-union/download/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= array-union@^1.0.1: version "1.0.2" - resolved "http://registry.npm.taobao.org/array-union/download/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" - resolved "http://registry.npm.taobao.org/array-uniq/download/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.2.1: version "0.2.1" - resolved "http://registry.npm.taobao.org/array-unique/download/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" - resolved "http://registry.npm.taobao.org/array-unique/download/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= -arrify@^1.0.0: +arrify@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/arrify/download/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= -asap@^2.0.3, asap@~2.0.3: - version "2.0.6" - resolved "http://registry.npm.taobao.org/asap/download/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" +asn1.js@^4.0.0: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" -asap@~1.0.0: +assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/asap/download/asap-1.0.0.tgz#b2a45da5fdfa20b0496fc3768cc27c12fa916a7d" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assert@^1.1.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + integrity sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE= + dependencies: + util "0.10.3" assign-symbols@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/assign-symbols/download/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= async-each@^1.0.0: version "1.0.1" - resolved "http://registry.npm.taobao.org/async-each/download/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + integrity sha1-GdOGodntxufByF04iu28xW0zYC0= -async@~0.2.6: - version "0.2.10" - resolved "http://registry.npm.taobao.org/async/download/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +async@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob@^2.1.1: version "2.1.2" - resolved "http://registry.npm.taobao.org/atob/download/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +autocomplete.js@0.33.0: + version "0.33.0" + resolved "https://registry.yarnpkg.com/autocomplete.js/-/autocomplete.js-0.33.0.tgz#33d460367e2e7b6c2fe424353d955e022fe4594c" + integrity sha512-J0F7BkPhYwXvfs8Skp6v2e2IHYv0SL8INyHYwb7nUpvKHr96g6zS8RNEFGEfEuO3ND+XUsesEMM59LlwQoLfoA== + dependencies: + immediate "^3.2.3" + +autoprefixer@^6.3.1: + version "6.7.7" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014" + integrity sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ= + dependencies: + browserslist "^1.7.6" + caniuse-db "^1.0.30000634" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^5.2.16" + postcss-value-parser "^3.2.3" + +autoprefixer@^8.2.0: + version "8.6.5" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-8.6.5.tgz#343f3d193ed568b3208e00117a1b96eb691d4ee9" + integrity sha512-PLWJN3Xo/rycNkx+mp8iBDMTm3FeWe4VmYaZDSqL5QQB9sLsQkG5k8n+LNDFnhh9kdq2K+egL/icpctOmDHwig== + dependencies: + browserslist "^3.2.8" + caniuse-lite "^1.0.30000864" + normalize-range "^0.1.2" + num2fraction "^1.2.2" + postcss "^6.0.23" + postcss-value-parser "^3.2.3" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: +babel-code-frame@^6.26.0: version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-code-frame/download/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= dependencies: chalk "^1.1.3" esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^7.2.1: - version "7.2.3" - resolved "http://registry.npm.taobao.org/babel-eslint/download/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" +babel-extract-comments@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/babel-extract-comments/-/babel-extract-comments-1.0.0.tgz#0a2aedf81417ed391b85e18b4614e693a0351a21" + integrity sha512-qWWzi4TlddohA91bFwgt6zO/J0X+io7Qp184Fw0m2JYRSTZnJbFR8+07KmzudHCZgOiKRCrjhylwv9Xd8gfhVQ== dependencies: - babel-code-frame "^6.22.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" - babylon "^6.17.0" + babylon "^6.18.0" -babel-messages@^6.23.0: - version "6.23.0" - resolved "http://registry.npm.taobao.org/babel-messages/download/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" +babel-helper-vue-jsx-merge-props@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" + integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg== + +babel-loader@8.0.0-beta.3: + version "8.0.0-beta.3" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.0-beta.3.tgz#49efeea6e8058d5af860a18a6de88b8c1450645b" + integrity sha512-yvaAx7cBEjh+R2oGL2vIPmveO6daS5TYP2FSPq4b6CUYjU/ilD4HHyfLIa9KUj6OKBcR9fQcl1NvUOTWNaJ6mw== dependencies: - babel-runtime "^6.22.0" + find-cache-dir "^1.0.0" + loader-utils "^1.0.2" + mkdirp "^0.5.1" + util.promisify "^1.0.0" -babel-runtime@^6.22.0, babel-runtime@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" +babel-plugin-dynamic-import-node@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.2.0.tgz#f91631e703e0595e47d4beafbb088576c87fbeee" + integrity sha512-yeDwKaLgGdTpXL7RgGt5r6T4LmnTza/hUn5Ul8uZSGGMtEjYo13Nxai7SQaGCTEzUtg9Zq9qJn0EjEr7SeSlTQ== dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" + babel-plugin-syntax-dynamic-import "^6.18.0" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + integrity sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo= + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + integrity sha1-/WU28rzhODb/o6VFjEkDpZe7O/U= -babel-traverse@^6.23.1: +babel-plugin-transform-object-rest-spread@^6.26.0: version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-traverse/download/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" + integrity sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY= dependencies: - babel-code-frame "^6.26.0" - babel-messages "^6.23.0" + babel-plugin-syntax-object-rest-spread "^6.8.0" babel-runtime "^6.26.0" - babel-types "^6.26.0" - babylon "^6.18.0" - debug "^2.6.8" - globals "^9.18.0" - invariant "^2.2.2" - lodash "^4.17.4" -babel-types@^6.23.0, babel-types@^6.26.0: - version "6.26.0" - resolved "http://registry.npm.taobao.org/babel-types/download/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" +babel-plugin-transform-vue-jsx@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-vue-jsx/-/babel-plugin-transform-vue-jsx-4.0.1.tgz#2c8bddce87a6ef09eaa59869ff1bfbeeafc5f88d" + integrity sha512-wbOz7ITB5cloLSjKUU1hWn8zhR+Dwah/RZiTiJY/CQliCwhowmzu6m7NEF+y5EJX/blDzGjRtZvC10Vdb3Q7vw== dependencies: - babel-runtime "^6.26.0" esutils "^2.0.2" - lodash "^4.17.4" - to-fast-properties "^1.0.3" -babylon@^6.17.0, babylon@^6.18.0: +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babylon@7.0.0-beta.47: + version "7.0.0-beta.47" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.47.tgz#6d1fa44f0abec41ab7c780481e62fd9aafbdea80" + integrity sha512-+rq2cr4GDhtToEzKFD6KZZMDBXhjFAr9JjPw9pAppZACeEWqNM294j+NdBzkSHYXwzzBmVjZ3nEVJlOhbR2gOQ== + +babylon@^6.18.0: version "6.18.0" - resolved "http://registry.npm.taobao.org/babylon/download/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + integrity sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg= balanced-match@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base64-js@^1.0.2: + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== base@^0.11.1: version "0.11.2" - resolved "http://registry.npm.taobao.org/base/download/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -305,34 +1388,63 @@ base@^0.11.1: mixin-deep "^1.2.0" pascalcase "^0.1.1" -basic-auth@~2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/basic-auth/download/basic-auth-2.0.0.tgz#015db3f353e02e56377755f962742e8981e7bbba" +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: - safe-buffer "5.1.1" + tweetnacl "^0.14.3" + +big.js@^3.1.3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" + integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== binary-extensions@^1.0.0: - version "1.11.0" - resolved "http://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + version "1.12.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" + integrity sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg== -bluebird@^3.2.2, bluebird@^3.4.0, bluebird@^3.5.0, bluebird@^3.5.1: - version "3.5.1" - resolved "http://registry.npm.taobao.org/bluebird/download/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" +bluebird@^3.1.1, bluebird@^3.5.1: + version "3.5.3" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" + integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw== + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.8" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== boolbase@~1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/boolbase/download/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + integrity sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw== + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" brace-expansion@^1.1.7: version "1.1.11" - resolved "http://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" braces@^1.8.2: version "1.8.5" - resolved "http://registry.npm.taobao.org/braces/download/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -340,7 +1452,8 @@ braces@^1.8.2: braces@^2.3.0, braces@^2.3.1: version "2.3.2" - resolved "http://registry.npm.taobao.org/braces/download/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -353,17 +1466,158 @@ braces@^2.3.0, braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -browser-fingerprint@0.0.1: - version "0.0.1" - resolved "http://registry.npm.taobao.org/browser-fingerprint/download/browser-fingerprint-0.0.1.tgz#8df3cdca25bf7d5b3542d61545d730053fce604a" +brorand@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= -bytes@3.0.0: +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== + dependencies: + pako "~1.0.5" + +browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: + version "1.7.7" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" + integrity sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk= + dependencies: + caniuse-db "^1.0.30000639" + electron-to-chromium "^1.2.7" + +browserslist@^3.0.0, browserslist@^3.2.8: + version "3.2.8" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" + integrity sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ== + dependencies: + caniuse-lite "^1.0.30000844" + electron-to-chromium "^1.3.47" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +builtin-status-codes@^3.0.0: version "3.0.0" - resolved "http://registry.npm.taobao.org/bytes/download/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= + +cacache@^10.0.4: + version "10.0.4" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-10.0.4.tgz#6452367999eff9d4188aefd9a14e9d7c6a263460" + integrity sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA== + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.1" + mississippi "^2.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^5.2.4" + unique-filename "^1.1.0" + y18n "^4.0.0" + +cacache@^11.0.2: + version "11.3.1" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.1.tgz#d09d25f6c4aca7a6d305d141ae332613aa1d515f" + integrity sha512-2PEw4cRRDu+iQvBTTuttQifacYjLPhET+SYO/gEFMy8uhi+jlJREDAjSF5FWSdV/Aw5h18caHA7vMTw2c+wDzA== + dependencies: + bluebird "^3.5.1" + chownr "^1.0.1" + figgy-pudding "^3.1.0" + glob "^7.1.2" + graceful-fs "^4.1.11" + lru-cache "^4.1.3" + mississippi "^3.0.0" + mkdirp "^0.5.1" + move-concurrently "^1.0.1" + promise-inflight "^1.0.1" + rimraf "^2.6.2" + ssri "^6.0.0" + unique-filename "^1.1.0" + y18n "^4.0.0" cache-base@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/cache-base/download/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -375,41 +1629,104 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -caller-path@^0.1.0: - version "0.1.0" - resolved "http://registry.npm.taobao.org/caller-path/download/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" +cache-content-type@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-content-type/-/cache-content-type-1.0.1.tgz#035cde2b08ee2129f4a8315ea8f00a00dba1453c" + integrity sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA== dependencies: - callsites "^0.2.0" + mime-types "^2.1.18" + ylru "^1.2.0" -callsites@^0.2.0: - version "0.2.0" - resolved "http://registry.npm.taobao.org/callsites/download/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +cache-loader@^1.2.2: + version "1.2.5" + resolved "https://registry.yarnpkg.com/cache-loader/-/cache-loader-1.2.5.tgz#9ab15b0ae5f546f376083a695fc1a75f546cb266" + integrity sha512-enWKEQ4kO3YreDFd7AtVRjtJBmNiqh/X9hVDReu0C4qm8gsGmySkwuWtdc+N5O+vq5FzxL1mIZc30NyXCB7o/Q== + dependencies: + loader-utils "^1.1.0" + mkdirp "^0.5.1" + neo-async "^2.5.0" + schema-utils "^0.4.2" -camel-case@^3.0.0: +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= + dependencies: + callsites "^2.0.0" + +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +camel-case@3.0.x: version "3.0.0" - resolved "http://registry.npm.taobao.org/camel-case/download/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= dependencies: no-case "^2.2.0" upper-case "^1.1.1" -camelcase@^1.0.2: - version "1.2.1" - resolved "http://registry.npm.taobao.org/camelcase/download/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" +camelcase-keys@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" + integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= + dependencies: + camelcase "^4.1.0" + map-obj "^2.0.0" + quick-lru "^1.0.0" -camelcase@^2.0.1: - version "2.1.1" - resolved "http://registry.npm.taobao.org/camelcase/download/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" +camelcase@^4.0.0, camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -center-align@^0.1.1: - version "0.1.3" - resolved "http://registry.npm.taobao.org/center-align/download/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" +caniuse-api@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-1.6.1.tgz#b534e7c734c4f81ec5fbe8aca2ad24354b962c6c" + integrity sha1-tTTnxzTE+B7F++isoq0kNUuWLGw= dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" + browserslist "^1.3.6" + caniuse-db "^1.0.30000529" + lodash.memoize "^4.1.2" + lodash.uniq "^4.5.0" + +caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: + version "1.0.30000921" + resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000921.tgz#2aa78193e23539634abcf0248919d5901506c53b" + integrity sha512-sAvmRuxZ457rlTK+ydUMpmeXjVfkiXQXv0POTdpHEdKrVwEQaeZqJgQA5MH7sKAGTGxzlLcDpfoNkpVXw09X5Q== -chalk@^1.1.1, chalk@^1.1.3: +caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000864: + version "1.0.30000921" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000921.tgz#7a607c1623444b22351d834e093aedda3c42fbe8" + integrity sha512-Bu09ciy0lMWLgpYC77I0YGuI8eFRBPPzaSOYJK1jTI64txCphYCqnWbxJYjHABYVt/TYX/p3jNjLBR87u1Bfpw== + +capture-stack-trace@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" + integrity sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw== + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^1.1.3: version "1.1.3" - resolved "http://registry.npm.taobao.org/chalk/download/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -417,67 +1734,19 @@ chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.1.0, chalk@^2.3.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.2, chalk@^2.4.1: version "2.4.1" - resolved "http://registry.npm.taobao.org/chalk/download/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" -character-parser@1.2.1: - version "1.2.1" - resolved "http://registry.npm.taobao.org/character-parser/download/character-parser-1.2.1.tgz#c0dde4ab182713b919b970959a123ecc1a30fcd6" - -character-parser@^2.1.1: - version "2.2.0" - resolved "http://registry.npm.taobao.org/character-parser/download/character-parser-2.2.0.tgz#c7ce28f36d4bcd9744e5ffc2c5fcde1c73261fc0" - dependencies: - is-regex "^1.0.3" - -chardet@^0.7.0: - version "0.7.0" - resolved "http://registry.npm.taobao.org/chardet/download/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - -cheerio@0.22.0, cheerio@^0.22.0: - version "0.22.0" - resolved "http://registry.npm.taobao.org/cheerio/download/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" - dependencies: - css-select "~1.2.0" - dom-serializer "~0.1.0" - entities "~1.1.1" - htmlparser2 "^3.9.1" - lodash.assignin "^4.0.9" - lodash.bind "^4.1.4" - lodash.defaults "^4.0.1" - lodash.filter "^4.4.0" - lodash.flatten "^4.2.0" - lodash.foreach "^4.3.0" - lodash.map "^4.4.0" - lodash.merge "^4.4.0" - lodash.pick "^4.2.1" - lodash.reduce "^4.4.0" - lodash.reject "^4.4.0" - lodash.some "^4.4.0" - -chokidar@^1.5.2, chokidar@^1.6.0: - version "1.7.0" - resolved "http://registry.npm.taobao.org/chokidar/download/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chokidar@^2.0.0: +chokidar@^2.0.2, chokidar@^2.0.3: version "2.0.4" - resolved "http://registry.npm.taobao.org/chokidar/download/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" + integrity sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ== dependencies: anymatch "^2.0.0" async-each "^1.0.0" @@ -494,177 +1763,396 @@ chokidar@^2.0.0: optionalDependencies: fsevents "^1.2.2" -chownr@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/chownr/download/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" +chownr@^1.0.1, chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +chrome-trace-event@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz#45a91bd2c20c9411f0963b5aaeb9a1b95e09cc48" + integrity sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A== + dependencies: + tslib "^1.9.0" + +ci-info@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" -circular-json@^0.3.1: - version "0.3.3" - resolved "http://registry.npm.taobao.org/circular-json/download/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" +clap@^1.0.9: + version "1.2.3" + resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" + integrity sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA== + dependencies: + chalk "^1.1.3" class-utils@^0.3.5: version "0.3.6" - resolved "http://registry.npm.taobao.org/class-utils/download/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" isobject "^3.0.0" static-extend "^0.1.1" -clean-css@^3.1.9: - version "3.4.28" - resolved "http://registry.npm.taobao.org/clean-css/download/clean-css-3.4.28.tgz#bf1945e82fc808f55695e6ddeaec01400efd03ff" - dependencies: - commander "2.8.x" - source-map "0.4.x" - -clean-css@^4.1.11: +clean-css@4.2.x: version "4.2.1" - resolved "http://registry.npm.taobao.org/clean-css/download/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" + integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== dependencies: source-map "~0.6.0" -cli-cursor@^2.1.0: +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + integrity sha1-T6kXw+WclKAEzWH47lCdplFocUM= + +cli-cursor@^2.0.0: version "2.1.0" - resolved "http://registry.npm.taobao.org/cli-cursor/download/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" -cli-width@^2.0.0: - version "2.2.0" - resolved "http://registry.npm.taobao.org/cli-width/download/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" +clipboard@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d" + integrity sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ== + dependencies: + good-listener "^1.2.2" + select "^1.1.2" + tiny-emitter "^2.0.0" -cliui@^2.1.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/cliui/download/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" +clipboardy@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/clipboardy/-/clipboardy-1.2.3.tgz#0526361bf78724c1f20be248d428e365433c07ef" + integrity sha512-2WNImOvCRe6r63Gk9pShfkwXsVtKCroMAevIbiae021mS850UkWPbevxsBz3tnvjZIEGvlwaqCPsw+4ulzNgJA== dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" + arch "^2.1.0" + execa "^0.8.0" -cliui@^3.0.3: - version "3.2.0" - resolved "http://registry.npm.taobao.org/cliui/download/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +coa@~1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/coa/-/coa-1.0.4.tgz#a9ef153660d6a86a8bdec0289a5c684d217432fd" + integrity sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0= dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" + q "^1.1.2" code-point-at@^1.0.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/code-point-at/download/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= collection-visit@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.9.0: +color-convert@^1.3.0, color-convert@^1.9.0: version "1.9.3" - resolved "http://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-name@1.1.3: version "1.1.3" - resolved "http://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -command-exists@^1.2.0: - version "1.2.7" - resolved "http://registry.npm.taobao.org/command-exists/download/command-exists-1.2.7.tgz#16828f0c3ff2b0c58805861ef211b64fc15692a8" +color-string@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" + integrity sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE= + dependencies: + color-name "^1.0.0" -commander@2.8.x: - version "2.8.1" - resolved "http://registry.npm.taobao.org/commander/download/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" +color@^0.11.0: + version "0.11.4" + resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" + integrity sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q= dependencies: - graceful-readlink ">= 1.0.0" + clone "^1.0.2" + color-convert "^1.3.0" + color-string "^0.3.0" -commander@~2.6.0: - version "2.6.0" - resolved "http://registry.npm.taobao.org/commander/download/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d" +colormin@^1.0.5: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colormin/-/colormin-1.1.2.tgz#ea2f7420a72b96881a38aae59ec124a6f7298133" + integrity sha1-6i90IKcrlogaOKrlnsEkpvcpgTM= + dependencies: + color "^0.11.0" + css-color-names "0.0.4" + has "^1.0.1" + +colors@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + integrity sha1-FopHAXVran9RoSzgyXv6KMCE7WM= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@2.17.x, commander@~2.17.1: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== + +commander@^2.15.1: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +common-tags@^1.4.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" + integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= component-emitter@^1.2.1: version "1.2.1" - resolved "http://registry.npm.taobao.org/component-emitter/download/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= -compressible@~2.0.14: - version "2.0.14" - resolved "http://registry.npm.taobao.org/compressible/download/compressible-2.0.14.tgz#326c5f507fbb055f54116782b969a81b67a29da7" +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.5.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: - mime-db ">= 1.34.0 < 2" + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" -compression@^1.7.3: - version "1.7.3" - resolved "http://registry.npm.taobao.org/compression/download/compression-1.7.3.tgz#27e0e176aaf260f7f2c2813c3e440adb9f1993db" +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + integrity sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw== dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.14" - debug "2.6.9" - on-headers "~1.0.1" - safe-buffer "5.1.2" - vary "~1.1.2" + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" -concat-map@0.0.1: - version "0.0.1" - resolved "http://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" +connect-history-api-fallback@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz#b06873934bc5e344fef611a196a6faae0aee015a" + integrity sha1-sGhzk0vF40T+9hGhlqb6rgruAVo= + +consola@^1.4.3: + version "1.4.5" + resolved "https://registry.yarnpkg.com/consola/-/consola-1.4.5.tgz#09732d07cb50af07332e54e0f42fafb92b962c4a" + integrity sha512-movqq3MbyXbSf7cG/x+EbO3VjKQVZPB/zeB5+lN1TuBYh9BWDemLQca9P+a4xpO4lXva9rz+Bd8XyqlH136Lww== + dependencies: + chalk "^2.3.2" + figures "^2.0.0" + lodash "^4.17.5" + std-env "^1.1.0" -connect@^3.6.6: - version "3.6.6" - resolved "http://registry.npm.taobao.org/connect/download/connect-3.6.6.tgz#09eff6c55af7236e137135a72574858b6786f524" +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= dependencies: - debug "2.6.9" - finalhandler "1.1.0" - parseurl "~1.3.2" - utils-merge "1.0.1" + date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -constantinople@^3.0.1: - version "3.1.2" - resolved "http://registry.npm.taobao.org/constantinople/download/constantinople-3.1.2.tgz#d45ed724f57d3d10500017a7d3a889c1381ae647" +consolidate@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/consolidate/-/consolidate-0.15.1.tgz#21ab043235c71a07d45d9aad98593b0dba56bab7" + integrity sha512-DW46nrsMJgy9kqAbPt5rKaCr7uFtpo4mSUvLHIUbJEjm0vo+aY5QLwBUq3FK4tRnJr/X0Psc0C4jf/h+HtXSMw== dependencies: - "@types/babel-types" "^7.0.0" - "@types/babylon" "^6.16.2" - babel-types "^6.26.0" - babylon "^6.18.0" + bluebird "^3.1.1" -constantinople@~3.0.1: - version "3.0.2" - resolved "http://registry.npm.taobao.org/constantinople/download/constantinople-3.0.2.tgz#4b945d9937907bcd98ee575122c3817516544141" +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= + +content-disposition@~0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" + integrity sha1-DPaLud318r55YcOoUXjLhdunjLQ= + +content-type@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +convert-source-map@^1.1.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== dependencies: - acorn "^2.1.0" + safe-buffer "~5.1.1" + +cookies@~0.7.1: + version "0.7.3" + resolved "https://registry.yarnpkg.com/cookies/-/cookies-0.7.3.tgz#7912ce21fbf2e8c2da70cf1c3f351aecf59dadfa" + integrity sha512-+gixgxYSgQLTaTIilDHAdlNPZDENDQernEMiIcZpYYP14zgHsCt4Ce1FEjFtcp6GefhozebB6orvhAAWx/IS0A== + dependencies: + depd "~1.1.2" + keygrip "~1.0.3" + +copy-concurrently@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== + dependencies: + aproba "^1.1.1" + fs-write-stream-atomic "^1.0.8" + iferr "^0.1.5" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.0" copy-descriptor@^0.1.0: version "0.1.1" - resolved "http://registry.npm.taobao.org/copy-descriptor/download/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js@^1.1.1: - version "1.2.7" - resolved "http://registry.npm.taobao.org/core-js/download/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" +copy-webpack-plugin@^4.5.1: + version "4.6.0" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.6.0.tgz#e7f40dd8a68477d405dd1b7a854aae324b158bae" + integrity sha512-Y+SQCF+0NoWQryez2zXn5J5knmr9z/9qSQt7fbL78u83rxmigOy8X5+BFn8CFSuX+nKT8gpYwJX68ekqtQt6ZA== + dependencies: + cacache "^10.0.4" + find-cache-dir "^1.0.0" + globby "^7.1.1" + is-glob "^4.0.0" + loader-utils "^1.1.0" + minimatch "^3.0.4" + p-limit "^1.0.0" + serialize-javascript "^1.4.0" -core-js@^2.4.0: - version "2.5.7" - resolved "http://registry.npm.taobao.org/core-js/download/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" +core-js@^2.4.0, core-js@^2.5.3: + version "2.6.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4" + integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw== -core-util-is@~1.0.0: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" - resolved "http://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cross-spawn@^4.0.0: - version "4.0.2" - resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" +cosmiconfig@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" + integrity sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ== + dependencies: + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + require-from-string "^2.0.1" + +cosmiconfig@^5.0.2: + version "5.0.7" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.7.tgz#39826b292ee0d78eda137dfa3173bd1c21a43b04" + integrity sha512-PcLqxTKiDmNT6pSpy4N6KtuPwb53W+2tzNvwOZw0WH9N6O0vLIBq0x8aj8Oj75ere4YcGi48bDFCL+3fRJdlNA== + dependencies: + import-fresh "^2.0.0" + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + +create-ecdh@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + integrity sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y= + dependencies: + capture-stack-trace "^1.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" + shebang-command "^1.2.0" which "^1.2.9" cross-spawn@^6.0.5: version "6.0.5" - resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -672,314 +2160,646 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -css-parse@1.0.4: - version "1.0.4" - resolved "http://registry.npm.taobao.org/css-parse/download/css-parse-1.0.4.tgz#38b0503fbf9da9f54e9c1dbda60e145c77117bdd" +crypto-browserify@^3.11.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + randomfill "^1.0.3" + +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + integrity sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4= + +css-color-names@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/css-color-names/-/css-color-names-0.0.4.tgz#808adc2e79cf84738069b646cb20ec27beb629e0" + integrity sha1-gIrcLnnPhHOAabZGyyDsJ762KeA= + +css-loader@^0.28.11: + version "0.28.11" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-0.28.11.tgz#c3f9864a700be2711bb5a2462b2389b1a392dab7" + integrity sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg== + dependencies: + babel-code-frame "^6.26.0" + css-selector-tokenizer "^0.7.0" + cssnano "^3.10.0" + icss-utils "^2.1.0" + loader-utils "^1.0.2" + lodash.camelcase "^4.3.0" + object-assign "^4.1.1" + postcss "^5.0.6" + postcss-modules-extract-imports "^1.2.0" + postcss-modules-local-by-default "^1.2.0" + postcss-modules-scope "^1.1.0" + postcss-modules-values "^1.3.0" + postcss-value-parser "^3.3.0" + source-list-map "^2.0.0" css-parse@1.7.x: version "1.7.0" - resolved "http://registry.npm.taobao.org/css-parse/download/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" + resolved "https://registry.yarnpkg.com/css-parse/-/css-parse-1.7.0.tgz#321f6cf73782a6ff751111390fc05e2c657d8c9b" + integrity sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs= -css-select@~1.2.0: +css-select@^1.1.0: version "1.2.0" - resolved "http://registry.npm.taobao.org/css-select/download/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= dependencies: boolbase "~1.0.0" css-what "2.1" domutils "1.5.1" nth-check "~1.0.1" -css-stringify@1.0.5: - version "1.0.5" - resolved "http://registry.npm.taobao.org/css-stringify/download/css-stringify-1.0.5.tgz#b0d042946db2953bb9d292900a6cb5f6d0122031" +css-selector-tokenizer@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz#a177271a8bca5019172f4f891fc6eed9cbf68d5d" + integrity sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA== + dependencies: + cssesc "^0.1.0" + fastparse "^1.1.1" + regexpu-core "^1.0.0" css-what@2.1: - version "2.1.0" - resolved "http://registry.npm.taobao.org/css-what/download/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" + version "2.1.2" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.2.tgz#c0876d9d0480927d7d4920dcd72af3595649554d" + integrity sha512-wan8dMWQ0GUeF7DGEPVjhHemVW/vy6xUYmFzRY8RYqgA0JtXC9rJmbScBjqSu6dg9q0lwPQy6ZAmJVr3PPTvqQ== + +cssesc@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-0.1.0.tgz#c814903e45623371a0477b40109aaafbeeaddbb4" + integrity sha1-yBSQPkViM3GgR3tAEJqq++6t27Q= -css@~1.0.8: - version "1.0.8" - resolved "http://registry.npm.taobao.org/css/download/css-1.0.8.tgz#9386811ca82bccc9ee7fb5a732b1e2a317c8a3e7" +cssnano@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38" + integrity sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg= + dependencies: + autoprefixer "^6.3.1" + decamelize "^1.1.2" + defined "^1.0.0" + has "^1.0.1" + object-assign "^4.0.1" + postcss "^5.0.14" + postcss-calc "^5.2.0" + postcss-colormin "^2.1.8" + postcss-convert-values "^2.3.4" + postcss-discard-comments "^2.0.4" + postcss-discard-duplicates "^2.0.1" + postcss-discard-empty "^2.0.1" + postcss-discard-overridden "^0.1.1" + postcss-discard-unused "^2.2.1" + postcss-filter-plugins "^2.0.0" + postcss-merge-idents "^2.1.5" + postcss-merge-longhand "^2.0.1" + postcss-merge-rules "^2.0.3" + postcss-minify-font-values "^1.0.2" + postcss-minify-gradients "^1.0.1" + postcss-minify-params "^1.0.4" + postcss-minify-selectors "^2.0.4" + postcss-normalize-charset "^1.1.0" + postcss-normalize-url "^3.0.7" + postcss-ordered-values "^2.1.0" + postcss-reduce-idents "^2.2.2" + postcss-reduce-initial "^1.0.0" + postcss-reduce-transforms "^1.0.3" + postcss-svgo "^2.1.1" + postcss-unique-selectors "^2.0.2" + postcss-value-parser "^3.2.3" + postcss-zindex "^2.0.1" + +csso@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/csso/-/csso-2.3.2.tgz#ddd52c587033f49e94b71fc55569f252e8ff5f85" + integrity sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U= dependencies: - css-parse "1.0.4" - css-stringify "1.0.5" + clap "^1.0.9" + source-map "^0.5.3" -cuid@~1.3.8: - version "1.3.8" - resolved "http://registry.npm.taobao.org/cuid/download/cuid-1.3.8.tgz#4b875e0969bad764f7ec0706cf44f5fb0831f6b7" +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= dependencies: - browser-fingerprint "0.0.1" - core-js "^1.1.1" - node-fingerprint "0.0.2" + array-find-index "^1.0.1" -debug@*, debug@^3.1.0: - version "3.1.0" - resolved "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" +cyclist@~0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= + +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + integrity sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8= dependencies: - ms "2.0.0" + es5-ext "^0.10.9" -debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= + +de-indent@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" + integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= + +debug@*: + version "4.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== + dependencies: + ms "^2.1.1" + +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.1, debug@^2.6.3, debug@^2.6.8: version "2.6.9" - resolved "http://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1: +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +debug@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +decamelize-keys@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= + dependencies: + decamelize "^1.1.0" + map-obj "^1.0.0" + +decamelize@^1.1.0, decamelize@^1.1.2: version "1.2.0" - resolved "http://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decode-uri-component@^0.2.0: version "0.2.0" - resolved "http://registry.npm.taobao.org/decode-uri-component/download/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + integrity sha1-9dJgKStmDghO/0zbyfCK0yR0SLU= deep-extend@^0.6.0: version "0.6.0" - resolved "http://registry.npm.taobao.org/deep-extend/download/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -deep-is@~0.1.3: - version "0.1.3" - resolved "http://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +deepmerge@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-1.5.2.tgz#10499d868844cdad4fee0842df8c7f6f0c95a753" + integrity sha512-95k0GDqvBjZavkuvzx/YqVLv/6YYa17fz6ILMSf7neqQITCPbnfEnQvEgMPNjH4kgobe7+WIL0yJEHku+H3qtQ== + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" - resolved "http://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/define-property/download/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" - resolved "http://registry.npm.taobao.org/define-property/download/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" -del@^2.0.2: - version "2.2.2" - resolved "http://registry.npm.taobao.org/del/download/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= -del@^3.0.0: - version "3.0.0" - resolved "http://registry.npm.taobao.org/del/download/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" - dependencies: - globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegate@^3.1.2: + version "3.2.0" + resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166" + integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw== delegates@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= -depd@~1.1.1, depd@~1.1.2: +depd@^1.1.2, depd@~1.1.2: version "1.1.2" - resolved "http://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" -destroy@~1.0.4: +destroy@^1.0.4: version "1.0.4" - resolved "http://registry.npm.taobao.org/destroy/download/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= detect-libc@^1.0.2: version "1.0.3" - resolved "http://registry.npm.taobao.org/detect-libc/download/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -doctrine@^2.1.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/doctrine/download/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" +diacritics@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/diacritics/-/diacritics-1.3.0.tgz#3efa87323ebb863e6696cebb0082d48ff3d6f7a1" + integrity sha1-PvqHMj67hj5mls67AILUj/PW96E= + +diffie-hellman@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +dir-glob@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== + dependencies: + arrify "^1.0.1" + path-type "^3.0.0" + +docsearch.js@^2.5.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/docsearch.js/-/docsearch.js-2.6.2.tgz#cb36a97aeac8a8d31eed5915cdee808a2248b41c" + integrity sha512-qyQ+raZlHSkfdpFg8wJNhjiz9WsjdQkRGe2LiiKS6vIIsouNNole2Kg/9UvGoUIK9PLLl31uL3I4YDwnrXt5yQ== + dependencies: + algoliasearch "^3.24.5" + autocomplete.js "0.33.0" + hogan.js "^3.0.2" + request "^2.87.0" + stack-utils "^1.0.1" + to-factory "^1.0.0" + zepto "^1.2.0" + +dom-converter@~0.2: + version "0.2.0" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" + integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== dependencies: - esutils "^2.0.2" - -doctypes@^1.1.0: - version "1.1.0" - resolved "http://registry.npm.taobao.org/doctypes/download/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" + utila "~0.4" -dom-serializer@0, dom-serializer@~0.1.0: +dom-serializer@0: version "0.1.0" - resolved "http://registry.npm.taobao.org/dom-serializer/download/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + integrity sha1-BzxpdUbOB4DOI75KKOKT5AvDDII= dependencies: domelementtype "~1.1.1" entities "~1.1.1" -domelementtype@1, domelementtype@^1.3.0: - version "1.3.0" - resolved "http://registry.npm.taobao.org/domelementtype/download/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" +dom-walk@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" + integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= + +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== + +domelementtype@1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== domelementtype@~1.1.1: version "1.1.3" - resolved "http://registry.npm.taobao.org/domelementtype/download/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + integrity sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs= + +domhandler@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.1.0.tgz#d2646f5e57f6c3bab11cf6cb05d3c0acf7412594" + integrity sha1-0mRvXlf2w7qxHPbLBdPArPdBJZQ= + dependencies: + domelementtype "1" -domhandler@^2.3.0: - version "2.4.2" - resolved "http://registry.npm.taobao.org/domhandler/download/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" +domutils@1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" + integrity sha1-vdw94Jm5ou+sxRxiPyj0FuzFdIU= dependencies: domelementtype "1" domutils@1.5.1: version "1.5.1" - resolved "http://registry.npm.taobao.org/domutils/download/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= dependencies: dom-serializer "0" domelementtype "1" -domutils@^1.5.1: - version "1.7.0" - resolved "http://registry.npm.taobao.org/domutils/download/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" +dot-prop@^4.1.0, dot-prop@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== dependencies: - dom-serializer "0" - domelementtype "1" + is-obj "^1.0.0" -ee-first@1.1.1: - version "1.1.1" - resolved "http://registry.npm.taobao.org/ee-first/download/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI= -encodeurl@~1.0.1, encodeurl@~1.0.2: - version "1.0.2" - resolved "http://registry.npm.taobao.org/encodeurl/download/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" +duplexify@^3.4.2, duplexify@^3.6.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.1.tgz#b1a7a29c4abfd639585efaecce80d666b1e34125" + integrity sha512-vM58DwdnKmty+FSPzT14K9JXb90H+j5emaR4KYbr2KTIz00WHGbWOe5ghQTx233ZCLZtrGDALzKwcjEtSt35mA== + dependencies: + end-of-stream "^1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" -entities@^1.1.1, entities@~1.1.1: +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +ee-first@1.1.1: version "1.1.1" - resolved "http://registry.npm.taobao.org/entities/download/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + +electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47: + version "1.3.92" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.92.tgz#9027b5abaea400045edd652c0e4838675c814399" + integrity sha512-En051LMzMl3/asMWGZEtU808HOoVWIpmmZx1Ep8N+TT9e7z/X8RcLeBU2kLSNLGQ+5SuKELzMx+MVuTBXk6Q9w== + +elliptic@^6.0.0: + version "6.4.1" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" + integrity sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ== + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + hmac-drbg "^1.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.0" -escape-html@~1.0.3: - version "1.0.3" - resolved "http://registry.npm.taobao.org/escape-html/download/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "http://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +end-of-stream@^1.0.0, end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" -eslint-config-hexo@^3.0.0: - version "3.0.0" - resolved "http://registry.npm.taobao.org/eslint-config-hexo/download/eslint-config-hexo-3.0.0.tgz#60c6355eea28cc862dbe7000b802eb5d42afee53" +enhanced-resolve@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" + integrity sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng== dependencies: - eslint-plugin-node "^5.2.1" + graceful-fs "^4.1.2" + memory-fs "^0.4.0" + tapable "^1.0.0" + +entities@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== -eslint-plugin-node@^5.2.1: - version "5.2.1" - resolved "http://registry.npm.taobao.org/eslint-plugin-node/download/eslint-plugin-node-5.2.1.tgz#80df3253c4d7901045ec87fa660a284e32bdca29" +envify@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/envify/-/envify-4.1.0.tgz#f39ad3db9d6801b4e6b478b61028d3f0b6819f7e" + integrity sha512-IKRVVoAYr4pIx4yIWNsz9mOsboxlNXiu7TNBnem/K/uTHdkyzXWDzHCK7UTolqBbgaBz0tQHsD3YNls0uIIjiw== dependencies: - ignore "^3.3.6" - minimatch "^3.0.4" - resolve "^1.3.3" - semver "5.3.0" + esprima "^4.0.0" + through "~2.3.4" -eslint-scope@^4.0.0: - version "4.0.0" - resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" +errno@^0.1.3, errno@~0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" + prr "~1.0.1" -eslint-utils@^1.3.1: - version "1.3.1" - resolved "http://registry.npm.taobao.org/eslint-utils/download/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" -eslint-visitor-keys@^1.0.0: +error-inject@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + resolved "https://registry.yarnpkg.com/error-inject/-/error-inject-1.0.0.tgz#e2b3d91b54aed672f309d950d154850fa11d4f37" + integrity sha1-4rPZG1Su1nLzCdlQ0VSFD6EdTzc= -eslint@^5.1.0: - version "5.5.0" - resolved "http://registry.npm.taobao.org/eslint/download/eslint-5.5.0.tgz#8557fcceab5141a8197da9ffd9904f89f64425c6" +es-abstract@^1.5.1: + version "1.12.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.12.0.tgz#9dbbdd27c6856f0001421ca18782d786bf8a6165" + integrity sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA== dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^4.0.0" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" - imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" - js-yaml "^3.12.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.5" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^2.0.0" - require-uncached "^1.0.3" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^4.0.3" - text-table "^0.2.0" + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" -espree@^4.0.0: +es-to-primitive@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.46" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" + integrity sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.1" + next-tick "1" + +es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-promise@^4.1.0: + version "4.2.5" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + integrity sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg== + +es6-symbol@^3.1.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= + dependencies: + d "1" + es5-ext "~0.10.14" + +escape-html@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-scope@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/espree/download/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= esprima@^4.0.0: version "4.0.1" - resolved "http://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - -esquery@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/esquery/download/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - dependencies: - estraverse "^4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esrecurse@^4.1.0: version "4.2.1" - resolved "http://registry.npm.taobao.org/esrecurse/download/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" - resolved "http://registry.npm.taobao.org/estraverse/download/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.2: version "2.0.2" - resolved "http://registry.npm.taobao.org/esutils/download/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= -etag@~1.8.1: - version "1.8.1" - resolved "http://registry.npm.taobao.org/etag/download/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" +events@^1.0.0, events@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= + +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +execa@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" + integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" expand-brackets@^0.1.4: version "0.1.5" - resolved "http://registry.npm.taobao.org/expand-brackets/download/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" - resolved "http://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -991,40 +2811,42 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" - resolved "http://registry.npm.taobao.org/expand-range/download/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" extend-shallow@^2.0.1: version "2.0.1" - resolved "http://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" - resolved "http://registry.npm.taobao.org/extend-shallow/download/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" -external-editor@^3.0.0: - version "3.0.3" - resolved "http://registry.npm.taobao.org/external-editor/download/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== extglob@^0.3.1: version "0.3.2" - resolved "http://registry.npm.taobao.org/extglob/download/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" - resolved "http://registry.npm.taobao.org/extglob/download/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -1035,38 +2857,72 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + fast-deep-equal@^2.0.1: version "2.0.1" - resolved "http://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-glob@^2.0.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.4.tgz#e54f4b66d378040e0e4d6a68ec36bbc5b04363c0" + integrity sha512-FjK2nCGI/McyzgNtTESqaWP3trPvHyRyoyY70hxjc3oKPNmDe8taohLZpoVKoUjW85tbU5txaYUZCNtVzygl1g== + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.1.2" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.3" + micromatch "^3.1.10" fast-json-stable-stringify@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "http://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +fastparse@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" + integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== + +figgy-pudding@^3.1.0, figgy-pudding@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== figures@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/figures/download/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/file-entry-cache/download/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" +file-loader@^1.1.11: + version "1.1.11" + resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-1.1.11.tgz#6fe886449b0f2a936e43cabaac0cdbfb369506f8" + integrity sha512-TGR4HU7HUsGg6GCOPJnFk06RhWgEWFLAGWiT6rcD+GRC2keU3s9RGJ+b3Z6/U73jwwNb2gKLJ7YCrp+jvU4ALg== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + loader-utils "^1.0.2" + schema-utils "^0.4.5" filename-regex@^2.0.0: version "2.0.1" - resolved "http://registry.npm.taobao.org/filename-regex/download/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: version "2.2.4" - resolved "http://registry.npm.taobao.org/fill-range/download/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" @@ -1076,82 +2932,167 @@ fill-range@^2.1.0: fill-range@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/fill-range/download/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range "^2.1.0" -finalhandler@1.1.0: - version "1.1.0" - resolved "http://registry.npm.taobao.org/finalhandler/download/finalhandler-1.1.0.tgz#ce0b6855b45853e791b2fcc680046d88253dd7f5" +find-cache-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" + integrity sha1-kojj6ePMN0hxfTnq3hfPcfww7m8= dependencies: - debug "2.6.9" - encodeurl "~1.0.1" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.2" - statuses "~1.3.1" - unpipe "~1.0.0" + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^2.0.0" -flat-cache@^1.2.1: - version "1.3.0" - resolved "http://registry.npm.taobao.org/flat-cache/download/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" +find-cache-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.0.0.tgz#4c1faed59f45184530fb9d7fa123a4d04a98472d" + integrity sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA== dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" + commondir "^1.0.1" + make-dir "^1.0.0" + pkg-dir "^3.0.0" + +find-up@^2.0.0, find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +flatten@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" + integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= + +flush-write-stream@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" + integrity sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw== + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.4" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" - resolved "http://registry.npm.taobao.org/for-own/download/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + fragment-cache@^0.2.1: version "0.2.1" - resolved "http://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" -fresh@0.5.2: +fresh@~0.5.2: version "0.5.2" - resolved "http://registry.npm.taobao.org/fresh/download/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + +from2@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.0" + +fs-extra@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + integrity sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs-extra@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd" + integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" fs-minipass@^1.2.5: version "1.2.5" - resolved "http://registry.npm.taobao.org/fs-minipass/download/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== dependencies: minipass "^2.2.1" +fs-write-stream-atomic@^1.0.8: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= + dependencies: + graceful-fs "^4.1.2" + iferr "^0.1.5" + imurmurhash "^0.1.4" + readable-stream "1 || 2" + fs.realpath@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.0.0, fsevents@^1.2.2: +fsevents@^1.2.2: version "1.2.4" - resolved "http://registry.npm.taobao.org/fsevents/download/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== dependencies: nan "^2.9.2" node-pre-gyp "^0.10.0" function-bind@^1.1.1: version "1.1.1" - resolved "http://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/functional-red-black-tree/download/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== gauge@~2.7.3: version "2.7.4" - resolved "http://registry.npm.taobao.org/gauge/download/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -1162,33 +3103,65 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== + +get-port@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" + integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" - resolved "http://registry.npm.taobao.org/get-value/download/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" glob-base@^0.3.0: version "0.3.0" - resolved "http://registry.npm.taobao.org/glob-base/download/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" glob-parent@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/glob-parent/download/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.1.0: version "3.1.0" - resolved "http://registry.npm.taobao.org/glob-parent/download/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= + glob@7.0.x: version "7.0.6" - resolved "http://registry.npm.taobao.org/glob/download/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.6.tgz#211bafaf49e525b8cd93260d14ab136152b3f57a" + integrity sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo= dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1197,19 +3170,10 @@ glob@7.0.x: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^6.0.1: - version "6.0.4" - resolved "http://registry.npm.taobao.org/glob/download/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: +glob@^7.0.5, glob@^7.1.2: version "7.1.3" - resolved "http://registry.npm.taobao.org/glob/download/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1218,60 +3182,134 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.7.0: - version "11.7.0" - resolved "http://registry.npm.taobao.org/globals/download/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + integrity sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU= + dependencies: + ini "^1.3.4" + +global@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f" + integrity sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8= + dependencies: + min-document "^2.19.0" + process "~0.5.1" -globals@^9.18.0: - version "9.18.0" - resolved "http://registry.npm.taobao.org/globals/download/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globals@^11.1.0: + version "11.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" + integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== -globby@^5.0.0: - version "5.0.0" - resolved "http://registry.npm.taobao.org/globby/download/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" +globby@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680" + integrity sha1-+yzP+UAfhgCUXfral0QMypcrhoA= dependencies: array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" + dir-glob "^2.0.0" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" -globby@^6.1.0: - version "6.1.0" - resolved "http://registry.npm.taobao.org/globby/download/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" +globby@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" + integrity sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw== dependencies: array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" + dir-glob "^2.0.0" + fast-glob "^2.0.2" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.4: - version "4.1.11" - resolved "http://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +good-listener@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50" + integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA= + dependencies: + delegate "^3.1.2" + +got@^6.7.1: + version "6.7.1" + resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + integrity sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA= + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +gray-matter@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.1.tgz#375263c194f0d9755578c277e41b1c1dfdf22c7d" + integrity sha512-p0MADBEBl1CohV7nRZ8sVinBexEe3CKVhh0A0QIHKpcbRoxB0VgeMpRPjW/HBHIPLAKrpIIIm5mZ6hKu3E+iQg== + dependencies: + js-yaml "^3.11.0" + kind-of "^6.0.2" + section-matter "^1.0.0" + strip-bom-string "^1.0.0" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "http://registry.npm.taobao.org/graceful-readlink/download/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" has-ansi@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/has-ansi/download/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= + has-flag@^3.0.0: version "3.0.0" - resolved "http://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-unicode@^2.0.0: version "2.0.1" - resolved "http://registry.npm.taobao.org/has-unicode/download/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" - resolved "http://registry.npm.taobao.org/has-value/download/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -1279,7 +3317,8 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/has-value/download/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -1287,325 +3326,357 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" - resolved "http://registry.npm.taobao.org/has-values/download/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/has-values/download/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" has@^1.0.1: version "1.0.3" - resolved "http://registry.npm.taobao.org/has/download/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" -hexo-bunyan@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/hexo-bunyan/download/hexo-bunyan-1.0.0.tgz#b2106b26547b232f0195db863cb5d5ff8527fd36" - optionalDependencies: - moment "^2.10.6" - mv "~2" - safe-json-stringify "~1" - -hexo-cli@^1.1.0: - version "1.1.0" - resolved "http://registry.npm.taobao.org/hexo-cli/download/hexo-cli-1.1.0.tgz#496d238d4646dbfd1cf047b6dc5271bfb5cb798f" - dependencies: - abbrev "^1.0.7" - bluebird "^3.4.0" - chalk "^1.1.3" - command-exists "^1.2.0" - hexo-fs "^0.2.0" - hexo-log "^0.2.0" - hexo-util "^0.6.0" - minimist "^1.2.0" - object-assign "^4.1.0" - resolve "^1.5.0" - tildify "^1.2.0" - -hexo-deployer-git@^0.3.1: - version "0.3.1" - resolved "http://registry.npm.taobao.org/hexo-deployer-git/download/hexo-deployer-git-0.3.1.tgz#26b085ecc50e2cc99ecd33d56c254c5544c02d21" - dependencies: - babel-eslint "^7.2.1" - bluebird "^3.5.0" - chalk "^1.1.3" - hexo-fs "^0.2.0" - hexo-util "^0.6.0" - moment "^2.18.0" - swig "^1.4.2" - -hexo-front-matter@^0.2.2: - version "0.2.3" - resolved "http://registry.npm.taobao.org/hexo-front-matter/download/hexo-front-matter-0.2.3.tgz#c7ca8ef420ea36bd85e8408a2e8c9bf49efa605e" - dependencies: - js-yaml "^3.6.1" - -hexo-fs@^0.2.0: - version "0.2.3" - resolved "http://registry.npm.taobao.org/hexo-fs/download/hexo-fs-0.2.3.tgz#c3a81b46e457dfafc56d87c78ef114104f4a3e41" +hash-base@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= dependencies: - bluebird "^3.4.0" - chokidar "^1.5.2" - escape-string-regexp "^1.0.5" - graceful-fs "^4.1.4" + inherits "^2.0.1" + safe-buffer "^5.0.1" -hexo-generator-archive@^0.1.4: - version "0.1.5" - resolved "http://registry.npm.taobao.org/hexo-generator-archive/download/hexo-generator-archive-0.1.5.tgz#a979214cdddee2693e0551809c294bedadbb69b3" - dependencies: - hexo-pagination "0.0.2" - object-assign "^2.0.0" +hash-sum@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/hash-sum/-/hash-sum-1.0.2.tgz#33b40777754c6432573c120cc3808bbd10d47f04" + integrity sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ= -hexo-generator-feed@^1.1.0: - version "1.2.2" - resolved "http://registry.npm.taobao.org/hexo-generator-feed/download/hexo-generator-feed-1.2.2.tgz#9516d1596509b157f4d044fb49b2bae398b82ba7" +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: - nunjucks "^3.0.0" - object-assign "^4.1.1" + inherits "^2.0.3" + minimalistic-assert "^1.0.1" -hexo-generator-sitemap@^1.1.2: +he@1.2.x, he@^1.1.0: version "1.2.0" - resolved "http://registry.npm.taobao.org/hexo-generator-sitemap/download/hexo-generator-sitemap-1.2.0.tgz#3018f8d7d1e2e42b3f71a65a7316ffcf583bc3f3" - dependencies: - minimatch "^3.0.0" - nunjucks "^2.3.0" - object-assign "^4.0.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== -hexo-i18n@^0.2.1: - version "0.2.1" - resolved "http://registry.npm.taobao.org/hexo-i18n/download/hexo-i18n-0.2.1.tgz#84f141432bf09d8b558ed878c728164b6d1cd6de" - dependencies: - sprintf-js "^1.0.2" - -hexo-log@^0.2.0: - version "0.2.0" - resolved "http://registry.npm.taobao.org/hexo-log/download/hexo-log-0.2.0.tgz#d30fd45e1a12a83c88033586640485efc5df5a6f" +hmac-drbg@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: - chalk "^1.1.1" - hexo-bunyan "^1.0.0" + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" -hexo-pagination@0.0.2: - version "0.0.2" - resolved "http://registry.npm.taobao.org/hexo-pagination/download/hexo-pagination-0.0.2.tgz#8cf470c7db0de5b18a3926a76deb194015df7f2b" - dependencies: - utils-merge "^1.0.0" +hoek@4.x.x: + version "4.2.1" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" + integrity sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA== -hexo-renderer-jade@^0.4.1: - version "0.4.1" - resolved "http://registry.npm.taobao.org/hexo-renderer-jade/download/hexo-renderer-jade-0.4.1.tgz#918ef3ac962a4a30121b972aa60801560682bf6a" +hogan.js@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd" + integrity sha1-TNnhq9QpQUbnZ55B14mHMrAse/0= dependencies: - jade "^1.11.0" - pug "^2.0.0-rc.1" + mkdirp "0.3.0" + nopt "1.0.10" -hexo-renderer-marked@^0.3.2: - version "0.3.2" - resolved "http://registry.npm.taobao.org/hexo-renderer-marked/download/hexo-renderer-marked-0.3.2.tgz#d6a37af9ff195e30f9ef6ede1a06ea1fe4322966" - dependencies: - hexo-util "^0.6.2" - marked "^0.3.9" - object-assign "^4.1.1" - strip-indent "^2.0.0" +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== -hexo-renderer-stylus@^0.3.1: - version "0.3.3" - resolved "http://registry.npm.taobao.org/hexo-renderer-stylus/download/hexo-renderer-stylus-0.3.3.tgz#c54ea27e1fd8e3c8a9a7a84cfba8ad354122ca7f" +html-comment-regex@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" + integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== + +html-minifier@^3.2.3: + version "3.5.21" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" + integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== + dependencies: + camel-case "3.0.x" + clean-css "4.2.x" + commander "2.17.x" + he "1.2.x" + param-case "2.1.x" + relateurl "0.2.x" + uglify-js "3.4.x" + +htmlparser2@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" + integrity sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4= dependencies: - nib "^1.1.2" - stylus "^0.54.5" + domelementtype "1" + domhandler "2.1" + domutils "1.1" + readable-stream "1.0" -hexo-server@^0.3.2: - version "0.3.3" - resolved "http://registry.npm.taobao.org/hexo-server/download/hexo-server-0.3.3.tgz#b86712974920bfcc3057debbdb35dd1be6c30080" +http-assert@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/http-assert/-/http-assert-1.4.0.tgz#0e550b4fca6adf121bbeed83248c17e62f593a9a" + integrity sha512-tPVv62a6l3BbQoM/N5qo969l0OFxqpnQzNUPeYfTP6Spo4zkgWeDBD1D5thI7sDLg7jCCihXTLB0X8UtdyAy8A== dependencies: - bluebird "^3.5.1" - chalk "^1.1.3" - compression "^1.7.3" - connect "^3.6.6" - mime "^1.6.0" - morgan "^1.9.0" - object-assign "^4.1.1" - opn "^5.3.0" - serve-static "^1.13.2" - -hexo-util@^0.6.0, hexo-util@^0.6.2, hexo-util@^0.6.3: - version "0.6.3" - resolved "http://registry.npm.taobao.org/hexo-util/download/hexo-util-0.6.3.tgz#16a2ade457bef955af0dfd22a3fe6f0a49a9137c" - dependencies: - bluebird "^3.4.0" - camel-case "^3.0.0" - cross-spawn "^4.0.0" - highlight.js "^9.4.0" - html-entities "^1.2.0" - striptags "^2.1.1" - -hexo@^3.7.1: - version "3.7.1" - resolved "http://registry.npm.taobao.org/hexo/download/hexo-3.7.1.tgz#0381874e67891b521b9e3023ef4db85a62337f96" - dependencies: - abbrev "^1.0.7" - archy "^1.0.0" - bluebird "^3.4.0" - chalk "^2.3.1" - cheerio "0.22.0" - hexo-cli "^1.1.0" - hexo-front-matter "^0.2.2" - hexo-fs "^0.2.0" - hexo-i18n "^0.2.1" - hexo-log "^0.2.0" - hexo-util "^0.6.3" - js-yaml "^3.6.1" - lodash "^4.17.5" - minimatch "^3.0.4" - moment "^2.19.4" - moment-timezone "^0.5.14" - nunjucks "^3.1.2" - pretty-hrtime "^1.0.2" - resolve "^1.5.0" - strip-ansi "^4.0.0" - strip-indent "^2.0.0" - swig-extras "0.0.1" - swig-templates "^2.0.2" - text-table "^0.2.0" - tildify "^1.2.0" - titlecase "^1.1.2" - warehouse "^2.2.0" - -highlight.js@^9.4.0: - version "9.12.0" - resolved "http://registry.npm.taobao.org/highlight.js/download/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" + deep-equal "~1.0.1" + http-errors "~1.7.1" -html-entities@^1.2.0: - version "1.2.1" - resolved "http://registry.npm.taobao.org/html-entities/download/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f" - -htmlparser2@^3.9.1: - version "3.9.2" - resolved "http://registry.npm.taobao.org/htmlparser2/download/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" +http-errors@^1.6.1, http-errors@^1.6.3, http-errors@~1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.1.tgz#6a4ffe5d35188e1c39f872534690585852e1f027" + integrity sha512-jWEUgtZWGSMba9I1N3gc1HmvpBUaNC9vDdA46yScAdp+C5rdEuKWUBLWTQpW9FwSWSbYYs++b6SDCxf9UEJzfw== dependencies: - domelementtype "^1.3.0" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^2.0.2" + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.0" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" http-errors@~1.6.2: version "1.6.3" - resolved "http://registry.npm.taobao.org/http-errors/download/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" + integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= dependencies: depd "~1.1.2" inherits "2.0.3" setprototypeof "1.1.0" statuses ">= 1.4.0 < 2" -iconv-lite@^0.4.24, iconv-lite@^0.4.4: +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= + +iconv-lite@^0.4.4: version "0.4.24" - resolved "http://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" +icss-replace-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded" + integrity sha1-Bupvg2ead0njhs/h/oEq5dsiPe0= + +icss-utils@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-2.1.0.tgz#83f0a0ec378bf3246178b6c2ad9136f135b1c962" + integrity sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI= + dependencies: + postcss "^6.0.1" + +ieee754@^1.1.4: + version "1.1.12" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" + integrity sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA== + +iferr@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= + ignore-walk@^3.0.1: version "3.0.1" - resolved "http://registry.npm.taobao.org/ignore-walk/download/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" -ignore@^3.3.6: +ignore@^3.3.5: version "3.3.10" - resolved "http://registry.npm.taobao.org/ignore/download/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== -ignore@^4.0.6: - version "4.0.6" - resolved "http://registry.npm.taobao.org/ignore/download/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" +immediate@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" + integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= + +import-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" + integrity sha1-qmzzbnInYShcs3HsZRn1PiQ1sKk= + dependencies: + import-from "^2.1.0" + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-from@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-from/-/import-from-2.1.0.tgz#335db7f2a7affd53aaa471d4b8021dee36b7f3b1" + integrity sha1-M1238qev/VOqpHHUuAId7ja387E= + dependencies: + resolve-from "^3.0.0" + +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM= + +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" imurmurhash@^0.1.4: version "0.1.4" - resolved "http://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +indent-string@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= + +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= + +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= inflight@^1.0.4: version "1.0.6" - resolved "http://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@~2.0.3: +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" - resolved "http://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@~1.3.0: - version "1.3.5" - resolved "http://registry.npm.taobao.org/ini/download/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -inquirer@^6.1.0: - version "6.2.0" - resolved "http://registry.npm.taobao.org/inquirer/download/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.0" - figures "^2.0.0" - lodash "^4.17.10" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.1.0" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" +ini@^1.3.4, ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== -invariant@^2.2.2: +invariant@^2.2.0, invariant@^2.2.2: version "2.2.4" - resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" -invert-kv@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/invert-kv/download/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" +is-absolute-url@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" + integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY= is-accessor-descriptor@^0.1.6: version "0.1.6" - resolved "http://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + is-binary-path@^1.0.0: version "1.0.1" - resolved "http://registry.npm.taobao.org/is-binary-path/download/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" is-buffer@^1.1.5: version "1.1.6" - resolved "http://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= + dependencies: + builtin-modules "^1.0.0" + +is-callable@^1.1.3, is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^1.0.10, is-ci@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" + integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== + dependencies: + ci-info "^1.5.0" is-data-descriptor@^0.1.4: version "0.1.4" - resolved "http://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + is-descriptor@^0.1.0: version "0.1.6" - resolved "http://registry.npm.taobao.org/is-descriptor/download/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -1613,370 +3684,820 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" kind-of "^6.0.2" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= + is-dotfile@^1.0.0: version "1.0.3" - resolved "http://registry.npm.taobao.org/is-dotfile/download/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" - resolved "http://registry.npm.taobao.org/is-equal-shallow/download/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" -is-expression@^3.0.0: - version "3.0.0" - resolved "http://registry.npm.taobao.org/is-expression/download/is-expression-3.0.0.tgz#39acaa6be7fd1f3471dc42c7416e61c24317ac9f" - dependencies: - acorn "~4.0.2" - object-assign "^4.0.1" - is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" - resolved "http://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" is-extglob@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/is-extglob/download/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-function@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.7.tgz#d2132e529bb0000a7f80794d4bdf5cd5e5813522" + integrity sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw== is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" - resolved "http://registry.npm.taobao.org/is-glob/download/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" - resolved "http://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/is-glob/download/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + integrity sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A= dependencies: is-extglob "^2.1.1" +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + integrity sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA= + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= + is-number@^2.1.0: version "2.1.0" - resolved "http://registry.npm.taobao.org/is-number/download/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" - resolved "http://registry.npm.taobao.org/is-number/download/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/is-number/download/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/is-path-cwd/download/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: +is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/is-path-in-cwd/download/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" - dependencies: - is-path-inside "^1.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-path-inside@^1.0.0: version "1.0.1" - resolved "http://registry.npm.taobao.org/is-path-inside/download/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= dependencies: path-is-inside "^1.0.1" +is-plain-obj@^1.0.0, is-plain-obj@^1.1, is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= + is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" - resolved "http://registry.npm.taobao.org/is-plain-object/download/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" - resolved "http://registry.npm.taobao.org/is-posix-bracket/download/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/is-primitive/download/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-promise@^2.0.0, is-promise@^2.1.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/is-promise/download/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= -is-promise@~1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/is-promise/download/is-promise-1.0.1.tgz#31573761c057e33c2e91aab9e96da08cefbe76e5" +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + integrity sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ= -is-regex@^1.0.3: +is-regex@^1.0.4: version "1.0.4" - resolved "http://registry.npm.taobao.org/is-regex/download/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" -is-resolvable@^1.1.0: +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= + +is-retry-allowed@^1.0.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/is-resolvable/download/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + integrity sha1-EaBgVotnM5REAz0BJaYaINVk+zQ= + +is-stream@^1.0.0, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-svg@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" + integrity sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk= + dependencies: + html-comment-regex "^1.1.0" + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-windows@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/is-windows/download/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== is-wsl@^1.1.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/is-wsl/download/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= -isarray@1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isarray@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.4.tgz#38e7bcbb0f3ba1b7933c86ba1894ddfc3781bbb7" + integrity sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA== + +isemail@3.x.x: + version "3.2.0" + resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.2.0.tgz#59310a021931a9fb06bbb51e155ce0b3f236832c" + integrity sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg== + dependencies: + punycode "2.x.x" isexe@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" - resolved "http://registry.npm.taobao.org/isobject/download/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" - resolved "http://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -jade@^1.11.0: - version "1.11.0" - resolved "http://registry.npm.taobao.org/jade/download/jade-1.11.0.tgz#9c80e538c12d3fb95c8d9bb9559fa0cc040405fd" - dependencies: - character-parser "1.2.1" - clean-css "^3.1.9" - commander "~2.6.0" - constantinople "~3.0.1" - jstransformer "0.0.2" - mkdirp "~0.5.0" - transformers "2.1.0" - uglify-js "^2.4.19" - void-elements "~2.0.1" - with "~4.0.0" +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -js-stringify@^1.0.1: - version "1.0.2" - resolved "http://registry.npm.taobao.org/js-stringify/download/js-stringify-1.0.2.tgz#1736fddfd9724f28a3682adc6230ae7e4e9679db" +javascript-stringify@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" + integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM= -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" +joi@^11.1.1: + version "11.4.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-11.4.0.tgz#f674897537b625e9ac3d0b7e1604c828ad913ccb" + integrity sha512-O7Uw+w/zEWgbL6OcHbyACKSj0PkQeUgmehdoXVSxt92QFCq4+1390Rwh5moI2K/OgC7D8RHRZqHZxT2husMJHA== + dependencies: + hoek "4.x.x" + isemail "3.x.x" + topo "2.x.x" -js-tokens@^3.0.2: +js-base64@^2.1.9: + version "2.4.9" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.9.tgz#748911fb04f48a60c4771b375cac45a80df11c03" + integrity sha512-xcinL3AuDJk7VSzsHgb9DvvIXayBbadtMZ4HFPx8rUszbW1MuNMlwYVC4zzCZ6e1sqZpnNS5ZFYOhXqA39T7LQ== + +js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" - resolved "http://registry.npm.taobao.org/js-tokens/download/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.12.0, js-yaml@^3.6.1: +js-yaml@^3.11.0, js-yaml@^3.9.0: version "3.12.0" - resolved "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== dependencies: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@~3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + integrity sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A= + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + +json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + json-schema-traverse@^0.4.1: version "0.4.1" - resolved "http://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= -jsonparse@^1.2.0: - version "1.3.1" - resolved "http://registry.npm.taobao.org/jsonparse/download/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -jstransformer@0.0.2: - version "0.0.2" - resolved "http://registry.npm.taobao.org/jstransformer/download/jstransformer-0.0.2.tgz#7aae29a903d196cfa0973d885d3e47947ecd76ab" - dependencies: - is-promise "^2.0.0" - promise "^6.0.1" +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= -jstransformer@1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/jstransformer/download/jstransformer-1.0.0.tgz#ed8bf0921e2f3f1ed4d5c1a44f68709ed24722c3" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: - is-promise "^2.0.0" - promise "^7.0.1" + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +keygrip@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.0.3.tgz#399d709f0aed2bab0a059e0cdd3a5023a053e1dc" + integrity sha512-/PpesirAIfaklxUzp4Yb7xBper9MwP6hNRA6BGGUFCgbJ+BM5CKBtsoxinNXkLHAr+GXS1/lSlF2rP7cv5Fl+g== + +killable@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" + integrity sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg== kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" - resolved "http://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/kind-of/download/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" - resolved "http://registry.npm.taobao.org/kind-of/download/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" - resolved "http://registry.npm.taobao.org/kind-of/download/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== -lazy-cache@^1.0.3: - version "1.0.4" - resolved "http://registry.npm.taobao.org/lazy-cache/download/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +koa-compose@^3.0.0, koa-compose@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-3.2.1.tgz#a85ccb40b7d986d8e5a345b3a1ace8eabcf54de7" + integrity sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec= + dependencies: + any-promise "^1.1.0" + +koa-compose@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/koa-compose/-/koa-compose-4.1.0.tgz#507306b9371901db41121c812e923d0d67d3e877" + integrity sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw== + +koa-connect@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/koa-connect/-/koa-connect-2.0.1.tgz#2acad159c33862de1d73aa4562a48de13f137c0f" + integrity sha512-MNaiK5og8aj4I+tx8l+jSW24QX7aaQyZemV821VPY+AOJ8XUbrrAj9AzrpZKDQp5jTmylAZW2sXhTz2+SRqZog== + +koa-convert@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/koa-convert/-/koa-convert-1.2.0.tgz#da40875df49de0539098d1700b50820cebcd21d0" + integrity sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA= + dependencies: + co "^4.6.0" + koa-compose "^3.0.0" -lcid@^1.0.0: +koa-is-json@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/lcid/download/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + resolved "https://registry.yarnpkg.com/koa-is-json/-/koa-is-json-1.0.0.tgz#273c07edcdcb8df6a2c1ab7d59ee76491451ec14" + integrity sha1-JzwH7c3Ljfaiwat9We52SRRR7BQ= + +koa-mount@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/koa-mount/-/koa-mount-3.0.0.tgz#08cab3b83d31442ed8b7e75c54b1abeb922ec197" + integrity sha1-CMqzuD0xRC7Yt+dcVLGr65IuwZc= dependencies: - invert-kv "^1.0.0" + debug "^2.6.1" + koa-compose "^3.2.1" -levn@^0.3.0, levn@~0.3.0: +koa-range@^0.3.0: version "0.3.0" - resolved "http://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + resolved "https://registry.yarnpkg.com/koa-range/-/koa-range-0.3.0.tgz#3588e3496473a839a1bd264d2a42b1d85bd7feac" + integrity sha1-NYjjSWRzqDmhvSZNKkKx2FvX/qw= dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" + stream-slice "^0.1.2" -lodash.assignin@^4.0.9: - version "4.2.0" - resolved "http://registry.npm.taobao.org/lodash.assignin/download/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2" +koa-send@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-4.1.3.tgz#0822207bbf5253a414c8f1765ebc29fa41353cb6" + integrity sha512-3UetMBdaXSiw24qM2Mx5mKmxLKw5ZTPRjACjfhK6Haca55RKm9hr/uHDrkrxhSl5/S1CKI/RivZVIopiatZuTA== + dependencies: + debug "^2.6.3" + http-errors "^1.6.1" + mz "^2.6.0" + resolve-path "^1.4.0" -lodash.bind@^4.1.4: - version "4.2.1" - resolved "http://registry.npm.taobao.org/lodash.bind/download/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35" +koa-static@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/koa-static/-/koa-static-4.0.3.tgz#5f93ad00fb1905db9ce46667c0e8bb7d22abfcd8" + integrity sha512-JGmxTuPWy4bH7bt6gD/OMWkhprawvRmzJSr8TWKmTL4N7+IMv3s0SedeQi5S4ilxM9Bo6ptkCyXj/7wf+VS5tg== + dependencies: + debug "^3.1.0" + koa-send "^4.1.3" -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "http://registry.npm.taobao.org/lodash.debounce/download/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" +koa-webpack@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/koa-webpack/-/koa-webpack-4.0.0.tgz#1d9b83c109db106d8ef65db376f910a45ba964c7" + integrity sha512-P+j2TzeZAqFwscd/dlLykk/sxwr6wQ5Tp3FYDhqv1+y9aRIffTPnu2zK+1BhfM+Kyh8bepU1jFR420maE+Vajw== + dependencies: + app-root-path "^2.0.1" + merge-options "^1.0.0" + webpack-dev-middleware "^3.0.0" + webpack-hot-client "^3.0.0" + webpack-log "^1.1.1" -lodash.defaults@^4.0.1: - version "4.2.0" - resolved "http://registry.npm.taobao.org/lodash.defaults/download/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" +koa@^2.4.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/koa/-/koa-2.6.2.tgz#57ba4d049b0a99cae0d594e6144e2931949a7ce1" + integrity sha512-KdnBFhTgh9ysMMoYe4J4fLvaKjT7mF3nRYV8MjxLzx6qywFNeptqi4xevyUltg1fZl2CFJ+HeLXuCGx07Yvl/A== + dependencies: + accepts "^1.3.5" + cache-content-type "^1.0.0" + content-disposition "~0.5.2" + content-type "^1.0.4" + cookies "~0.7.1" + debug "~3.1.0" + delegates "^1.0.0" + depd "^1.1.2" + destroy "^1.0.4" + error-inject "^1.0.0" + escape-html "^1.0.3" + fresh "~0.5.2" + http-assert "^1.3.0" + http-errors "^1.6.3" + is-generator-function "^1.0.7" + koa-compose "^4.1.0" + koa-convert "^1.2.0" + koa-is-json "^1.0.0" + on-finished "^2.3.0" + only "~0.0.2" + parseurl "^1.3.2" + statuses "^1.5.0" + type-is "^1.6.16" + vary "^1.1.2" + +last-call-webpack-plugin@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/last-call-webpack-plugin/-/last-call-webpack-plugin-3.0.0.tgz#9742df0e10e3cf46e5c0381c2de90d3a7a2d7555" + integrity sha512-7KI2l2GIZa9p2spzPIVZBYyNKkN+e/SQPpnjlTiPhdbDW3F86tdKKELxKpzJ5sgU19wQWsACULZmpTPYHeWO5w== + dependencies: + lodash "^4.17.5" + webpack-sources "^1.1.0" -lodash.filter@^4.4.0: - version "4.6.0" - resolved "http://registry.npm.taobao.org/lodash.filter/download/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace" +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + integrity sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU= + dependencies: + package-json "^4.0.0" -lodash.flatten@^4.2.0: - version "4.4.0" - resolved "http://registry.npm.taobao.org/lodash.flatten/download/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" +linkify-it@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.1.0.tgz#c4caf38a6cd7ac2212ef3c7d2bde30a91561f9db" + integrity sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg== + dependencies: + uc.micro "^1.0.1" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" -lodash.foreach@^4.3.0: +load-script@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4" + integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ= + +loader-runner@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.1.tgz#026f12fe7c3115992896ac02ba022ba92971b979" + integrity sha512-By6ZFY7ETWOc9RFaAIb23IjJVcM4dvJC/N57nmdz9RSkMXvAXGI7SyVlAw3v8vjtDRlqThgVDVmTnr9fqMlxkw== + +loader-utils@^0.2.16: + version "0.2.17" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" + integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g= + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + object-assign "^4.0.1" + +loader-utils@^1.0.2, loader-utils@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" + integrity sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0= + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= + +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + +lodash.clonedeep@^4.5.0: version "4.5.0" - resolved "http://registry.npm.taobao.org/lodash.foreach/download/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= -lodash.map@^4.4.0: - version "4.6.0" - resolved "http://registry.npm.taobao.org/lodash.map/download/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.merge@^4.4.0: - version "4.6.1" - resolved "http://registry.npm.taobao.org/lodash.merge/download/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.pick@^4.2.1: +lodash.template@^4.4.0: version "4.4.0" - resolved "http://registry.npm.taobao.org/lodash.pick/download/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" -lodash.reduce@^4.4.0: - version "4.6.0" - resolved "http://registry.npm.taobao.org/lodash.reduce/download/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b" +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= + dependencies: + lodash._reinterpolate "~3.0.0" -lodash.reject@^4.4.0: - version "4.6.0" - resolved "http://registry.npm.taobao.org/lodash.reject/download/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415" +lodash.throttle@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" + integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= -lodash.some@^4.4.0: - version "4.6.0" - resolved "http://registry.npm.taobao.org/lodash.some/download/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" +lodash.uniq@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" + integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.5.1: - version "4.17.10" - resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== -longest@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/longest/download/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" +log-symbols@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== + dependencies: + chalk "^2.0.1" + +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= + dependencies: + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" + +loglevelnext@^1.0.1, loglevelnext@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.5.tgz#36fc4f5996d6640f539ff203ba819641680d75a2" + integrity sha512-V/73qkPuJmx4BcBF19xPBr+0ZRVBhc4POxvZTZdMeXpJ4NItXSJ/MSwuFT0kQJlCbXvdlZoQQ/418bS1y9Jh6A== + dependencies: + es6-symbol "^3.1.1" + object.assign "^4.1.0" loose-envify@^1.0.0: version "1.4.0" - resolved "http://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" +loud-rejection@^1.0.0, loud-rejection@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + lower-case@^1.1.1: version "1.1.4" - resolved "http://registry.npm.taobao.org/lower-case/download/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= -lru-cache@^4.0.1: - version "4.1.3" - resolved "http://registry.npm.taobao.org/lru-cache/download/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA== + +lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" -lunr@^2.1.2: - version "2.3.2" - resolved "http://registry.npm.taobao.org/lunr/download/lunr-2.3.2.tgz#7164301092b2d7ab664573156f686df5c25c4185" +make-dir@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" + integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== + dependencies: + pify "^3.0.0" map-cache@^0.2.2: version "0.2.2" - resolved "http://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= + +map-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" + integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= map-visit@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +markdown-it-anchor@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-5.0.2.tgz#cdd917a05b7bf92fb736a6dae3385c6d0d0fa552" + integrity sha512-AFM/woBI8QDJMS/9+MmsBMT5/AR+ImfOsunQZTZhzcTmna3rIzAzbOh5E0l6mlFM/i9666BpUtkqQ9bS7WApCg== + +markdown-it-container@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-2.0.0.tgz#0019b43fd02eefece2f1960a2895fba81a404695" + integrity sha1-ABm0P9Au7+zi8ZYKKJX7qBpARpU= + +markdown-it-emoji@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-1.4.0.tgz#9bee0e9a990a963ba96df6980c4fddb05dfb4dcc" + integrity sha1-m+4OmpkKljupbfaYDE/dsF37Tcw= + +markdown-it-table-of-contents@^0.4.0: + version "0.4.3" + resolved "https://registry.yarnpkg.com/markdown-it-table-of-contents/-/markdown-it-table-of-contents-0.4.3.tgz#6453925a76e49b9b3d9569a0d89f1c2168b46982" + integrity sha512-x/OdaRzLYxAjmB+jIVlXuE3nX7tZTLDQxm58RkgjTLyQ+I290jYQvPS9cJjVN6SM3U6K6CHKYNgUtPNZmLblYQ== + +markdown-it@^8.4.1: + version "8.4.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.2.tgz#386f98998dc15a37722aa7722084f4020bdd9b54" + integrity sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ== + dependencies: + argparse "^1.0.7" + entities "~1.1.1" + linkify-it "^2.0.0" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +math-expression-evaluator@^1.2.14: + version "1.2.17" + resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" + integrity sha1-3oGf282E3M2PrlnGrreWFbnSZqw= + +math-random@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" + integrity sha1-izqsWIuKZuSXXjzepn97sylgH6w= + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +memory-fs@^0.4.0, memory-fs@~0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: - object-visit "^1.0.0" + errno "^0.1.3" + readable-stream "^2.0.1" -markdown@~0.5.0: - version "0.5.0" - resolved "http://registry.npm.taobao.org/markdown/download/markdown-0.5.0.tgz#28205b565a8ae7592de207463d6637dc182722b2" +meow@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" + integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== + dependencies: + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist-options "^3.0.1" + normalize-package-data "^2.3.4" + read-pkg-up "^3.0.0" + redent "^2.0.0" + trim-newlines "^2.0.0" + yargs-parser "^10.0.0" + +merge-options@^1.0.0, merge-options@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-1.0.1.tgz#2a64b24457becd4e4dc608283247e94ce589aa32" + integrity sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg== dependencies: - nopt "~2.1.1" + is-plain-obj "^1.1" -marked@^0.3.9: - version "0.3.19" - resolved "http://registry.npm.taobao.org/marked/download/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" +merge-source-map@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" + integrity sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw== + dependencies: + source-map "^0.6.1" -math-random@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/math-random/download/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== -micromatch@^2.1.5: +micromatch@^2.3.11: version "2.3.11" - resolved "http://registry.npm.taobao.org/micromatch/download/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -1992,9 +4513,10 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.4: +micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" - resolved "http://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -2010,119 +4532,208 @@ micromatch@^3.1.4: snapdragon "^0.8.1" to-regex "^3.0.2" -"mime-db@>= 1.34.0 < 2": - version "1.36.0" - resolved "http://registry.npm.taobao.org/mime-db/download/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" -mime-db@~1.35.0: - version "1.35.0" - resolved "http://registry.npm.taobao.org/mime-db/download/mime-db-1.35.0.tgz#0569d657466491283709663ad379a99b90d9ab47" +mime-db@~1.37.0: + version "1.37.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.37.0.tgz#0b6a0ce6fdbe9576e25f1f2d2fde8830dc0ad0d8" + integrity sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg== -mime-types@~2.1.18: - version "2.1.19" - resolved "http://registry.npm.taobao.org/mime-types/download/mime-types-2.1.19.tgz#71e464537a7ef81c15f2db9d97e913fc0ff606f0" +mime-types@^2.1.12, mime-types@^2.1.18, mime-types@~2.1.18, mime-types@~2.1.19: + version "2.1.21" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.21.tgz#28995aa1ecb770742fe6ae7e58f9181c744b3f96" + integrity sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg== dependencies: - mime-db "~1.35.0" - -mime@1.4.1: - version "1.4.1" - resolved "http://registry.npm.taobao.org/mime/download/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" + mime-db "~1.37.0" -mime@^1.6.0: - version "1.6.0" - resolved "http://registry.npm.taobao.org/mime/download/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mime@^2.0.3, mime@^2.3.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.0.tgz#e051fd881358585f3279df333fe694da0bcffdd6" + integrity sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w== mimic-fn@^1.0.0: version "1.2.0" - resolved "http://registry.npm.taobao.org/mimic-fn/download/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +min-document@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" + integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU= + dependencies: + dom-walk "^0.1.0" + +mini-css-extract-plugin@0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.4.1.tgz#d2bcf77bb2596b8e4bd9257e43d3f9164c2e86cb" + integrity sha512-XWuB3G61Rtasq/gLe7cp5cuozehE6hN+E4sxCamRR/WDiHTg+f7ZIAS024r8UJQffY+e2gGELXQZgQoFDfNDCg== + dependencies: + "@webpack-contrib/schema-utils" "^1.0.0-beta.0" + loader-utils "^1.1.0" + webpack-sources "^1.1.0" + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= + +minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" - resolved "http://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" +minimist-options@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" + integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + minimist@0.0.8: version "0.0.8" - resolved "http://registry.npm.taobao.org/minimist/download/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0: version "1.2.0" - resolved "http://registry.npm.taobao.org/minimist/download/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -minimist@~0.0.1: - version "0.0.10" - resolved "http://registry.npm.taobao.org/minimist/download/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minipass@^2.2.1, minipass@^2.3.3: - version "2.3.4" - resolved "http://registry.npm.taobao.org/minipass/download/minipass-2.3.4.tgz#4768d7605ed6194d6d576169b9e12ef71e9d9957" +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" -minizlib@^1.1.0: - version "1.1.0" - resolved "http://registry.npm.taobao.org/minizlib/download/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== dependencies: minipass "^2.2.1" +mississippi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f" + integrity sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^2.0.1" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + +mississippi@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== + dependencies: + concat-stream "^1.5.0" + duplexify "^3.4.2" + end-of-stream "^1.1.0" + flush-write-stream "^1.0.0" + from2 "^2.1.0" + parallel-transform "^1.1.0" + pump "^3.0.0" + pumpify "^1.3.3" + stream-each "^1.1.0" + through2 "^2.0.0" + mixin-deep@^1.2.0: version "1.3.1" - resolved "http://registry.npm.taobao.org/mixin-deep/download/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" +mkdirp@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" + integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4= + mkdirp@0.5.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" - resolved "http://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" -moment-timezone@^0.5.14: - version "0.5.21" - resolved "http://registry.npm.taobao.org/moment-timezone/download/moment-timezone-0.5.21.tgz#3cba247d84492174dbf71de2a9848fa13207b845" - dependencies: - moment ">= 2.9.0" - -"moment@>= 2.9.0", moment@^2.10.6, moment@^2.18.0, moment@^2.19.4: - version "2.22.2" - resolved "http://registry.npm.taobao.org/moment/download/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" - -morgan@^1.9.0: - version "1.9.0" - resolved "http://registry.npm.taobao.org/morgan/download/morgan-1.9.0.tgz#d01fa6c65859b76fcf31b3cb53a3821a311d8051" +move-concurrently@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= dependencies: - basic-auth "~2.0.0" - debug "2.6.9" - depd "~1.1.1" - on-finished "~2.3.0" - on-headers "~1.0.1" + aproba "^1.1.1" + copy-concurrently "^1.0.0" + fs-write-stream-atomic "^1.0.8" + mkdirp "^0.5.1" + rimraf "^2.5.4" + run-queue "^1.0.3" ms@2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -mute-stream@0.0.7: - version "0.0.7" - resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - -mv@~2: +ms@^2.1.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/mv/download/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mz@^2.6.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== dependencies: - mkdirp "~0.5.1" - ncp "~2.0.0" - rimraf "~2.4.0" + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" nan@^2.9.2: - version "2.11.0" - resolved "http://registry.npm.taobao.org/nan/download/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" + version "2.12.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.0.tgz#9d443fdb5e13a20770cc5e602eee59760a685885" + integrity sha512-zT5nC0JhbljmyEf+Z456nvm7iO7XgRV2hYxoBtPpnyp+0Q4aCoP6uWNn76v/I6k2kCYNLWqWbwBWQcjsNI/bjw== + +nanoassert@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" + integrity sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40= + +nanobus@^4.3.1: + version "4.4.0" + resolved "https://registry.yarnpkg.com/nanobus/-/nanobus-4.4.0.tgz#e5c20846fa17cff01ef5aac301410d1e541f81ed" + integrity sha512-Hv9USGyH8EsPy0o8pPWE7x3YRIfuZDgMBirzjU6XLebhiSK2g53JlfqgolD0c39ne6wXAfaBNcIAvYe22Bav+Q== + dependencies: + nanoassert "^1.1.0" + nanotiming "^7.2.0" + remove-array-items "^1.0.0" nanomatch@^1.2.9: version "1.2.13" - resolved "http://registry.npm.taobao.org/nanomatch/download/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -2136,17 +4747,25 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -natural-compare@^1.4.0: - version "1.4.0" - resolved "http://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +nanoscheduler@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/nanoscheduler/-/nanoscheduler-1.0.3.tgz#6ca027941bf3e04139ea4bab6227ea6ad803692f" + integrity sha512-jBbrF3qdU9321r8n9X7yu18DjP31Do2ItJm3mWrt90wJTrnDO+HXpoV7ftaUglAtjgj9s+OaCxGufbvx6pvbEQ== + dependencies: + nanoassert "^1.1.0" -ncp@~2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/ncp/download/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" +nanotiming@^7.2.0: + version "7.3.1" + resolved "https://registry.yarnpkg.com/nanotiming/-/nanotiming-7.3.1.tgz#dc5cf8d9d8ad401a4394d1a9b7a16714bccfefda" + integrity sha512-l3lC7v/PfOuRWQa8vV29Jo6TG10wHtnthLElFXs4Te4Aas57Fo4n1Q8LH9n+NDh9riOzTVvb2QNBhTS4JUKNjw== + dependencies: + nanoassert "^1.1.0" + nanoscheduler "^1.0.2" needle@^2.2.1: - version "2.2.2" - resolved "http://registry.npm.taobao.org/needle/download/needle-2.2.2.tgz#1120ca4c41f2fcc6976fd28a8968afe239929418" + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== dependencies: debug "^2.1.2" iconv-lite "^0.4.4" @@ -2154,31 +4773,64 @@ needle@^2.2.1: negotiator@0.6.1: version "0.6.1" - resolved "http://registry.npm.taobao.org/negotiator/download/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + integrity sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk= -nib@^1.1.2: - version "1.1.2" - resolved "http://registry.npm.taobao.org/nib/download/nib-1.1.2.tgz#6a69ede4081b95c0def8be024a4c8ae0c2cbb6c7" - dependencies: - stylus "0.54.5" +neo-async@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +next-tick@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= nice-try@^1.0.4: version "1.0.5" - resolved "http://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== no-case@^2.2.0: version "2.3.2" - resolved "http://registry.npm.taobao.org/no-case/download/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== dependencies: lower-case "^1.1.1" -node-fingerprint@0.0.2: - version "0.0.2" - resolved "http://registry.npm.taobao.org/node-fingerprint/download/node-fingerprint-0.0.2.tgz#31cbabeb71a67ae7dd5a7dc042e51c3c75868501" +node-libs-browser@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" + integrity sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg== + dependencies: + assert "^1.1.1" + browserify-zlib "^0.2.0" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^1.0.0" + https-browserify "^1.0.0" + os-browserify "^0.3.0" + path-browserify "0.0.0" + process "^0.11.10" + punycode "^1.2.4" + querystring-es3 "^0.2.0" + readable-stream "^2.3.3" + stream-browserify "^2.0.1" + stream-http "^2.7.2" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.0" + url "^0.11.0" + util "^0.10.3" + vm-browserify "0.0.4" node-pre-gyp@^0.10.0: version "0.10.3" - resolved "http://registry.npm.taobao.org/node-pre-gyp/download/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -2191,416 +4843,968 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" +nopt@1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= + dependencies: + abbrev "1" + nopt@^4.0.1: version "4.0.1" - resolved "http://registry.npm.taobao.org/nopt/download/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" -nopt@~2.1.1: - version "2.1.2" - resolved "http://registry.npm.taobao.org/nopt/download/nopt-2.1.2.tgz#6cccd977b80132a07731d6e8ce58c2c8303cf9af" +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== dependencies: - abbrev "1" + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" -normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: +normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/normalize-path/download/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" +normalize-range@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" + integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= + +normalize-url@^1.4.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" + integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw= + dependencies: + object-assign "^4.0.1" + prepend-http "^1.0.0" + query-string "^4.1.0" + sort-keys "^1.0.0" + npm-bundled@^1.0.1: version "1.0.5" - resolved "http://registry.npm.taobao.org/npm-bundled/download/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.5.tgz#3c1732b7ba936b3a10325aef616467c0ccbcc979" + integrity sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g== npm-packlist@^1.1.6: - version "1.1.11" - resolved "http://registry.npm.taobao.org/npm-packlist/download/npm-packlist-1.1.11.tgz#84e8c683cbe7867d34b1d357d893ce29e28a02de" + version "1.1.12" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.12.tgz#22bde2ebc12e72ca482abd67afc51eb49377243a" + integrity sha512-WJKFOVMeAlsU/pjXuqVdzU0WfgtIBCupkEVwn+1Y0ERAbUfWw8R4GjgVbaKnUjRoD2FoQbHOCbOyT5Mbs9Lw4g== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + npmlog@^4.0.2: version "4.1.2" - resolved "http://registry.npm.taobao.org/npmlog/download/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" gauge "~2.7.3" set-blocking "~2.0.0" +nprogress@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" + integrity sha1-y480xTIT2JVyP8urkH6UIq28r7E= + nth-check@~1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/nth-check/download/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== dependencies: boolbase "~1.0.0" +num2fraction@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" + integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= + number-is-nan@^1.0.0: version "1.0.1" - resolved "http://registry.npm.taobao.org/number-is-nan/download/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -nunjucks@^2.3.0: - version "2.5.2" - resolved "http://registry.npm.taobao.org/nunjucks/download/nunjucks-2.5.2.tgz#ea7d346e785b8a4874666c3cca9e18c577fba22c" - dependencies: - asap "^2.0.3" - chokidar "^1.6.0" - yargs "^3.32.0" - -nunjucks@^3.0.0, nunjucks@^3.1.2: - version "3.1.3" - resolved "http://registry.npm.taobao.org/nunjucks/download/nunjucks-3.1.3.tgz#9a23c844af01c143a0b40f3bdd1212a9d7877260" - dependencies: - a-sync-waterfall "^1.0.0" - asap "^2.0.3" - postinstall-build "^5.0.1" - yargs "^3.32.0" - optionalDependencies: - chokidar "^2.0.0" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^2.0.0: - version "2.1.1" - resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" - resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" - resolved "http://registry.npm.taobao.org/object-copy/download/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@~1.0.0: + version "1.0.12" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" + integrity sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag== + object-visit@^1.0.0: version "1.0.1" - resolved "http://registry.npm.taobao.org/object-visit/download/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + object.omit@^2.0.0: version "2.0.1" - resolved "http://registry.npm.taobao.org/object.omit/download/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" object.pick@^1.3.0: version "1.3.0" - resolved "http://registry.npm.taobao.org/object.pick/download/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" -on-finished@~2.3.0: +on-finished@^2.3.0: version "2.3.0" - resolved "http://registry.npm.taobao.org/on-finished/download/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= dependencies: ee-first "1.1.1" -on-headers@~1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/on-headers/download/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" - -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" - resolved "http://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -onetime@^2.0.0: - version "2.0.1" - resolved "http://registry.npm.taobao.org/onetime/download/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +only@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/only/-/only-0.0.2.tgz#2afde84d03e50b9a8edc444e30610a70295edfb4" + integrity sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q= + +opn@^5.1.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/opn/-/opn-5.4.0.tgz#cb545e7aab78562beb11aa3bfabc7042e1761035" + integrity sha512-YF9MNdVy/0qvJvDtunAOzFw9iasOQHpVthTCvGzxt61Il64AYSGdK+rYwld7NAfk9qJ7dt+hymBNSc9LNYS+Sw== + dependencies: + is-wsl "^1.1.0" + +optimize-css-assets-webpack-plugin@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-4.0.3.tgz#4f714e276b279700892c4a6202b7e22812d6f683" + integrity sha512-iOfMsuGMPbM/bZZ731gwtAXfXjIkR97BXqUXsPGIzBaQzpvqajsoIFlR+z+Q7FLcq2TmV4JFGo80d98ttfRzhA== + dependencies: + cssnano "^3.10.0" + last-call-webpack-plugin "^3.0.0" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-limit@^1.0.0, p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + integrity sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A== + dependencies: + p-try "^2.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= + +p-try@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ== + +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + integrity sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0= + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + +pako@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.7.tgz#2473439021b57f1516c82f58be7275ad8ef1bb27" + integrity sha512-3HNK5tW4x8o5mO8RuHZp3Ydw9icZXx0RANAOMzlMzx7LVXhMJ4mo3MOBpzyd7r/+RUu8BmndP47LXT+vzjtWcQ== + +parallel-transform@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= + dependencies: + cyclist "~0.2.2" + inherits "^2.0.3" + readable-stream "^2.1.5" + +param-case@2.1.x: + version "2.1.1" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= + dependencies: + no-case "^2.2.0" + +parse-asn1@^5.0.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" + integrity sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw== + dependencies: + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parseurl@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" + integrity sha1-/CidTtiZMRlGDBViUyYs3I3mW/M= + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@1.0.1, path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +pbkdf2@^3.0.3: + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= + dependencies: + find-up "^2.1.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +portfinder@^1.0.13: + version "1.0.20" + resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.20.tgz#bea68632e54b2e13ab7b0c4775e9b41bf270e44a" + integrity sha512-Yxe4mTyDzTd59PZJY4ojZR8F+E5e97iq2ZOHPz3HDgSvYC5siNad2tLooQ5y5QHyQhc3xVqvyk/eNA3wuoa7Sw== + dependencies: + async "^1.5.2" + debug "^2.2.0" + mkdirp "0.5.x" + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +postcss-calc@^5.2.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" + integrity sha1-d7rnypKK2FcW4v2kLyYb98HWW14= + dependencies: + postcss "^5.0.2" + postcss-message-helpers "^2.0.0" + reduce-css-calc "^1.2.6" + +postcss-colormin@^2.1.8: + version "2.2.2" + resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-2.2.2.tgz#6631417d5f0e909a3d7ec26b24c8a8d1e4f96e4b" + integrity sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks= + dependencies: + colormin "^1.0.5" + postcss "^5.0.13" + postcss-value-parser "^3.2.3" + +postcss-convert-values@^2.3.4: + version "2.6.1" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz#bbd8593c5c1fd2e3d1c322bb925dcae8dae4d62d" + integrity sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0= + dependencies: + postcss "^5.0.11" + postcss-value-parser "^3.1.2" + +postcss-discard-comments@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d" + integrity sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0= + dependencies: + postcss "^5.0.14" + +postcss-discard-duplicates@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz#b9abf27b88ac188158a5eb12abcae20263b91932" + integrity sha1-uavye4isGIFYpesSq8riAmO5GTI= + dependencies: + postcss "^5.0.4" + +postcss-discard-empty@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz#d2b4bd9d5ced5ebd8dcade7640c7d7cd7f4f92b5" + integrity sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU= + dependencies: + postcss "^5.0.14" + +postcss-discard-overridden@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz#8b1eaf554f686fb288cd874c55667b0aa3668d58" + integrity sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg= + dependencies: + postcss "^5.0.16" + +postcss-discard-unused@^2.2.1: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz#bce30b2cc591ffc634322b5fb3464b6d934f4433" + integrity sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM= + dependencies: + postcss "^5.0.14" + uniqs "^2.0.0" + +postcss-filter-plugins@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz#82245fdf82337041645e477114d8e593aa18b8ec" + integrity sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ== + dependencies: + postcss "^5.0.4" + +postcss-load-config@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-2.0.0.tgz#f1312ddbf5912cd747177083c5ef7a19d62ee484" + integrity sha512-V5JBLzw406BB8UIfsAWSK2KSwIJ5yoEIVFb4gVkXci0QdKgA24jLmHZ/ghe/GgX0lJ0/D1uUK1ejhzEY94MChQ== + dependencies: + cosmiconfig "^4.0.0" + import-cwd "^2.0.0" + +postcss-loader@^2.1.5: + version "2.1.6" + resolved "https://registry.yarnpkg.com/postcss-loader/-/postcss-loader-2.1.6.tgz#1d7dd7b17c6ba234b9bed5af13e0bea40a42d740" + integrity sha512-hgiWSc13xVQAq25cVw80CH0l49ZKlAnU1hKPOdRrNj89bokRr/bZF2nT+hebPPF9c9xs8c3gw3Fr2nxtmXYnNg== + dependencies: + loader-utils "^1.1.0" + postcss "^6.0.0" + postcss-load-config "^2.0.0" + schema-utils "^0.4.0" + +postcss-merge-idents@^2.1.5: + version "2.1.7" + resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270" + integrity sha1-TFUwMTwI4dWzu/PSu8dH4njuonA= + dependencies: + has "^1.0.1" + postcss "^5.0.10" + postcss-value-parser "^3.1.1" + +postcss-merge-longhand@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz#23d90cd127b0a77994915332739034a1a4f3d658" + integrity sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg= + dependencies: + postcss "^5.0.4" + +postcss-merge-rules@^2.0.3: + version "2.1.2" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz#d1df5dfaa7b1acc3be553f0e9e10e87c61b5f721" + integrity sha1-0d9d+qexrMO+VT8OnhDofGG19yE= + dependencies: + browserslist "^1.5.2" + caniuse-api "^1.5.2" + postcss "^5.0.4" + postcss-selector-parser "^2.2.2" + vendors "^1.0.0" + +postcss-message-helpers@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e" + integrity sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4= + +postcss-minify-font-values@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz#4b58edb56641eba7c8474ab3526cafd7bbdecb69" + integrity sha1-S1jttWZB66fIR0qzUmyv17vey2k= + dependencies: + object-assign "^4.0.1" + postcss "^5.0.4" + postcss-value-parser "^3.0.2" + +postcss-minify-gradients@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz#5dbda11373703f83cfb4a3ea3881d8d75ff5e6e1" + integrity sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE= dependencies: - mimic-fn "^1.0.0" + postcss "^5.0.12" + postcss-value-parser "^3.3.0" -opn@^5.3.0: - version "5.3.0" - resolved "http://registry.npm.taobao.org/opn/download/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" +postcss-minify-params@^1.0.4: + version "1.2.2" + resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz#ad2ce071373b943b3d930a3fa59a358c28d6f1f3" + integrity sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM= dependencies: - is-wsl "^1.1.0" + alphanum-sort "^1.0.1" + postcss "^5.0.2" + postcss-value-parser "^3.0.2" + uniqs "^2.0.0" -optimist@~0.3.5: - version "0.3.7" - resolved "http://registry.npm.taobao.org/optimist/download/optimist-0.3.7.tgz#c90941ad59e4273328923074d2cf2e7cbc6ec0d9" +postcss-minify-selectors@^2.0.4: + version "2.1.1" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz#b2c6a98c0072cf91b932d1a496508114311735bf" + integrity sha1-ssapjAByz5G5MtGkllCBFDEXNb8= dependencies: - wordwrap "~0.0.2" + alphanum-sort "^1.0.2" + has "^1.0.1" + postcss "^5.0.14" + postcss-selector-parser "^2.0.0" -optimist@~0.6: - version "0.6.1" - resolved "http://registry.npm.taobao.org/optimist/download/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" +postcss-modules-extract-imports@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz#dc87e34148ec7eab5f791f7cd5849833375b741a" + integrity sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw== dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" + postcss "^6.0.1" -optionator@^0.8.2: - version "0.8.2" - resolved "http://registry.npm.taobao.org/optionator/download/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" +postcss-modules-local-by-default@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz#f7d80c398c5a393fa7964466bd19500a7d61c069" + integrity sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk= dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" + css-selector-tokenizer "^0.7.0" + postcss "^6.0.1" -os-homedir@^1.0.0: - version "1.0.2" - resolved "http://registry.npm.taobao.org/os-homedir/download/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +postcss-modules-scope@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz#d6ea64994c79f97b62a72b426fbe6056a194bb90" + integrity sha1-1upkmUx5+XtipytCb75gVqGUu5A= + dependencies: + css-selector-tokenizer "^0.7.0" + postcss "^6.0.1" -os-locale@^1.4.0: - version "1.4.0" - resolved "http://registry.npm.taobao.org/os-locale/download/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" +postcss-modules-values@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz#ecffa9d7e192518389f42ad0e83f72aec456ea20" + integrity sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA= dependencies: - lcid "^1.0.0" + icss-replace-symbols "^1.1.0" + postcss "^6.0.1" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: - version "1.0.2" - resolved "http://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +postcss-normalize-charset@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz#ef9ee71212d7fe759c78ed162f61ed62b5cb93f1" + integrity sha1-757nEhLX/nWceO0WL2HtYrXLk/E= + dependencies: + postcss "^5.0.5" -osenv@^0.1.4: - version "0.1.5" - resolved "http://registry.npm.taobao.org/osenv/download/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" +postcss-normalize-url@^3.0.7: + version "3.0.8" + resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz#108f74b3f2fcdaf891a2ffa3ea4592279fc78222" + integrity sha1-EI90s/L82viRov+j6kWSJ5/HgiI= dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" + is-absolute-url "^2.0.0" + normalize-url "^1.4.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" -p-map@^1.1.1: - version "1.2.0" - resolved "http://registry.npm.taobao.org/p-map/download/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" +postcss-ordered-values@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz#eec6c2a67b6c412a8db2042e77fe8da43f95c11d" + integrity sha1-7sbCpntsQSqNsgQud/6NpD+VwR0= + dependencies: + postcss "^5.0.4" + postcss-value-parser "^3.0.1" -parse-glob@^3.0.4: - version "3.0.4" - resolved "http://registry.npm.taobao.org/parse-glob/download/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" +postcss-reduce-idents@^2.2.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz#c2c6d20cc958284f6abfbe63f7609bf409059ad3" + integrity sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM= dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" + postcss "^5.0.4" + postcss-value-parser "^3.0.2" -parseurl@~1.3.2: - version "1.3.2" - resolved "http://registry.npm.taobao.org/parseurl/download/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" +postcss-reduce-initial@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz#68f80695f045d08263a879ad240df8dd64f644ea" + integrity sha1-aPgGlfBF0IJjqHmtJA343WT2ROo= + dependencies: + postcss "^5.0.4" -pascalcase@^0.1.1: - version "0.1.1" - resolved "http://registry.npm.taobao.org/pascalcase/download/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" +postcss-reduce-transforms@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz#ff76f4d8212437b31c298a42d2e1444025771ae1" + integrity sha1-/3b02CEkN7McKYpC0uFEQCV3GuE= + dependencies: + has "^1.0.1" + postcss "^5.0.8" + postcss-value-parser "^3.0.1" -path-dirname@^1.0.0: - version "1.0.2" - resolved "http://registry.npm.taobao.org/path-dirname/download/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" +postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz#f9437788606c3c9acee16ffe8d8b16297f27bb90" + integrity sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A= + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "http://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +postcss-selector-parser@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" + integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= + dependencies: + dot-prop "^4.1.1" + indexes-of "^1.0.1" + uniq "^1.0.1" -path-is-inside@^1.0.1, path-is-inside@^1.0.2: - version "1.0.2" - resolved "http://registry.npm.taobao.org/path-is-inside/download/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +postcss-svgo@^2.1.1: + version "2.1.6" + resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-2.1.6.tgz#b6df18aa613b666e133f08adb5219c2684ac108d" + integrity sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0= + dependencies: + is-svg "^2.0.0" + postcss "^5.0.14" + postcss-value-parser "^3.2.3" + svgo "^0.7.0" -path-key@^2.0.1: - version "2.0.1" - resolved "http://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" +postcss-unique-selectors@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" + integrity sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0= + dependencies: + alphanum-sort "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" -path-parse@^1.0.5: - version "1.0.6" - resolved "http://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" +postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" + integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== -pify@^2.0.0: - version "2.3.0" - resolved "http://registry.npm.taobao.org/pify/download/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +postcss-zindex@^2.0.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" + integrity sha1-0hCd3AVbka9n/EyzsCWUZjnSryI= + dependencies: + has "^1.0.1" + postcss "^5.0.4" + uniqs "^2.0.0" -pify@^3.0.0: - version "3.0.0" - resolved "http://registry.npm.taobao.org/pify/download/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" +postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.6, postcss@^5.0.8, postcss@^5.2.16: + version "5.2.18" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5" + integrity sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg== + dependencies: + chalk "^1.1.3" + js-base64 "^2.1.9" + source-map "^0.5.6" + supports-color "^3.2.3" -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "http://registry.npm.taobao.org/pinkie-promise/download/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" +postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.20, postcss@^6.0.23: + version "6.0.23" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" + integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag== dependencies: - pinkie "^2.0.0" + chalk "^2.4.1" + source-map "^0.6.1" + supports-color "^5.4.0" -pinkie@^2.0.0: - version "2.0.4" - resolved "http://registry.npm.taobao.org/pinkie/download/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +prepend-http@^1.0.0, prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= -pluralize@^7.0.0: - version "7.0.0" - resolved "http://registry.npm.taobao.org/pluralize/download/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "http://registry.npm.taobao.org/posix-character-classes/download/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" +prettier@1.13.7: + version "1.13.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.7.tgz#850f3b8af784a49a6ea2d2eaa7ed1428a34b7281" + integrity sha512-KIU72UmYPGk4MujZGYMFwinB7lOf2LsDNGSOC8ufevsrPLISrZbNJlWstRi3m0AMuszbH+EFSQ/r6w56RSPK6w== -postinstall-build@^5.0.1: - version "5.0.2" - resolved "http://registry.npm.taobao.org/postinstall-build/download/postinstall-build-5.0.2.tgz#e5863f5afe05cfd398e230682ed17a3d7d48fa91" +pretty-bytes@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9" + integrity sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk= -prelude-ls@~1.1.2: - version "1.1.2" - resolved "http://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +pretty-error@^2.0.2: + version "2.1.1" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3" + integrity sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM= + dependencies: + renderkid "^2.0.1" + utila "~0.4" -preserve@^0.2.0: - version "0.2.0" - resolved "http://registry.npm.taobao.org/preserve/download/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +pretty-time@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e" + integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA== -pretty-hrtime@^1.0.2: - version "1.0.3" - resolved "http://registry.npm.taobao.org/pretty-hrtime/download/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" +prismjs@^1.13.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.15.0.tgz#8801d332e472091ba8def94976c8877ad60398d9" + integrity sha512-Lf2JrFYx8FanHrjoV5oL8YHCclLQgbJcVZR+gikGGMqz6ub5QVWDTM6YIwm3BuPxM/LOV+rKns3LssXNLIf+DA== + optionalDependencies: + clipboard "^2.0.0" + +private@^0.1.6: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== process-nextick-args@~2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== -progress@^2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/progress/download/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= -promise@^6.0.1: - version "6.1.0" - resolved "http://registry.npm.taobao.org/promise/download/promise-6.1.0.tgz#2ce729f6b94b45c26891ad0602c5c90e04c6eef6" - dependencies: - asap "~1.0.0" +process@~0.5.1: + version "0.5.2" + resolved "https://registry.yarnpkg.com/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf" + integrity sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8= -promise@^7.0.1: - version "7.3.1" - resolved "http://registry.npm.taobao.org/promise/download/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" - dependencies: - asap "~2.0.3" +promise-inflight@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -promise@~2.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/promise/download/promise-2.0.0.tgz#46648aa9d605af5d2e70c3024bf59436da02b80e" - dependencies: - is-promise "~1" +prr@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/pseudomap/download/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -pug-attrs@^2.0.3: - version "2.0.3" - resolved "http://registry.npm.taobao.org/pug-attrs/download/pug-attrs-2.0.3.tgz#a3095f970e64151f7bdad957eef55fb5d7905d15" - dependencies: - constantinople "^3.0.1" - js-stringify "^1.0.1" - pug-runtime "^2.0.4" +psl@^1.1.24: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== -pug-code-gen@^2.0.1: - version "2.0.1" - resolved "http://registry.npm.taobao.org/pug-code-gen/download/pug-code-gen-2.0.1.tgz#0951ec83225d74d8cfc476a7f99a259b5f7d050c" - dependencies: - constantinople "^3.0.1" - doctypes "^1.1.0" - js-stringify "^1.0.1" - pug-attrs "^2.0.3" - pug-error "^1.3.2" - pug-runtime "^2.0.4" - void-elements "^2.0.1" - with "^5.0.0" - -pug-error@^1.3.2: - version "1.3.2" - resolved "http://registry.npm.taobao.org/pug-error/download/pug-error-1.3.2.tgz#53ae7d9d29bb03cf564493a026109f54c47f5f26" +public-encrypt@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" -pug-filters@^3.1.0: - version "3.1.0" - resolved "http://registry.npm.taobao.org/pug-filters/download/pug-filters-3.1.0.tgz#27165555bc04c236e4aa2b0366246dfa021b626e" +pump@^2.0.0, pump@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== dependencies: - clean-css "^4.1.11" - constantinople "^3.0.1" - jstransformer "1.0.0" - pug-error "^1.3.2" - pug-walk "^1.1.7" - resolve "^1.1.6" - uglify-js "^2.6.1" + end-of-stream "^1.1.0" + once "^1.3.1" -pug-lexer@^4.0.0: - version "4.0.0" - resolved "http://registry.npm.taobao.org/pug-lexer/download/pug-lexer-4.0.0.tgz#210c18457ef2e1760242740c5e647bd794cec278" +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== dependencies: - character-parser "^2.1.1" - is-expression "^3.0.0" - pug-error "^1.3.2" + end-of-stream "^1.1.0" + once "^1.3.1" -pug-linker@^3.0.5: - version "3.0.5" - resolved "http://registry.npm.taobao.org/pug-linker/download/pug-linker-3.0.5.tgz#9e9a7ae4005682d027deeb96b000f88eeb83a02f" +pumpify@^1.3.3: + version "1.5.1" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== dependencies: - pug-error "^1.3.2" - pug-walk "^1.1.7" + duplexify "^3.6.0" + inherits "^2.0.3" + pump "^2.0.0" -pug-load@^2.0.11: - version "2.0.11" - resolved "http://registry.npm.taobao.org/pug-load/download/pug-load-2.0.11.tgz#e648e57ed113fe2c1f45d57858ea2bad6bc01527" - dependencies: - object-assign "^4.1.0" - pug-walk "^1.1.7" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= -pug-parser@^5.0.0: - version "5.0.0" - resolved "http://registry.npm.taobao.org/pug-parser/download/pug-parser-5.0.0.tgz#e394ad9b3fca93123940aff885c06e44ab7e68e4" - dependencies: - pug-error "^1.3.2" - token-stream "0.0.1" +punycode@2.x.x, punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pug-runtime@^2.0.4: - version "2.0.4" - resolved "http://registry.npm.taobao.org/pug-runtime/download/pug-runtime-2.0.4.tgz#e178e1bda68ab2e8c0acfc9bced2c54fd88ceb58" +punycode@^1.2.4, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -pug-strip-comments@^1.0.3: - version "1.0.3" - resolved "http://registry.npm.taobao.org/pug-strip-comments/download/pug-strip-comments-1.0.3.tgz#f1559592206edc6f85310dacf4afb48a025af59f" +q@^1.1.2: + version "1.5.1" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +query-string@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" + integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s= dependencies: - pug-error "^1.3.2" + object-assign "^4.1.0" + strict-uri-encode "^1.0.0" -pug-walk@^1.1.7: - version "1.1.7" - resolved "http://registry.npm.taobao.org/pug-walk/download/pug-walk-1.1.7.tgz#c00d5c5128bac5806bec15d2b7e7cdabe42531f3" +querystring-es3@^0.2.0, querystring-es3@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= -pug@^2.0.0-rc.1: - version "2.0.3" - resolved "http://registry.npm.taobao.org/pug/download/pug-2.0.3.tgz#71cba82537c95a5eab7ed04696e4221f53aa878e" - dependencies: - pug-code-gen "^2.0.1" - pug-filters "^3.1.0" - pug-lexer "^4.0.0" - pug-linker "^3.0.5" - pug-load "^2.0.11" - pug-parser "^5.0.0" - pug-runtime "^2.0.4" - pug-strip-comments "^1.0.3" - -punycode@^2.1.0: - version "2.1.1" - resolved "http://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= + +quick-lru@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" + integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= randomatic@^3.0.0: - version "3.1.0" - resolved "http://registry.npm.taobao.org/randomatic/download/randomatic-3.1.0.tgz#36f2ca708e9e567f5ed2ec01949026d50aa10116" + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== dependencies: is-number "^4.0.0" kind-of "^6.0.0" math-random "^1.0.1" -range-parser@~1.2.0: +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + integrity sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A== + dependencies: + safe-buffer "^5.1.0" + +randomfill@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" + +range-parser@^1.0.3: version "1.2.0" - resolved "http://registry.npm.taobao.org/range-parser/download/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + integrity sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4= -rc@^1.2.7: +rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: version "1.2.8" - resolved "http://registry.npm.taobao.org/rc/download/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" minimist "^1.2.0" strip-json-comments "~2.0.1" -readable-stream@^2.0.2, readable-stream@^2.0.6: +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" - resolved "http://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -2610,186 +5814,377 @@ readable-stream@^2.0.2, readable-stream@^2.0.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@1.0: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readdirp@^2.0.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/readdirp/download/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== dependencies: - graceful-fs "^4.1.2" - minimatch "^3.0.2" + graceful-fs "^4.1.11" + micromatch "^3.1.10" readable-stream "^2.0.2" - set-immediate-shim "^1.0.1" -regenerator-runtime@^0.11.0: +redent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" + integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= + dependencies: + indent-string "^3.0.0" + strip-indent "^2.0.0" + +reduce-css-calc@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" + integrity sha1-dHyRTgSWFKTJz7umKYca0dKSdxY= + dependencies: + balanced-match "^0.4.2" + math-expression-evaluator "^1.2.14" + reduce-function-call "^1.0.1" + +reduce-function-call@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.2.tgz#5a200bf92e0e37751752fe45b0ab330fd4b6be99" + integrity sha1-WiAL+S4ON3UXUv5FsKszD9S2vpk= + dependencies: + balanced-match "^0.4.2" + +reduce@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/reduce/-/reduce-1.0.1.tgz#14fa2e5ff1fc560703a020cbb5fbaab691565804" + integrity sha1-FPouX/H8VgcDoCDLtfuqtpFWWAQ= + dependencies: + object-keys "~1.0.0" + +regenerate-unicode-properties@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" + integrity sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw== + dependencies: + regenerate "^1.4.0" + +regenerate@^1.2.1, regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + +regenerator-runtime@^0.11.0, regenerator-runtime@^0.11.1: version "0.11.1" - resolved "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.12.3: + version "0.12.4" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.12.4.tgz#aa9b6c59f4b97be080e972506c560b3bccbfcff0" + integrity sha512-p2I0fY+TbSLD2/VFTFb/ypEHxs3e3AjU0DzttdPqk2bSmDhfSh5E54b86Yc6XhUa5KykK1tgbvZ4Nr82oCJWkQ== + dependencies: + private "^0.1.6" regex-cache@^0.4.2: version "0.4.4" - resolved "http://registry.npm.taobao.org/regex-cache/download/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/regex-not/download/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^2.0.0: - version "2.0.0" - resolved "http://registry.npm.taobao.org/regexpp/download/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" +regexpu-core@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b" + integrity sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs= + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regexpu-core@^4.1.3, regexpu-core@^4.1.4: + version "4.4.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.4.0.tgz#8d43e0d1266883969720345e70c275ee0aec0d32" + integrity sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^7.0.0" + regjsgen "^0.5.0" + regjsparser "^0.6.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.0.2" + +register-service-worker@^1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/register-service-worker/-/register-service-worker-1.5.2.tgz#a4631896c38d6ec5597358f44988cc46a911912d" + integrity sha512-XNqSZHJsFGnvEGkg/2IrCp6G8Ya3qLj4mq0bSHil/dfdO82LOxGnMnJjAD9MYCvf/8cDCO8pL+1i65yzmP7rPQ== + +registry-auth-token@^3.0.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + integrity sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ== + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + integrity sha1-PU74cPc93h138M+aOBQyRE4XSUI= + dependencies: + rc "^1.0.1" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + integrity sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc= + +regjsgen@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + integrity sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw= + dependencies: + jsesc "~0.5.0" + +regjsparser@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== + dependencies: + jsesc "~0.5.0" + +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= + +remove-array-items@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/remove-array-items/-/remove-array-items-1.1.1.tgz#fd745ff73d0822e561ea910bf1b401fc7843e693" + integrity sha512-MXW/jtHyl5F1PZI7NbpS8SOtympdLuF20aoWJT5lELR1p/HJDd5nqW8Eu9uLh/hCRY3FgvrIT5AwDCgBODklcA== remove-trailing-separator@^1.0.1: version "1.1.0" - resolved "http://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +renderkid@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.2.tgz#12d310f255360c07ad8fde253f6c9e9de372d2aa" + integrity sha512-FsygIxevi1jSiPY9h7vZmBFUbAOcbYm9UwyiLNdVsLRs/5We9Ob5NMPbGYUTWiLq5L+ezlVdE0A8bbME5CWTpg== + dependencies: + css-select "^1.1.0" + dom-converter "~0.2" + htmlparser2 "~3.3.0" + strip-ansi "^3.0.0" + utila "^0.4.0" repeat-element@^1.1.2: version "1.1.3" - resolved "http://registry.npm.taobao.org/repeat-element/download/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" - resolved "http://registry.npm.taobao.org/repeat-string/download/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" -require-uncached@^1.0.3: - version "1.0.3" - resolved "http://registry.npm.taobao.org/require-uncached/download/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" +require-from-string@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" + resolve-from "^3.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "http://registry.npm.taobao.org/resolve-from/download/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-path@^1.3.3, resolve-path@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve-path/-/resolve-path-1.4.0.tgz#c4bda9f5efb2fce65247873ab36bb4d834fe16f7" + integrity sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc= + dependencies: + http-errors "~1.6.2" + path-is-absolute "1.0.1" resolve-url@^0.2.1: version "0.2.1" - resolved "http://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.1.6, resolve@^1.3.3, resolve@^1.5.0: +resolve@^1.2.0, resolve@^1.3.2, resolve@^1.6.0: version "1.8.1" - resolved "http://registry.npm.taobao.org/resolve/download/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" restore-cursor@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/restore-cursor/download/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" ret@~0.1.10: version "0.1.15" - resolved "http://registry.npm.taobao.org/ret/download/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -right-align@^0.1.1: - version "0.1.3" - resolved "http://registry.npm.taobao.org/right-align/download/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" - resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== dependencies: glob "^7.0.5" -rimraf@~2.4.0: - version "2.4.5" - resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da" - dependencies: - glob "^6.0.1" - -run-async@^2.2.0: - version "2.3.0" - resolved "http://registry.npm.taobao.org/run-async/download/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: - is-promise "^2.1.0" + hash-base "^3.0.0" + inherits "^2.0.1" -rxjs@^6.1.0: - version "6.3.1" - resolved "http://registry.npm.taobao.org/rxjs/download/rxjs-6.3.1.tgz#878a1a8c64b8a5da11dcf74b5033fe944cdafb84" +run-queue@^1.0.0, run-queue@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.1: - version "5.1.1" - resolved "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + aproba "^1.1.1" -safe-buffer@5.1.2, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" - resolved "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - -safe-json-stringify@~1: - version "1.2.0" - resolved "http://registry.npm.taobao.org/safe-json-stringify/download/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-regex@^1.1.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/safe-regex/download/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3": +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" - resolved "http://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sax@0.5.x: version "0.5.8" - resolved "http://registry.npm.taobao.org/sax/download/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" + resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" + integrity sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE= -sax@^1.2.4: +sax@^1.2.4, sax@~1.2.1: version "1.2.4" - resolved "http://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -semver@5.3.0: - version "5.3.0" - resolved "http://registry.npm.taobao.org/semver/download/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" +schema-utils@^0.4.0, schema-utils@^0.4.2, schema-utils@^0.4.4, schema-utils@^0.4.5: + version "0.4.7" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187" + integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ== + dependencies: + ajv "^6.1.0" + ajv-keywords "^3.1.0" -semver@^5.3.0, semver@^5.5.0, semver@^5.5.1: - version "5.5.1" - resolved "http://registry.npm.taobao.org/semver/download/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" +schema-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770" + integrity sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g== + dependencies: + ajv "^6.1.0" + ajv-errors "^1.0.0" + ajv-keywords "^3.1.0" -send@0.16.2: - version "0.16.2" - resolved "http://registry.npm.taobao.org/send/download/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" +section-matter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167" + integrity sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA== dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" + extend-shallow "^2.0.1" + kind-of "^6.0.0" -serve-static@^1.13.2: - version "1.13.2" - resolved "http://registry.npm.taobao.org/serve-static/download/serve-static-1.13.2.tgz#095e8472fd5b46237db50ce486a43f4b86c6cec1" +select@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d" + integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0= + +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + integrity sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY= dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.2" - send "0.16.2" + semver "^5.0.3" + +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +serialize-javascript@^1.3.0, serialize-javascript@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" + integrity sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ== set-blocking@~2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -set-immediate-shim@^1.0.1: - version "1.0.1" - resolved "http://registry.npm.taobao.org/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= set-value@^0.4.3: version "0.4.3" - resolved "http://registry.npm.taobao.org/set-value/download/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -2798,40 +6193,65 @@ set-value@^0.4.3: set-value@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/set-value/download/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" is-plain-object "^2.0.3" split-string "^3.0.1" +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + setprototypeof@1.1.0: version "1.1.0" - resolved "http://registry.npm.taobao.org/setprototypeof/download/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" + integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" shebang-command@^1.2.0: version "1.2.0" - resolved "http://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" - resolved "http://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slice-ansi@1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/slice-ansi/download/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== dependencies: is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/snapdragon-node/download/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -2839,13 +6259,15 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" - resolved "http://registry.npm.taobao.org/snapdragon-util/download/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" - resolved "http://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -2856,9 +6278,22 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" +sort-keys@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= + dependencies: + is-plain-obj "^1.0.0" + +source-list-map@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== + source-map-resolve@^0.5.0: version "0.5.2" - resolved "http://registry.npm.taobao.org/source-map-resolve/download/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -2866,117 +6301,280 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" +source-map-support@~0.5.6: + version "0.5.9" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + integrity sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" - resolved "http://registry.npm.taobao.org/source-map-url/download/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - -source-map@0.1.34: - version "0.1.34" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.1.34.tgz#a7cfe89aec7b1682c3b198d0acfb47d7d090566b" - dependencies: - amdefine ">=0.0.4" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.1.x, source-map@~0.1.7: +source-map@0.1.x: version "0.1.43" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + integrity sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y= dependencies: amdefine ">=0.0.4" -source-map@0.4.x: - version "0.4.4" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" +source-map@0.5.6: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + integrity sha1-dc449SvwczxafwwRjYEzSiu19BI= + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: - amdefine ">=0.0.4" + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" -source-map@^0.5.6, source-map@~0.5.1: - version "0.5.7" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== -source-map@~0.6.0: - version "0.6.1" - resolved "http://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz#a59efc09784c2a5bada13cfeaf5c75dd214044d2" + integrity sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" - resolved "http://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" -sprintf-js@^1.0.2: - version "1.1.1" - resolved "http://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.1.1.tgz#36be78320afe5801f6cea3ee78b6e5aab940ea0c" - sprintf-js@~1.0.2: version "1.0.3" - resolved "http://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +sshpk@^1.7.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.15.2.tgz#c946d6bd9b1a39d0e8635763f5242d6ed6dcb629" + integrity sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +ssri@^5.2.4: + version "5.3.0" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-5.3.0.tgz#ba3872c9c6d33a0704a7d71ff045e5ec48999d06" + integrity sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ== + dependencies: + safe-buffer "^5.1.1" + +ssri@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + dependencies: + figgy-pudding "^3.5.1" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== static-extend@^0.1.1: version "0.1.2" - resolved "http://registry.npm.taobao.org/static-extend/download/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" -"statuses@>= 1.4.0 < 2": +"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@^1.5.0: version "1.5.0" - resolved "http://registry.npm.taobao.org/statuses/download/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= -statuses@~1.3.1: +std-env@^1.1.0, std-env@^1.3.1: version "1.3.1" - resolved "http://registry.npm.taobao.org/statuses/download/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-1.3.1.tgz#4e1758412439e9ece1d437b1b098551911aa44ee" + integrity sha512-KI2F2pPJpd3lHjng+QLezu0eq+QDtXcv1um016mhOPAJFHKL+09ykK5PUBWta2pZDC8BVV0VPya08A15bUXSLQ== + dependencies: + is-ci "^1.1.0" -statuses@~1.4.0: - version "1.4.0" - resolved "http://registry.npm.taobao.org/statuses/download/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" +stream-browserify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + integrity sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds= + dependencies: + inherits "~2.0.1" + readable-stream "^2.0.2" + +stream-each@^1.1.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== + dependencies: + end-of-stream "^1.1.0" + stream-shift "^1.0.0" + +stream-http@^2.7.2: + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.1" + readable-stream "^2.3.6" + to-arraybuffer "^1.0.0" + xtend "^4.0.0" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= + +stream-slice@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/stream-slice/-/stream-slice-0.1.2.tgz#2dc4f4e1b936fb13f3eb39a2def1932798d07a4b" + integrity sha1-LcT04bk2+xPz6zmi3vGTJ5jQeks= + +strict-uri-encode@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" + integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= string-width@^1.0.1: version "1.0.2" - resolved "http://registry.npm.taobao.org/string-width/download/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" - resolved "http://registry.npm.taobao.org/string-width/download/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string_decoder@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= + string_decoder@~1.1.1: version "1.1.1" - resolved "http://registry.npm.taobao.org/string_decoder/download/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: safe-buffer "~5.1.0" +stringify-object@^3.2.2: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" - resolved "http://registry.npm.taobao.org/strip-ansi/download/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" - resolved "http://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" +strip-bom-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" + integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-comments@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-1.0.2.tgz#82b9c45e7f05873bee53f37168af930aa368679d" + integrity sha512-kL97alc47hoyIQSV165tTt9rG5dn4w1dNnBhOQ3bOU1Nc1hel09jnXANaHJ7vzHLd4Ju8kseDGzlev96pghLFw== + dependencies: + babel-extract-comments "^1.0.0" + babel-plugin-transform-object-rest-spread "^6.26.0" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + strip-indent@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/strip-indent/download/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@~2.0.1: version "2.0.1" - resolved "http://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -striptags@^2.1.1: - version "2.2.1" - resolved "http://registry.npm.taobao.org/striptags/download/striptags-2.2.1.tgz#4c450b708d41b8bf39cf24c49ff234fc6aabfd32" +stylus-loader@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/stylus-loader/-/stylus-loader-3.0.2.tgz#27a706420b05a38e038e7cacb153578d450513c6" + integrity sha512-+VomPdZ6a0razP+zinir61yZgpw2NfljeSsdUF5kJuEzlo3khXhY19Fn6l8QQz1GRJGtMCo8nG5C04ePyV7SUA== + dependencies: + loader-utils "^1.0.2" + lodash.clonedeep "^4.5.0" + when "~3.6.x" -stylus@0.54.5, stylus@^0.54.5: +stylus@^0.54.5: version "0.54.5" - resolved "http://registry.npm.taobao.org/stylus/download/stylus-0.54.5.tgz#42b9560931ca7090ce8515a798ba9e6aa3d6dc79" + resolved "https://registry.yarnpkg.com/stylus/-/stylus-0.54.5.tgz#42b9560931ca7090ce8515a798ba9e6aa3d6dc79" + integrity sha1-QrlWCTHKcJDOhRWnmLqeaqPW3Hk= dependencies: css-parse "1.7.x" debug "*" @@ -2987,37 +6585,40 @@ stylus@0.54.5, stylus@^0.54.5: supports-color@^2.0.0: version "2.0.0" - resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -supports-color@^5.3.0: - version "5.5.0" - resolved "http://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - dependencies: - has-flag "^3.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -swig-extras@0.0.1: - version "0.0.1" - resolved "http://registry.npm.taobao.org/swig-extras/download/swig-extras-0.0.1.tgz#b503fede372ab9c24c6ac68caf656bcef1872328" +supports-color@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= dependencies: - markdown "~0.5.0" + has-flag "^1.0.0" -swig-templates@^2.0.2: - version "2.0.3" - resolved "http://registry.npm.taobao.org/swig-templates/download/swig-templates-2.0.3.tgz#6b4c43b462175df2a8da857a2043379ec6ea6fd0" +supports-color@^5.3.0, supports-color@^5.4.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: - optimist "~0.6" - uglify-js "2.6.0" + has-flag "^3.0.0" -swig@^1.4.2: - version "1.4.2" - resolved "http://registry.npm.taobao.org/swig/download/swig-1.4.2.tgz#4085ca0453369104b5d483e2841b39b7ae1aaba5" +svgo@^0.7.0: + version "0.7.2" + resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" + integrity sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U= dependencies: - optimist "~0.6" - uglify-js "~2.4" + coa "~1.0.1" + colors "~1.1.2" + csso "~2.3.1" + js-yaml "~3.7.0" + mkdirp "~0.5.1" + sax "~1.2.1" + whet.extend "~0.9.9" table@^4.0.3: version "4.0.3" - resolved "http://registry.npm.taobao.org/table/download/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" + integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== dependencies: ajv "^6.0.1" ajv-keywords "^3.0.0" @@ -3026,298 +6627,974 @@ table@^4.0.3: slice-ansi "1.0.0" string-width "^2.1.1" +tapable@^1.0.0, tapable@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.1.tgz#4d297923c5a72a42360de2ab52dadfaaec00018e" + integrity sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA== + tar@^4: - version "4.4.6" - resolved "http://registry.npm.taobao.org/tar/download/tar-4.4.6.tgz#63110f09c00b4e60ac8bcfe1bf3c8660235fbc9b" + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== dependencies: - chownr "^1.0.1" + chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.3" - minizlib "^1.1.0" + minipass "^2.3.4" + minizlib "^1.1.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" yallist "^3.0.2" +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + integrity sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk= + dependencies: + execa "^0.7.0" + +terser-webpack-plugin@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-1.1.0.tgz#cf7c25a1eee25bf121f4a587bb9e004e3f80e528" + integrity sha512-61lV0DSxMAZ8AyZG7/A4a3UPlrbOBo8NIQ4tJzLPAdGOQ+yoNC7l5ijEow27lBAL2humer01KLS6bGIMYQxKoA== + dependencies: + cacache "^11.0.2" + find-cache-dir "^2.0.0" + schema-utils "^1.0.0" + serialize-javascript "^1.4.0" + source-map "^0.6.1" + terser "^3.8.1" + webpack-sources "^1.1.0" + worker-farm "^1.5.2" + +terser@^3.8.1: + version "3.11.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-3.11.0.tgz#60782893e1f4d6788acc696351f40636d0e37af0" + integrity sha512-5iLMdhEPIq3zFWskpmbzmKwMQixKmTYwY3Ox9pjtSklBLnHiuQ0GKJLhL1HSYtyffHM3/lDIFBnb82m9D7ewwQ== + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + source-map-support "~0.5.6" + text-table@^0.2.0: version "0.2.0" - resolved "http://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -"through@>=2.2.7 <3", through@^2.3.6: - version "2.3.8" - resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" -tildify@^1.2.0: - version "1.2.0" - resolved "http://registry.npm.taobao.org/tildify/download/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" +"thenify@>= 3.1.0 < 4": + version "3.3.0" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" + integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= dependencies: - os-homedir "^1.0.0" + any-promise "^1.0.0" -titlecase@^1.1.2: - version "1.1.2" - resolved "http://registry.npm.taobao.org/titlecase/download/titlecase-1.1.2.tgz#78113d1108086b8326331a3247dea8f5a49ea853" +through2@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== + dependencies: + readable-stream "~2.3.6" + xtend "~4.0.1" + +through@~2.3.4: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +time-fix-plugin@^2.0.0: + version "2.0.5" + resolved "https://registry.yarnpkg.com/time-fix-plugin/-/time-fix-plugin-2.0.5.tgz#41c76e734217cc91a08ea525fdde56de119fb683" + integrity sha512-veHRiEsQ50KSrfdhkZiFvZIjRoyfyfxpgskD+P7uVQAcNe6rIMLZ8vhjFRE2XrPqQdy+4CF+jXsWAlgVy9Bfcg== -tmp@^0.0.33: - version "0.0.33" - resolved "http://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + integrity sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8= + +timers-browserify@^2.0.4: + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== dependencies: - os-tmpdir "~1.0.2" + setimmediate "^1.0.4" -to-fast-properties@^1.0.3: - version "1.0.3" - resolved "http://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +tiny-emitter@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.0.2.tgz#82d27468aca5ade8e5fd1e6d22b57dd43ebdfb7c" + integrity sha512-2NM0auVBGft5tee/OxP4PI3d8WItkDM+fPnaRAVo6xTDI2knbz9eC5ArWGqtGlYqiH3RU5yMpdyTTO7MguC4ow== + +to-arraybuffer@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= + +to-factory@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/to-factory/-/to-factory-1.0.0.tgz#8738af8bd97120ad1d4047972ada5563bf9479b1" + integrity sha1-hzivi9lxIK0dQEeXKtpVY7+UebE= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" - resolved "http://registry.npm.taobao.org/to-object-path/download/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" - resolved "http://registry.npm.taobao.org/to-regex-range/download/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" - resolved "http://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" regex-not "^1.0.2" safe-regex "^1.1.0" -token-stream@0.0.1: - version "0.0.1" - resolved "http://registry.npm.taobao.org/token-stream/download/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a" +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== -transformers@2.1.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/transformers/download/transformers-2.1.0.tgz#5d23cb35561dd85dc67fb8482309b47d53cce9a7" +toml@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.3.tgz#8d683d729577cb286231dfc7a8affe58d31728fb" + integrity sha512-O7L5hhSQHxuufWUdcTRPfuTh3phKfAZ/dqfxZFoxPCj2RYmpaSGLEIs016FCXItQwNr08yefUB5TSjzRYnajTA== + +topo@2.x.x: + version "2.0.2" + resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182" + integrity sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI= + dependencies: + hoek "4.x.x" + +toposort@^1.0.0: + version "1.0.7" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029" + integrity sha1-LmhELZ9k7HILjMieZEOsbKqVACk= + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: - css "~1.0.8" - promise "~2.0" - uglify-js "~2.2.5" + psl "^1.1.24" + punycode "^1.4.1" + +trim-newlines@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" + integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= tslib@^1.9.0: version "1.9.3" - resolved "http://registry.npm.taobao.org/tslib/download/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== -type-check@~0.3.2: - version "0.3.2" - resolved "http://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= -uglify-js@2.6.0: - version "2.6.0" - resolved "http://registry.npm.taobao.org/uglify-js/download/uglify-js-2.6.0.tgz#25eaa1cc3550e39410ceefafd1cfbb6b6d15f001" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" + safe-buffer "^5.0.1" -uglify-js@^2.4.19, uglify-js@^2.6.1: - version "2.8.29" - resolved "http://registry.npm.taobao.org/uglify-js/download/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-is@^1.6.16: + version "1.6.16" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" + integrity sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q== dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" + media-typer "0.3.0" + mime-types "~2.1.18" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376" + integrity sha512-JoLI4g5zv5qNyT09f4YAvEZIIV1oOjqnewYg5D38dkQljIzpPT296dbIGvKro3digYI1bkb7W6EP1y4uDlmzLg== -uglify-js@~2.2.5: - version "2.2.5" - resolved "http://registry.npm.taobao.org/uglify-js/download/uglify-js-2.2.5.tgz#a6e02a70d839792b9780488b7b8b184c095c99c7" +uglify-js@3.4.x: + version "3.4.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.9.tgz#af02f180c1207d76432e473ed24a28f4a782bae3" + integrity sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q== dependencies: - optimist "~0.3.5" - source-map "~0.1.7" + commander "~2.17.1" + source-map "~0.6.1" -uglify-js@~2.4: - version "2.4.24" - resolved "http://registry.npm.taobao.org/uglify-js/download/uglify-js-2.4.24.tgz#fad5755c1e1577658bb06ff9ab6e548c95bebd6e" +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== dependencies: - async "~0.2.6" - source-map "0.1.34" - uglify-to-browserify "~1.0.0" - yargs "~3.5.4" + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" -uglify-to-browserify@~1.0.0: +unicode-match-property-value-ecmascript@^1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/uglify-to-browserify/download/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" + integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + integrity sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg== union-value@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/union-value/download/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" set-value "^0.4.3" -unpipe@~1.0.0: +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= + +uniqs@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/uniqs/-/uniqs-2.0.0.tgz#ffede4b36b25290696e6e165d4a59edb998e6b02" + integrity sha1-/+3ks2slKQaW5uFl1KWe25mOawI= + +unique-filename@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== + dependencies: + unique-slug "^2.0.0" + +unique-slug@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + integrity sha512-n9cU6+gITaVu7VGj1Z8feKMmfAjEAQGhwD9fE3zvpRRa0wEIx8ODYkVGfSc94M2OX00tUFV8wH3zYbm1I8mxFg== + dependencies: + imurmurhash "^0.1.4" + +unique-string@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/unpipe/download/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + integrity sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo= + dependencies: + crypto-random-string "^1.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unset-value@^1.0.0: version "1.0.0" - resolved "http://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + integrity sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c= + upath@^1.0.5: version "1.1.0" - resolved "http://registry.npm.taobao.org/upath/download/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" + integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== + +update-notifier@^2.3.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + integrity sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw== + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" upper-case@^1.1.1: version "1.1.3" - resolved "http://registry.npm.taobao.org/upper-case/download/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= uri-js@^4.2.2: version "4.2.2" - resolved "http://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" - resolved "http://registry.npm.taobao.org/urix/download/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +url-join@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-3.0.0.tgz#26e8113ace195ea30d0fc38186e45400f9cea672" + integrity sha1-JugROs4ZXqMND8OBhuRUAPnOpnI= + +url-loader@^1.0.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-1.1.2.tgz#b971d191b83af693c5e3fea4064be9e1f2d7f8d8" + integrity sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg== + dependencies: + loader-utils "^1.1.0" + mime "^2.0.3" + schema-utils "^1.0.0" + +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + integrity sha1-evjzA2Rem9eaJy56FKxovAYJ2nM= + dependencies: + prepend-http "^1.0.1" + +url@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= + dependencies: + punycode "1.3.2" + querystring "0.2.0" use@^3.1.0: version "3.1.1" - resolved "http://registry.npm.taobao.org/use/download/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== util-deprecate@~1.0.1: version "1.0.2" - resolved "http://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -utils-merge@1.0.1, utils-merge@^1.0.0: - version "1.0.1" - resolved "http://registry.npm.taobao.org/utils-merge/download/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" +util.promisify@1.0.0, util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= + dependencies: + inherits "2.0.1" + +util@^0.10.3: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + +utila@^0.4.0, utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= + +uuid@^3.1.0, uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +v8-compile-cache@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.2.tgz#a428b28bb26790734c4fc8bc9fa106fccebf6a6c" + integrity sha512-1wFuMUIM16MDJRCrpbpuEPTUGmM5QMUg0cr3KFwra2XgOgFcPGDQHDh3CszSCD2Zewc/dh/pamNEW8CbfDebUw== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" -vary@~1.1.2: +vary@^1.1.2: version "1.1.2" - resolved "http://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -void-elements@^2.0.1, void-elements@~2.0.1: - version "2.0.1" - resolved "http://registry.npm.taobao.org/void-elements/download/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" +vendors@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/vendors/-/vendors-1.0.2.tgz#7fcb5eef9f5623b156bcea89ec37d63676f21801" + integrity sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ== + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= + dependencies: + indexof "0.0.1" + +vue-hot-reload-api@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz#b2d3d95402a811602380783ea4f566eb875569a2" + integrity sha512-AA86yKZ5uOKz87/q1UpngEXhbRkaYg1b7HMMVRobNV1IVKqZe8oLIzo6iMocVwZXnYitlGwf2k4ZRLOZlS8oPQ== + +vue-loader@^15.2.4: + version "15.4.2" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.4.2.tgz#812bb26e447dd3b84c485eb634190d914ce125e2" + integrity sha512-nVV27GNIA9MeoD8yQ3dkUzwlAaAsWeYSWZHsu/K04KCD339lW0Jv2sJWsjj3721SP7sl2lYdPmjcHgkWQSp5bg== + dependencies: + "@vue/component-compiler-utils" "^2.0.0" + hash-sum "^1.0.2" + loader-utils "^1.1.0" + vue-hot-reload-api "^2.3.0" + vue-style-loader "^4.1.0" + +vue-router@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.2.tgz#dedc67afe6c4e2bc25682c8b1c2a8c0d7c7e56be" + integrity sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg== -warehouse@^2.2.0: - version "2.2.0" - resolved "http://registry.npm.taobao.org/warehouse/download/warehouse-2.2.0.tgz#5d09d64942992be667d8f7c86a09c2b8aea04062" +vue-server-renderer@^2.5.16: + version "2.5.21" + resolved "https://registry.yarnpkg.com/vue-server-renderer/-/vue-server-renderer-2.5.21.tgz#7c2b611d2e8558359cdb84dcd3080845c07121b4" + integrity sha512-bAkOYZ5DnmQKv3RboNbmCB4LReF2tIE20EgUeWrz/87aVkpMihf3FVK+8DT45nyN4k9iSQOhsyem49fq++cF8w== dependencies: - JSONStream "^1.0.7" - bluebird "^3.2.2" - cuid "~1.3.8" - graceful-fs "^4.1.3" - is-plain-object "^2.0.1" - lodash "^4.2.1" + chalk "^1.1.3" + hash-sum "^1.0.2" + he "^1.1.0" + lodash.template "^4.4.0" + lodash.uniq "^4.5.0" + resolve "^1.2.0" + serialize-javascript "^1.3.0" + source-map "0.5.6" + +vue-style-loader@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-4.1.2.tgz#dedf349806f25ceb4e64f3ad7c0a44fba735fcf8" + integrity sha512-0ip8ge6Gzz/Bk0iHovU9XAUQaFt/G2B61bnWa2tCcqqdgfHs1lF9xXorFbE55Gmy92okFT+8bfmySuUOu13vxQ== + dependencies: + hash-sum "^1.0.2" + loader-utils "^1.0.2" + +vue-template-compiler@^2.5.16: + version "2.5.21" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.21.tgz#a57ceb903177e8f643560a8d639a0f8db647054a" + integrity sha512-Vmk5Cv7UcmI99B9nXJEkaK262IQNnHp5rJYo+EwYpe2epTAXqcVyExhV6pk8jTkxQK2vRc8v8KmZBAwdmUZvvw== + dependencies: + de-indent "^1.0.2" + he "^1.1.0" + +vue-template-es2015-compiler@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18" + integrity sha512-x3LV3wdmmERhVCYy3quqA57NJW7F3i6faas++pJQWtknWT+n7k30F4TVdHvCLn48peTJFRvCpxs3UuFPqgeELg== + +vue@^2.5.16: + version "2.5.21" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.21.tgz#3d33dcd03bb813912ce894a8303ab553699c4a85" + integrity sha512-Aejvyyfhn0zjVeLvXd70h4hrE4zZDx1wfZqia6ekkobLmUZ+vNFQer53B4fu0EjWBSiqApxPejzkO1Znt3joxQ== + +vuepress-html-webpack-plugin@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/vuepress-html-webpack-plugin/-/vuepress-html-webpack-plugin-3.2.0.tgz#219be272ad510faa8750d2d4e70fd028bfd1c16e" + integrity sha512-BebAEl1BmWlro3+VyDhIOCY6Gef2MCBllEVAP3NUAtMguiyOwo/dClbwJ167WYmcxHJKLl7b0Chr9H7fpn1d0A== + dependencies: + html-minifier "^3.2.3" + loader-utils "^0.2.16" + lodash "^4.17.3" + pretty-error "^2.0.2" + tapable "^1.0.0" + toposort "^1.0.0" + util.promisify "1.0.0" + +vuepress@^0.14.8: + version "0.14.8" + resolved "https://registry.yarnpkg.com/vuepress/-/vuepress-0.14.8.tgz#1e0a70a64c19e82e365eb7313b1ec88cc4ad7ab3" + integrity sha512-2BVubO3a4Nl8i/tWaO66iq2NRxxf9bh3QwDdoUuBTrhGtLgjv8mv4xrsgMpiPLXo1uk7bQY4hjZNvbYjCLCQkg== + dependencies: + "@babel/core" "7.0.0-beta.47" + "@vue/babel-preset-app" "3.0.0-beta.11" + autoprefixer "^8.2.0" + babel-loader "8.0.0-beta.3" + cache-loader "^1.2.2" + chalk "^2.3.2" + chokidar "^2.0.3" + commander "^2.15.1" + connect-history-api-fallback "^1.5.0" + copy-webpack-plugin "^4.5.1" + cross-spawn "^6.0.5" + css-loader "^0.28.11" + diacritics "^1.3.0" + docsearch.js "^2.5.2" + escape-html "^1.0.3" + file-loader "^1.1.11" + fs-extra "^5.0.0" + globby "^8.0.1" + gray-matter "^4.0.1" + js-yaml "^3.11.0" + koa-connect "^2.0.1" + koa-mount "^3.0.0" + koa-range "^0.3.0" + koa-static "^4.0.2" + loader-utils "^1.1.0" + lodash.throttle "^4.1.1" + lru-cache "^4.1.2" + markdown-it "^8.4.1" + markdown-it-anchor "^5.0.2" + markdown-it-container "^2.0.0" + markdown-it-emoji "^1.4.0" + markdown-it-table-of-contents "^0.4.0" + mini-css-extract-plugin "0.4.1" + nprogress "^0.2.0" + optimize-css-assets-webpack-plugin "^4.0.0" + portfinder "^1.0.13" + postcss-loader "^2.1.5" + prismjs "^1.13.0" + register-service-worker "^1.5.1" + semver "^5.5.0" + stylus "^0.54.5" + stylus-loader "^3.0.2" + toml "^2.3.3" + url-loader "^1.0.1" + vue "^2.5.16" + vue-loader "^15.2.4" + vue-router "^3.0.1" + vue-server-renderer "^2.5.16" + vue-template-compiler "^2.5.16" + vuepress-html-webpack-plugin "^3.2.0" + webpack "^4.8.1" + webpack-chain "^4.6.0" + webpack-merge "^4.1.2" + webpack-serve "^1.0.2" + webpackbar "^2.6.1" + workbox-build "^3.1.0" + +watchpack@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== + dependencies: + chokidar "^2.0.2" + graceful-fs "^4.1.2" + neo-async "^2.5.0" + +webpack-chain@^4.6.0: + version "4.12.1" + resolved "https://registry.yarnpkg.com/webpack-chain/-/webpack-chain-4.12.1.tgz#6c8439bbb2ab550952d60e1ea9319141906c02a6" + integrity sha512-BCfKo2YkDe2ByqkEWe1Rw+zko4LsyS75LVr29C6xIrxAg9JHJ4pl8kaIZ396SUSNp6b4815dRZPSTAS8LlURRQ== + dependencies: + deepmerge "^1.5.2" + javascript-stringify "^1.6.0" + +webpack-dev-middleware@^3.0.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.4.0.tgz#1132fecc9026fd90f0ecedac5cbff75d1fb45890" + integrity sha512-Q9Iyc0X9dP9bAsYskAVJ/hmIZZQwf/3Sy4xCAZgL5cUkjZmUZLt4l5HpbST/Pdgjn3u6pE7u5OdGd1apgzRujA== + dependencies: + memory-fs "~0.4.1" + mime "^2.3.1" + range-parser "^1.0.3" + webpack-log "^2.0.0" + +webpack-hot-client@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/webpack-hot-client/-/webpack-hot-client-3.0.0.tgz#b714f257a264001275bc1491741685779cde12f2" + integrity sha512-6k91015hZ4Okkz8u6OzRgJygEL+3J3ay6HVZhWBF3tT2P0rZJ0mgca39dotJxngggUm3S8707c0vrcynn1IzEQ== + dependencies: + json-stringify-safe "^5.0.1" + loglevelnext "^1.0.2" + strip-ansi "^4.0.0" + uuid "^3.1.0" + webpack-log "^1.1.1" + ws "^4.0.0" + +webpack-log@^1.1.1, webpack-log@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-1.2.0.tgz#a4b34cda6b22b518dbb0ab32e567962d5c72a43d" + integrity sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqT4lwWwoMHdQWwEKw736fCHEekokTEKHA== + dependencies: + chalk "^2.1.0" + log-symbols "^2.1.0" + loglevelnext "^1.0.1" + uuid "^3.1.0" + +webpack-log@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f" + integrity sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg== + dependencies: + ansi-colors "^3.0.0" + uuid "^3.3.2" + +webpack-merge@^4.1.2: + version "4.1.5" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-4.1.5.tgz#2be31e846c20767d1bef56bdca64c328a681190a" + integrity sha512-sVcM+MMJv6DO0C0GLLltx8mUlGMKXE0zBsuMqZ9jz2X9gsekALw6Rs0cAfTWc97VuWS6NpVUa78959zANnMMLQ== + dependencies: + lodash "^4.17.5" + +webpack-serve@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/webpack-serve/-/webpack-serve-1.0.4.tgz#d1c83955926969ba195e5032f978da92ef07829c" + integrity sha512-WhI9PMY2YLFliZhDsQFE5Os/On5Py6DGZpeBJyDM8xl0cspxgvXmWFywACn2YWWDgowqIxRqveyGh2RwdFWTNQ== + dependencies: + "@shellscape/koa-static" "^4.0.4" + "@webpack-contrib/config-loader" "^1.1.1" + chalk "^2.3.0" + clipboardy "^1.2.2" + cosmiconfig "^5.0.2" + debug "^3.1.0" + find-up "^2.1.0" + get-port "^3.2.0" + import-local "^1.0.0" + killable "^1.0.0" + koa "^2.4.1" + koa-webpack "^4.0.0" + lodash "^4.17.5" + loud-rejection "^1.6.0" + meow "^5.0.0" + nanobus "^4.3.1" + opn "^5.1.0" + resolve "^1.6.0" + time-fix-plugin "^2.0.0" + update-notifier "^2.3.0" + url-join "3.0.0" + v8-compile-cache "^2.0.0" + webpack-hot-client "^3.0.0" + webpack-log "^1.1.2" + +webpack-sources@^1.1.0, webpack-sources@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== + dependencies: + source-list-map "^2.0.0" + source-map "~0.6.1" + +webpack@^4.8.1: + version "4.27.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-4.27.1.tgz#5f2e2db446d2266376fa15d7d2277a1a9c2e12bb" + integrity sha512-WArHiLvHrlfyRM8i7f+2SFbr/XbQ0bXqTkPF8JpHOzub5482Y3wx7rEO8stuLGOKOgZJcqcisLhD7LrM/+fVMw== + dependencies: + "@webassemblyjs/ast" "1.7.11" + "@webassemblyjs/helper-module-context" "1.7.11" + "@webassemblyjs/wasm-edit" "1.7.11" + "@webassemblyjs/wasm-parser" "1.7.11" + acorn "^5.6.2" + acorn-dynamic-import "^3.0.0" + ajv "^6.1.0" + ajv-keywords "^3.1.0" + chrome-trace-event "^1.0.0" + enhanced-resolve "^4.1.0" + eslint-scope "^4.0.0" + json-parse-better-errors "^1.0.2" + loader-runner "^2.3.0" + loader-utils "^1.1.0" + memory-fs "~0.4.1" + micromatch "^3.1.8" + mkdirp "~0.5.0" + neo-async "^2.5.0" + node-libs-browser "^2.0.0" + schema-utils "^0.4.4" + tapable "^1.1.0" + terser-webpack-plugin "^1.1.0" + watchpack "^1.5.0" + webpack-sources "^1.3.0" + +webpackbar@^2.6.1: + version "2.6.4" + resolved "https://registry.yarnpkg.com/webpackbar/-/webpackbar-2.6.4.tgz#9118dde6b8f513a2d50ce630952157bca9218c6f" + integrity sha512-uQzJwuX172E+Vnk2NRFSM1hZBMCXd2CIpRUl1hr5tbAndTGVnDmYXQKHsbgbCKQXFJKKAl8EHYsdeauJZu2Qvg== + dependencies: + chalk "^2.4.1" + consola "^1.4.3" + figures "^2.0.0" + loader-utils "^1.1.0" + lodash "^4.17.10" + log-update "^2.3.0" + pretty-time "^1.1.0" + schema-utils "^1.0.0" + std-env "^1.3.1" + table "^4.0.3" + +when@~3.6.x: + version "3.6.4" + resolved "https://registry.yarnpkg.com/when/-/when-3.6.4.tgz#473b517ec159e2b85005497a13983f095412e34e" + integrity sha1-RztRfsFZ4rhQBUl6E5g/CVQS404= + +whet.extend@~0.9.9: + version "0.9.9" + resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" + integrity sha1-+HfVv2SMl+WqVC+twW1qJZucEaE= which@^1.2.9: version "1.3.1" - resolved "http://registry.npm.taobao.org/which/download/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" wide-align@^1.1.0: version "1.1.3" - resolved "http://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: string-width "^1.0.2 || 2" -window-size@0.1.0: - version "0.1.0" - resolved "http://registry.npm.taobao.org/window-size/download/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -window-size@^0.1.4: - version "0.1.4" - resolved "http://registry.npm.taobao.org/window-size/download/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - -with@^5.0.0: - version "5.1.1" - resolved "http://registry.npm.taobao.org/with/download/with-5.1.1.tgz#fa4daa92daf32c4ea94ed453c81f04686b575dfe" +widest-line@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" + integrity sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA== dependencies: - acorn "^3.1.0" - acorn-globals "^3.0.0" + string-width "^2.1.1" -with@~4.0.0: - version "4.0.3" - resolved "http://registry.npm.taobao.org/with/download/with-4.0.3.tgz#eefd154e9e79d2c8d3417b647a8f14d9fecce14e" +workbox-background-sync@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-3.6.3.tgz#6609a0fac9eda336a7c52e6aa227ba2ae532ad94" + integrity sha512-ypLo0B6dces4gSpaslmDg5wuoUWrHHVJfFWwl1udvSylLdXvnrfhFfriCS42SNEe5lsZtcNZF27W/SMzBlva7Q== dependencies: - acorn "^1.0.1" - acorn-globals "^1.0.3" - -wordwrap@0.0.2: - version "0.0.2" - resolved "http://registry.npm.taobao.org/wordwrap/download/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + workbox-core "^3.6.3" -wordwrap@~0.0.2: - version "0.0.3" - resolved "http://registry.npm.taobao.org/wordwrap/download/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" +workbox-broadcast-cache-update@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-broadcast-cache-update/-/workbox-broadcast-cache-update-3.6.3.tgz#3f5dff22ada8c93e397fb38c1dc100606a7b92da" + integrity sha512-pJl4lbClQcvp0SyTiEw0zLSsVYE1RDlCPtpKnpMjxFtu8lCFTAEuVyzxp9w7GF4/b3P4h5nyQ+q7V9mIR7YzGg== + dependencies: + workbox-core "^3.6.3" -wordwrap@~1.0.0: - version "1.0.0" - resolved "http://registry.npm.taobao.org/wordwrap/download/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +workbox-build@^3.1.0: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-3.6.3.tgz#77110f9f52dc5d82fa6c1c384c6f5e2225adcbd8" + integrity sha512-w0clZ/pVjL8VXy6GfthefxpEXs0T8uiRuopZSFVQ8ovfbH6c6kUpEh6DcYwm/Y6dyWPiCucdyAZotgjz+nRz8g== + dependencies: + babel-runtime "^6.26.0" + common-tags "^1.4.0" + fs-extra "^4.0.2" + glob "^7.1.2" + joi "^11.1.1" + lodash.template "^4.4.0" + pretty-bytes "^4.0.2" + stringify-object "^3.2.2" + strip-comments "^1.0.2" + workbox-background-sync "^3.6.3" + workbox-broadcast-cache-update "^3.6.3" + workbox-cache-expiration "^3.6.3" + workbox-cacheable-response "^3.6.3" + workbox-core "^3.6.3" + workbox-google-analytics "^3.6.3" + workbox-navigation-preload "^3.6.3" + workbox-precaching "^3.6.3" + workbox-range-requests "^3.6.3" + workbox-routing "^3.6.3" + workbox-strategies "^3.6.3" + workbox-streams "^3.6.3" + workbox-sw "^3.6.3" + +workbox-cache-expiration@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-cache-expiration/-/workbox-cache-expiration-3.6.3.tgz#4819697254a72098a13f94b594325a28a1e90372" + integrity sha512-+ECNph/6doYx89oopO/UolYdDmQtGUgo8KCgluwBF/RieyA1ZOFKfrSiNjztxOrGJoyBB7raTIOlEEwZ1LaHoA== + dependencies: + workbox-core "^3.6.3" + +workbox-cacheable-response@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-3.6.3.tgz#869f1a68fce9063f6869ddbf7fa0a2e0a868b3aa" + integrity sha512-QpmbGA9SLcA7fklBLm06C4zFg577Dt8u3QgLM0eMnnbaVv3rhm4vbmDpBkyTqvgK/Ly8MBDQzlXDtUCswQwqqg== + dependencies: + workbox-core "^3.6.3" + +workbox-core@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-3.6.3.tgz#69abba70a4f3f2a5c059295a6f3b7c62bd00e15c" + integrity sha512-cx9cx0nscPkIWs8Pt98HGrS9/aORuUcSkWjG25GqNWdvD/pSe7/5Oh3BKs0fC+rUshCiyLbxW54q0hA+GqZeSQ== + +workbox-google-analytics@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-3.6.3.tgz#99df2a3d70d6e91961e18a6752bac12e91fbf727" + integrity sha512-RQBUo/6SXtIaQTRFj4RQZ9e1gAl7D8oS5S+Hi173Kk70/BgJjzPwXpC5A249Jv5YfkCOLMQCeF9A27BiD0b0ig== + dependencies: + workbox-background-sync "^3.6.3" + workbox-core "^3.6.3" + workbox-routing "^3.6.3" + workbox-strategies "^3.6.3" + +workbox-navigation-preload@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-3.6.3.tgz#a2c34eb7c17e7485b795125091215f757b3c4964" + integrity sha512-dd26xTX16DUu0i+MhqZK/jQXgfIitu0yATM4jhRXEmpMqQ4MxEeNvl2CgjDMOHBnCVMax+CFZQWwxMx/X/PqCw== + dependencies: + workbox-core "^3.6.3" + +workbox-precaching@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-3.6.3.tgz#5341515e9d5872c58ede026a31e19bafafa4e1c1" + integrity sha512-aBqT66BuMFviPTW6IpccZZHzpA8xzvZU2OM1AdhmSlYDXOJyb1+Z6blVD7z2Q8VNtV1UVwQIdImIX+hH3C3PIw== + dependencies: + workbox-core "^3.6.3" + +workbox-range-requests@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-range-requests/-/workbox-range-requests-3.6.3.tgz#3cc21cba31f2dd8c43c52a196bcc8f6cdbcde803" + integrity sha512-R+yLWQy7D9aRF9yJ3QzwYnGFnGDhMUij4jVBUVtkl67oaVoP1ymZ81AfCmfZro2kpPRI+vmNMfxxW531cqdx8A== + dependencies: + workbox-core "^3.6.3" + +workbox-routing@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-3.6.3.tgz#659cd8f9274986cfa98fda0d050de6422075acf7" + integrity sha512-bX20i95OKXXQovXhFOViOK63HYmXvsIwZXKWbSpVeKToxMrp0G/6LZXnhg82ijj/S5yhKNRf9LeGDzaqxzAwMQ== + dependencies: + workbox-core "^3.6.3" + +workbox-strategies@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-3.6.3.tgz#11a0dc249a7bc23d3465ec1322d28fa6643d64a0" + integrity sha512-Pg5eulqeKet2y8j73Yw6xTgLdElktcWExGkzDVCGqfV9JCvnGuEpz5eVsCIK70+k4oJcBCin9qEg3g3CwEIH3g== + dependencies: + workbox-core "^3.6.3" + +workbox-streams@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-streams/-/workbox-streams-3.6.3.tgz#beaea5d5b230239836cc327b07d471aa6101955a" + integrity sha512-rqDuS4duj+3aZUYI1LsrD2t9hHOjwPqnUIfrXSOxSVjVn83W2MisDF2Bj+dFUZv4GalL9xqErcFW++9gH+Z27w== + dependencies: + workbox-core "^3.6.3" + +workbox-sw@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-3.6.3.tgz#278ea4c1831b92bbe2d420da8399176c4b2789ff" + integrity sha512-IQOUi+RLhvYCiv80RP23KBW/NTtIvzvjex28B8NW1jOm+iV4VIu3VXKXTA6er5/wjjuhmtB28qEAUqADLAyOSg== + +worker-farm@^1.5.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0" + integrity sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ== + dependencies: + errno "~0.1.7" -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "http://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" +wrap-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" + string-width "^2.1.1" + strip-ansi "^4.0.0" wrappy@1: version "1.0.2" - resolved "http://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write@^0.2.1: - version "0.2.1" - resolved "http://registry.npm.taobao.org/write/download/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" +write-file-atomic@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + integrity sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA== dependencies: - mkdirp "^0.5.1" + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" -y18n@^3.2.0: - version "3.2.1" - resolved "http://registry.npm.taobao.org/y18n/download/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" +ws@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289" + integrity sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA== + dependencies: + async-limiter "~1.0.0" + safe-buffer "~5.1.0" + +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= + +xtend@^4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + integrity sha1-pcbVMr5lbiPbgg77lDofBJmNY68= + +y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== yallist@^2.1.2: version "2.1.2" - resolved "http://registry.npm.taobao.org/yallist/download/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "http://registry.npm.taobao.org/yallist/download/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== -yargs@^3.32.0: - version "3.32.0" - resolved "http://registry.npm.taobao.org/yargs/download/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" +yargs-parser@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" + camelcase "^4.1.0" -yargs@~3.10.0: - version "3.10.0" - resolved "http://registry.npm.taobao.org/yargs/download/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" +ylru@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ylru/-/ylru-1.2.1.tgz#f576b63341547989c1de7ba288760923b27fe84f" + integrity sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ== -yargs@~3.5.4: - version "3.5.4" - resolved "http://registry.npm.taobao.org/yargs/download/yargs-3.5.4.tgz#d8aff8f665e94c34bd259bdebd1bfaf0ddd35361" - dependencies: - camelcase "^1.0.2" - decamelize "^1.0.0" - window-size "0.1.0" - wordwrap "0.0.2" +zepto@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98" + integrity sha1-4Se9nmb9hGvl6rSME5SIL3wOT5g=